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