MTK++ Latest version: 0.2.0

Public Member Functions | Protected Types | Protected Attributes
MTKpp::gaussianParser Class Reference

Reads and writes gaussian format files. More...

#include <mtkpp/src/Parsers/gaussianParser.h>

Inheritance diagram for MTKpp::gaussianParser:
Inheritance graph
[legend]
Collaboration diagram for MTKpp::gaussianParser:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 gaussianParser ()
 gaussianParser Constructor
 ~gaussianParser ()
 gaussianParser Destructor
void Read (const std::string &i, sheet *pSheet=0)
 Read gaussian formatted file.
void Write (const std::string &o, molecule *m)
 Write gaussian formatted input file.
void Write (const std::string &o, molecule *m, std::vector< vector3d > &coordinates)
 Write gaussian formatted input file.
void Write (const std::string &o, collection *c, const int &molID)
 Write gaussian formatted input file.
int generateZMatrix (molecule *m)
 Generate Z-Matrix.
void readMappingFile (std::string f)
 Read zmatrix mapping file.
void writeMappingFile (std::string m)
 Write zmatrix mapping file.
void addCommandOption (const std::string &c)
 Add command.
void addCommandOption (const std::string &c, const std::string &o)
 Add command and value.
void addCommandOption (const std::string &c, std::vector< std::string > &o)
 Add command and vector of values.
std::vector< std::string > getCommandOption (const std::string &c)
 Remove command and value.
void removeCommandOption (const std::string &c)
 Remove command and value.
void addIop (const std::string &i)
 Add iop.
void clearIop ()
 clear iop
void setChkPt (const std::string &c)
 Set check point file.
void setMem (const std::string &m)
 Set memory requirement.
void setNProc (const std::string &n)
 Set number of processors to use.
void setTheory (const std::string &t)
 Set level of theory.
void setBasisSet (const std::string &b)
 Set basis set.
void setBasisSetFile (const std::string &b)
 Set basis set file.
void setPseudoPotentialFile (const std::string &b)
 Set pseudopotential file.
void setModRedundantFile (const std::string &b)
 Set modredundant file.
void setCharge (const int &i)
 Set charge.
void setMultiplicity (const int &i)
 Set multiplicity.
void setVerbosity (const std::string &i)
 Set verbosity.
void setInternal (int i)
 Write internal coordinates.
void setCartesian (int i)
 Write Cartesian coordinates.
void setNoCoords ()
 Do not write coordinates.
void setWriteMoleculeName (int i)
 Write molecule name.
void setWriteChargeAndMult (int i)
 Write charge and multiplicity.
void setMKRadii (std::string e, double d)
 Set Merz-Kollman radii.
void readFormattedChkPtFile (std::string fchkPtFile, sheet *pSheet)
 Read Formatted Check Point File.
int getForceConstant (sheet *pSheet, int i, int j, double &r, double &fc)
 Get Force Constant.
int getForceConstant (sheet *pSheet, int i, int j, int k, double &a, double &fc)
 Get Force Constant.
int getForceConstantZMAT (int i, int j, double &r, double &fc)
 Get Force Constant.
int getForceConstantZMAT (int i, int j, int k, double &a, double &fc)
 Get Force Constant.
std::vector< double > getFrequencies ()
 Get Frequencies.
virtual void Read ()
 Read function.
virtual void Write ()
 Write function.
std::ofstream & OpenFile (std::string fileName)
 Write function.
std::string determineElement (std::string &name)
 Preceive element symbol from the atom name.
void setError (int i)
 Error handling within Parsers.
bool getError ()
 Error handling within dcParser.
void setErrorMessage (std::string s)
 Error handling within Parsers.
std::string getErrorMessage ()
 Error handling within Parsers.

Protected Types

typedef std::map< std::string,
std::vector< std::string >
>::iterator 
mapIterator
 command options map iterator
typedef std::map< std::string,
double >::iterator 
dMapIterator
 MK radii iterator.
typedef std::map< int, int >
::iterator 
iMapIterator
 int, int iterator

Protected Attributes

std::string itsChkPtFile
 chk pt file
bool bChkPt
 Write check point file.
std::string itsMem
 memory requirement
bool bMem
 Turn on mem.
std::string itsNProc
 number of processors
bool bNProc
 Turn on number of processors.
bool bWriteInternalCoords
 Use internal or cartesian coordinates.
bool bWriteCartCoords
 Use internal or cartesian coordinates.
bool bWriteMoleculeName
 Write molecule name.
bool bWriteChargeAndMult
 Write charge and multiplicity.
std::string itsTheory
 Level of theory.
std::string itsBasisSet
 Basis Set.
std::string itsBasisSetFile
 Basis Set File.
std::string itsPseudoPotentialFile
 PseudoPotential File.
std::string itsModRedundantFile
 modredundant File
int itsCharge
 Charge.
int itsMultiplicity
 Multiplicity.
std::string itsVerbosity
 Logging level (verbosity) - T, N or P?
std::map< std::string,
std::vector< std::string > > 
itsCommandOptions
 command options map
std::map< std::string, double > itsMKRadii
 Merz-Kollman radii.
std::vector< std::string > iops
zmatParserpZmatParser
 zmatParser pointer
bool bZMatrixGenerated
 z-matrix was generated
std::vector< std::vector
< std::string > > 
zmatrix
 zmatrix
std::vector< std::vector< int > > zmatrixBonds
 zmatrix bonds
std::vector< std::vector< int > > zmatrixAngles
 zmatrix angles
std::vector< std::vector< int > > zmatrixTorsions
 zmatrix torsions
std::map< std::string, double > zmatData
std::vector< std::string > zmatDataAngles
std::vector< std::string > zmatDataTorsions
std::vector< std::string > zmatDataNames
std::map< std::string, int > zmatDataType
std::map< std::string, double > forceConstants
 Force constant map.
std::vector< double > frequencies
 Frequencies.
std::map< int, int > atomMap
 mapping between molecule and zmatrix
bool bModRedundant
 Redundant coordinates found in output file.
std::map< int, std::string > modRedBonds
 redundant bonds
std::map< ULONG_KIND, std::string > modRedAngles
 redundant angles
std::map< int, std::string > modRedDihedrals
 redundant dihedrals
std::vector< std::string > atomLabels
 labels
std::vector< vector3d * > molCoords
 coordinates
Eigen::Matrix< double, Dynamic,
Dynamic > 
eigenvectors
 Eigenvectors.
table< std::string > * pGaussAtoms
 Atom labels.
table< double > * pGaussCoords
 Coordinates.
table< double > * pGaussEValues
 Eigenvalue table.
table< double > * pGaussEVectors
 Eigenvector table.
std::ofstream outputFileStream
 Output File Stream.
bool bError
 Error occured.
std::string errorMessage
 Error message.
unsigned int NUM_INDENTS_PER_SPACE

Detailed Description

Reads and writes gaussian format files.

Author:
Martin Peters
Version:
0.1
Date:
2006

Member Typedef Documentation

typedef std::map<std::string, std::vector<std::string> >::iterator MTKpp::gaussianParser::mapIterator [protected]

command options map iterator

typedef std::map<std::string, double>::iterator MTKpp::gaussianParser::dMapIterator [protected]

MK radii iterator.

typedef std::map<int, int>::iterator MTKpp::gaussianParser::iMapIterator [protected]

int, int iterator


Constructor & Destructor Documentation

MTKpp::gaussianParser::gaussianParser ( )
MTKpp::gaussianParser::~gaussianParser ( )

gaussianParser Destructor

References bZMatrixGenerated, and pZmatParser.


Member Function Documentation

void MTKpp::gaussianParser::Read ( const std::string &  i,
sheet pSheet = 0 
)
void MTKpp::gaussianParser::Write ( const std::string &  o,
molecule m 
)

Write gaussian formatted input file.

Parameters:
oOutput file
mmolecule pointer
Todo:
Write function

References MTKpp::molecule::getCoordinates(), and MTKpp::baseParser::Write().

Referenced by main().

void MTKpp::gaussianParser::Write ( const std::string &  o,
molecule m,
std::vector< vector3d > &  coordinates 
)
void MTKpp::gaussianParser::Write ( const std::string &  o,
collection c,
const int &  molID 
)

Write gaussian formatted input file.

Parameters:
oOutput file
ccollection pointer
molIDThe ID of the molecule in the collection
Todo:
Write function

References MTKpp::molecule::getCoordinates(), MTKpp::collection::getMolecule(), and MTKpp::baseParser::Write().

int MTKpp::gaussianParser::generateZMatrix ( molecule m)

Generate Z-Matrix.

Parameters:
mmolecule pointer

References atomMap, bZMatrixGenerated, MTKpp::zmatParser::genZmatrix(), pZmatParser, zmatData, and zmatrix.

Referenced by main(), and Write().

void MTKpp::gaussianParser::readMappingFile ( std::string  f)

Read zmatrix mapping file.

Parameters:
fmapping file name

References atomMap, and MTKpp::splitString().

Referenced by main().

void MTKpp::gaussianParser::writeMappingFile ( std::string  m)

Write zmatrix mapping file.

Parameters:
mmapping file name

References atomMap, and bZMatrixGenerated.

Referenced by main().

void MTKpp::gaussianParser::addCommandOption ( const std::string &  c)

Add command.

Parameters:
ccommand name

References itsCommandOptions.

Referenced by main().

void MTKpp::gaussianParser::addCommandOption ( const std::string &  c,
const std::string &  o 
)

Add command and value.

Parameters:
ccommand name
ocommand value

References itsCommandOptions.

void MTKpp::gaussianParser::addCommandOption ( const std::string &  c,
std::vector< std::string > &  o 
)

Add command and vector of values.

Parameters:
ccommand name
ocommand value

References itsCommandOptions.

std::vector< std::string > MTKpp::gaussianParser::getCommandOption ( const std::string &  c)

Remove command and value.

Parameters:
ccommand name

References itsCommandOptions.

Referenced by main(), and Write().

void MTKpp::gaussianParser::removeCommandOption ( const std::string &  c)

Remove command and value.

Parameters:
ccommand name

References itsCommandOptions.

Referenced by main().

void MTKpp::gaussianParser::addIop ( const std::string &  i)

Add iop.

Parameters:
iiop command

References iops.

Referenced by main().

void MTKpp::gaussianParser::clearIop ( )

clear iop

References iops.

Referenced by main().

void MTKpp::gaussianParser::setChkPt ( const std::string &  c)

Set check point file.

Parameters:
cchkpt file

References bChkPt, and itsChkPtFile.

Referenced by main().

void MTKpp::gaussianParser::setMem ( const std::string &  m)

Set memory requirement.

Parameters:
mmemory

References bMem, and itsMem.

Referenced by main().

void MTKpp::gaussianParser::setNProc ( const std::string &  n)

Set number of processors to use.

Parameters:
nnumber of processors

References bNProc, and itsNProc.

Referenced by main().

void MTKpp::gaussianParser::setTheory ( const std::string &  t)

Set level of theory.

Parameters:
ttheory

References itsTheory.

Referenced by main().

void MTKpp::gaussianParser::setBasisSet ( const std::string &  b)

Set basis set.

Parameters:
bbasis set

References itsBasisSet.

Referenced by main().

void MTKpp::gaussianParser::setBasisSetFile ( const std::string &  b)

Set basis set file.

Parameters:
bbasis set file

References itsBasisSetFile.

Referenced by main().

void MTKpp::gaussianParser::setPseudoPotentialFile ( const std::string &  b)

Set pseudopotential file.

Parameters:
bpseudopotential file

References itsPseudoPotentialFile.

Referenced by main().

void MTKpp::gaussianParser::setModRedundantFile ( const std::string &  b)

Set modredundant file.

Parameters:
bmodredundant file

References itsModRedundantFile.

Referenced by main().

void MTKpp::gaussianParser::setCharge ( const int &  i)

Set charge.

Parameters:
icharge

References itsCharge.

Referenced by main().

void MTKpp::gaussianParser::setMultiplicity ( const int &  i)

Set multiplicity.

Parameters:
imultiplicity

References itsMultiplicity.

Referenced by main().

void MTKpp::gaussianParser::setVerbosity ( const std::string &  i)

Set verbosity.

Parameters:
iverbosity

References itsVerbosity.

Referenced by main().

void MTKpp::gaussianParser::setInternal ( int  i)

Write internal coordinates.

Parameters:
ion/off switch

References bWriteCartCoords, and bWriteInternalCoords.

void MTKpp::gaussianParser::setCartesian ( int  i)

Write Cartesian coordinates.

Parameters:
ion/off switch

References bWriteCartCoords, and bWriteInternalCoords.

Referenced by main().

void MTKpp::gaussianParser::setNoCoords ( )

Do not write coordinates.

References bWriteCartCoords, and bWriteInternalCoords.

Referenced by main().

void MTKpp::gaussianParser::setWriteMoleculeName ( int  i)

Write molecule name.

Parameters:
iswitch

References bWriteMoleculeName.

Referenced by main().

void MTKpp::gaussianParser::setWriteChargeAndMult ( int  i)

Write charge and multiplicity.

Parameters:
iswitch

References bWriteChargeAndMult.

Referenced by main().

void MTKpp::gaussianParser::setMKRadii ( std::string  e,
double  d 
)

Set Merz-Kollman radii.

Parameters:
eelement symbol
dvalue

References itsMKRadii.

Referenced by main().

void MTKpp::gaussianParser::readFormattedChkPtFile ( std::string  fchkPtFile,
sheet pSheet 
)

Read Formatted Check Point File.

Parameters:
fchkPtFileformatted check point file
pSheetsheet pointer

References MTKpp::sheet::addTable(), MTKpp::BOHR2ANG, MTKpp::table< T >::getMatrix(), MTKpp::sheet::setName(), MTKpp::table< T >::setName(), MTKpp::table< T >::setSizes(), and MTKpp::splitString().

Referenced by main().

int MTKpp::gaussianParser::getForceConstant ( sheet pSheet,
int  i,
int  j,
double &  r,
double &  fc 
)

Get Force Constant.

Parameters:
pSheetsheet pointer
iatom i index
jatom j index
rbond distance
fcforce constant
Returns:
success

References MTKpp::vector3d::dist(), MTKpp::eigenValueSort(), MTKpp::table< T >::getMatrix(), MTKpp::sheet::getTable(), MTKpp::HB2TOKCALMOLA2, and MTKpp::vector3d::unit().

Referenced by main().

int MTKpp::gaussianParser::getForceConstant ( sheet pSheet,
int  i,
int  j,
int  k,
double &  a,
double &  fc 
)

Get Force Constant.

Parameters:
pSheetsheet pointer
iatom i index
jatom j index
katom k index
aangle
fcforce constant
Returns:
success

References MTKpp::BOHR2ANG, MTKpp::vector3d::dist2(), MTKpp::eigenValueSort(), MTKpp::table< T >::getMatrix(), MTKpp::sheet::getTable(), MTKpp::H2KCALMOL, MTKpp::RAD2DEG, and MTKpp::vector3d::unit().

int MTKpp::gaussianParser::getForceConstantZMAT ( int  i,
int  j,
double &  r,
double &  fc 
)

Get Force Constant.

Parameters:
iatom i index
jatom j index
rbond distance
fcforce constant
Returns:
success

References atomMap, bModRedundant, MTKpp::double2String(), MTKpp::errorLogger, forceConstants, MTKpp::HB2TOKCALMOLA2, MTKpp::indexAB(), MTKpp::INFO, MTKpp::int2String(), MTKpp::MAXATOMS, modRedBonds, molCoords, MTKpp::MTK_ERROR, MTKpp::errorHandler::throwError(), zmatData, and zmatrix.

Referenced by main().

int MTKpp::gaussianParser::getForceConstantZMAT ( int  i,
int  j,
int  k,
double &  a,
double &  fc 
)
std::vector< double > MTKpp::gaussianParser::getFrequencies ( )

Get Frequencies.

References frequencies.

Referenced by main().

void MTKpp::baseParser::Read ( ) [virtual, inherited]

Read function.

Referenced by MTKpp::acParser::Read(), and MTKpp::molParser::Read().

void MTKpp::baseParser::Write ( ) [virtual, inherited]
std::ofstream & MTKpp::baseParser::OpenFile ( std::string  fileName) [inherited]

Write function.

References MTKpp::baseParser::outputFileStream.

Referenced by main().

std::string MTKpp::baseParser::determineElement ( std::string &  name) [inherited]

Preceive element symbol from the atom name.

References MTKpp::GetAlphaChar(), and MTKpp::removeCharacter().

Referenced by MTKpp::pdbParser::Read(), and MTKpp::prepParser::readFragment().

void MTKpp::baseParser::setError ( int  i) [inline, inherited]
bool MTKpp::baseParser::getError ( ) [inline, inherited]

Error handling within dcParser.

Returns:
error

References MTKpp::baseParser::bError.

Referenced by main().

void MTKpp::baseParser::setErrorMessage ( std::string  s) [inline, inherited]
std::string MTKpp::baseParser::getErrorMessage ( ) [inline, inherited]

Error handling within Parsers.

Returns:
error message

References MTKpp::baseParser::errorMessage.

Referenced by main().


Member Data Documentation

std::string MTKpp::gaussianParser::itsChkPtFile [protected]

chk pt file

Referenced by gaussianParser(), setChkPt(), and Write().

Write check point file.

Referenced by gaussianParser(), setChkPt(), and Write().

std::string MTKpp::gaussianParser::itsMem [protected]

memory requirement

Referenced by gaussianParser(), setMem(), and Write().

bool MTKpp::gaussianParser::bMem [protected]

Turn on mem.

Referenced by gaussianParser(), setMem(), and Write().

std::string MTKpp::gaussianParser::itsNProc [protected]

number of processors

Referenced by setNProc(), and Write().

Turn on number of processors.

Referenced by gaussianParser(), setNProc(), and Write().

Use internal or cartesian coordinates.

Referenced by gaussianParser(), setCartesian(), setInternal(), setNoCoords(), and Write().

Use internal or cartesian coordinates.

Referenced by gaussianParser(), setCartesian(), setInternal(), setNoCoords(), and Write().

Write molecule name.

Referenced by setWriteMoleculeName(), and Write().

Write charge and multiplicity.

Referenced by setWriteChargeAndMult(), and Write().

std::string MTKpp::gaussianParser::itsTheory [protected]

Level of theory.

Referenced by gaussianParser(), setTheory(), and Write().

std::string MTKpp::gaussianParser::itsBasisSet [protected]

Basis Set.

Referenced by gaussianParser(), setBasisSet(), and Write().

std::string MTKpp::gaussianParser::itsBasisSetFile [protected]

Basis Set File.

Referenced by gaussianParser(), setBasisSetFile(), and Write().

PseudoPotential File.

Referenced by setPseudoPotentialFile(), and Write().

modredundant File

Referenced by setModRedundantFile(), and Write().

Charge.

Referenced by gaussianParser(), Read(), setCharge(), and Write().

Multiplicity.

Referenced by gaussianParser(), Read(), setMultiplicity(), and Write().

std::string MTKpp::gaussianParser::itsVerbosity [protected]

Logging level (verbosity) - T, N or P?

Referenced by gaussianParser(), setVerbosity(), and Write().

std::map<std::string, std::vector<std::string> > MTKpp::gaussianParser::itsCommandOptions [protected]

command options map

Referenced by addCommandOption(), getCommandOption(), removeCommandOption(), and Write().

std::map<std::string, double> MTKpp::gaussianParser::itsMKRadii [protected]

Merz-Kollman radii.

Referenced by setMKRadii(), and Write().

std::vector<std::string> MTKpp::gaussianParser::iops [protected]

Referenced by addIop(), clearIop(), and Write().

zmatParser pointer

Referenced by generateZMatrix(), and ~gaussianParser().

z-matrix was generated

Referenced by gaussianParser(), generateZMatrix(), Write(), writeMappingFile(), and ~gaussianParser().

std::vector<std::vector<std::string> > MTKpp::gaussianParser::zmatrix [protected]

zmatrix

Referenced by generateZMatrix(), getForceConstantZMAT(), Read(), and Write().

std::vector<std::vector<int> > MTKpp::gaussianParser::zmatrixBonds [protected]

zmatrix bonds

Referenced by Read().

std::vector<std::vector<int> > MTKpp::gaussianParser::zmatrixAngles [protected]

zmatrix angles

Referenced by Read().

std::vector<std::vector<int> > MTKpp::gaussianParser::zmatrixTorsions [protected]

zmatrix torsions

Referenced by Read().

std::map<std::string, double> MTKpp::gaussianParser::zmatData [protected]
std::vector<std::string> MTKpp::gaussianParser::zmatDataAngles [protected]

Referenced by Read().

std::vector<std::string> MTKpp::gaussianParser::zmatDataTorsions [protected]

Referenced by Read().

std::vector<std::string> MTKpp::gaussianParser::zmatDataNames [protected]

Referenced by Read().

std::map<std::string, int> MTKpp::gaussianParser::zmatDataType [protected]

Referenced by Read().

std::map<std::string, double> MTKpp::gaussianParser::forceConstants [protected]

Force constant map.

Referenced by getForceConstantZMAT(), and Read().

std::vector<double> MTKpp::gaussianParser::frequencies [protected]

Frequencies.

Referenced by getFrequencies(), and Read().

std::map<int, int> MTKpp::gaussianParser::atomMap [protected]

mapping between molecule and zmatrix

Referenced by generateZMatrix(), getForceConstantZMAT(), readMappingFile(), and writeMappingFile().

Redundant coordinates found in output file.

Referenced by gaussianParser(), getForceConstantZMAT(), and Read().

std::map<int, std::string> MTKpp::gaussianParser::modRedBonds [protected]

redundant bonds

Referenced by getForceConstantZMAT(), and Read().

std::map<ULONG_KIND, std::string> MTKpp::gaussianParser::modRedAngles [protected]

redundant angles

Referenced by getForceConstantZMAT(), and Read().

std::map<int, std::string> MTKpp::gaussianParser::modRedDihedrals [protected]

redundant dihedrals

Referenced by Read().

std::vector<std::string> MTKpp::gaussianParser::atomLabels [protected]

labels

Referenced by Read().

std::vector<vector3d*> MTKpp::gaussianParser::molCoords [protected]

coordinates

Referenced by getForceConstantZMAT(), and Read().

Eigen::Matrix<double, Dynamic, Dynamic> MTKpp::gaussianParser::eigenvectors [protected]

Eigenvectors.

Referenced by Read().

table<std::string>* MTKpp::gaussianParser::pGaussAtoms [protected]

Atom labels.

Referenced by Read().

Coordinates.

Referenced by Read().

Eigenvalue table.

Referenced by Read().

Eigenvector table.

Referenced by gaussianParser(), and Read().

std::ofstream MTKpp::baseParser::outputFileStream [protected, inherited]

Output File Stream.

Referenced by MTKpp::baseParser::OpenFile().

bool MTKpp::baseParser::bError [protected, inherited]
std::string MTKpp::baseParser::errorMessage [protected, inherited]
unsigned int MTKpp::baseParser::NUM_INDENTS_PER_SPACE [protected, inherited]

The documentation for this class was generated from the following files:

Generated on Fri Dec 23 2011 09:28:57 for MTK++ by Doxygen 1.7.5.1