Changeset 69eb71 for src/molecules.hpp


Ignore:
Timestamp:
Dec 3, 2008, 2:12:05 PM (16 years ago)
Author:
Christian Neuen <neuen@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
f683fe
Parents:
1ffa21
Message:

Multiple changes to boundary, currently not fully operational.
Molecules has a new routine to create adjacency lists, reading bonds from a dbond file instead of looking for the distances by itself.
Vector function Project onto plane has been updated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecules.hpp

    r1ffa21 r69eb71  
    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 < 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 > 
     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 
     266  /// Initialising routines in fragmentation
     267  void CreateAdjacencyList2(ofstream *out, ifstream *output);
    267268  void CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem);
    268269  void CreateListOfBondsPerAtom(ofstream *out);
    269  
     270
    270271  // Graph analysis
    271272  MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, class StackClass<bond *> *&BackEdgeStack);
     
    283284
    284285  molecule *CopyMolecule();
    285  
     286
    286287  /// Fragment molecule by two different approaches:
    287288  int FragmentMolecule(ofstream *out, int Order, config *configuration);
     
    305306  int LookForRemovalCandidate(ofstream *&out, KeySet *&Leaf, int *&ShortestPathList);
    306307  int GuesstimateFragmentCount(ofstream *out, int order);
    307          
    308   // Recognize doubly appearing molecules in a list of them   
     308
     309  // Recognize doubly appearing molecules in a list of them
    309310  int * IsEqualToWithinThreshold(ofstream *out, molecule *OtherMolecule, double threshold);
    310311  int * GetFatherSonAtomicMap(ofstream *out, molecule *OtherMolecule);
    311        
     312
    312313  // Output routines.
    313314  bool Output(ofstream *out);
     
    330331    int NumberOfMolecules;        //!< Number of entries in \a **FragmentList and of to be returned one.
    331332    int NumberOfTopAtoms;         //!< Number of atoms in the molecule from which all fragments originate
    332    
     333
    333334  MoleculeListClass();
    334335  MoleculeListClass(int Num, int NumAtoms);
     
    340341  bool OutputConfigForListOfFragments(ofstream *out, config *configuration, int *SortIndex);
    341342  void Output(ofstream *out);
    342  
     343
    343344  private:
    344345};
     
    350351class MoleculeLeafClass {
    351352  public:
    352     molecule *Leaf;                   //!< molecule of this leaf 
     353    molecule *Leaf;                   //!< molecule of this leaf
    353354    //MoleculeLeafClass *UpLeaf;        //!< Leaf one level up
    354355    //MoleculeLeafClass *DownLeaf;      //!< First leaf one level down
     
    386387    bool FastParsing;
    387388    double Deltat;
    388    
     389
    389390    private:
    390391    char *mainname;
    391392    char *defaultpath;
    392393    char *pseudopotpath;
    393    
     394
    394395    int DoOutVis;
    395396    int DoOutMes;
     
    406407    int UseAddGramSch;
    407408    int Seed;
    408    
     409
    409410    int MaxOuterStep;
    410411    int OutVisStep;
     
    414415    int MaxPsiStep;
    415416    double EpsWannier;
    416    
     417
    417418    int MaxMinStep;
    418419    double RelEpsTotalEnergy;
     
    423424    double InitRelEpsKineticEnergy;
    424425    int InitMaxMinGapStopStep;
    425    
     426
    426427    //double BoxLength[NDIM*NDIM];
    427    
     428
    428429    double ECut;
    429430    int MaxLevel;
     
    434435    int RTActualUse;
    435436    int AddPsis;
    436    
     437
    437438    double RCut;
    438439    int StructOpt;
     
    441442    int MaxTypes;
    442443
    443  
     444
    444445  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);
    445  
     446
    446447  public:
    447448  config();
Note: See TracChangeset for help on using the changeset viewer.