Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecules.hpp

    r2746be r437922  
    6969#define DistanceMultiMapPair pair <double, pair < PointMap::iterator, PointMap::iterator> >
    7070
     71#define MoleculeList list <molecule *>
     72#define MoleculeListTest pair <MoleculeList::iterator, bool>
     73
    7174/******************************** Some small functions and/or structures **********************************/
    7275
     
    114117  element *type;
    115118};
    116 
    117 
    118119
    119120/** Single atom.
     
    129130    atom *father;   //!< In many-body bond order fragmentations points to originating atom
    130131    atom *Ancestor; //!< "Father" in Depth-First-Search
    131     char *Name;                 //!< unique name used during many-body bond-order fragmentation
     132    char *Name;      //!< unique name used during many-body bond-order fragmentation
    132133    int FixedIon;   //!< config variable that states whether forces act on the ion or not
    133134    int *sort;      //!< sort criteria
     
    144145  ~atom();
    145146
    146   bool Output(int ElementNo, int AtomNo, ofstream *out) const;
     147  bool Output(int ElementNo, int AtomNo, ofstream *out, const char *comment = NULL) const;
    147148  bool OutputXYZLine(ofstream *out) const;
    148149  atom *GetTrueFather();
     
    161162class bond {
    162163  public:
    163         atom *leftatom;         //!< first bond partner
    164         atom *rightatom;        //!< second bond partner
     164    atom *leftatom;    //!< first bond partner
     165    atom *rightatom;  //!< second bond partner
    165166    bond *previous; //!< previous atom in molecule list
    166167    bond *next;     //!< next atom in molecule list
    167         int HydrogenBond;       //!< Number of hydrogen atoms in the bond
    168         int BondDegree;         //!< single, double, triple, ... bond
     168    int HydrogenBond;  //!< Number of hydrogen atoms in the bond
     169    int BondDegree;    //!< single, double, triple, ... bond
    169170    int nr;           //!< unique number in a molecule, updated by molecule::CreateAdjacencyList()
    170171    bool Cyclic;      //!< flag whether bond is part of a cycle or not, given in DepthFirstSearchAnalysis()
     
    210211    int MDSteps;        //!< The number of MD steps in Trajectories
    211212    int *NumberOfBondsPerAtom;  //!< Number of Bonds each atom has
    212     int AtomCount;                                      //!< number of atoms, brought up-to-date by CountAtoms()
    213     int BondCount;                                      //!< number of atoms, brought up-to-date by CountBonds()
     213    int AtomCount;          //!< number of atoms, brought up-to-date by CountAtoms()
     214    int BondCount;          //!< number of atoms, brought up-to-date by CountBonds()
    214215    int ElementCount;       //!< how many unique elements are therein
    215216    int ElementsInMolecule[MAX_ELEMENTS]; //!< list whether element (sorted by atomic number) is alread present or not
    216     int NoNonHydrogen;  //!< number of non-hydrogen atoms in molecule
     217    int NoNonHydrogen;  //!< number of non-hydrogen atoms in molecule
    217218    int NoNonBonds;     //!< number of non-hydrogen bonds in molecule
    218219    int NoCyclicBonds;  //!< number of cyclic bonds in molecule, by DepthFirstSearchAnalysis()
    219220    double BondDistance;  //!< typical bond distance used in CreateAdjacencyList() and furtheron
     221    bool ActiveFlag;    //!< in a MoleculeListClass used to discern active from inactive molecules
     222    Vector Center;      //!< Center of molecule in a global box
     223    char name[MAXSTRINGSIZE];         //!< arbitrary name
     224    int IndexNr;        //!< index of molecule in a MoleculeListClass
    220225
    221226  molecule(periodentafel *teil);
     
    225230  bool AddAtom(atom *pointer);
    226231  bool RemoveAtom(atom *pointer);
     232  bool UnlinkAtom(atom *pointer);
    227233  bool CleanupMolecule();
    228234
     
    245251  bool CenterInBox(ofstream *out, Vector *BoxLengths);
    246252  void CenterEdge(ofstream *out, Vector *max);
    247   void CenterOrigin(ofstream *out, Vector *max);
    248   void CenterGravity(ofstream *out, Vector *max);
     253  void CenterOrigin(ofstream *out);
     254  void CenterPeriodic(ofstream *out);
     255  void CenterAtVector(ofstream *out, Vector *newcenter);
    249256  void Translate(const Vector *x);
    250257  void Mirror(const Vector *x);
    251258  void Align(Vector *n);
    252259  void Scale(double **factor);
    253   void DetermineCenter(Vector &center);
     260  void DeterminePeriodicCenter(Vector &center);
    254261  Vector * DetermineCenterOfGravity(ofstream *out);
    255262  Vector * DetermineCenterOfAll(ofstream *out);
     263  void SetNameFromFilename(const char *filename);
    256264  void SetBoxDimension(Vector *dim);
    257265  double * ReturnFullMatrixforSymmetric(double *cell_size);
    258266  void ScanForPeriodicCorrection(ofstream *out);
    259         void PrincipalAxisSystem(ofstream *out, bool DoRotate);
    260         double VolumeOfConvexEnvelope(ofstream *out, bool IsAngstroem);
    261         bool VerletForceIntegration(char *file, double delta_t, bool IsAngstroem);
     267  void PrincipalAxisSystem(ofstream *out, bool DoRotate);
     268  double VolumeOfConvexEnvelope(ofstream *out, bool IsAngstroem);
     269  Vector* FindEmbeddingHole(ofstream *out, molecule *srcmol);
     270
     271  bool VerletForceIntegration(char *file, double delta_t, bool IsAngstroem);
    262272
    263273  bool CheckBounds(const Vector *x) const;
     
    300310  /// -# BOSSANOVA
    301311  void FragmentBOSSANOVA(ofstream *out, Graph *&FragmentList, KeyStack &RootStack, int *MinimumRingSize);
    302         int PowerSetGenerator(ofstream *out, int Order, struct UniqueFragments &FragmentSearch, KeySet RestrictedKeySet);
     312  int PowerSetGenerator(ofstream *out, int Order, struct UniqueFragments &FragmentSearch, KeySet RestrictedKeySet);
    303313  bool BuildInducedSubgraph(ofstream *out, const molecule *Father);
    304314  molecule * StoreFragmentFromKeySet(ofstream *out, KeySet &Leaflet, bool IsAngstroem);
     
    328338class MoleculeListClass {
    329339  public:
    330     molecule **ListOfMolecules;   //!< pointer list of fragment molecules to check for equality
    331     int NumberOfMolecules;        //!< Number of entries in \a **FragmentList and of to be returned one.
    332     int NumberOfTopAtoms;         //!< Number of atoms in the molecule from which all fragments originate
     340    MoleculeList ListOfMolecules; //!< List of the contained molecules
     341    int MaxIndex;
    333342
    334343  MoleculeListClass();
    335   MoleculeListClass(int Num, int NumAtoms);
    336344  ~MoleculeListClass();
    337345
    338   /// Output configs.
    339346  bool AddHydrogenCorrection(ofstream *out, char *path);
    340347  bool StoreForcesFile(ofstream *out, char *path, int *SortIndex);
     348  void insert(molecule *mol);
     349  molecule * ReturnIndex(int index);
    341350  bool OutputConfigForListOfFragments(ofstream *out, config *configuration, int *SortIndex);
     351  int NumberOfActiveMolecules();
     352  void Enumerate(ofstream *out);
    342353  void Output(ofstream *out);
     354
     355  // merging of molecules
     356  bool SimpleMerge(molecule *mol, molecule *srcmol);
     357  bool SimpleAdd(molecule *mol, molecule *srcmol);
     358  bool SimpleMultiMerge(molecule *mol, int *src, int N);
     359  bool SimpleMultiAdd(molecule *mol, int *src, int N);
     360  bool ScatterMerge(molecule *mol, int *src, int N);
     361  bool EmbedMerge(molecule *mol, molecule *srcmol);
    343362
    344363  private:
     
    456475  bool Save(const char *filename, periodentafel *periode, molecule *mol) const;
    457476  bool SaveMPQC(const char *filename, molecule *mol) const;
    458   void Edit(molecule *mol);
     477  void Edit();
    459478  bool GetIsAngstroem() const;
    460479  char *GetDefaultPath() const;
Note: See TracChangeset for help on using the changeset viewer.