[go: up one dir, main page]

Menu

[r1130]: / trunk / src / Molecule.h  Maximize  Restore  History

Download this file

116 lines (90 with data), 4.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#ifndef GUARD_Molecule_h
#define GUARD_Molecule_h
//-------------------------------------------------------------------------------------------
//
// Molecule.h
//
// Author: Struan Robertson
// Date: 5/Jan/2003
//
// This header file contains the declaration of the Molecule class.
//
//-------------------------------------------------------------------------------------------
#include "MolecularComponents.h"
namespace mesmer
{
class MoleculeManager ;
// Because many Molecule properties are not needed in all molecules, they are
// handled in the following classes, which are derived from MolecularComponent.
class gWellProperties ;
class gBathProperties ;
class gTransitionState;
class gDensityOfStates;
class gPopulation;
class gStructure;
//**************************************************
/// Basic molecule: has name and some collision parameters.
/// Used for bath gases and unmodelled product molecules.
class Molecule
{
//-------------------------------------------------------------------------------------------------
// Basic information of a molecule
//-------------------------------------------------------------------------------------------------
private:
const MesmerEnv& m_Env;
MesmerFlags& m_Flags;
unsigned int m_atomNumber; // If (m_atomNumber == 0), the atomArray element is missing.
PersistPtr m_ppPersist; // Conduit for I/O
std::string m_Name ; // Molecule name.
std::string m_Description; // Longer description for the structure
MoleculeManager *m_pMoleculeManager; // Pointer molecule manager for navigation purposes.
std::map<std::string, bool> m_molTypes;
// Component pointers
friend class MolecularComponent; // Provide access privalage of MolecularComponent to private members of Molecule.
gBathProperties* g_bath; // Component pointer for bath gas properties
gDensityOfStates* g_dos; // Component pointer for cell density of state properties
gTransitionState* g_ts; // Component pointer for transition state properties
gPopulation* g_pop; // Component pointer for population and equilibrium fraction
gWellProperties* g_coll; // Component pointer for collision down model properties
gStructure* g_struc; // Component pointer for chemical structural properties
public:
//
// Constructor
//
Molecule(const MesmerEnv& Env, MesmerFlags& m_Flags, const string& molType, MoleculeManager *pMoleculeManager) ;
virtual ~Molecule();
// Initialize Molecule. Returns false if no id attribute
// or if no description attribute and <molecule> has no child elements. Probably just a placeholder.
virtual bool InitializeMolecule(PersistPtr pp);
PersistPtr get_PersistentPointer() const { return m_ppPersist; } ;
std::string getDescription() const { return m_Description ; } ;
const MesmerEnv& getEnv() const { return m_Env; } ;
std::string getName() const { return m_Name ; } ;
const MesmerFlags& getFlags() const { return m_Flags;} ;
MoleculeManager* getMoleculeManager() const { return m_pMoleculeManager; } ;
bool checkDegOfFreedom();
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Manipulators of component pointers
gBathProperties& getBath();
gDensityOfStates& getDOS();
gTransitionState& getTS();
gPopulation& getPop();
gWellProperties& getColl();
gStructure& getStruc();
bool activateRole(string molType);
bool hasDOSProperties(){return g_dos!=NULL;}
bool isMolType(const string& molType){
return m_molTypes[molType];
}
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
};
}//namespace
// CHECK FOR INPUTFILE PARAMETERS
// for these check values, initially the values are given -1. If not provided by user the value will remain as -1.
// If provided by the user the value will be increased to 0.
// During calcualtion, every inputfile parameter if called by any function, the class will check if the parameter
// is provided. If it is provided, the chk value will increase by 1. So if a chk value is 9, it is asked for 9 times.
// However, if the user did not provide the value and the values is asked. The program will stop and report error.
// Values with obvious default values are also accounted in this check but the program will not exit; only
// warning message will be given.
#endif // GUARD_Molecule_h