| [cee0b57] | 1 | /** \file molecule.hpp | 
|---|
| [14de469] | 2 | * | 
|---|
| [69eb71] | 3 | * Class definitions of atom and molecule, element and periodentafel | 
|---|
| [14de469] | 4 | */ | 
|---|
|  | 5 |  | 
|---|
|  | 6 | #ifndef MOLECULES_HPP_ | 
|---|
|  | 7 | #define MOLECULES_HPP_ | 
|---|
|  | 8 |  | 
|---|
|  | 9 | using namespace std; | 
|---|
|  | 10 |  | 
|---|
| [f66195] | 11 | /*********************************************** includes ***********************************/ | 
|---|
|  | 12 |  | 
|---|
| [14de469] | 13 | // GSL headers | 
|---|
| [d52ea1b] | 14 | #include <gsl/gsl_eigen.h> | 
|---|
| [14de469] | 15 | #include <gsl/gsl_heapsort.h> | 
|---|
| [6e9353] | 16 | #include <gsl/gsl_linalg.h> | 
|---|
|  | 17 | #include <gsl/gsl_matrix.h> | 
|---|
|  | 18 | #include <gsl/gsl_multimin.h> | 
|---|
|  | 19 | #include <gsl/gsl_vector.h> | 
|---|
| [62f793] | 20 | #include <gsl/gsl_randist.h> | 
|---|
| [14de469] | 21 |  | 
|---|
| [edb93c] | 22 | //// STL headers | 
|---|
| [14de469] | 23 | #include <map> | 
|---|
|  | 24 | #include <set> | 
|---|
|  | 25 | #include <deque> | 
|---|
| [d7e30c] | 26 | #include <list> | 
|---|
| [5e0d1f] | 27 | #include <vector> | 
|---|
| [14de469] | 28 |  | 
|---|
| [f66195] | 29 | #include "graph.hpp" | 
|---|
| [6d35e4] | 30 | #include "stackclass.hpp" | 
|---|
| [357fba] | 31 | #include "tesselation.hpp" | 
|---|
| [14de469] | 32 |  | 
|---|
| [f66195] | 33 | /****************************************** forward declarations *****************************/ | 
|---|
|  | 34 |  | 
|---|
|  | 35 | class atom; | 
|---|
|  | 36 | class bond; | 
|---|
|  | 37 | class element; | 
|---|
|  | 38 | class ForceMatrix; | 
|---|
|  | 39 | class LinkedCell; | 
|---|
| [14de469] | 40 | class molecule; | 
|---|
| [2319ed] | 41 | class MoleculeLeafClass; | 
|---|
| [14de469] | 42 | class MoleculeListClass; | 
|---|
| [f66195] | 43 | class periodentafel; | 
|---|
|  | 44 | class Vector; | 
|---|
| [14de469] | 45 |  | 
|---|
|  | 46 | /******************************** Some definitions for easier reading **********************************/ | 
|---|
|  | 47 |  | 
|---|
| [edb93c] | 48 | #define MoleculeList list <molecule *> | 
|---|
|  | 49 | #define MoleculeListTest pair <MoleculeList::iterator, bool> | 
|---|
|  | 50 |  | 
|---|
| [ed060e] | 51 | #define DistancePair pair < double, atom* > | 
|---|
|  | 52 | #define DistanceMap multimap < double, atom* > | 
|---|
|  | 53 | #define DistanceTestPair pair < DistanceMap::iterator, bool> | 
|---|
|  | 54 |  | 
|---|
| [1907a7] | 55 |  | 
|---|
| [14de469] | 56 | /************************************* Class definitions ****************************************/ | 
|---|
|  | 57 |  | 
|---|
| [ccd9f5] | 58 | /** Structure to contain parameters needed for evaluation of constraint potential. | 
|---|
|  | 59 | */ | 
|---|
|  | 60 | struct EvaluatePotential | 
|---|
|  | 61 | { | 
|---|
|  | 62 | int startstep;              //!< start configuration (MDStep in atom::trajectory) | 
|---|
|  | 63 | int endstep;                //!< end configuration (MDStep in atom::trajectory) | 
|---|
|  | 64 | atom **PermutationMap;      //!< gives target ptr for each atom, array of size molecule::AtomCount (this is "x" in \f$ V^{con}(x) \f$ ) | 
|---|
|  | 65 | DistanceMap **DistanceList; //!< distance list of each atom to each atom | 
|---|
|  | 66 | DistanceMap::iterator *StepList; //!< iterator to ascend through NearestNeighbours \a **DistanceList | 
|---|
|  | 67 | int *DoubleList;            //!< count of which sources want to move to this target, basically the injective measure (>1 -> not injective) | 
|---|
|  | 68 | DistanceMap::iterator *DistanceIterators; //!< marks which was the last picked target as injective candidate with smallest distance | 
|---|
|  | 69 | bool IsAngstroem;           //!< whether coordinates are in angstroem (true) or bohrradius (false) | 
|---|
|  | 70 | double *PenaltyConstants;   //!<  penalty constant in front of each term | 
|---|
|  | 71 | }; | 
|---|
| [14de469] | 72 |  | 
|---|
| [62f793] | 73 | #define MaxThermostats 6      //!< maximum number of thermostat entries in Ions#ThermostatNames and Ions#ThermostatImplemented | 
|---|
|  | 74 | enum thermostats { None, Woodcock, Gaussian, Langevin, Berendsen, NoseHoover };   //!< Thermostat names for output | 
|---|
|  | 75 |  | 
|---|
|  | 76 |  | 
|---|
| [14de469] | 77 | /** The complete molecule. | 
|---|
|  | 78 | * Class incorporates number of types | 
|---|
|  | 79 | */ | 
|---|
| [357fba] | 80 | class molecule : public PointCloud { | 
|---|
| [042f82] | 81 | public: | 
|---|
|  | 82 | double cell_size[6];//!< cell size | 
|---|
|  | 83 | periodentafel *elemente; //!< periodic table with each element | 
|---|
|  | 84 | atom *start;        //!< start of atom list | 
|---|
|  | 85 | atom *end;          //!< end of atom list | 
|---|
|  | 86 | bond *first;        //!< start of bond list | 
|---|
|  | 87 | bond *last;         //!< end of bond list | 
|---|
|  | 88 | bond ***ListOfBondsPerAtom; //!< pointer list for each atom and each bond it has | 
|---|
|  | 89 | int MDSteps;        //!< The number of MD steps in Trajectories | 
|---|
|  | 90 | int *NumberOfBondsPerAtom;  //!< Number of Bonds each atom has | 
|---|
|  | 91 | int AtomCount;          //!< number of atoms, brought up-to-date by CountAtoms() | 
|---|
|  | 92 | int BondCount;          //!< number of atoms, brought up-to-date by CountBonds() | 
|---|
|  | 93 | int ElementCount;       //!< how many unique elements are therein | 
|---|
|  | 94 | int ElementsInMolecule[MAX_ELEMENTS]; //!< list whether element (sorted by atomic number) is alread present or not | 
|---|
|  | 95 | int NoNonHydrogen;  //!< number of non-hydrogen atoms in molecule | 
|---|
|  | 96 | int NoNonBonds;     //!< number of non-hydrogen bonds in molecule | 
|---|
|  | 97 | int NoCyclicBonds;  //!< number of cyclic bonds in molecule, by DepthFirstSearchAnalysis() | 
|---|
|  | 98 | double BondDistance;  //!< typical bond distance used in CreateAdjacencyList() and furtheron | 
|---|
|  | 99 | bool ActiveFlag;    //!< in a MoleculeListClass used to discern active from inactive molecules | 
|---|
|  | 100 | Vector Center;      //!< Center of molecule in a global box | 
|---|
|  | 101 | char name[MAXSTRINGSIZE];         //!< arbitrary name | 
|---|
|  | 102 | int IndexNr;        //!< index of molecule in a MoleculeListClass | 
|---|
| [357fba] | 103 | class Tesselation *TesselStruct; | 
|---|
| [042f82] | 104 |  | 
|---|
|  | 105 | molecule(periodentafel *teil); | 
|---|
| [ab1932] | 106 | virtual ~molecule(); | 
|---|
| [042f82] | 107 |  | 
|---|
| [357fba] | 108 | // re-definition of virtual functions from PointCloud | 
|---|
|  | 109 | Vector *GetCenter(ofstream *out); | 
|---|
|  | 110 | TesselPoint *GetPoint(); | 
|---|
|  | 111 | TesselPoint *GetTerminalPoint(); | 
|---|
|  | 112 | void GoToNext(); | 
|---|
|  | 113 | void GoToPrevious(); | 
|---|
|  | 114 | void GoToFirst(); | 
|---|
|  | 115 | void GoToLast(); | 
|---|
|  | 116 | bool IsEmpty(); | 
|---|
| [1999d8] | 117 | bool IsEnd(); | 
|---|
| [042f82] | 118 |  | 
|---|
| [33f9f7] | 119 | // templates for allowing global manipulation of all vectors | 
|---|
| [cee0b57] | 120 | template <typename res> void ActOnAllVectors( res (Vector::*f)() ); | 
|---|
| [e9f8f9] | 121 | template <typename res> void ActOnAllVectors( res (Vector::*f)() const); | 
|---|
|  | 122 | template <typename res> void ActOnAllVectors( res (Vector::*f)() ) const; | 
|---|
| [49f802c] | 123 | template <typename res> void ActOnAllVectors( res (Vector::*f)() const) const; | 
|---|
| [33f9f7] | 124 | template <typename res, typename T> void ActOnAllVectors( res (Vector::*f)(T), T t ); | 
|---|
| [e9f8f9] | 125 | template <typename res, typename T> void ActOnAllVectors( res (Vector::*f)(T) const, T t ); | 
|---|
|  | 126 | template <typename res, typename T> void ActOnAllVectors( res (Vector::*f)(T), T t ) const; | 
|---|
| [49f802c] | 127 | template <typename res, typename T> void ActOnAllVectors( res (Vector::*f)(T) const, T t ) const; | 
|---|
| [33f9f7] | 128 | template <typename res, typename T, typename U> void ActOnAllVectors( res (Vector::*f)(T, U), T t, U u ); | 
|---|
| [e9f8f9] | 129 | template <typename res, typename T, typename U> void ActOnAllVectors( res (Vector::*f)(T, U) const, T t, U u ); | 
|---|
|  | 130 | template <typename res, typename T, typename U> void ActOnAllVectors( res (Vector::*f)(T, U), T t, U u ) const; | 
|---|
| [49f802c] | 131 | template <typename res, typename T, typename U> void ActOnAllVectors( res (Vector::*f)(T, U) const, T t, U u ) const; | 
|---|
| [33f9f7] | 132 | template <typename res, typename T, typename U, typename V> void ActOnAllVectors( res (Vector::*f)(T, U, V), T t, U u, V v); | 
|---|
| [e9f8f9] | 133 | template <typename res, typename T, typename U, typename V> void ActOnAllVectors( res (Vector::*f)(T, U, V) const, T t, U u, V v); | 
|---|
|  | 134 | template <typename res, typename T, typename U, typename V> void ActOnAllVectors( res (Vector::*f)(T, U, V), T t, U u, V v) const; | 
|---|
| [49f802c] | 135 | template <typename res, typename T, typename U, typename V> void ActOnAllVectors( res (Vector::*f)(T, U, V) const, T t, U u, V v) const; | 
|---|
| [e9f8f9] | 136 |  | 
|---|
|  | 137 | // templates for allowing global manipulation of molecule with each atom as single argument | 
|---|
|  | 138 | template <typename res> void ActWithEachAtom( res (molecule::*f)(atom *) ); | 
|---|
|  | 139 | template <typename res> void ActWithEachAtom( res (molecule::*f)(atom *) const); | 
|---|
|  | 140 | template <typename res> void ActWithEachAtom( res (molecule::*f)(atom *) ) const; | 
|---|
| [49f802c] | 141 | template <typename res> void ActWithEachAtom( res (molecule::*f)(atom *) const) const; | 
|---|
| [e9f8f9] | 142 |  | 
|---|
|  | 143 | // templates for allowing global copying of molecule with each atom as single argument | 
|---|
|  | 144 | template <typename res> void ActOnCopyWithEachAtom( res (molecule::*f)(atom *) , molecule *copy); | 
|---|
|  | 145 | template <typename res> void ActOnCopyWithEachAtom( res (molecule::*f)(atom *) const , molecule *copy); | 
|---|
|  | 146 | template <typename res> void ActOnCopyWithEachAtom( res (molecule::*f)(atom *) , molecule *copy) const; | 
|---|
| [49f802c] | 147 | template <typename res> void ActOnCopyWithEachAtom( res (molecule::*f)(atom *) const, molecule *copy) const; | 
|---|
| [33f9f7] | 148 |  | 
|---|
| [cee0b57] | 149 | // templates for allowing global manipulation of all atoms | 
|---|
|  | 150 | template <typename res> void ActOnAllAtoms( res (atom::*f)() ); | 
|---|
| [e9f8f9] | 151 | template <typename res> void ActOnAllAtoms( res (atom::*f)() const ); | 
|---|
|  | 152 | template <typename res> void ActOnAllAtoms( res (atom::*f)() ) const; | 
|---|
| [49f802c] | 153 | template <typename res> void ActOnAllAtoms( res (atom::*f)() const) const; | 
|---|
| [cee0b57] | 154 | template <typename res, typename T> void ActOnAllAtoms( res (atom::*f)(T), T t ); | 
|---|
| [e9f8f9] | 155 | template <typename res, typename T> void ActOnAllAtoms( res (atom::*f)(T) const, T t ); | 
|---|
| [49f802c] | 156 | template <typename res, typename T> void ActOnAllAtoms( res (atom::*f)(T), T t ) const; | 
|---|
| [e9f8f9] | 157 | template <typename res, typename T> void ActOnAllAtoms( res (atom::*f)(T) const, T t ) const; | 
|---|
| [cee0b57] | 158 | template <typename res, typename T, typename U> void ActOnAllAtoms( res (atom::*f)(T, U), T t, U u ); | 
|---|
| [e9f8f9] | 159 | template <typename res, typename T, typename U> void ActOnAllAtoms( res (atom::*f)(T, U) const, T t, U u ); | 
|---|
|  | 160 | template <typename res, typename T, typename U> void ActOnAllAtoms( res (atom::*f)(T, U), T t, U u ) const; | 
|---|
| [49f802c] | 161 | template <typename res, typename T, typename U> void ActOnAllAtoms( res (atom::*f)(T, U) const, T t, U u ) const; | 
|---|
| [cee0b57] | 162 | template <typename res, typename T, typename U, typename V> void ActOnAllAtoms( res (atom::*f)(T, U, V), T t, U u, V v); | 
|---|
| [e9f8f9] | 163 | template <typename res, typename T, typename U, typename V> void ActOnAllAtoms( res (atom::*f)(T, U, V) const, T t, U u, V v); | 
|---|
|  | 164 | template <typename res, typename T, typename U, typename V> void ActOnAllAtoms( res (atom::*f)(T, U, V), T t, U u, V v) const; | 
|---|
| [49f802c] | 165 | template <typename res, typename T, typename U, typename V> void ActOnAllAtoms( res (atom::*f)(T, U, V) const, T t, U u, V v) const; | 
|---|
| [e9f8f9] | 166 | template <typename res, typename T, typename U, typename V, typename W> void ActOnAllAtoms( res (atom::*f)(T, U, V, W), T t, U u, V v, W w); | 
|---|
|  | 167 | template <typename res, typename T, typename U, typename V, typename W> void ActOnAllAtoms( res (atom::*f)(T, U, V, W) const, T t, U u, V v, W w); | 
|---|
|  | 168 | template <typename res, typename T, typename U, typename V, typename W> void ActOnAllAtoms( res (atom::*f)(T, U, V, W), T t, U u, V v, W w) const; | 
|---|
| [49f802c] | 169 | template <typename res, typename T, typename U, typename V, typename W> void ActOnAllAtoms( res (atom::*f)(T, U, V, W) const, T t, U u, V v, W w) const; | 
|---|
| [e9f8f9] | 170 |  | 
|---|
|  | 171 | // templates for allowing conditional global copying of molecule with each atom as single argument | 
|---|
|  | 172 | template <typename res> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) () ); | 
|---|
|  | 173 | template <typename res, typename T> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T), T t ); | 
|---|
|  | 174 | template <typename res, typename T, typename U> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T, U), T t, U u ); | 
|---|
|  | 175 | template <typename res, typename T, typename U, typename V> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T, U, V), T t, U u, V v ); | 
|---|
|  | 176 |  | 
|---|
|  | 177 | // templates for allowing global manipulation of an array with one entry per atom | 
|---|
| [4a7776a] | 178 | void SetIndexedArrayForEachAtomTo ( atom **array, int TesselPoint::* index); | 
|---|
| [5034e1] | 179 | template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int TesselPoint::* index, void (*Setor)(T *, T *)); | 
|---|
|  | 180 | template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int TesselPoint::* index, void (*Setor)(T *, T *), T t); | 
|---|
|  | 181 | template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int TesselPoint::* index, void (*Setor)(T *, T *), T *t); | 
|---|
|  | 182 | template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int element::*index, void (*Setor)(T *, T *)); | 
|---|
|  | 183 | template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int element::*index, void (*Setor)(T *, T *), T t); | 
|---|
|  | 184 | template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int element::*index, void (*Setor)(T *, T *), T *t); | 
|---|
| [49f802c] | 185 | template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int TesselPoint::* index, T (atom::*Setor)(Vector &), Vector atom::*value); | 
|---|
|  | 186 | template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int TesselPoint::*index, T (atom::*Setor)(Vector &), Vector &vect ); | 
|---|
| [cee0b57] | 187 |  | 
|---|
| [5034e1] | 188 | // templates for allowing global manipulation of each atom by entries in an array | 
|---|
|  | 189 | template <typename T> void SetAtomValueToIndexedArray ( T *array, int TesselPoint::*index, T atom::*value ); | 
|---|
|  | 190 | template <typename T> void SetAtomValueToIndexedArray ( T *array, int element::*index, T atom::*value ); | 
|---|
|  | 191 |  | 
|---|
| [042f82] | 192 | /// remove atoms from molecule. | 
|---|
|  | 193 | bool AddAtom(atom *pointer); | 
|---|
|  | 194 | bool RemoveAtom(atom *pointer); | 
|---|
|  | 195 | bool UnlinkAtom(atom *pointer); | 
|---|
|  | 196 | bool CleanupMolecule(); | 
|---|
|  | 197 |  | 
|---|
|  | 198 | /// Add/remove atoms to/from molecule. | 
|---|
|  | 199 | atom * AddCopyAtom(atom *pointer); | 
|---|
|  | 200 | bool AddXYZFile(string filename); | 
|---|
|  | 201 | bool AddHydrogenReplacementAtom(ofstream *out, bond *Bond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bond **BondList, int NumBond, bool IsAngstroem); | 
|---|
| [cee0b57] | 202 | bond * AddBond(atom *first, atom *second, int degree = 1); | 
|---|
| [042f82] | 203 | bool RemoveBond(bond *pointer); | 
|---|
|  | 204 | bool RemoveBonds(atom *BondPartner); | 
|---|
|  | 205 |  | 
|---|
|  | 206 | /// Find atoms. | 
|---|
|  | 207 | atom * FindAtom(int Nr) const; | 
|---|
|  | 208 | atom * AskAtom(string text); | 
|---|
|  | 209 |  | 
|---|
|  | 210 | /// Count and change present atoms' coordination. | 
|---|
|  | 211 | void CountAtoms(ofstream *out); | 
|---|
|  | 212 | void CountElements(); | 
|---|
|  | 213 | void CalculateOrbitals(class config &configuration); | 
|---|
|  | 214 | bool CenterInBox(ofstream *out); | 
|---|
| [f3278b] | 215 | bool BoundInBox(ofstream *out); | 
|---|
| [042f82] | 216 | void CenterEdge(ofstream *out, Vector *max); | 
|---|
| [437922] | 217 | void CenterOrigin(ofstream *out); | 
|---|
|  | 218 | void CenterPeriodic(ofstream *out); | 
|---|
|  | 219 | void CenterAtVector(ofstream *out, Vector *newcenter); | 
|---|
| [042f82] | 220 | void Translate(const Vector *x); | 
|---|
|  | 221 | void TranslatePeriodically(const Vector *trans); | 
|---|
|  | 222 | void Mirror(const Vector *x); | 
|---|
|  | 223 | void Align(Vector *n); | 
|---|
|  | 224 | void Scale(double **factor); | 
|---|
| [437922] | 225 | void DeterminePeriodicCenter(Vector ¢er); | 
|---|
| [042f82] | 226 | Vector * DetermineCenterOfGravity(ofstream *out); | 
|---|
|  | 227 | Vector * DetermineCenterOfAll(ofstream *out); | 
|---|
| [437922] | 228 | void SetNameFromFilename(const char *filename); | 
|---|
| [042f82] | 229 | void SetBoxDimension(Vector *dim); | 
|---|
|  | 230 | void ScanForPeriodicCorrection(ofstream *out); | 
|---|
| [631dcb] | 231 | bool VerletForceIntegration(ofstream *out, char *file, config &configuration); | 
|---|
| [62f793] | 232 | void Thermostats(config &configuration, double ActualTemp, int Thermostat); | 
|---|
| [042f82] | 233 | void PrincipalAxisSystem(ofstream *out, bool DoRotate); | 
|---|
|  | 234 | double VolumeOfConvexEnvelope(ofstream *out, bool IsAngstroem); | 
|---|
|  | 235 | Vector* FindEmbeddingHole(ofstream *out, molecule *srcmol); | 
|---|
|  | 236 |  | 
|---|
|  | 237 |  | 
|---|
| [ccd9f5] | 238 | double ConstrainedPotential(ofstream *out, struct EvaluatePotential &Params); | 
|---|
| [631dcb] | 239 | double MinimiseConstrainedPotential(ofstream *out, atom **&permutation, int startstep, int endstep, bool IsAngstroem); | 
|---|
|  | 240 | void EvaluateConstrainedForces(ofstream *out, int startstep, int endstep, atom **PermutationMap, ForceMatrix *Force); | 
|---|
| [f7f7a4] | 241 | bool LinearInterpolationBetweenConfiguration(ofstream *out, int startstep, int endstep, const char *prefix, config &configuration, bool MapByIdentity); | 
|---|
| [d52ea1b] | 242 |  | 
|---|
| [042f82] | 243 | bool CheckBounds(const Vector *x) const; | 
|---|
|  | 244 | void GetAlignvector(struct lsq_params * par) const; | 
|---|
|  | 245 |  | 
|---|
|  | 246 | /// Initialising routines in fragmentation | 
|---|
|  | 247 | void CreateAdjacencyList2(ofstream *out, ifstream *output); | 
|---|
|  | 248 | void CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem); | 
|---|
|  | 249 | void CreateListOfBondsPerAtom(ofstream *out); | 
|---|
|  | 250 |  | 
|---|
|  | 251 | // Graph analysis | 
|---|
|  | 252 | MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, class StackClass<bond *> *&BackEdgeStack); | 
|---|
|  | 253 | void CyclicStructureAnalysis(ofstream *out, class StackClass<bond *> *BackEdgeStack, int *&MinimumRingSize); | 
|---|
|  | 254 | bool PickLocalBackEdges(ofstream *out, atom **ListOfLocalAtoms, class StackClass<bond *> *&ReferenceStack, class StackClass<bond *> *&LocalStack); | 
|---|
|  | 255 | bond * FindNextUnused(atom *vertex); | 
|---|
|  | 256 | void SetNextComponentNumber(atom *vertex, int nr); | 
|---|
|  | 257 | void InitComponentNumbers(); | 
|---|
|  | 258 | void OutputComponentNumber(ofstream *out, atom *vertex); | 
|---|
|  | 259 | void ResetAllBondsToUnused(); | 
|---|
|  | 260 | void ResetAllAtomNumbers(); | 
|---|
|  | 261 | int CountCyclicBonds(ofstream *out); | 
|---|
|  | 262 | bool CheckForConnectedSubgraph(ofstream *out, KeySet *Fragment); | 
|---|
|  | 263 | string GetColor(enum Shading color); | 
|---|
|  | 264 |  | 
|---|
|  | 265 | molecule *CopyMolecule(); | 
|---|
| [89c8b2] | 266 | molecule* CopyMoleculeFromSubRegion(Vector offset, double *parallelepiped); | 
|---|
| [042f82] | 267 |  | 
|---|
|  | 268 | /// Fragment molecule by two different approaches: | 
|---|
|  | 269 | int FragmentMolecule(ofstream *out, int Order, config *configuration); | 
|---|
|  | 270 | bool CheckOrderAtSite(ofstream *out, bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL); | 
|---|
|  | 271 | bool StoreAdjacencyToFile(ofstream *out, char *path); | 
|---|
|  | 272 | bool CheckAdjacencyFileAgainstMolecule(ofstream *out, char *path, atom **ListOfAtoms); | 
|---|
|  | 273 | bool ParseOrderAtSiteFromFile(ofstream *out, char *path); | 
|---|
|  | 274 | bool StoreOrderAtSiteFile(ofstream *out, char *path); | 
|---|
|  | 275 | bool StoreForcesFile(ofstream *out, MoleculeListClass *BondFragments, char *path, int *SortIndex); | 
|---|
|  | 276 | bool CreateMappingLabelsToConfigSequence(ofstream *out, int *&SortIndex); | 
|---|
|  | 277 | void BreadthFirstSearchAdd(ofstream *out, molecule *Mol, atom **&AddedAtomList, bond **&AddedBondList, atom *Root, bond *Bond, int BondOrder, bool IsAngstroem); | 
|---|
|  | 278 | /// -# BOSSANOVA | 
|---|
|  | 279 | void FragmentBOSSANOVA(ofstream *out, Graph *&FragmentList, KeyStack &RootStack, int *MinimumRingSize); | 
|---|
|  | 280 | int PowerSetGenerator(ofstream *out, int Order, struct UniqueFragments &FragmentSearch, KeySet RestrictedKeySet); | 
|---|
|  | 281 | bool BuildInducedSubgraph(ofstream *out, const molecule *Father); | 
|---|
|  | 282 | molecule * StoreFragmentFromKeySet(ofstream *out, KeySet &Leaflet, bool IsAngstroem); | 
|---|
|  | 283 | void SPFragmentGenerator(ofstream *out, struct UniqueFragments *FragmentSearch, int RootDistance, bond **BondsSet, int SetDimension, int SubOrder); | 
|---|
|  | 284 | int LookForRemovalCandidate(ofstream *&out, KeySet *&Leaf, int *&ShortestPathList); | 
|---|
|  | 285 | int GuesstimateFragmentCount(ofstream *out, int order); | 
|---|
|  | 286 |  | 
|---|
|  | 287 | // Recognize doubly appearing molecules in a list of them | 
|---|
|  | 288 | int * IsEqualToWithinThreshold(ofstream *out, molecule *OtherMolecule, double threshold); | 
|---|
|  | 289 | int * GetFatherSonAtomicMap(ofstream *out, molecule *OtherMolecule); | 
|---|
|  | 290 |  | 
|---|
|  | 291 | // Output routines. | 
|---|
|  | 292 | bool Output(ofstream *out); | 
|---|
|  | 293 | bool OutputTrajectories(ofstream *out); | 
|---|
|  | 294 | void OutputListOfBonds(ofstream *out) const; | 
|---|
|  | 295 | bool OutputXYZ(ofstream *out) const; | 
|---|
|  | 296 | bool OutputTrajectoriesXYZ(ofstream *out); | 
|---|
|  | 297 | bool Checkout(ofstream *out) const; | 
|---|
|  | 298 | bool OutputTemperatureFromTrajectories(ofstream *out, int startstep, int endstep, ofstream *output); | 
|---|
|  | 299 |  | 
|---|
|  | 300 | private: | 
|---|
|  | 301 | int last_atom;      //!< number given to last atom | 
|---|
| [357fba] | 302 | atom *InternalPointer;  //!< internal pointer for PointCloud | 
|---|
| [14de469] | 303 | }; | 
|---|
|  | 304 |  | 
|---|
| [e9f8f9] | 305 | #include "molecule_template.hpp" | 
|---|
| [33f9f7] | 306 |  | 
|---|
| [14de469] | 307 | /** A list of \a molecule classes. | 
|---|
|  | 308 | */ | 
|---|
|  | 309 | class MoleculeListClass { | 
|---|
| [042f82] | 310 | public: | 
|---|
|  | 311 | MoleculeList ListOfMolecules; //!< List of the contained molecules | 
|---|
|  | 312 | int MaxIndex; | 
|---|
|  | 313 |  | 
|---|
|  | 314 | MoleculeListClass(); | 
|---|
|  | 315 | ~MoleculeListClass(); | 
|---|
|  | 316 |  | 
|---|
|  | 317 | bool AddHydrogenCorrection(ofstream *out, char *path); | 
|---|
|  | 318 | bool StoreForcesFile(ofstream *out, char *path, int *SortIndex); | 
|---|
| [437922] | 319 | void insert(molecule *mol); | 
|---|
| [042f82] | 320 | molecule * ReturnIndex(int index); | 
|---|
|  | 321 | bool OutputConfigForListOfFragments(ofstream *out, config *configuration, int *SortIndex); | 
|---|
|  | 322 | int NumberOfActiveMolecules(); | 
|---|
|  | 323 | void Enumerate(ofstream *out); | 
|---|
|  | 324 | void Output(ofstream *out); | 
|---|
|  | 325 |  | 
|---|
|  | 326 | // merging of molecules | 
|---|
| [1907a7] | 327 | bool SimpleMerge(molecule *mol, molecule *srcmol); | 
|---|
|  | 328 | bool SimpleAdd(molecule *mol, molecule *srcmol); | 
|---|
|  | 329 | bool SimpleMultiMerge(molecule *mol, int *src, int N); | 
|---|
|  | 330 | bool SimpleMultiAdd(molecule *mol, int *src, int N); | 
|---|
|  | 331 | bool ScatterMerge(molecule *mol, int *src, int N); | 
|---|
|  | 332 | bool EmbedMerge(molecule *mol, molecule *srcmol); | 
|---|
|  | 333 |  | 
|---|
| [042f82] | 334 | private: | 
|---|
| [14de469] | 335 | }; | 
|---|
|  | 336 |  | 
|---|
|  | 337 |  | 
|---|
|  | 338 | /** A leaf for a tree of \a molecule class | 
|---|
|  | 339 | * Wraps molecules in a tree structure | 
|---|
|  | 340 | */ | 
|---|
|  | 341 | class MoleculeLeafClass { | 
|---|
| [042f82] | 342 | public: | 
|---|
|  | 343 | molecule *Leaf;                   //!< molecule of this leaf | 
|---|
|  | 344 | //MoleculeLeafClass *UpLeaf;        //!< Leaf one level up | 
|---|
|  | 345 | //MoleculeLeafClass *DownLeaf;      //!< First leaf one level down | 
|---|
|  | 346 | MoleculeLeafClass *previous;  //!< Previous leaf on this level | 
|---|
|  | 347 | MoleculeLeafClass *next;      //!< Next leaf on this level | 
|---|
|  | 348 |  | 
|---|
|  | 349 | //MoleculeLeafClass(MoleculeLeafClass *Up, MoleculeLeafClass *Previous); | 
|---|
|  | 350 | MoleculeLeafClass(MoleculeLeafClass *PreviousLeaf); | 
|---|
|  | 351 | ~MoleculeLeafClass(); | 
|---|
|  | 352 |  | 
|---|
|  | 353 | bool AddLeaf(molecule *ptr, MoleculeLeafClass *Previous); | 
|---|
|  | 354 | bool FillBondStructureFromReference(ofstream *out, molecule *reference, int &FragmentCounter, atom ***&ListOfLocalAtoms, bool FreeList = false); | 
|---|
|  | 355 | bool FillRootStackForSubgraphs(ofstream *out, KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter); | 
|---|
|  | 356 | bool AssignKeySetsToFragment(ofstream *out, molecule *reference, Graph *KeySetList, atom ***&ListOfLocalAtoms, Graph **&FragmentList, int &FragmentCounter, bool FreeList = false); | 
|---|
|  | 357 | bool FillListOfLocalAtoms(ofstream *out, atom ***&ListOfLocalAtoms, const int FragmentCounter, const int GlobalAtomCount, bool &FreeList); | 
|---|
|  | 358 | void TranslateIndicesToGlobalIDs(ofstream *out, Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets, Graph &TotalGraph); | 
|---|
|  | 359 | int Count() const; | 
|---|
| [14de469] | 360 | }; | 
|---|
|  | 361 |  | 
|---|
| [d1df9b] | 362 |  | 
|---|
| [14de469] | 363 | #endif /*MOLECULES_HPP_*/ | 
|---|
|  | 364 |  | 
|---|