Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecules.hpp

    • Property mode changed from 100644 to 100755
    rdf793a r2746be  
    11/** \file molecules.hpp
    22 *
    3  * Class definitions of atom and molecule, element and periodentafel 
     3 * Class definitions of atom and molecule, element and periodentafel
    44 */
    55
     
    1010
    1111// GSL headers
     12#include <gsl/gsl_multimin.h>
     13#include <gsl/gsl_vector.h>
     14#include <gsl/gsl_matrix.h>
    1215#include <gsl/gsl_eigen.h>
    1316#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>
    1917
    2018// STL headers
     
    5654#define BoundariesTestPair pair< Boundaries::iterator, bool>
    5755
    58 #define PointMap map < int, class BoundaryPointSet * > 
    59 #define PointPair pair < int, class BoundaryPointSet * > 
    60 #define PointTestPair pair < PointMap::iterator, bool > 
    61 
    62 #define LineMap map < int, class BoundaryLineSet * > 
    63 #define LinePair pair < int, class BoundaryLineSet * > 
    64 #define LineTestPair pair < LinePair::iterator, bool >
    65 
    66 #define TriangleMap map < int, class BoundaryTriangleSet * > 
    67 #define TrianglePair pair < int, class BoundaryTriangleSet * > 
    68 #define TriangleTestPair pair < TrianglePair::iterator, bool > 
     56#define PointMap map < int, class BoundaryPointSet * >
     57#define PointPair pair < int, class BoundaryPointSet * >
     58#define PointTestPair pair < PointMap::iterator, bool >
     59
     60#define LineMap map < int, class BoundaryLineSet * >
     61#define LinePair pair < int, class BoundaryLineSet * >
     62#define LineTestPair pair < LineMap::iterator, bool >
     63
     64#define TriangleMap map < int, class BoundaryTriangleSet * >
     65#define TrianglePair pair < int, class BoundaryTriangleSet * >
     66#define TriangleTestPair pair < TrianglePair::iterator, bool >
    6967
    7068#define DistanceMultiMap multimap <double, pair < PointMap::iterator, PointMap::iterator> >
     
    8886//bool operator < (KeySet SubgraphA, KeySet SubgraphB);   //note: this declaration is important, otherwise normal < is used (producing wrong order)
    8987inline void InsertFragmentIntoGraph(ofstream *out, struct UniqueFragments *Fragment); // Insert a KeySet into a Graph
    90 inline void InsertGraphIntoGraph(ofstream *out, Graph &graph1, Graph &graph2, int *counter);  // Insert all KeySet's in a Graph into another Graph 
     88inline void InsertGraphIntoGraph(ofstream *out, Graph &graph1, Graph &graph2, int *counter);  // Insert all KeySet's in a Graph into another Graph
    9189int CompareDoubles (const void * a, const void * b);
    9290
     
    142140    unsigned char AdaptiveOrder;  //!< current present bond order at site (0 means "not set")
    143141    bool MaxOrder;  //!< whether this atom as a root in fragmentation still creates more fragments on higher orders or not
    144  
     142
    145143  atom();
    146144  ~atom();
    147  
     145
    148146  bool Output(int ElementNo, int AtomNo, ofstream *out) const;
    149147  bool OutputXYZLine(ofstream *out) const;
    150148  atom *GetTrueFather();
    151149  bool Compare(atom &ptr);
    152  
     150
    153151  private:
    154152};
    155153
    156 ostream & operator << (ostream &ost, const atom &a);
     154ostream & operator << (ostream &ost, atom &a);
    157155
    158156/** Bonds between atoms.
     
    171169    int nr;           //!< unique number in a molecule, updated by molecule::CreateAdjacencyList()
    172170    bool Cyclic;      //!< flag whether bond is part of a cycle or not, given in DepthFirstSearchAnalysis()
    173     enum EdgeType Type;//!< whether this is a tree or back edge 
    174        
     171    enum EdgeType Type;//!< whether this is a tree or back edge
     172
    175173  atom * GetOtherAtom(atom *Atom) const;
    176174  bond * GetFirstBond();
    177175  bond * GetLastBond();
    178  
     176
    179177  bool MarkUsed(enum Shading color);
    180178  enum Shading IsUsed();
     
    182180  bool Contains(const atom *ptr);
    183181  bool Contains(const int nr);
    184  
     182
    185183  bond();
    186184  bond(atom *left, atom *right);
     
    188186  bond(atom *left, atom *right, int degree, int number);
    189187  ~bond();
    190    
    191   private: 
     188
     189  private:
    192190    enum Shading Used;        //!< marker in depth-first search, DepthFirstSearchAnalysis()
    193191};
    194192
    195 
    196 ostream & operator << (ostream &ost, const bond &b);
     193ostream & operator << (ostream &ost, bond &b);
    197194
    198195class MoleculeLeafClass;
    199 
    200 
    201 #define MaxThermostats 6      //!< maximum number of thermostat entries in Ions#ThermostatNames and Ions#ThermostatImplemented
    202 enum thermostats { None, Woodcock, Gaussian, Langevin, Berendsen, NoseHoover };   //!< Thermostat names for output
    203 
    204196
    205197/** The complete molecule.
     
    226218    int NoCyclicBonds;  //!< number of cyclic bonds in molecule, by DepthFirstSearchAnalysis()
    227219    double BondDistance;  //!< typical bond distance used in CreateAdjacencyList() and furtheron
    228  
     220
    229221  molecule(periodentafel *teil);
    230222  ~molecule();
    231  
     223
    232224  /// remove atoms from molecule.
    233225  bool AddAtom(atom *pointer);
     
    238230  atom * AddCopyAtom(atom *pointer);
    239231  bool AddXYZFile(string filename);
    240   bool AddHydrogenReplacementAtom(ofstream *out, bond *Bond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bond **BondList, int NumBond, bool IsAngstroem); 
     232  bool AddHydrogenReplacementAtom(ofstream *out, bond *Bond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bond **BondList, int NumBond, bool IsAngstroem);
    241233  bond * AddBond(atom *first, atom *second, int degree);
    242234  bool RemoveBond(bond *pointer);
    243235  bool RemoveBonds(atom *BondPartner);
    244    
     236
    245237  /// Find atoms.
    246   atom * FindAtom(int Nr) const; 
     238  atom * FindAtom(int Nr) const;
    247239  atom * AskAtom(string text);
    248240
     
    252244  void CalculateOrbitals(class config &configuration);
    253245  bool CenterInBox(ofstream *out, Vector *BoxLengths);
    254   void CenterEdge(ofstream *out, Vector *max); 
    255   void CenterOrigin(ofstream *out, Vector *max); 
     246  void CenterEdge(ofstream *out, Vector *max);
     247  void CenterOrigin(ofstream *out, Vector *max);
    256248  void CenterGravity(ofstream *out, Vector *max);
    257249  void Translate(const Vector *x);
     
    267259        void PrincipalAxisSystem(ofstream *out, bool DoRotate);
    268260        double VolumeOfConvexEnvelope(ofstream *out, bool IsAngstroem);
    269        
    270         bool VerletForceIntegration(ofstream *out, char *file, config &configuration);
    271   void Thermostats(config &configuration, double ActualTemp, int Thermostat);
    272 
    273   double ConstrainedPotential(ofstream *out, atom **permutation, int start, int end, double *constants, bool IsAngstroem);
    274         double MinimiseConstrainedPotential(ofstream *out, atom **&permutation, int startstep, int endstep, bool IsAngstroem);
    275         void EvaluateConstrainedForces(ofstream *out, int startstep, int endstep, atom **PermutationMap, ForceMatrix *Force);
    276         bool LinearInterpolationBetweenConfiguration(ofstream *out, int startstep, int endstep, const char *prefix, config &configuration);
    277        
     261        bool VerletForceIntegration(char *file, double delta_t, bool IsAngstroem);
     262
    278263  bool CheckBounds(const Vector *x) const;
    279264  void GetAlignvector(struct lsq_params * par) const;
    280265
    281   /// Initialising routines in fragmentation 
     266  /// Initialising routines in fragmentation
     267  void CreateAdjacencyList2(ofstream *out, ifstream *output);
    282268  void CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem);
    283269  void CreateListOfBondsPerAtom(ofstream *out);
    284  
     270
    285271  // Graph analysis
    286272  MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, class StackClass<bond *> *&BackEdgeStack);
     
    298284
    299285  molecule *CopyMolecule();
    300  
     286
    301287  /// Fragment molecule by two different approaches:
    302288  int FragmentMolecule(ofstream *out, int Order, config *configuration);
     
    320306  int LookForRemovalCandidate(ofstream *&out, KeySet *&Leaf, int *&ShortestPathList);
    321307  int GuesstimateFragmentCount(ofstream *out, int order);
    322          
    323   // Recognize doubly appearing molecules in a list of them   
     308
     309  // Recognize doubly appearing molecules in a list of them
    324310  int * IsEqualToWithinThreshold(ofstream *out, molecule *OtherMolecule, double threshold);
    325311  int * GetFatherSonAtomicMap(ofstream *out, molecule *OtherMolecule);
    326        
     312
    327313  // Output routines.
    328314  bool Output(ofstream *out);
     
    345331    int NumberOfMolecules;        //!< Number of entries in \a **FragmentList and of to be returned one.
    346332    int NumberOfTopAtoms;         //!< Number of atoms in the molecule from which all fragments originate
    347    
     333
    348334  MoleculeListClass();
    349335  MoleculeListClass(int Num, int NumAtoms);
     
    353339  bool AddHydrogenCorrection(ofstream *out, char *path);
    354340  bool StoreForcesFile(ofstream *out, char *path, int *SortIndex);
    355   bool OutputConfigForListOfFragments(ofstream *out, const char *fragmentprefix, config *configuration, int *SortIndex, bool DoPeriodic, bool DoCentering);
     341  bool OutputConfigForListOfFragments(ofstream *out, config *configuration, int *SortIndex);
    356342  void Output(ofstream *out);
    357  
     343
    358344  private:
    359345};
     
    365351class MoleculeLeafClass {
    366352  public:
    367     molecule *Leaf;                   //!< molecule of this leaf 
     353    molecule *Leaf;                   //!< molecule of this leaf
    368354    //MoleculeLeafClass *UpLeaf;        //!< Leaf one level up
    369355    //MoleculeLeafClass *DownLeaf;      //!< First leaf one level down
     
    401387    bool FastParsing;
    402388    double Deltat;
    403     int DoConstrainedMD;
    404     int MaxOuterStep;
    405     int Thermostat;
    406     int *ThermostatImplemented;
    407     char **ThermostatNames;
    408     double TempFrequency;
    409     double alpha;
    410     double HooverMass;
    411     double TargetTemp;
    412     int ScaleTempStep;
    413    
     389    string basis;
     390
    414391    private:
    415392    char *mainname;
    416393    char *defaultpath;
    417394    char *pseudopotpath;
    418    
     395
    419396    int DoOutVis;
    420397    int DoOutMes;
     
    431408    int UseAddGramSch;
    432409    int Seed;
    433    
     410
     411    int MaxOuterStep;
    434412    int OutVisStep;
    435413    int OutSrcStep;
     414    double TargetTemp;
     415    int ScaleTempStep;
    436416    int MaxPsiStep;
    437417    double EpsWannier;
    438    
     418
    439419    int MaxMinStep;
    440420    double RelEpsTotalEnergy;
     
    445425    double InitRelEpsKineticEnergy;
    446426    int InitMaxMinGapStopStep;
    447    
     427
    448428    //double BoxLength[NDIM*NDIM];
    449    
     429
    450430    double ECut;
    451431    int MaxLevel;
     
    456436    int RTActualUse;
    457437    int AddPsis;
    458    
     438
    459439    double RCut;
    460440    int StructOpt;
     
    463443    int MaxTypes;
    464444
    465  
     445
    466446  int ParseForParameter(int verbose, ifstream *file, const char *name, int sequential, int const xth, int const yth, int type, void *value, int repetition, int critical);
    467  
     447
    468448  public:
    469449  config();
     
    474454  void LoadOld(char *filename, periodentafel *periode, molecule *mol);
    475455  void RetrieveConfigPathAndName(string filename);
    476   bool Save(ofstream *file, periodentafel *periode, molecule *mol) const;
    477   bool SaveMPQC(ofstream *file, molecule *mol) const;
     456  bool Save(const char *filename, periodentafel *periode, molecule *mol) const;
     457  bool SaveMPQC(const char *filename, molecule *mol) const;
    478458  void Edit(molecule *mol);
    479459  bool GetIsAngstroem() const;
    480460  char *GetDefaultPath() const;
    481461  void SetDefaultPath(const char *path);
    482   void InitThermostats(ifstream *source);
    483462};
    484463
Note: See TracChangeset for help on using the changeset viewer.