Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecules.hpp

    • Property mode changed from 100755 to 100644
    r848729 rf89a9e  
    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
     
    5454#define BoundariesTestPair pair< Boundaries::iterator, bool>
    5555
    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 >
     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 < LinePair::iterator, bool >
     63
     64#define TriangleMap map < int, class BoundaryTriangleSet * > 
     65#define TrianglePair pair < int, class BoundaryTriangleSet * > 
     66#define TriangleTestPair pair < TrianglePair::iterator, bool > 
    6767
    6868#define DistanceMultiMap multimap <double, pair < PointMap::iterator, PointMap::iterator> >
     
    8686//bool operator < (KeySet SubgraphA, KeySet SubgraphB);   //note: this declaration is important, otherwise normal < is used (producing wrong order)
    8787inline void InsertFragmentIntoGraph(ofstream *out, struct UniqueFragments *Fragment); // Insert a KeySet into a Graph
    88 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 
    8989int CompareDoubles (const void * a, const void * b);
    9090
     
    140140    unsigned char AdaptiveOrder;  //!< current present bond order at site (0 means "not set")
    141141    bool MaxOrder;  //!< whether this atom as a root in fragmentation still creates more fragments on higher orders or not
    142 
     142 
    143143  atom();
    144144  ~atom();
    145 
     145 
    146146  bool Output(int ElementNo, int AtomNo, ofstream *out) const;
    147147  bool OutputXYZLine(ofstream *out) const;
    148148  atom *GetTrueFather();
    149149  bool Compare(atom &ptr);
    150 
     150 
    151151  private:
    152152};
     
    169169    int nr;           //!< unique number in a molecule, updated by molecule::CreateAdjacencyList()
    170170    bool Cyclic;      //!< flag whether bond is part of a cycle or not, given in DepthFirstSearchAnalysis()
    171     enum EdgeType Type;//!< whether this is a tree or back edge
    172 
     171    enum EdgeType Type;//!< whether this is a tree or back edge 
     172       
    173173  atom * GetOtherAtom(atom *Atom) const;
    174174  bond * GetFirstBond();
    175175  bond * GetLastBond();
    176 
     176 
    177177  bool MarkUsed(enum Shading color);
    178178  enum Shading IsUsed();
     
    180180  bool Contains(const atom *ptr);
    181181  bool Contains(const int nr);
    182 
     182 
    183183  bond();
    184184  bond(atom *left, atom *right);
     
    186186  bond(atom *left, atom *right, int degree, int number);
    187187  ~bond();
    188 
    189   private:
     188   
     189  private: 
    190190    enum Shading Used;        //!< marker in depth-first search, DepthFirstSearchAnalysis()
    191191};
     
    218218    int NoCyclicBonds;  //!< number of cyclic bonds in molecule, by DepthFirstSearchAnalysis()
    219219    double BondDistance;  //!< typical bond distance used in CreateAdjacencyList() and furtheron
    220 
     220 
    221221  molecule(periodentafel *teil);
    222222  ~molecule();
    223 
     223 
    224224  /// remove atoms from molecule.
    225225  bool AddAtom(atom *pointer);
     
    230230  atom * AddCopyAtom(atom *pointer);
    231231  bool AddXYZFile(string filename);
    232   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); 
    233233  bond * AddBond(atom *first, atom *second, int degree);
    234234  bool RemoveBond(bond *pointer);
    235235  bool RemoveBonds(atom *BondPartner);
    236 
     236   
    237237  /// Find atoms.
    238   atom * FindAtom(int Nr) const;
     238  atom * FindAtom(int Nr) const; 
    239239  atom * AskAtom(string text);
    240240
     
    244244  void CalculateOrbitals(class config &configuration);
    245245  bool CenterInBox(ofstream *out, Vector *BoxLengths);
    246   void CenterEdge(ofstream *out, Vector *max);
    247   void CenterOrigin(ofstream *out, Vector *max);
     246  void CenterEdge(ofstream *out, Vector *max); 
     247  void CenterOrigin(ofstream *out, Vector *max); 
    248248  void CenterGravity(ofstream *out, Vector *max);
    249249  void Translate(const Vector *x);
     
    260260        double VolumeOfConvexEnvelope(ofstream *out, bool IsAngstroem);
    261261        bool VerletForceIntegration(char *file, double delta_t, bool IsAngstroem);
    262 
     262       
    263263  bool CheckBounds(const Vector *x) const;
    264264  void GetAlignvector(struct lsq_params * par) const;
    265265
    266   /// Initialising routines in fragmentation
    267   void CreateAdjacencyList2(ofstream *out, ifstream *output);
     266  /// Initialising routines in fragmentation 
    268267  void CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem);
    269268  void CreateListOfBondsPerAtom(ofstream *out);
    270 
     269 
    271270  // Graph analysis
    272271  MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, class StackClass<bond *> *&BackEdgeStack);
     
    284283
    285284  molecule *CopyMolecule();
    286 
     285 
    287286  /// Fragment molecule by two different approaches:
    288287  int FragmentMolecule(ofstream *out, int Order, config *configuration);
     
    306305  int LookForRemovalCandidate(ofstream *&out, KeySet *&Leaf, int *&ShortestPathList);
    307306  int GuesstimateFragmentCount(ofstream *out, int order);
    308 
    309   // Recognize doubly appearing molecules in a list of them
     307         
     308  // Recognize doubly appearing molecules in a list of them   
    310309  int * IsEqualToWithinThreshold(ofstream *out, molecule *OtherMolecule, double threshold);
    311310  int * GetFatherSonAtomicMap(ofstream *out, molecule *OtherMolecule);
    312 
     311       
    313312  // Output routines.
    314313  bool Output(ofstream *out);
     
    331330    int NumberOfMolecules;        //!< Number of entries in \a **FragmentList and of to be returned one.
    332331    int NumberOfTopAtoms;         //!< Number of atoms in the molecule from which all fragments originate
    333 
     332   
    334333  MoleculeListClass();
    335334  MoleculeListClass(int Num, int NumAtoms);
     
    341340  bool OutputConfigForListOfFragments(ofstream *out, config *configuration, int *SortIndex);
    342341  void Output(ofstream *out);
    343 
     342 
    344343  private:
    345344};
     
    351350class MoleculeLeafClass {
    352351  public:
    353     molecule *Leaf;                   //!< molecule of this leaf
     352    molecule *Leaf;                   //!< molecule of this leaf 
    354353    //MoleculeLeafClass *UpLeaf;        //!< Leaf one level up
    355354    //MoleculeLeafClass *DownLeaf;      //!< First leaf one level down
     
    387386    bool FastParsing;
    388387    double Deltat;
    389 
     388   
    390389    private:
    391390    char *mainname;
    392391    char *defaultpath;
    393392    char *pseudopotpath;
    394 
     393   
    395394    int DoOutVis;
    396395    int DoOutMes;
     
    407406    int UseAddGramSch;
    408407    int Seed;
    409 
     408   
    410409    int MaxOuterStep;
    411410    int OutVisStep;
     
    415414    int MaxPsiStep;
    416415    double EpsWannier;
    417 
     416   
    418417    int MaxMinStep;
    419418    double RelEpsTotalEnergy;
     
    424423    double InitRelEpsKineticEnergy;
    425424    int InitMaxMinGapStopStep;
    426 
     425   
    427426    //double BoxLength[NDIM*NDIM];
    428 
     427   
    429428    double ECut;
    430429    int MaxLevel;
     
    435434    int RTActualUse;
    436435    int AddPsis;
    437 
     436   
    438437    double RCut;
    439438    int StructOpt;
     
    442441    int MaxTypes;
    443442
    444 
     443 
    445444  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);
    446 
     445 
    447446  public:
    448447  config();
Note: See TracChangeset for help on using the changeset viewer.