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