Changeset 3738f0
- Timestamp:
- Mar 1, 2011, 12:49:28 PM (15 years ago)
- 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, Candidate_v1.7.0, 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:
- 0cbad2
- Parents:
- ce5f05
- git-author:
- Frederik Heber <heber@…> (02/26/11 00:10:05)
- git-committer:
- Frederik Heber <heber@…> (03/01/11 12:49:28)
- Files:
-
- 25 edited
-
src/Actions/FragmentationAction/CreateAdjacencyAction.cpp (modified) (1 diff)
-
src/Actions/FragmentationAction/DepthFirstSearchAction.cpp (modified) (1 diff)
-
src/Actions/FragmentationAction/FragmentationAction.cpp (modified) (2 diffs)
-
src/Actions/FragmentationAction/SubgraphDissectionAction.cpp (modified) (5 diffs)
-
src/Actions/MoleculeAction/FillVoidWithMoleculeAction.cpp (modified) (1 diff)
-
src/Actions/MoleculeAction/FillWithMoleculeAction.cpp (modified) (1 diff)
-
src/Actions/MoleculeAction/SaveAdjacencyAction.cpp (modified) (1 diff)
-
src/Actions/MoleculeAction/SaveBondsAction.cpp (modified) (1 diff)
-
src/AtomSet.hpp (modified) (5 diffs)
-
src/bondgraph.cpp (modified) (10 diffs)
-
src/bondgraph.hpp (modified) (5 diffs)
-
src/linkedcell.cpp (modified) (1 diff)
-
src/linkedcell.hpp (modified) (1 diff)
-
src/molecule.cpp (modified) (1 diff)
-
src/molecule.hpp (modified) (3 diffs)
-
src/molecule_fragmentation.cpp (modified) (2 diffs)
-
src/molecule_graph.cpp (modified) (2 diffs)
-
src/unittests/AnalysisBondsUnitTest.cpp (modified) (1 diff)
-
src/unittests/BondGraphUnitTest.cpp (modified) (3 diffs)
-
src/unittests/CountBondsUnitTest.cpp (modified) (1 diff)
-
tests/Fragmentations/defs.in (modified) (1 diff)
-
tests/regression/Fragmentation/FragmentMolecule/testsuite-fragmentation-fragment-molecule.at (modified) (1 diff)
-
tests/regression/Graph/DepthFirstSearch/testsuite-graph-depth-first-search.at (modified) (1 diff)
-
tests/regression/Molecules/SaveAdjacency/testsuite-molecules-save-adjacency.at (modified) (1 diff)
-
tests/regression/Molecules/SaveBonds/testsuite-molecules-save-bonds.at (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/CreateAdjacencyAction.cpp
rce5f05 r3738f0 58 58 BondGraph *BG = World::getInstance().getBondGraph(); 59 59 ASSERT(BG != NULL, "FragmentationCreateAdjacencyAction: BondGraph is NULL."); 60 BG->SetMaxDistanceToMaxOfCovalentRadii(AtomSetMixin<std::vector<atom *> >(World::getInstance().getSelectedAtoms())); 60 61 double BondDistance = BG->getMaxDistance(); 61 62 bool IsAngstroem = configuration->GetIsAngstroem(); -
src/Actions/FragmentationAction/DepthFirstSearchAction.cpp
rce5f05 r3738f0 52 52 std::deque<bond *> *BackEdgeStack = NULL; 53 53 std::deque<bond *> *LocalBackEdgeStack = NULL; 54 BondGraph *BG = World::getInstance().getBondGraph();55 mol->CreateAdjacencyList(params.distance, World::getInstance().getConfig()->GetIsAngstroem(), &BondGraph::getMinMaxDistance, BG);56 54 Subgraphs = mol->DepthFirstSearchAnalysis(BackEdgeStack); 57 55 if (Subgraphs != NULL) { -
src/Actions/FragmentationAction/FragmentationAction.cpp
rce5f05 r3738f0 43 43 clock_t start,end; 44 44 molecule *mol = NULL; 45 config *configuration = World::getInstance().getConfig();46 45 int ExitFlag = 0; 47 46 … … 55 54 DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl); 56 55 start = clock(); 57 mol->CreateAdjacencyList(params.distance, configuration->GetIsAngstroem(), &BondGraph::getMinMaxDistance, World::getInstance().getBondGraph());58 56 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl); 59 57 if (mol->hasBondStructure()) { -
src/Actions/FragmentationAction/SubgraphDissectionAction.cpp
rce5f05 r3738f0 50 50 getParametersfromValueStorage(); 51 51 52 DoLog(1) && (Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl);53 52 54 53 // first create stuff for undo state 54 LOG(0, "STATUS: Creating undo state."); 55 55 MolAtomList moleculelist; 56 56 vector<molecule *> allmolecules = World::getInstance().getAllMolecules(); … … 66 66 67 67 // 0a. remove all present molecules 68 LOG(0, "STATUS: Removing all present molecules."); 68 69 MoleculeListClass *molecules = World::getInstance().getMolecules(); 69 70 for (vector<molecule *>::iterator MolRunner = allmolecules.begin(); MolRunner != allmolecules.end(); ++MolRunner) { … … 88 89 89 90 // 1. create the bond structure of the single molecule 91 LOG(0, "STATUS: (Re-)constructing adjacency."); 90 92 if (mol->getBondCount() == 0) { 91 93 BondGraph *BG = World::getInstance().getBondGraph(); 92 if (!BG->CreateAdjacencyForMolecule(mol)) { 93 World::getInstance().destroyMolecule(mol); 94 DoeLog(1) && (eLog()<< Verbose(1) << "There are no bonds." << endl); 95 return Action::failure; 96 } 94 molecule::atomVector Set = mol->getAtomSet(); 95 BG->CreateAdjacency(Set); 96 // if (mol->getBondCount() == 0) { 97 // World::getInstance().destroyMolecule(mol); 98 // ELOG(1, "There are no bonds."); 99 // return Action::failure; 100 // } 97 101 } 98 102 99 103 // 2. scan for connected subgraphs 104 LOG(0, "STATUS: Analysing adjacency graph."); 100 105 MoleculeLeafClass *Subgraphs = NULL; // list of subgraphs from DFS analysis 101 106 std::deque<bond *> *BackEdgeStack = NULL; … … 111 116 112 117 // TODO: When DepthFirstSearchAnalysis does not use AddCopyAtom() anymore, we don't need to delete all original atoms 118 LOG(0, "STATUS: Creating molecules as connected subgraphs."); 113 119 { 114 120 { … … 152 158 153 159 // 4. free Leafs 160 LOG(0, "STATUS: Done."); 154 161 MoleculeLeafClass *MolecularWalker = Subgraphs; 155 162 while (MolecularWalker->next != NULL) { -
src/Actions/MoleculeAction/FillVoidWithMoleculeAction.cpp
rce5f05 r3738f0 73 73 molecule *filler = World::getInstance().getMolecule(MoleculeByOrder(-1)); // get last molecule 74 74 filler->SetNameFromFilename(params.fillername.string().c_str()); 75 World::getInstance().getBondGraph()->CreateAdjacencyForMolecule(filler); 75 molecule::atomVector Set = filler->getAtomSet(); 76 World::getInstance().getBondGraph()->CreateAdjacency(Set); 76 77 77 78 // call routine -
src/Actions/MoleculeAction/FillWithMoleculeAction.cpp
rce5f05 r3738f0 84 84 // filler->AddBond(first, third, 1); 85 85 // filler->AddBond(second, third, 1); 86 World::getInstance().getBondGraph()->CreateAdjacencyForMolecule(filler); 86 molecule::atomVector Set = filler->getAtomSet(); 87 World::getInstance().getBondGraph()->CreateAdjacency(Set); 87 88 // filler->SetNameFromFilename("water"); 88 89 // TODO: Remove the erasure of molecule when saving does not depend on them anymore. -
src/Actions/MoleculeAction/SaveAdjacencyAction.cpp
rce5f05 r3738f0 49 49 mol = iter->second; 50 50 DoLog(0) && (Log() << Verbose(0) << "Storing adjacency to path " << params.adjacencyfile << "." << endl); 51 World::getInstance().getBondGraph()->CreateAdjacencyForMolecule(mol);52 51 // TODO: sollte stream nicht filename benutzen, besser fuer unit test 53 52 mol->StoreAdjacencyToFile(params.adjacencyfile.leaf(), params.adjacencyfile.branch_path().string()); -
src/Actions/MoleculeAction/SaveBondsAction.cpp
rce5f05 r3738f0 49 49 mol = iter->second; 50 50 DoLog(0) && (Log() << Verbose(0) << "Storing bonds to path " << params.bondsfile << "." << endl); 51 World::getInstance().getBondGraph()->CreateAdjacencyForMolecule(mol);52 51 // TODO: sollte stream, nicht filenamen direkt nutzen, besser fuer unit tests 53 52 mol->StoreBondsToFile(params.bondsfile.leaf(), params.bondsfile.branch_path().string()); -
src/AtomSet.hpp
rce5f05 r3738f0 39 39 }; 40 40 41 template <class Set> 42 class AtomSetMixin : public Set 41 template <class container_type, 42 class iterator_type = typename container_type::iterator, 43 class const_iterator_type = typename container_type::const_iterator> 44 class AtomSetMixin : public container_type 43 45 { 44 46 // when our set carries something besides a atom* this will produce an error 45 typedef typename is_atom<typename Set::value_type>::wrong_type check_for_atom;47 typedef typename is_atom<typename container_type::value_type>::wrong_type check_for_atom; 46 48 public: 47 49 // typedefs for STL conforming structure 48 typedef typename Set::iteratoriterator;49 typedef typename Set::const_iteratorconst_iterator;50 typedef iterator_type iterator; 51 typedef const_iterator_type const_iterator; 50 52 51 53 AtomSetMixin() : 52 Set()54 container_type() 53 55 {} 54 56 55 AtomSetMixin(const Set& src) :56 Set(src)57 AtomSetMixin(const container_type& src) : 58 container_type(src) 57 59 {} 58 60 virtual ~AtomSetMixin(){} … … 117 119 }; 118 120 119 template<class Set> 120 inline void AtomSetMixin<Set>::translate(const Vector &translater){ 121 template <class container_type, 122 class iterator_type, 123 class const_iterator_type> 124 inline void AtomSetMixin<container_type,iterator_type,const_iterator_type>::translate(const Vector &translater){ 121 125 BOOST_FOREACH(AtomInfo *atom,*this){ 122 126 *(atom) += translater; … … 124 128 } 125 129 126 template<class Set> 127 inline void AtomSetMixin<Set>::addVelocityAtStep(const Vector velocity, unsigned int step){ 130 template <class container_type, 131 class iterator_type, 132 class const_iterator_type> 133 inline void AtomSetMixin<container_type,iterator_type,const_iterator_type>::addVelocityAtStep(const Vector velocity, unsigned int step){ 128 134 BOOST_FOREACH(AtomInfo *atom,*this){ 129 135 atom->setAtomicVelocityAtStep(step, atom->getAtomicVelocityAtStep(step)+velocity); … … 131 137 } 132 138 133 template<class Set> 139 template <class container_type, 140 class iterator_type, 141 class const_iterator_type> 134 142 template<class Function> 135 inline void AtomSetMixin< Set>::transformNodes(Function f){143 inline void AtomSetMixin<container_type,iterator_type,const_iterator_type>::transformNodes(Function f){ 136 144 std::for_each(this->begin(), 137 145 this->end(), … … 139 147 } 140 148 141 template<class Set> 142 inline double AtomSetMixin<Set>::totalMass() const{ 149 template <class container_type, 150 class iterator_type, 151 class const_iterator_type> 152 inline double AtomSetMixin<container_type,iterator_type,const_iterator_type>::totalMass() const{ 143 153 return accumulate(this->begin(),this->end(),valueSum<double>(&AtomInfo::getMass,0)).value; 144 154 } 145 155 146 template<class Set> 147 inline double AtomSetMixin<Set>::totalTemperatureAtStep(unsigned int step) const{ 156 template <class container_type, 157 class iterator_type, 158 class const_iterator_type> 159 inline double AtomSetMixin<container_type,iterator_type,const_iterator_type>::totalTemperatureAtStep(unsigned int step) const{ 148 160 return accumulate(this->begin(),this->end(),stepValueSum<double>(step,&AtomInfo::getKineticEnergy,0)).value; 149 161 } 150 162 151 template<class Set> 152 inline Vector AtomSetMixin<Set>::totalMomentumAtStep(unsigned int step) const{ 163 template <class container_type, 164 class iterator_type, 165 class const_iterator_type> 166 inline Vector AtomSetMixin<container_type,iterator_type,const_iterator_type>::totalMomentumAtStep(unsigned int step) const{ 153 167 return accumulate(this->begin(),this->end(),stepValueSum<Vector>(step,&AtomInfo::getMomentum,Vector())).value; 154 168 } -
src/bondgraph.cpp
rce5f05 r3738f0 25 25 #include "bond.hpp" 26 26 #include "bondgraph.hpp" 27 #include "Box.hpp" 27 28 #include "element.hpp" 28 29 #include "CodePatterns/Info.hpp" 30 #include "CodePatterns/Log.hpp" 31 #include "CodePatterns/Range.hpp" 29 32 #include "CodePatterns/Verbose.hpp" 30 #include "CodePatterns/Log.hpp"31 33 #include "molecule.hpp" 32 34 #include "parser.hpp" 33 35 #include "periodentafel.hpp" 34 36 #include "LinearAlgebra/Vector.hpp" 37 #include "World.hpp" 38 #include "WorldTime.hpp" 35 39 36 40 const double BondGraph::BondThreshold = 0.4; //!< CSD threshold in bond check which is the width of the interval whose center is the sum of the covalent radii … … 40 44 max_distance(0), 41 45 IsAngstroem(IsA) 42 {} ;46 {} 43 47 44 48 BondGraph::~BondGraph() … … 47 51 delete(BondLengthMatrix); 48 52 } 49 } ;53 } 50 54 51 55 bool BondGraph::LoadBondLengthTable(std::istream &input) … … 57 61 // allocate MatrixContainer 58 62 if (BondLengthMatrix != NULL) { 59 DoLog(1) && (Log() << Verbose(1) << "MatrixContainer for Bond length already present, removing." << endl);63 LOG(1, "MatrixContainer for Bond length already present, removing."); 60 64 delete(BondLengthMatrix); 61 65 } … … 64 68 // parse in matrix 65 69 if ((input.good()) && (status = TempContainer->ParseMatrix(input, 0, 1, 0))) { 66 DoLog(1) && (Log() << Verbose(1) << "Parsing bond length matrix successful." << endl);70 LOG(1, "Parsing bond length matrix successful."); 67 71 } else { 68 72 DoeLog(1) && (eLog()<< Verbose(1) << "Parsing bond length matrix failed." << endl); … … 87 91 } 88 92 return status; 89 }; 90 91 bool BondGraph::CreateAdjacencyForMolecule(molecule * const mol) 92 { 93 Info FunctionInfo(__func__); 94 bool status = true; 95 96 if (mol->empty()) // only construct if molecule is not empty 97 return false; 98 99 SetMaxDistanceToMaxOfCovalentRadii(mol); 100 mol->CreateAdjacencyList(max_distance, IsAngstroem, &BondGraph::getMinMaxDistance, this); 101 102 return status; 103 }; 93 } 104 94 105 95 double BondGraph::GetBondLength(int firstZ, int secondZ) … … 113 103 return (BondLengthMatrix->Matrix[0][firstZ][secondZ]); 114 104 } 115 }; 116 117 double BondGraph::SetMaxDistanceToMaxOfCovalentRadii(const molecule * const mol) 118 { 119 Info FunctionInfo(__func__); 120 max_distance = 0.; 121 122 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 123 if ((*iter)->getType()->getCovalentRadius() > max_distance) 124 max_distance = (*iter)->getType()->getCovalentRadius(); 125 } 126 max_distance *= 2.; 127 max_distance += BondThreshold; 128 129 return max_distance; 130 }; 105 } 131 106 132 107 double BondGraph::getMaxDistance() const … … 142 117 MaxDistance = MinDistance + BondThreshold; 143 118 MinDistance -= BondThreshold; 144 } ;119 } 145 120 146 121 void BondGraph::BondLengthMatrixMinMaxDistance(const BondedParticle * const Walker, const BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem) … … 152 127 MaxDistance = MinDistance + BondThreshold; 153 128 MinDistance -= BondThreshold; 154 } ;129 } 155 130 156 131 void BondGraph::getMinMaxDistance(const BondedParticle * const Walker, const BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem) … … 164 139 } 165 140 } 141 142 void BondGraph::CreateAdjacency(LinkedCell &LC) 143 { 144 atom *Walker = NULL; 145 atom *OtherWalker = NULL; 146 int n[NDIM]; 147 double MinDistance, MaxDistance; 148 Box &domain = World::getInstance().getDomain(); 149 150 unsigned int BondCount = 0; 151 // 3a. go through every cell 152 LOG(3, "INFO: Celling ... "); 153 for (LC.n[0] = 0; LC.n[0] < LC.N[0]; LC.n[0]++) 154 for (LC.n[1] = 0; LC.n[1] < LC.N[1]; LC.n[1]++) 155 for (LC.n[2] = 0; LC.n[2] < LC.N[2]; LC.n[2]++) { 156 const TesselPointSTLList *List = LC.GetCurrentCell(); 157 LOG(2, "Current cell is " << LC.n[0] << ", " << LC.n[1] << ", " << LC.n[2] << " with No. " << LC.index << " containing " << List->size() << " points."); 158 if (List != NULL) { 159 for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { 160 Walker = dynamic_cast<atom*>(*Runner); 161 ASSERT(Walker != NULL, 162 "BondGraph::CreateAdjacency() - Tesselpoint that was not an atom retrieved from LinkedNode"); 163 LOG(2, "INFO: Current Atom is " << *Walker << "."); 164 // 3c. check for possible bond between each atom in this and every one in the 27 cells 165 for (n[0] = -1; n[0] <= 1; n[0]++) 166 for (n[1] = -1; n[1] <= 1; n[1]++) 167 for (n[2] = -1; n[2] <= 1; n[2]++) { 168 const TesselPointSTLList *OtherList = LC.GetRelativeToCurrentCell(n); 169 if (OtherList != NULL) { 170 LOG(3, "INFO: Current relative cell is " << LC.n[0] << ", " << LC.n[1] << ", " << LC.n[2] << " with No. " << LC.index << " containing " << List->size() << " points."); 171 for (TesselPointSTLList::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) { 172 if ((*OtherRunner) > Walker) { // just to not add bonds from both sides 173 OtherWalker = dynamic_cast<atom*>(*OtherRunner); 174 ASSERT(OtherWalker != NULL, 175 "BondGraph::CreateAdjacency() - TesselPoint that was not an atom retrieved from LinkedNode"); 176 getMinMaxDistance(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem); 177 const double distance = domain.periodicDistanceSquared(OtherWalker->getPosition(),Walker->getPosition()); 178 LOG(2, "INFO: Checking distance " << distance << " against typical bond length of [" << MinDistance * MinDistance << "," << MaxDistance * MaxDistance << "]."); 179 const bool status = (distance <= MaxDistance * MaxDistance) && (distance >= MinDistance * MinDistance); 180 LOG(3, "INFO: MinDistance is " << MinDistance << " and MaxDistance is " << MaxDistance << "."); 181 if (OtherWalker->father > Walker->father ) { // just to not add bonds from both sides 182 if (status) { // create bond if distance is smaller 183 LOG(1, "ACCEPT: Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "."); 184 bond * Binder = new bond(Walker->father, OtherWalker->father, 1); 185 Walker->father->RegisterBond(WorldTime::getTime(), Binder); 186 OtherWalker->father->RegisterBond(WorldTime::getTime(), Binder); 187 BondCount++; 188 } else { 189 LOG(1, "REJECT: Squared distance " 190 << distance << " is out of covalent bounds [" 191 << MinDistance*MinDistance << "," 192 << MaxDistance * MaxDistance << "]."); 193 } 194 } else { 195 LOG(5, "REJECT: Not Adding: Wrong order of father's."); 196 } 197 } else { 198 LOG(5, "REJECT: Not Adding: Wrong order."); 199 } 200 } 201 } 202 } 203 } 204 } 205 } 206 LOG(1, "I detected " << BondCount << " bonds in the molecule."); 207 } -
src/bondgraph.hpp
rce5f05 r3738f0 20 20 #include <iosfwd> 21 21 22 #include "AtomSet.hpp" 23 #include "bond.hpp" 24 #include "CodePatterns/Assert.hpp" 25 #include "CodePatterns/Log.hpp" 26 #include "CodePatterns/Range.hpp" 27 #include "CodePatterns/Verbose.hpp" 28 #include "element.hpp" 29 #include "linkedcell.hpp" 30 #include "IPointCloud.hpp" 31 #include "PointCloudAdaptor.hpp" 22 32 23 33 /****************************************** forward declarations *****************************/ … … 51 61 bool LoadBondLengthTable(std::istream &input); 52 62 53 /** Creates the bond list for all atoms in a given molecule.54 * \param *mol molecule with atoms55 * \return true - success, false - failed to construct bond structure56 */57 bool CreateAdjacencyForMolecule(molecule * const mol);58 59 63 /** Returns the entry for a given index pair. 60 64 * \param firstelement index/atom number of first element (row index) … … 64 68 double GetBondLength(int firstelement, int secondelement); 65 69 66 /** Determines the maximum of all element::CovalentRadius for elements present in \a *mol. 67 * \param *out output stream for debugging 68 * \param *mol molecule with all atoms and their respective elements. 69 */ 70 double SetMaxDistanceToMaxOfCovalentRadii(const molecule * const mol); 70 /** Determines the maximum of all element::CovalentRadius for elements present in \a &Set. 71 * 72 * Sets BondGraph::max_distance 73 * 74 * \param &Set PointCloud with all particles 75 */ 76 template <class container_type, 77 class iterator_type, 78 class const_iterator_type> 79 double SetMaxDistanceToMaxOfCovalentRadii(const AtomSetMixin<container_type,iterator_type,const_iterator_type> &Set) 80 { 81 max_distance = 0.; 82 83 for(const_iterator_type AtomRunner = Set.begin(); AtomRunner != Set.end(); ++AtomRunner) { 84 const double radius = (*AtomRunner)->getType()->getCovalentRadius(); 85 if (radius > max_distance) 86 max_distance = radius; 87 } 88 max_distance *= 2.; 89 max_distance += BondThreshold; 90 91 return max_distance; 92 } 93 94 /** Returns the upper limit on possible bond distances. 95 * 96 * Is set by SetMaxDistanceToMaxOfCovalentRadii(), is needed e.g. as cutoff 97 * for linked-cell. 98 * 99 * \return maximum possible bond distance 100 */ 101 double getMaxDistance() const; 71 102 72 103 /** Returns bond criterion for given pair based on a bond length matrix. … … 80 111 void getMinMaxDistance(const BondedParticle * const Walker, const BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem); 81 112 82 /** Returns the maximum distance (e.g. necessary for LinkedCell). 83 * \return BondGraph::max_distance 84 */ 85 double getMaxDistance() const; 113 /** Creates the adjacency list for a given \a Range of iterable atoms. 114 * 115 * @param Set Range with begin and end iterator 116 */ 117 template <class container_type, 118 class iterator_type, 119 class const_iterator_type> 120 void CreateAdjacency(AtomSetMixin<container_type,iterator_type,const_iterator_type> &Set) 121 { 122 LOG(1, "STATUS: Removing all present bonds."); 123 cleanAdjacencyList(Set); 124 125 // count atoms in molecule = dimension of matrix (also give each unique name and continuous numbering) 126 const unsigned int counter = Set.size(); 127 if (counter > 1) { 128 LOG(1, "STATUS: Setting max bond distance."); 129 SetMaxDistanceToMaxOfCovalentRadii(Set); 130 131 LOG(1, "STATUS: Creating LinkedCell structure for given " << counter << " atoms."); 132 PointCloudAdaptor< AtomSetMixin<container_type,iterator_type> > cloud(&Set, "SetOfAtoms"); 133 LinkedCell *LC = new LinkedCell(cloud, max_distance); 134 135 CreateAdjacency(*LC); 136 delete (LC); 137 138 // correct bond degree by comparing valence and bond degree 139 LOG(1, "STATUS: Correcting bond degree."); 140 CorrectBondDegree(Set); 141 142 // output bonds for debugging (if bond chain list was correctly installed) 143 LOG(2, "STATUS: Printing list of created bonds."); 144 std::stringstream output; 145 for(const_iterator_type AtomRunner = Set.begin(); AtomRunner != Set.end(); ++AtomRunner) { 146 (*AtomRunner)->OutputBondOfAtom(output); 147 output << std::endl << "\t\t"; 148 } 149 LOG(2, output.str()); 150 } else { 151 LOG(1, "REJECT: AtomCount is " << counter << ", thus no bonds, no connections."); 152 } 153 } 154 155 /** Creates an adjacency list of the molecule. 156 * Generally, we use the CSD approach to bond recognition, that is the the distance 157 * between two atoms A and B must be within [Rcov(A)+Rcov(B)-t,Rcov(A)+Rcov(B)+t] with 158 * a threshold t = 0.4 Angstroem. 159 * To make it O(N log N) the function uses the linked-cell technique as follows: 160 * The procedure is step-wise: 161 * -# Remove every bond in list 162 * -# Count the atoms in the molecule with CountAtoms() 163 * -# partition cell into smaller linked cells of size \a bonddistance 164 * -# put each atom into its corresponding cell 165 * -# go through every cell, check the atoms therein against all possible bond partners in the 27 adjacent cells, add bond if true 166 * -# correct the bond degree iteratively (single->double->triple bond) 167 * -# finally print the bond list to \a *out if desired 168 * \param &LC Linked Cell Container with all atoms 169 */ 170 void CreateAdjacency(LinkedCell &LC); 171 172 /** Removes all bonds within the given set of iterable atoms. 173 * 174 * @param Set Range with atoms 175 */ 176 template <class container_type, 177 class iterator_type, 178 class const_iterator_type> 179 void cleanAdjacencyList(AtomSetMixin<container_type,iterator_type,const_iterator_type> &Set) 180 { 181 // remove every bond from the list 182 for(iterator_type AtomRunner = Set.begin(); AtomRunner != Set.end(); ++AtomRunner) { 183 BondList& ListOfBonds = (*AtomRunner)->getListOfBonds(); 184 for(BondList::iterator BondRunner = ListOfBonds.begin(); 185 !ListOfBonds.empty(); 186 BondRunner = ListOfBonds.begin()) { 187 ASSERT((*BondRunner)->Contains(*AtomRunner), 188 "BondGraph::cleanAdjacencyList() - "+ 189 toString(*BondRunner)+" does not contain "+ 190 toString(*AtomRunner)+"."); 191 delete((*BondRunner)); 192 } 193 } 194 } 195 196 /** correct bond degree by comparing valence and bond degree. 197 * correct Bond degree of each bond by checking both bond partners for a mismatch between valence and current sum of bond degrees, 198 * iteratively increase the one first where the other bond partner has the fewest number of bonds (i.e. in general bonds oxygene 199 * preferred over carbon bonds). Beforehand, we had picked the first mismatching partner, which lead to oxygenes with single instead of 200 * double bonds as was expected. 201 * @param Set Range with atoms 202 * \return number of bonds that could not be corrected 203 */ 204 template <class container_type, 205 class iterator_type, 206 class const_iterator_type> 207 int CorrectBondDegree(AtomSetMixin<container_type,iterator_type,const_iterator_type> &Set) const 208 { 209 // reset 210 resetBondDegree(Set); 211 // re-calculate 212 return calculateBondDegree(Set); 213 } 86 214 87 215 private: … … 108 236 void CovalentMinMaxDistance(const BondedParticle * const Walker, const BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem); 109 237 238 239 /** Resets the bond::BondDegree of all atoms in the set to 1. 240 * 241 * @param Set Range with atoms 242 */ 243 template <class container_type, 244 class iterator_type, 245 class const_iterator_type> 246 void resetBondDegree(AtomSetMixin<container_type,iterator_type,const_iterator_type> &Set) const 247 { 248 // reset bond degrees 249 for(iterator_type AtomRunner = Set.begin(); AtomRunner != Set.end(); ++AtomRunner) { 250 BondList &ListOfBonds = (*AtomRunner)->getListOfBonds(); 251 for (BondList::iterator BondIter = ListOfBonds.begin(); 252 BondIter != ListOfBonds.end(); 253 ++BondIter) 254 (*BondIter)->BondDegree = 1; 255 } 256 } 257 258 /** Calculates the bond degree for each atom on the set. 259 * 260 * @param Set Range with atoms 261 * @return number of non-matching bonds 262 */ 263 template <class container_type, 264 class iterator_type, 265 class const_iterator_type> 266 int calculateBondDegree(AtomSetMixin<container_type,iterator_type,const_iterator_type> &Set) const 267 { 268 //DoLog(1) && (Log() << Verbose(1) << "Correcting Bond degree of each bond ... " << endl); 269 int No = 0, OldNo = -1; 270 do { 271 OldNo = No; 272 No=0; 273 for(iterator_type AtomRunner = Set.begin(); AtomRunner != Set.end(); ++AtomRunner) { 274 No+=(*AtomRunner)->CorrectBondDegree(); 275 } 276 } while (OldNo != No); 277 //DoLog(0) && (Log() << Verbose(0) << " done." << endl); 278 return No; 279 } 280 110 281 //!> Matrix with bond lenth per two elements 111 282 MatrixContainer *BondLengthMatrix; -
src/linkedcell.cpp
rce5f05 r3738f0 23 23 #include "linkedcell.hpp" 24 24 #include "CodePatterns/Verbose.hpp" 25 #include "CodePatterns/Range.hpp" 25 26 #include "CodePatterns/Log.hpp" 26 27 #include "molecule.hpp" -
src/linkedcell.hpp
rce5f05 r3738f0 25 25 #include <map> 26 26 27 #include "CodePatterns/Assert.hpp"28 #include "CodePatterns/Log.hpp"29 #include "CodePatterns/Verbose.hpp"27 //#include "CodePatterns/Assert.hpp" 28 //#include "CodePatterns/Log.hpp" 29 //#include "CodePatterns/Verbose.hpp" 30 30 #include "Helpers/defs.hpp" 31 31 #include "LinearAlgebra/Vector.hpp" -
src/molecule.cpp
rce5f05 r3738f0 231 231 bool molecule::containsAtom(atom* key){ 232 232 return (find(key) != end()); 233 } 234 235 molecule::atomVector molecule::getAtomSet() const 236 { 237 atomVector vector_of_atoms; 238 BOOST_FOREACH(atom *_atom, atoms) 239 vector_of_atoms.push_back(_atom); 240 return vector_of_atoms; 233 241 } 234 242 -
src/molecule.hpp
rce5f05 r3738f0 87 87 public: 88 88 typedef ATOMSET(std::list) atomSet; 89 typedef ATOMSET(std::vector) atomVector; 89 90 typedef std::set<atomId_t> atomIdSet; 90 91 typedef ObservedIterator<atomSet> iterator; … … 141 142 142 143 virtual bool changeId(atomId_t newId); 144 145 atomVector getAtomSet() const; 143 146 144 147 iterator begin(); … … 208 211 /// Initialising routines in fragmentation 209 212 void CreateAdjacencyListFromDbondFile(ifstream *output); 210 void CreateAdjacencyList(double bonddistance, bool IsAngstroem, void (BondGraph::*minmaxdistance)(const BondedParticle * const , const BondedParticle * const , double &, double &, bool), BondGraph *BG = NULL);211 int CorrectBondDegree() const;212 213 void OutputBondsList() const; 213 214 void CyclicBondAnalysis() const; -
src/molecule_fragmentation.cpp
rce5f05 r3738f0 667 667 iter != World::getInstance().moleculeEnd(); 668 668 ++iter) { 669 // reset bond degree to 1670 for (molecule::iterator atomiter = (*iter)->begin();671 atomiter != (*iter)->end();672 ++atomiter) {673 const BondList& ListOfBonds = (*atomiter)->getListOfBonds();674 for (BondList::const_iterator bonditer = ListOfBonds.begin();675 bonditer != ListOfBonds.end();676 ++bonditer) {677 (*bonditer)->BondDegree = 1;678 }679 }680 669 // correct bond degree 681 (*iter)->CorrectBondDegree(); 670 molecule::atomVector Set = (*iter)->getAtomSet(); 671 World::getInstance().getBondGraph()->CorrectBondDegree(Set); 682 672 } 683 673 … … 748 738 MolecularWalker = MolecularWalker->next; 749 739 DoLog(1) && (Log() << Verbose(1) << "Fragmenting subgraph " << MolecularWalker << "." << endl); 750 //MolecularWalker->Leaf->OutputListOfBonds(out); // output atom::ListOfBonds for debugging751 740 if (MolecularWalker->Leaf->hasBondStructure()) { 752 741 // call BOSSANOVA method -
src/molecule_graph.cpp
rce5f05 r3738f0 111 111 } 112 112 113 /** Creates an adjacency list of the molecule.114 * Generally, we use the CSD approach to bond recognition, that is the the distance115 * between two atoms A and B must be within [Rcov(A)+Rcov(B)-t,Rcov(A)+Rcov(B)+t] with116 * a threshold t = 0.4 Angstroem.117 * To make it O(N log N) the function uses the linked-cell technique as follows:118 * The procedure is step-wise:119 * -# Remove every bond in list120 * -# Count the atoms in the molecule with CountAtoms()121 * -# partition cell into smaller linked cells of size \a bonddistance122 * -# put each atom into its corresponding cell123 * -# go through every cell, check the atoms therein against all possible bond partners in the 27 adjacent cells, add bond if true124 * -# correct the bond degree iteratively (single->double->triple bond)125 * -# finally print the bond list to \a *out if desired126 * \param bonddistance length of linked cells (i.e. maximum minimal length checked)127 * \param IsAngstroem whether coordinate system is gauged to Angstroem or Bohr radii128 * \param *minmaxdistance function to give upper and lower bound on whether particle is bonded to some other129 * \param *BG BondGraph with the member function above or NULL, if just standard covalent should be used.130 */131 void molecule::CreateAdjacencyList(132 double bonddistance,133 bool IsAngstroem,134 void (BondGraph::*minmaxdistance)(const BondedParticle * const , const BondedParticle * const , double &, double &, bool),135 BondGraph *BG)136 {137 atom *Walker = NULL;138 atom *OtherWalker = NULL;139 int n[NDIM];140 double MinDistance, MaxDistance;141 LinkedCell *LC = NULL;142 bool free_BG = false;143 Box &domain = World::getInstance().getDomain();144 145 DoLog(0) && (Log() << Verbose(0) << "Begin of CreateAdjacencyList." << endl);146 // remove every bond from the list147 for(molecule::iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner) {148 BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();149 for(BondList::iterator BondRunner = ListOfBonds.begin();150 !ListOfBonds.empty();151 BondRunner = ListOfBonds.begin())152 if ((*BondRunner)->leftatom == *AtomRunner)153 delete((*BondRunner));154 }155 156 // count atoms in molecule = dimension of matrix (also give each unique name and continuous numbering)157 DoLog(1) && (Log() << Verbose(1) << "AtomCount " << getAtomCount() << " and bonddistance is " << bonddistance << "." << endl);158 159 if ((getAtomCount() > 1) && (bonddistance > 0.1)) {160 DoLog(2) && (Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl);161 PointCloudAdaptor<molecule> cloud(this, name);162 LC = new LinkedCell(cloud, bonddistance);163 164 // create a list to map Tesselpoint::Nr to atom *165 DoLog(2) && (Log() << Verbose(2) << "Creating TesselPoint to atom map ... " << endl);166 167 // set numbers for atoms that can later be used168 int i=0;169 for(internal_iterator iter = atoms.begin();iter!= atoms.end(); ++iter){170 (*iter)->setNr(i++);171 }172 173 // 3a. go through every cell174 DoLog(2) && (Log() << Verbose(2) << "Celling ... " << endl);175 for (LC->n[0] = 0; LC->n[0] < LC->N[0]; LC->n[0]++)176 for (LC->n[1] = 0; LC->n[1] < LC->N[1]; LC->n[1]++)177 for (LC->n[2] = 0; LC->n[2] < LC->N[2]; LC->n[2]++) {178 const TesselPointSTLList *List = LC->GetCurrentCell();179 Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;180 if (List != NULL) {181 for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {182 Walker = dynamic_cast<atom*>(*Runner);183 ASSERT(Walker,"Tesselpoint that was not an atom retrieved from LinkedNode");184 Log() << Verbose(0) << "Current Atom is " << *Walker << "." << endl;185 // 3c. check for possible bond between each atom in this and every one in the 27 cells186 for (n[0] = -1; n[0] <= 1; n[0]++)187 for (n[1] = -1; n[1] <= 1; n[1]++)188 for (n[2] = -1; n[2] <= 1; n[2]++) {189 const TesselPointSTLList *OtherList = LC->GetRelativeToCurrentCell(n);190 if (OtherList != NULL) {191 Log() << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;192 for (TesselPointSTLList::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {193 if ((*OtherRunner)->getNr() > Walker->getNr()) {194 OtherWalker = dynamic_cast<atom*>(*OtherRunner);195 ASSERT(OtherWalker,"TesselPoint that was not an atom retrieved from LinkedNode");196 (BG->*minmaxdistance)(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem);197 const double distance = domain.periodicDistanceSquared(OtherWalker->getPosition(),Walker->getPosition());198 Log() << Verbose(1) << "Checking distance " << distance << " against typical bond length of " << bonddistance*bonddistance << "." << endl;199 const bool status = (distance <= MaxDistance * MaxDistance) && (distance >= MinDistance * MinDistance);200 Log() << Verbose(1) << "MinDistance is " << MinDistance << " and MaxDistance is " << MaxDistance << "." << endl;201 if (OtherWalker->father->getNr() > Walker->father->getNr()) {202 if (status) { // create bond if distance is smaller203 Log() << Verbose(1) << "Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "." << endl;204 AddBond(Walker->father, OtherWalker->father, 1); // also increases molecule::BondCount205 } else {206 Log() << Verbose(1) << "Not Adding: distance too great." << endl;207 }208 } else {209 Log() << Verbose(1) << "Not Adding: Wrong order of labels." << endl;210 }211 }212 }213 }214 }215 }216 }217 }218 delete (LC);219 DoLog(1) && (Log() << Verbose(1) << "I detected " << getBondCount() << " bonds in the molecule." << endl);220 221 // correct bond degree by comparing valence and bond degree222 DoLog(2) && (Log() << Verbose(2) << "Correcting bond degree ... " << endl);223 CorrectBondDegree();224 225 // output bonds for debugging (if bond chain list was correctly installed)226 for(molecule::internal_iterator iter = atoms.begin(); iter != atoms.end(); ++iter)227 (*iter)->OutputBondOfAtom((std::ostream &)std::cout);228 } else229 DoLog(1) && (Log() << Verbose(1) << "AtomCount is " << getAtomCount() << ", thus no bonds, no connections!." << endl);230 DoLog(0) && (Log() << Verbose(0) << "End of CreateAdjacencyList." << endl);231 if (free_BG)232 delete(BG);233 }234 ;235 236 113 /** Checks for presence of bonds within atom list. 237 114 * TODO: more sophisticated check for bond structure (e.g. connected subgraph, ...) … … 265 142 } 266 143 ; 267 268 /** correct bond degree by comparing valence and bond degree.269 * correct Bond degree of each bond by checking both bond partners for a mismatch between valence and current sum of bond degrees,270 * iteratively increase the one first where the other bond partner has the fewest number of bonds (i.e. in general bonds oxygene271 * preferred over carbon bonds). Beforehand, we had picked the first mismatching partner, which lead to oxygenes with single instead of272 * double bonds as was expected.273 * \return number of bonds that could not be corrected274 */275 int molecule::CorrectBondDegree() const276 {277 int No = 0, OldNo = -1;278 279 if (getBondCount() != 0) {280 DoLog(1) && (Log() << Verbose(1) << "Correcting Bond degree of each bond ... " << endl);281 do {282 OldNo = No;283 No=0;284 BOOST_FOREACH(atom *atom,atoms){285 No+=atom->CorrectBondDegree();286 }287 } while (OldNo != No);288 DoLog(0) && (Log() << Verbose(0) << " done." << endl);289 } else {290 DoLog(1) && (Log() << Verbose(1) << "BondCount is " << getBondCount() << ", no bonds between any of the " << getAtomCount() << " atoms." << endl);291 }292 DoLog(0) && (Log() << Verbose(0) << No << " bonds could not be corrected." << endl);293 294 return (No);295 }296 144 297 145 -
src/unittests/AnalysisBondsUnitTest.cpp
rce5f05 r3738f0 109 109 CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(5,5) ); 110 110 111 BG->CreateAdjacencyForMolecule(TestMolecule); 111 molecule::atomVector Set = TestMolecule->getAtomSet(); 112 BG->CreateAdjacency(Set); 112 113 }; 113 114 -
src/unittests/BondGraphUnitTest.cpp
rce5f05 r3738f0 139 139 }; 140 140 141 /** UnitTest for BondGraphTest::CreateAdjacency ForMolecule().141 /** UnitTest for BondGraphTest::CreateAdjacency(). 142 142 */ 143 143 void BondGraphTest::ConstructGraphFromTableTest() … … 147 147 Runner++; 148 148 CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(test) ); 149 CPPUNIT_ASSERT_EQUAL( true , BG->CreateAdjacencyForMolecule(TestMolecule) ); 149 molecule::atomVector Set = TestMolecule->getAtomSet(); 150 BG->CreateAdjacency(Set); 151 CPPUNIT_ASSERT( TestMolecule->getBondCount() != 0); 150 152 CPPUNIT_ASSERT_EQUAL( true , (*Walker)->IsBondedTo(WorldTime::getTime(), (*Runner)) ); 151 153 }; 152 154 153 /** UnitTest for BondGraphTest::CreateAdjacency ForMolecule().155 /** UnitTest for BondGraphTest::CreateAdjacency(). 154 156 */ 155 157 void BondGraphTest::ConstructGraphFromCovalentRadiiTest() … … 157 159 158 160 CPPUNIT_ASSERT_EQUAL( false , BG->LoadBondLengthTable(dummy) ); 159 CPPUNIT_ASSERT_EQUAL( true , BG->CreateAdjacencyForMolecule(TestMolecule) ); 161 molecule::atomVector Set = TestMolecule->getAtomSet(); 162 BG->CreateAdjacency(Set); 163 CPPUNIT_ASSERT( TestMolecule->getBondCount() != 0); 160 164 161 165 // this cannot be assured using dynamic IDs -
src/unittests/CountBondsUnitTest.cpp
rce5f05 r3738f0 112 112 113 113 // construct bond graphs 114 CPPUNIT_ASSERT_EQUAL( true , BG->CreateAdjacencyForMolecule(TestMolecule1) ); 115 CPPUNIT_ASSERT_EQUAL( true , BG->CreateAdjacencyForMolecule(TestMolecule2) ); 114 molecule::atomVector Set1 = TestMolecule1->getAtomSet(); 115 BG->CreateAdjacency(Set1); 116 CPPUNIT_ASSERT( TestMolecule1->getBondCount() != 0); 117 molecule::atomVector Set2 = TestMolecule2->getAtomSet(); 118 BG->CreateAdjacency(Set2); 119 CPPUNIT_ASSERT( TestMolecule2->getBondCount() != 0); 116 120 // TestMolecule1->Output((ofstream *)&cout); 117 121 // TestMolecule1->OutputBondsList(std::cout); -
tests/Fragmentations/defs.in
rce5f05 r3738f0 57 57 echo "Current dir is `pwd`, calling $MOLECUILDER $mol.conf --select-molecule-by-id 0 -f $FILENAME --order $ORDER --distance $DISTANCE." 58 58 if [ -e $mol.dbond ]; then 59 $MOLECUILDER -i ../$mol.xyz -A $mol.dbond --select- molecule-by-id 0 -f $FILENAME --order $ORDER --distance $DISTANCE &>stdout || exitcode=$?59 $MOLECUILDER -i ../$mol.xyz -A $mol.dbond --select-all-atoms --create-adjacency --select-molecule-by-id 0 -f $FILENAME --order $ORDER --distance $DISTANCE &>stdout || exitcode=$? 60 60 else 61 $MOLECUILDER -i ../$mol.xyz --select- molecule-by-id 0 -f $FILENAME --order $ORDER --distance $DISTANCE $>stdout || exitcode=$?61 $MOLECUILDER -i ../$mol.xyz --select-all-atoms --create-adjacency --select-molecule-by-id 0 -f $FILENAME --order $ORDER --distance $DISTANCE $>stdout || exitcode=$? 62 62 fi 63 63 cat <stdout -
tests/regression/Fragmentation/FragmentMolecule/testsuite-fragmentation-fragment-molecule.at
rce5f05 r3738f0 3 3 AT_SETUP([Fragmentation - Fragmentation]) 4 4 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Fragmentation/FragmentMolecule/pre/test.conf .], 0) 5 AT_CHECK([../../molecuilder -i test.conf -v 1 --select- molecule-by-id 0 -f ./BondFragment --distance 1.55 --order 2], 0, [ignore], [ignore])5 AT_CHECK([../../molecuilder -i test.conf -v 1 --select-all-atoms --create-adjacency --select-molecule-by-id 0 -f ./BondFragment --distance 1.55 --order 2], 0, [ignore], [ignore]) 6 6 AT_CHECK([ls -l BondFragment*.conf | wc -l], 0, [5 7 7 ], [ignore]) -
tests/regression/Graph/DepthFirstSearch/testsuite-graph-depth-first-search.at
rce5f05 r3738f0 4 4 AT_KEYWORDS([graph]) 5 5 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Graph/DepthFirstSearch/pre/test.conf .], 0) 6 AT_CHECK([../../molecuilder -i test.conf -v 3-D 2.], 0, [stdout], [stderr])6 AT_CHECK([../../molecuilder -i test.conf -v 3 --select-all-atoms --create-adjacency -D 2.], 0, [stdout], [stderr]) 7 7 AT_CHECK([fgrep -c "No rings were detected in the molecular structure." stdout], 0, [1 8 8 ], [ignore]) -
tests/regression/Molecules/SaveAdjacency/testsuite-molecules-save-adjacency.at
rce5f05 r3738f0 4 4 AT_KEYWORDS([Molecules]) 5 5 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/SaveAdjacency/pre/test.conf .], 0) 6 AT_CHECK([../../molecuilder -i test.conf -v 1 --select- molecule-by-id 0 -J test.adj], 0, [stdout], [stderr])6 AT_CHECK([../../molecuilder -i test.conf -v 1 --select-all-atoms --create-adjacency --select-molecule-by-id 0 -J test.adj], 0, [stdout], [stderr]) 7 7 AT_CHECK([file=test.adj; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/SaveAdjacency/post/$file], 0, [ignore], [ignore]) 8 8 AT_CLEANUP -
tests/regression/Molecules/SaveBonds/testsuite-molecules-save-bonds.at
rce5f05 r3738f0 4 4 AT_KEYWORDS([Molecules]) 5 5 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/SaveBonds/pre/test.conf .], 0) 6 AT_CHECK([../../molecuilder -i test.conf -v 1 --select- molecule-by-id 0 -j test.dbond], 0, [stdout], [stderr])6 AT_CHECK([../../molecuilder -i test.conf -v 1 --select-all-atoms --create-adjacency --select-molecule-by-id 0 -j test.dbond], 0, [stdout], [stderr]) 7 7 AT_CHECK([file=test.dbond; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/SaveBonds/post/$file], 0, [ignore], [ignore]) 8 8 AT_CLEANUP
Note:
See TracChangeset
for help on using the changeset viewer.
