Chemistry::ESPT::ADFout - Amsterdam Density Functional (ADF) output file object.


Chemistry-ESPT documentation Contained in the Chemistry-ESPT distribution.

Index


Code Index:

NAME

Top

Chemistry::ESPT::ADFout - Amsterdam Density Functional (ADF) output file object.

SYNOPSIS

Top

   use Chemistry::ESPT::ADFout;

   my $out = Chemistry::ESPT::ADFout->new();

DESCRIPTION

Top

This module provides methods to quickly access data contianed in an ADF output file. ADF output files can only be read currently.

ATTRIBUTES

Top

All attributes are currently read-only and get populated by reading the assigned ESS file. Attribute values are accessible through the $ADFout->get() method.

COMPILE

String containing the compile architechture.

EELEC

Electronic energy.

EIGEN

A rank two tensor containing the eigenvalues. The eigenvalues correspond to Alpha or Beta depending upon what spin was passesd to $ADFout->analyze().

FUNCTIONAL

String containing the DFT functional utlized in this job.

HOMO

Number corresponding to the highest occupied molecular orbital. The value corresponds to either Alpha or Beta electrons depending upon what spin was passesd to $ADFout->analyze().

MOSYMM

A rank two tensor containing the molecular orbital symmetry labels.

OCC

A rank two tensor containing the molecular orbital occupations.

PG

Array of molecular point group values.

REVISION

ADF revision label.

RUNTIME

Date when the calculation was run.

VERSION

ADF version.

METHODS

Top

Method parameters denoted in [] are optional.

$out->new()

Creates a new ADFout object

$out->analyze(filename [spin])

Analyze the spin results in file called filename. Spin defaults to Alpha.

VERSION

Top

0.02

SEE ALSO

Top

Chemistry::ESPT::ESSfile, http://www.scm.com

AUTHOR

Top

Dr. Jason L. Sonnenberg, <sonnenberg.11@osu.edu>

COPYRIGHT AND LICENSE

Top


Chemistry-ESPT documentation Contained in the Chemistry-ESPT distribution.
package Chemistry::ESPT::ADFout;

use base qw(Chemistry::ESPT::ESSfile);
use strict;
use warnings;

our $VERSION = '0.02';

## the object constructor **

sub new {
	my $invocant = shift;
	my $class = ref($invocant) || $invocant;
	my $out = Chemistry::ESPT::ESSfile->new();
	
	$out->{TYPE} = "out";
	
	# program info
	$out->{PROGRAM} = "ADF";
	$out->{VERSION} = undef;
	$out->{REVISION} = undef;
	$out->{COMPILE} = undef;
	
	# calc info
	$out->{RUNTIME} = undef;
	$out->{THEORY} = "DFT";		
	$out->{FUNCTIONAL} = undef;	
	$out->{BASIS} = "Mixed";	
	$out->{NBASIS} = 0;			# Core-orthogonalized Symmetrized Fragment Orbitals
	
	# molecular info
	$out->{EIGEN} = [];
	$out->{EELEC} = undef;			# SCF electronic bonding energy
	$out->{ENERGY} = undef; 		# total bonding energy 
	$out->{EINFO} = "Bonding E(elec)";	# total bonding energy description
	$out->{HOMO} = undef;
	$out->{MOSYMM} = [];
	$out->{OCC} = [];
	$out->{PG} = undef;

	bless($out, $class);
	return $out;
}


## methods ##

# set filename & spin then digest the file
sub analyze: method {
	my $out = shift;
	$out->prepare(@_);
	$out->_digest();
	return;
}

## subroutines ##

sub _digest {
# Files larger than 1Mb should be converted to binary and then
# processed to ensure maximum speed. -D. Ennis, OSC

# For items with multiple occurances, the last value is reported 

my $out = shift;

# flags & counters
my $Ccount = 0;
my $Cflag = 0;
my $eigcount = 0;
my $MOcount = 0;
my $orbcount = -1;
my $PGcount = 0;
my $rparsed = 0;
my $Sflag = 0;
my $symmflag = 0;

# open filename for reading or display error
open(LOGFILE,$out->{FILENAME}) || die "Could not read $out->{FILENAME}\n$!\n";

# grab everything which may be useful
while (<LOGFILE>){
	# skip blank lines
	next if /^$/;

        # version info & run time (multiple occurances & values)
	if ( /^\sADF\s+(\d+).(\d+)\s+RunTime:\s+([a-zA-Z]+)(\d{1,2})-(\d{4})\s\d{2}:\d{2}:\d{2}/ ) {
		$out->{VERSION} = $1;
              	$out->{REVISION} = $2;
		$out->{RUNTIME} = "$4-$3-$5";
		next;
        }
	# compile architecture (multiple occurances)
	if ( /^\s\*+\s+([a-z_A-Z]+)\s+\*+/ ) {
		$out->{COMPILE} = $1;
		next;
	}
	# functional (multiple occurances)
	if ( /^\s+Gradient Corrections:\s+([a-zA-Z0-9]+)\s+([a-zA-Z0-9]+)/ ) {
		$out->{FUNCTIONAL} = "$1$2";
		next;
	}
        # full point group 
        if ( /^\s+Symmetry:\s+([CDSIOT])\(([0-9DHILNV]+)\)/ ) {
	        $out->{PG} [$PGcount] = "$1($2)";
		$PGcount++;
		next;
	}
        # electrons 
	# figure HOMO & LUMO, alphas fill first
	# restricted
        if ( /^\s+Total:\s+(\d+)\s+\z/ ) {
                $out->{ALPHA} = $out->{BETA} = $out->{HOMO} = $1/2;
		next;
        }
	# unrestricted
        if ( /^\s+Total:\s+(\d+)\s+(?:\(Spin-A\)\s+\+\s+)*(\d+)\s+(?:\(Spin-B\))*/ ) {
                $out->{ALPHA} = $1;
                $out->{BETA} = $2;
		$out->{HOMO} = $out->{uc($out->{SPIN})};
		next;
        }
        # charge (multiple values and occurances)
        if ( /^\s+Net Charge:\s+(-*\d+)/ ) {   
                $out->{CHARGE} = $1;
		next;
        }
	# Multiplicity (multiple occurrences)
	if ( /^\s+Spin polar:\s+(\d+)/ ) {
		$out->{MULTIPLICITY} = $1+1;
		next;
	}
	# Core-orthogonalized Symmetrized Fragment Orbitals (molecular calculations)
	if (/^\s+Total nr. of \(C\)SFOs \(summation over all irreps\)\s+:\s+(\d+)/) {
		$out->{NBASIS} = $1;
		next;
	}
        # orbital symmetries, energies, occupations (multiple occurrences)
        if ( /^\s+Orbital\s+Energies,\s+all\s+Irreps/ ) {
		$symmflag = 1;
		$MOcount = 0;
		$orbcount++;
		next;
	} 
        if ( $symmflag == 1 && /^\s+([123ABDEGHILMPST\.gu]+)\s+\d+\s+[$out->{SPIN}]*\s+(\d+\.\d+)\s+(\-*\d\.\d+E\-*\+*\d+)\s+(\-*\d+\.\d+)\s+/ ) {
		my $symm = $1;
		my $txt = $2;
		my $eigen = $3;
		my $degen = 1;
		if ( $symm =~ /E[E123\.ug]/ ) {
			$degen = 2;
		} elsif ( $symm =~ /T[123\.ug]/ ) {
			$degen = 3;
		}
		$orbcount++ if $orbcount == -1;  	# temporary hack
		for (my $i=1; $i<=$degen; $i++ ) {
			$out->{MOSYMM} [$orbcount] [$MOcount] = lc($symm);
              		$out->{EIGEN} [$orbcount] [$MOcount] = $eigen;
			$out->{OCC} [$orbcount] [$MOcount] = $txt/$degen;
 			$MOcount++;
		}
            	$MOcount = $symmflag = 0 if $MOcount == $out->{NBASIS};
                next;                                     
        }
	# SCF bonding electronic energy
	# Grab from logfile.  Occurs earlier but harder to pick out.
	if ( /^\s+.*\s+GGA-XC\s+(-*\d+\.\d+)\s+a\.u\./ ) {
		$out->{EELEC} = $1;
		$out->{ENERGY} = $1;
		next;
	}
	# <S**2> value
	if ( /^\s+Total\s+S2\s+\(S\s+squared\)\s+\d\.\d+\s+(\d\.\d+)/ ) {
		$out->{SSQUARED} = $1;
		next;
	}

}
}


1;
__END__
# Below is the documentation for this module.