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