Changeset 3738f0


Ignore:
Timestamp:
Mar 1, 2011, 12:49:28 PM (15 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

Moved molecule::CreateAdjacencyList over to class BondGraph.

to make this possible we had to:

other changes:

TESTFIXES:

  • the regression test for all Actions mentioned above that don't create adjacency themselves anymore needed to be prepended with --select-all-atoms --create-adjacency.
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/FragmentationAction/CreateAdjacencyAction.cpp

    rce5f05 r3738f0  
    5858  BondGraph *BG = World::getInstance().getBondGraph();
    5959  ASSERT(BG != NULL, "FragmentationCreateAdjacencyAction: BondGraph is NULL.");
     60  BG->SetMaxDistanceToMaxOfCovalentRadii(AtomSetMixin<std::vector<atom *> >(World::getInstance().getSelectedAtoms()));
    6061  double BondDistance = BG->getMaxDistance();
    6162  bool IsAngstroem = configuration->GetIsAngstroem();
  • src/Actions/FragmentationAction/DepthFirstSearchAction.cpp

    rce5f05 r3738f0  
    5252  std::deque<bond *> *BackEdgeStack = NULL;
    5353  std::deque<bond *> *LocalBackEdgeStack = NULL;
    54   BondGraph *BG = World::getInstance().getBondGraph();
    55   mol->CreateAdjacencyList(params.distance, World::getInstance().getConfig()->GetIsAngstroem(), &BondGraph::getMinMaxDistance, BG);
    5654  Subgraphs = mol->DepthFirstSearchAnalysis(BackEdgeStack);
    5755  if (Subgraphs != NULL) {
  • src/Actions/FragmentationAction/FragmentationAction.cpp

    rce5f05 r3738f0  
    4343  clock_t start,end;
    4444  molecule *mol = NULL;
    45   config *configuration = World::getInstance().getConfig();
    4645  int ExitFlag = 0;
    4746
     
    5554    DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl);
    5655    start = clock();
    57     mol->CreateAdjacencyList(params.distance, configuration->GetIsAngstroem(), &BondGraph::getMinMaxDistance, World::getInstance().getBondGraph());
    5856    DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl);
    5957    if (mol->hasBondStructure()) {
  • src/Actions/FragmentationAction/SubgraphDissectionAction.cpp

    rce5f05 r3738f0  
    5050  getParametersfromValueStorage();
    5151
    52   DoLog(1) && (Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl);
    5352
    5453  // first create stuff for undo state
     54  LOG(0, "STATUS: Creating undo state.");
    5555  MolAtomList moleculelist;
    5656  vector<molecule *> allmolecules = World::getInstance().getAllMolecules();
     
    6666
    6767  // 0a. remove all present molecules
     68  LOG(0, "STATUS: Removing all present molecules.");
    6869  MoleculeListClass *molecules = World::getInstance().getMolecules();
    6970  for (vector<molecule *>::iterator MolRunner = allmolecules.begin(); MolRunner != allmolecules.end(); ++MolRunner) {
     
    8889
    8990  // 1. create the bond structure of the single molecule
     91  LOG(0, "STATUS: (Re-)constructing adjacency.");
    9092  if (mol->getBondCount() == 0) {
    9193    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//    }
    97101  }
    98102
    99103  // 2. scan for connected subgraphs
     104  LOG(0, "STATUS: Analysing adjacency graph.");
    100105  MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
    101106  std::deque<bond *> *BackEdgeStack = NULL;
     
    111116
    112117  // 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.");
    113119  {
    114120    {
     
    152158
    153159  // 4. free Leafs
     160  LOG(0, "STATUS: Done.");
    154161  MoleculeLeafClass *MolecularWalker = Subgraphs;
    155162  while (MolecularWalker->next != NULL) {
  • src/Actions/MoleculeAction/FillVoidWithMoleculeAction.cpp

    rce5f05 r3738f0  
    7373  molecule *filler = World::getInstance().getMolecule(MoleculeByOrder(-1)); // get last molecule
    7474  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);
    7677
    7778  // call routine
  • src/Actions/MoleculeAction/FillWithMoleculeAction.cpp

    rce5f05 r3738f0  
    8484//    filler->AddBond(first, third, 1);
    8585//    filler->AddBond(second, third, 1);
    86   World::getInstance().getBondGraph()->CreateAdjacencyForMolecule(filler);
     86  molecule::atomVector Set = filler->getAtomSet();
     87  World::getInstance().getBondGraph()->CreateAdjacency(Set);
    8788//    filler->SetNameFromFilename("water");
    8889  // TODO: Remove the erasure of molecule when saving does not depend on them anymore.
  • src/Actions/MoleculeAction/SaveAdjacencyAction.cpp

    rce5f05 r3738f0  
    4949    mol = iter->second;
    5050    DoLog(0) && (Log() << Verbose(0) << "Storing adjacency to path " << params.adjacencyfile << "." << endl);
    51     World::getInstance().getBondGraph()->CreateAdjacencyForMolecule(mol);
    5251    // TODO: sollte stream nicht filename benutzen, besser fuer unit test
    5352    mol->StoreAdjacencyToFile(params.adjacencyfile.leaf(), params.adjacencyfile.branch_path().string());
  • src/Actions/MoleculeAction/SaveBondsAction.cpp

    rce5f05 r3738f0  
    4949    mol = iter->second;
    5050    DoLog(0) && (Log() << Verbose(0) << "Storing bonds to path " << params.bondsfile << "." << endl);
    51     World::getInstance().getBondGraph()->CreateAdjacencyForMolecule(mol);
    5251    // TODO: sollte stream, nicht filenamen direkt nutzen, besser fuer unit tests
    5352    mol->StoreBondsToFile(params.bondsfile.leaf(), params.bondsfile.branch_path().string());
  • src/AtomSet.hpp

    rce5f05 r3738f0  
    3939};
    4040
    41 template <class Set>
    42 class AtomSetMixin : public Set
     41template <class container_type,
     42          class iterator_type = typename container_type::iterator,
     43          class const_iterator_type = typename container_type::const_iterator>
     44class AtomSetMixin : public container_type
    4345{
    4446  // 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;
    4648public:
    4749  // typedefs for STL conforming structure
    48   typedef typename Set::iterator iterator;
    49   typedef typename Set::const_iterator const_iterator;
     50  typedef iterator_type iterator;
     51  typedef const_iterator_type const_iterator;
    5052
    5153  AtomSetMixin() :
    52     Set()
     54    container_type()
    5355  {}
    5456
    55   AtomSetMixin(const Set& src) :
    56     Set(src)
     57  AtomSetMixin(const container_type& src) :
     58    container_type(src)
    5759  {}
    5860  virtual ~AtomSetMixin(){}
     
    117119};
    118120
    119 template<class Set>
    120 inline void AtomSetMixin<Set>::translate(const Vector &translater){
     121template <class container_type,
     122          class iterator_type,
     123          class const_iterator_type>
     124inline void AtomSetMixin<container_type,iterator_type,const_iterator_type>::translate(const Vector &translater){
    121125  BOOST_FOREACH(AtomInfo *atom,*this){
    122126    *(atom) += translater;
     
    124128}
    125129
    126 template<class Set>
    127 inline void AtomSetMixin<Set>::addVelocityAtStep(const Vector velocity, unsigned int step){
     130template <class container_type,
     131          class iterator_type,
     132          class const_iterator_type>
     133inline void AtomSetMixin<container_type,iterator_type,const_iterator_type>::addVelocityAtStep(const Vector velocity, unsigned int step){
    128134  BOOST_FOREACH(AtomInfo *atom,*this){
    129135    atom->setAtomicVelocityAtStep(step, atom->getAtomicVelocityAtStep(step)+velocity);
     
    131137}
    132138
    133 template<class Set>
     139template <class container_type,
     140          class iterator_type,
     141          class const_iterator_type>
    134142template<class Function>
    135 inline void AtomSetMixin<Set>::transformNodes(Function f){
     143inline void AtomSetMixin<container_type,iterator_type,const_iterator_type>::transformNodes(Function f){
    136144  std::for_each(this->begin(),
    137145                this->end(),
     
    139147}
    140148
    141 template<class Set>
    142 inline double AtomSetMixin<Set>::totalMass() const{
     149template <class container_type,
     150          class iterator_type,
     151          class const_iterator_type>
     152inline double AtomSetMixin<container_type,iterator_type,const_iterator_type>::totalMass() const{
    143153  return accumulate(this->begin(),this->end(),valueSum<double>(&AtomInfo::getMass,0)).value;
    144154}
    145155
    146 template<class Set>
    147 inline double AtomSetMixin<Set>::totalTemperatureAtStep(unsigned int step) const{
     156template <class container_type,
     157          class iterator_type,
     158          class const_iterator_type>
     159inline double AtomSetMixin<container_type,iterator_type,const_iterator_type>::totalTemperatureAtStep(unsigned int step) const{
    148160  return accumulate(this->begin(),this->end(),stepValueSum<double>(step,&AtomInfo::getKineticEnergy,0)).value;
    149161}
    150162
    151 template<class Set>
    152 inline Vector AtomSetMixin<Set>::totalMomentumAtStep(unsigned int step) const{
     163template <class container_type,
     164          class iterator_type,
     165          class const_iterator_type>
     166inline Vector AtomSetMixin<container_type,iterator_type,const_iterator_type>::totalMomentumAtStep(unsigned int step) const{
    153167  return accumulate(this->begin(),this->end(),stepValueSum<Vector>(step,&AtomInfo::getMomentum,Vector())).value;
    154168}
  • src/bondgraph.cpp

    rce5f05 r3738f0  
    2525#include "bond.hpp"
    2626#include "bondgraph.hpp"
     27#include "Box.hpp"
    2728#include "element.hpp"
    2829#include "CodePatterns/Info.hpp"
     30#include "CodePatterns/Log.hpp"
     31#include "CodePatterns/Range.hpp"
    2932#include "CodePatterns/Verbose.hpp"
    30 #include "CodePatterns/Log.hpp"
    3133#include "molecule.hpp"
    3234#include "parser.hpp"
    3335#include "periodentafel.hpp"
    3436#include "LinearAlgebra/Vector.hpp"
     37#include "World.hpp"
     38#include "WorldTime.hpp"
    3539
    3640const 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
     
    4044    max_distance(0),
    4145    IsAngstroem(IsA)
    42 {};
     46{}
    4347
    4448BondGraph::~BondGraph()
     
    4751    delete(BondLengthMatrix);
    4852  }
    49 };
     53}
    5054
    5155bool BondGraph::LoadBondLengthTable(std::istream &input)
     
    5761  // allocate MatrixContainer
    5862  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.");
    6064    delete(BondLengthMatrix);
    6165  }
     
    6468  // parse in matrix
    6569  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.");
    6771  } else {
    6872    DoeLog(1) && (eLog()<< Verbose(1) << "Parsing bond length matrix failed." << endl);
     
    8791  }
    8892  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}
    10494
    10595double BondGraph::GetBondLength(int firstZ, int secondZ)
     
    113103    return (BondLengthMatrix->Matrix[0][firstZ][secondZ]);
    114104  }
    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}
    131106
    132107double BondGraph::getMaxDistance() const
     
    142117  MaxDistance = MinDistance + BondThreshold;
    143118  MinDistance -= BondThreshold;
    144 };
     119}
    145120
    146121void BondGraph::BondLengthMatrixMinMaxDistance(const BondedParticle * const Walker, const BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem)
     
    152127  MaxDistance = MinDistance + BondThreshold;
    153128  MinDistance -= BondThreshold;
    154 };
     129}
    155130
    156131void BondGraph::getMinMaxDistance(const BondedParticle * const Walker, const BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem)
     
    164139  }
    165140}
     141
     142void 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  
    2020#include <iosfwd>
    2121
     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"
    2232
    2333/****************************************** forward declarations *****************************/
     
    5161  bool LoadBondLengthTable(std::istream &input);
    5262
    53   /** Creates the bond list for all atoms in a given molecule.
    54    * \param *mol molecule with atoms
    55    * \return true - success, false - failed to construct bond structure
    56    */
    57   bool CreateAdjacencyForMolecule(molecule * const mol);
    58 
    5963  /** Returns the entry for a given index pair.
    6064   * \param firstelement index/atom number of first element (row index)
     
    6468  double GetBondLength(int firstelement, int secondelement);
    6569
    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;
    71102
    72103  /** Returns bond criterion for given pair based on a bond length matrix.
     
    80111  void getMinMaxDistance(const BondedParticle * const Walker, const BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem);
    81112
    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  }
    86214
    87215private:
     
    108236  void CovalentMinMaxDistance(const BondedParticle * const Walker, const BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem);
    109237
     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
    110281  //!> Matrix with bond lenth per two elements
    111282  MatrixContainer *BondLengthMatrix;
  • src/linkedcell.cpp

    rce5f05 r3738f0  
    2323#include "linkedcell.hpp"
    2424#include "CodePatterns/Verbose.hpp"
     25#include "CodePatterns/Range.hpp"
    2526#include "CodePatterns/Log.hpp"
    2627#include "molecule.hpp"
  • src/linkedcell.hpp

    rce5f05 r3738f0  
    2525#include <map>
    2626
    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"
    3030#include "Helpers/defs.hpp"
    3131#include "LinearAlgebra/Vector.hpp"
  • src/molecule.cpp

    rce5f05 r3738f0  
    231231bool molecule::containsAtom(atom* key){
    232232  return (find(key) != end());
     233}
     234
     235molecule::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;
    233241}
    234242
  • src/molecule.hpp

    rce5f05 r3738f0  
    8787public:
    8888  typedef ATOMSET(std::list) atomSet;
     89  typedef ATOMSET(std::vector) atomVector;
    8990  typedef std::set<atomId_t> atomIdSet;
    9091  typedef ObservedIterator<atomSet> iterator;
     
    141142
    142143  virtual bool changeId(atomId_t newId);
     144
     145  atomVector getAtomSet() const;
    143146
    144147  iterator begin();
     
    208211  /// Initialising routines in fragmentation
    209212  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;
    212213  void OutputBondsList() const;
    213214  void CyclicBondAnalysis() const;
  • src/molecule_fragmentation.cpp

    rce5f05 r3738f0  
    667667      iter != World::getInstance().moleculeEnd();
    668668      ++iter) {
    669       // reset bond degree to 1
    670     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     }
    680669    // correct bond degree
    681     (*iter)->CorrectBondDegree();
     670    molecule::atomVector Set = (*iter)->getAtomSet();
     671    World::getInstance().getBondGraph()->CorrectBondDegree(Set);
    682672  }
    683673
     
    748738      MolecularWalker = MolecularWalker->next;
    749739      DoLog(1) && (Log() << Verbose(1) << "Fragmenting subgraph " << MolecularWalker << "." << endl);
    750       //MolecularWalker->Leaf->OutputListOfBonds(out);  // output atom::ListOfBonds for debugging
    751740      if (MolecularWalker->Leaf->hasBondStructure()) {
    752741        // call BOSSANOVA method
  • src/molecule_graph.cpp

    rce5f05 r3738f0  
    111111}
    112112
    113 /** Creates an adjacency list of the molecule.
    114  * Generally, we use the CSD approach to bond recognition, that is the the distance
    115  * between two atoms A and B must be within [Rcov(A)+Rcov(B)-t,Rcov(A)+Rcov(B)+t] with
    116  * 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 list
    120  *  -# Count the atoms in the molecule with CountAtoms()
    121  *  -# partition cell into smaller linked cells of size \a bonddistance
    122  *  -# put each atom into its corresponding cell
    123  *  -# go through every cell, check the atoms therein against all possible bond partners in the 27 adjacent cells, add bond if true
    124  *  -# correct the bond degree iteratively (single->double->triple bond)
    125  *  -# finally print the bond list to \a *out if desired
    126  * \param bonddistance length of linked cells (i.e. maximum minimal length checked)
    127  * \param IsAngstroem whether coordinate system is gauged to Angstroem or Bohr radii
    128  * \param *minmaxdistance function to give upper and lower bound on whether particle is bonded to some other
    129  * \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 list
    147   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 used
    168     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 cell
    174     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 cells
    186               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 smaller
    203                               Log() << Verbose(1) << "Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "." << endl;
    204                               AddBond(Walker->father, OtherWalker->father, 1); // also increases molecule::BondCount
    205                             } 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 degree
    222     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   } else
    229     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 
    236113/** Checks for presence of bonds within atom list.
    237114 * TODO: more sophisticated check for bond structure (e.g. connected subgraph, ...)
     
    265142}
    266143;
    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 oxygene
    271  * preferred over carbon bonds). Beforehand, we had picked the first mismatching partner, which lead to oxygenes with single instead of
    272  * double bonds as was expected.
    273  * \return number of bonds that could not be corrected
    274  */
    275 int molecule::CorrectBondDegree() const
    276 {
    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 }
    296144
    297145
  • src/unittests/AnalysisBondsUnitTest.cpp

    rce5f05 r3738f0  
    109109  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(5,5) );
    110110
    111   BG->CreateAdjacencyForMolecule(TestMolecule);
     111  molecule::atomVector Set = TestMolecule->getAtomSet();
     112  BG->CreateAdjacency(Set);
    112113};
    113114
  • src/unittests/BondGraphUnitTest.cpp

    rce5f05 r3738f0  
    139139};
    140140
    141 /** UnitTest for BondGraphTest::CreateAdjacencyForMolecule().
     141/** UnitTest for BondGraphTest::CreateAdjacency().
    142142 */
    143143void BondGraphTest::ConstructGraphFromTableTest()
     
    147147  Runner++;
    148148  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);
    150152  CPPUNIT_ASSERT_EQUAL( true , (*Walker)->IsBondedTo(WorldTime::getTime(), (*Runner)) );
    151153};
    152154
    153 /** UnitTest for BondGraphTest::CreateAdjacencyForMolecule().
     155/** UnitTest for BondGraphTest::CreateAdjacency().
    154156 */
    155157void BondGraphTest::ConstructGraphFromCovalentRadiiTest()
     
    157159
    158160  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);
    160164
    161165  // this cannot be assured using dynamic IDs
  • src/unittests/CountBondsUnitTest.cpp

    rce5f05 r3738f0  
    112112
    113113  // 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);
    116120//  TestMolecule1->Output((ofstream *)&cout);
    117121//  TestMolecule1->OutputBondsList(std::cout);
  • tests/Fragmentations/defs.in

    rce5f05 r3738f0  
    5757        echo "Current dir is `pwd`, calling $MOLECUILDER $mol.conf --select-molecule-by-id 0 -f $FILENAME --order $ORDER --distance $DISTANCE."
    5858        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=$?
    6060        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=$?
    6262        fi
    6363        cat <stdout
  • tests/regression/Fragmentation/FragmentMolecule/testsuite-fragmentation-fragment-molecule.at

    rce5f05 r3738f0  
    33AT_SETUP([Fragmentation - Fragmentation])
    44AT_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])
     5AT_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])
    66AT_CHECK([ls -l BondFragment*.conf | wc -l], 0, [5
    77], [ignore])
  • tests/regression/Graph/DepthFirstSearch/testsuite-graph-depth-first-search.at

    rce5f05 r3738f0  
    44AT_KEYWORDS([graph])
    55AT_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])
     6AT_CHECK([../../molecuilder -i test.conf -v 3 --select-all-atoms --create-adjacency -D 2.], 0, [stdout], [stderr])
    77AT_CHECK([fgrep -c "No rings were detected in the molecular structure." stdout], 0, [1
    88], [ignore])
  • tests/regression/Molecules/SaveAdjacency/testsuite-molecules-save-adjacency.at

    rce5f05 r3738f0  
    44AT_KEYWORDS([Molecules])
    55AT_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])
     6AT_CHECK([../../molecuilder -i test.conf  -v 1 --select-all-atoms --create-adjacency --select-molecule-by-id 0 -J test.adj], 0, [stdout], [stderr])
    77AT_CHECK([file=test.adj; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/SaveAdjacency/post/$file], 0, [ignore], [ignore])
    88AT_CLEANUP
  • tests/regression/Molecules/SaveBonds/testsuite-molecules-save-bonds.at

    rce5f05 r3738f0  
    44AT_KEYWORDS([Molecules])
    55AT_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])
     6AT_CHECK([../../molecuilder -i test.conf  -v 1 --select-all-atoms --create-adjacency --select-molecule-by-id 0 -j test.dbond], 0, [stdout], [stderr])
    77AT_CHECK([file=test.dbond; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/SaveBonds/post/$file], 0, [ignore], [ignore])
    88AT_CLEANUP
Note: See TracChangeset for help on using the changeset viewer.