Changeset 98a293b


Ignore:
Timestamp:
Aug 16, 2014, 3:52:30 PM (10 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, 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:
a8f1d2
Parents:
bdd5a8
git-author:
Frederik Heber <heber@…> (07/18/14 17:08:09)
git-committer:
Frederik Heber <heber@…> (08/16/14 15:52:30)
Message:

SaturatedFragment can deal with a global saturation position map.

  • so far, we create an empty one in FragmentationAction such that nothing's changed for the moment.
  • similarly in StoreSaturatedFragmentAction. However, there this is intended as only local information is required (it's only a single fragment).
Location:
src
Files:
12 edited

Legend:

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

    rbdd5a8 r98a293b  
    4242#include "Fragmentation/Exporters/ExportGraph_ToFiles.hpp"
    4343#include "Fragmentation/Exporters/ExportGraph_ToJobs.hpp"
     44#include "Fragmentation/Exporters/SaturatedFragment.hpp"
    4445#include "Fragmentation/Fragmentation.hpp"
    4546#include "Fragmentation/Graph.hpp"
     
    261262  }
    262263
     264  // create global saturation positions map
     265  SaturatedFragment::GlobalSaturationPositions_t globalsaturationpositions;
     266
    263267  {
    264268    const enum HydrogenSaturation saturation =  params.DoSaturation.get() ? DoSaturate : DontSaturate;
     
    266270    if (params.types.get().size() != 0) {
    267271      // store molecule's fragment to file
    268       ExportGraph_ToFiles exporter(TotalGraph, treatment, saturation);
     272      ExportGraph_ToFiles exporter(TotalGraph, treatment, saturation, globalsaturationpositions);
    269273      exporter.setPrefix(params.prefix.get());
    270274      exporter.setOutputTypes(params.types.get());
     
    272276    } else {
    273277      // store molecule's fragment in FragmentJobQueue
    274       ExportGraph_ToJobs exporter(TotalGraph, treatment, saturation);
     278      ExportGraph_ToJobs exporter(TotalGraph, treatment, saturation, globalsaturationpositions);
    275279      exporter.setLevel(params.level.get());
    276280      exporter();
  • src/Actions/FragmentationAction/StoreSaturatedFragmentAction.cpp

    rbdd5a8 r98a293b  
    3939#include "CodePatterns/Log.hpp"
    4040#include "Fragmentation/Exporters/ExportGraph_ToFiles.hpp"
     41#include "Fragmentation/Exporters/SaturatedFragment.hpp"
    4142#include "Fragmentation/Graph.hpp"
    4243#include "World.hpp"
     
    7778  // store molecule's fragment to file
    7879  {
     80    // we use an empty map here such that saturation is done locally
     81    SaturatedFragment::GlobalSaturationPositions_t globalsaturationpositions;
     82
    7983    const enum HydrogenSaturation saturation =  params.DoSaturation.get() ? DoSaturate : DontSaturate;
    80     ExportGraph_ToFiles exporter(TotalGraph, IncludeHydrogen, saturation);
     84    ExportGraph_ToFiles exporter(TotalGraph, IncludeHydrogen, saturation, globalsaturationpositions);
    8185    exporter.setPrefix(params.prefix.get());
    8286    exporter.setOutputTypes(params.types.get());
  • src/Fragmentation/Exporters/ExportGraph.cpp

    rbdd5a8 r98a293b  
    5858  const Graph &_graph,
    5959  const enum HydrogenTreatment _treatment,
    60   const enum HydrogenSaturation _saturation) :
     60  const enum HydrogenSaturation _saturation,
     61  const SaturatedFragment::GlobalSaturationPositions_t &_globalsaturationpositions) :
    6162  TotalGraph(_graph),
    6263  BondFragments(World::getPointer()),
    6364  treatment(_treatment),
    6465  saturation(_saturation),
     66  globalsaturationpositions(_globalsaturationpositions),
    6567  CurrentKeySet(TotalGraph.begin())
    6668{
     
    115117          hydrogens,
    116118          treatment,
    117           saturation)
     119          saturation,
     120          globalsaturationpositions)
    118121  );
    119122  // and return
  • src/Fragmentation/Exporters/ExportGraph.hpp

    rbdd5a8 r98a293b  
    4141      const Graph &_graph,
    4242      const enum HydrogenTreatment _treatment,
    43       const enum HydrogenSaturation _saturation);
     43      const enum HydrogenSaturation _saturation,
     44      const SaturatedFragment::GlobalSaturationPositions_t &_globalsaturationpositions);
    4445  virtual ~ExportGraph();
    4546
     
    102103  const enum HydrogenSaturation saturation;
    103104
     105  //!> Global information over all atoms with saturation positions to be used per fragment
     106  const SaturatedFragment::GlobalSaturationPositions_t &globalsaturationpositions;
     107
    104108private:
    105109  //!> iterator pointing at the CurrentKeySet to be exported
  • src/Fragmentation/Exporters/ExportGraph_ToFiles.cpp

    rbdd5a8 r98a293b  
    5757 * @param _treatment whether to always add already present hydrogens or not
    5858 * @param _saturation whether to saturate dangling bonds with hydrogen or not
     59 * @param _globalsaturationpositions possibly empty map with global information
     60 *        where to place saturation hydrogens to fulfill consistency principle
    5961 */
    6062ExportGraph_ToFiles::ExportGraph_ToFiles(
    6163    const Graph &_graph,
    6264    const enum HydrogenTreatment _treatment,
    63     const enum HydrogenSaturation _saturation) :
    64                 ExportGraph(_graph, _treatment, _saturation)
     65    const enum HydrogenSaturation _saturation,
     66    const SaturatedFragment::GlobalSaturationPositions_t &_globalsaturationpositions) :
     67                ExportGraph(_graph, _treatment, _saturation, _globalsaturationpositions)
    6568{}
    6669
  • src/Fragmentation/Exporters/ExportGraph_ToFiles.hpp

    rbdd5a8 r98a293b  
    3333            const Graph &_graph,
    3434            const enum HydrogenTreatment _treatment,
    35             const enum HydrogenSaturation _saturation);
     35            const enum HydrogenSaturation _saturation,
     36      const SaturatedFragment::GlobalSaturationPositions_t &_globalsaturationpositions);
    3637        virtual ~ExportGraph_ToFiles();
    3738
  • src/Fragmentation/Exporters/ExportGraph_ToJobs.cpp

    rbdd5a8 r98a293b  
    5959    const Graph &_graph,
    6060    const enum HydrogenTreatment _treatment,
    61     const enum HydrogenSaturation _saturation) :
    62     ExportGraph(_graph, _treatment, _saturation),
     61    const enum HydrogenSaturation _saturation,
     62    const SaturatedFragment::GlobalSaturationPositions_t &_globalsaturationpositions) :
     63    ExportGraph(_graph, _treatment, _saturation,_globalsaturationpositions),
    6364    level(5)
    6465{}
  • src/Fragmentation/Exporters/ExportGraph_ToJobs.hpp

    rbdd5a8 r98a293b  
    3535   * \param _treatment whether hydrogen is excluded in the _graph or not
    3636   * \param _saturation whether we saturate dangling bonds or not
     37   * \param _globalsaturationpositions possibly empty map with global information
     38   *        where to place saturation hydrogens to fulfill consistency principle
    3739   */
    3840  ExportGraph_ToJobs(
    3941      const Graph &_graph,
    4042      const enum HydrogenTreatment _treatment,
    41       const enum HydrogenSaturation _saturation);
     43      const enum HydrogenSaturation _saturation,
     44      const SaturatedFragment::GlobalSaturationPositions_t &_globalsaturationpositions);
    4245  virtual ~ExportGraph_ToJobs();
    4346
  • src/Fragmentation/Exporters/SaturatedFragment.cpp

    rbdd5a8 r98a293b  
    6363    HydrogenPool &_hydrogens,
    6464    const enum HydrogenTreatment _treatment,
    65     const enum HydrogenSaturation _saturation) :
     65    const enum HydrogenSaturation _saturation,
     66    const GlobalSaturationPositions_t &_globalsaturationpositions) :
    6667  container(_container),
    6768  set(_set),
     
    7778  container.insert(set);
    7879
    79   // prepare saturation hydrogens
    80   saturate();
     80  // prepare saturation hydrogens, either using global information
     81  // or if not given, local information (created in the function)
     82  if (_globalsaturationpositions.empty())
     83    saturate();
     84  else
     85    saturate(_globalsaturationpositions);
    8186}
    8287
     
    99104}
    100105
    101 void SaturatedFragment::saturate()
    102 {
    103   // so far, we just have a set of keys. Hence, convert to atom refs
    104   // and gather all atoms in a vector
    105   std::vector<atom *> atoms;
    106   for (KeySet::const_iterator iter = FullMolecule.begin();
    107       iter != FullMolecule.end();
     106typedef std::vector<atom *> atoms_t;
     107
     108atoms_t gatherAllAtoms(const KeySet &_FullMolecule)
     109{
     110  atoms_t atoms;
     111  for (KeySet::const_iterator iter = _FullMolecule.begin();
     112      iter != _FullMolecule.end();
    108113      ++iter) {
    109114    atom * const Walker = World::getInstance().getAtom(AtomById(*iter));
    110115    ASSERT( Walker != NULL,
    111         "SaturatedFragment::OutputConfig() - id "
     116        "gatherAllAtoms() - id "
    112117        +toString(*iter)+" is unknown to World.");
    113118    atoms.push_back(Walker);
    114119  }
    115120
    116 //  bool LonelyFlag = false;
    117   // go through each atom of the fragment and gather all cut bonds in list
    118   typedef std::map<atom *, BondList > CutBonds_t;
     121  return atoms;
     122}
     123
     124typedef std::map<atom *, BondList > CutBonds_t;
     125
     126CutBonds_t gatherCutBonds(
     127    const atoms_t &_atoms,
     128    const KeySet &_set,
     129    const enum HydrogenTreatment _treatment)
     130{
     131  //  bool LonelyFlag = false;
    119132  CutBonds_t CutBonds;
    120   for (std::vector<atom *>::const_iterator iter = atoms.begin();
    121       iter != atoms.end();
     133  for (atoms_t::const_iterator iter = _atoms.begin();
     134      iter != _atoms.end();
    122135      ++iter) {
    123136    atom * const Walker = *iter;
     
    129142        ++BondRunner) {
    130143      atom * const OtherWalker = (*BondRunner)->GetOtherAtom(Walker);
    131       // if other atom is in key set
    132       if (set.find(OtherWalker->getId()) != set.end()) {
     144      // if other atom is in key set or is a specially treated hydrogen
     145      if (_set.find(OtherWalker->getId()) != _set.end()) {
    133146        LOG(4, "DEBUG: Walker " << *Walker << " is bound to " << *OtherWalker << ".");
    134 //        if (OtherWalker->getId() > Walker->getId()) { // add bond (Nr check is for adding only one of both variants: ab, ba)
    135 ////          std::stringstream output;
    136 ////            output << "ACCEPT: Adding Bond: "
    137 //          output << Leaf->AddBond((*iter), OtherWalker, (*BondRunner)->getDegree());
    138 ////            LOG(3, output.str());
    139 //          //NumBonds[(*iter)->getNr()]++;
    140 //        } else {
    141 ////            LOG(3, "REJECY: Not adding bond, labels in wrong order.");
    142 //        }
    143 //        LonelyFlag = false;
     147      } else if ((_treatment == ExcludeHydrogen)
     148          && (OtherWalker->getElementNo() == (atomicNumber_t)1)) {
     149        LOG(4, "DEBUG: Walker " << *Walker << " is bound to specially treated hydrogen " <<
     150            *OtherWalker << ".");
    144151      } else {
    145152        LOG(4, "DEBUG: Walker " << *Walker << " is bound to "
    146153            << *OtherWalker << ", who is not in this fragment molecule.");
    147         if (saturation == DoSaturate) {
    148 //          LOG(3, "ACCEPT: Adding Hydrogen to " << (*iter)->Name << " and a bond in between.");
    149154          if (CutBonds.count(Walker) == 0)
    150155            CutBonds.insert( std::make_pair(Walker, BondList() ));
    151156          CutBonds[Walker].push_back(*BondRunner);
    152         }
    153 //        } else if ((treatment == ExcludeHydrogen) && (OtherWalker->getElementNo() == (atomicNumber_t)1)) {
    154 //          // just copy the atom if it's a hydrogen
    155 //          atom * const OtherWalker = Leaf->AddCopyAtom(OtherWalker);
    156 //          Leaf->AddBond((*iter), OtherWalker, (*BondRunner)->getDegree());
    157 //        }
    158         //NumBonds[(*iter)->getNr()] += Binder->getDegree();
    159157      }
    160158    }
     159  }
     160
     161  return CutBonds;
     162}
     163
     164typedef std::vector<atomId_t> atomids_t;
     165
     166atomids_t gatherPresentExcludedHydrogens(
     167    const atoms_t &_atoms,
     168    const KeySet &_set,
     169    const enum HydrogenTreatment _treatment)
     170{
     171  //  bool LonelyFlag = false;
     172  atomids_t ExcludedHydrogens;
     173  for (atoms_t::const_iterator iter = _atoms.begin();
     174      iter != _atoms.end();
     175      ++iter) {
     176    atom * const Walker = *iter;
     177
     178    // go through all bonds
     179    const BondList& ListOfBonds = Walker->getListOfBonds();
     180    for (BondList::const_iterator BondRunner = ListOfBonds.begin();
     181        BondRunner != ListOfBonds.end();
     182        ++BondRunner) {
     183      atom * const OtherWalker = (*BondRunner)->GetOtherAtom(Walker);
     184      // if other atom is in key set or is a specially treated hydrogen
     185      if (_set.find(OtherWalker->getId()) != _set.end()) {
     186        LOG(6, "DEBUG: OtherWalker " << *OtherWalker << " is in set already.");
     187      } else if ((_treatment == ExcludeHydrogen)
     188          && (OtherWalker->getElementNo() == (atomicNumber_t)1)) {
     189        LOG(5, "DEBUG: Adding excluded hydrogen OtherWalker " << *OtherWalker << ".");
     190        ExcludedHydrogens.push_back(OtherWalker->getId());
     191      } else {
     192        LOG(6, "DEBUG: OtherWalker " << *Walker << " is not in this fragment molecule and no hydrogen.");
     193      }
     194    }
     195  }
     196
     197  return ExcludedHydrogens;
     198}
     199
     200void SaturatedFragment::saturate()
     201{
     202  // so far, we just have a set of keys. Hence, convert to atom refs
     203  // and gather all atoms in a vector
     204  std::vector<atom *> atoms = gatherAllAtoms(FullMolecule);
     205
     206  // go through each atom of the fragment and gather all cut bonds in list
     207  CutBonds_t CutBonds = gatherCutBonds(atoms, set, treatment);
     208
     209  // add excluded hydrogens to FullMolecule if treated specially
     210  if (treatment == ExcludeHydrogen) {
     211    atomids_t ExcludedHydrogens = gatherPresentExcludedHydrogens(atoms, set, treatment);
     212    FullMolecule.insert(ExcludedHydrogens.begin(), ExcludedHydrogens.end());
    161213  }
    162214
     
    168220      exit(1);
    169221  }
     222}
     223
     224void SaturatedFragment::saturate(
     225    const GlobalSaturationPositions_t &_globalsaturationpositions)
     226{
     227  // so far, we just have a set of keys. Hence, convert to atom refs
     228  // and gather all atoms in a vector
     229  std::vector<atom *> atoms = gatherAllAtoms(FullMolecule);
     230
     231  // go through each atom of the fragment and gather all cut bonds in list
     232  CutBonds_t CutBonds = gatherCutBonds(atoms, set, treatment);
     233
     234  // add excluded hydrogens to FullMolecule if treated specially
     235  if (treatment == ExcludeHydrogen) {
     236    atomids_t ExcludedHydrogens = gatherPresentExcludedHydrogens(atoms, set, treatment);
     237    FullMolecule.insert(ExcludedHydrogens.begin(), ExcludedHydrogens.end());
     238  }
     239
     240  // go through all cut bonds and replace with a hydrogen
     241  if (saturation == DoSaturate) {
     242    for (CutBonds_t::const_iterator atomiter = CutBonds.begin();
     243        atomiter != CutBonds.end(); ++atomiter) {
     244      atom * const Walker = atomiter->first;
     245      LOG(4, "DEBUG: We are now saturating dangling bonds of " << *Walker);
     246
     247      // gather set of positions for this atom from global map
     248      GlobalSaturationPositions_t::const_iterator mapiter =
     249          _globalsaturationpositions.find(Walker->getId());
     250      ASSERT( mapiter != _globalsaturationpositions.end(),
     251          "SaturatedFragment::saturate() - no global information for "
     252          +toString(*Walker));
     253      const SaturationsPositionsPerNeighbor_t &saturationpositions =
     254          mapiter->second;
     255
     256      // go through all cut bonds for this atom
     257      for (BondList::const_iterator bonditer = atomiter->second.begin();
     258          bonditer != atomiter->second.end(); ++bonditer) {
     259        atom * const OtherWalker = (*bonditer)->GetOtherAtom(Walker);
     260
     261        // get positions from global map
     262        SaturationsPositionsPerNeighbor_t::const_iterator positionsiter =
     263            saturationpositions.find(OtherWalker->getId());
     264        ASSERT(positionsiter != saturationpositions.end(),
     265            "SaturatedFragment::saturate() - no information on bond neighbor "
     266            +toString(*OtherWalker)+" to atom "+toString(*Walker));
     267        ASSERT(!positionsiter->second.empty(),
     268            "SaturatedFragment::saturate() - no positions for saturating bond to"
     269            +toString(*OtherWalker)+" to atom "+toString(*Walker));
     270
     271        // get typical bond distance from elements database
     272        double BondDistance = Walker->getType()->getHBondDistance(positionsiter->second.size()-1);
     273        if (BondDistance < 0.) {
     274          ELOG(2, "saturateAtoms() - no typical hydrogen bond distance of degree "
     275              +toString(positionsiter->second.size())+" for element "
     276              +toString(Walker->getType()->getName()));
     277          // try bond degree 1 distance
     278          BondDistance = Walker->getType()->getHBondDistance(1-1);
     279          if (BondDistance < 0.) {
     280            ELOG(1, "saturateAtoms() - no typical hydrogen bond distance for element "
     281                +toString(Walker->getType()->getName()));
     282            BondDistance = 1.;
     283          }
     284        }
     285        ASSERT( BondDistance > 0.,
     286            "SaturatedFragment::saturate() - negative bond distance");
     287
     288        // place hydrogen at each point
     289        LOG(4, "DEBUG: Places to saturate for atom " << *OtherWalker
     290            << " are " << positionsiter->second);
     291        atom * const father = Walker;
     292        for (SaturationsPositions_t::const_iterator positer = positionsiter->second.begin();
     293            positer != positionsiter->second.end(); ++positer) {
     294          const atom& hydrogen =
     295              setHydrogenReplacement(Walker, *positer, BondDistance, father);
     296          FullMolecule.insert(hydrogen.getId());
     297        }
     298      }
     299    }
     300  } else
     301    LOG(3, "INFO: We are not saturating cut bonds.");
     302}
     303
     304const atom& SaturatedFragment::setHydrogenReplacement(
     305  const atom * const _OwnerAtom,
     306  const Vector &_position,
     307  const double _distance,
     308  atom * const _father)
     309{
     310  atom * const _atom = hydrogens.leaseHydrogen();    // new atom
     311  _atom->setPosition( _OwnerAtom->getPosition() + _distance * _position );
     312  // always set as fixed ion (not moving during molecular dynamics simulation)
     313  _atom->setFixedIon(true);
     314  // if we replace hydrogen, we mark it as our father, otherwise we are just an added hydrogen with no father
     315  _atom->father = _father;
     316  SaturationHydrogens.insert(_atom->getId());
     317
     318  return *_atom;
    170319}
    171320
  • src/Fragmentation/Exporters/SaturatedFragment.hpp

    rbdd5a8 r98a293b  
    2323#include "Fragmentation/HydrogenSaturation_enum.hpp"
    2424#include "Parser/FormatParserStorage.hpp"
     25
     26#include "LinearAlgebra/Vector.hpp"
    2527
    2628class atom;
     
    4345  typedef std::set<KeySet> KeySetsInUse_t;
    4446
     47  //!> List of points giving saturation positions for a single bond neighbor
     48  typedef std::list<Vector> SaturationsPositions_t;
     49  //!> map for one atom, containing the saturation points for all its neighbors
     50  typedef std::map<int, SaturationsPositions_t> SaturationsPositionsPerNeighbor_t;
     51  //!> containing the saturation points over all desired atoms required
     52  typedef std::map<int, SaturationsPositionsPerNeighbor_t> GlobalSaturationPositions_t;
     53
    4554  /** Constructor of SaturatedFragment requires \a set which we are tightly
    4655   * associated.
     
    4958   * \param _container container to add KeySet as in-use
    5059   * \param _hydrogens pool with hydrogens for saturation
     60   * \param _globalsaturationpositions saturation positions to be used
    5161   */
    5262  SaturatedFragment(
     
    5565      HydrogenPool &_hydrogens,
    5666      const enum HydrogenTreatment _treatment,
    57       const enum HydrogenSaturation saturation);
     67      const enum HydrogenSaturation saturation,
     68      const GlobalSaturationPositions_t &_globalsaturationpositions);
    5869
    5970  /** Destructor of class SaturatedFragment.
     
    101112  /** Helper function to lease and bring in place saturation hydrogens.
    102113   *
     114   * Here, we use local information to calculate saturation positions.
     115   *
    103116   */
    104117  void saturate();
     118
     119  /** Helper function to lease and bring in place saturation hydrogens.
     120   *
     121   * Here, saturation positions have to be calculated before and are fully
     122   * stored in \a _globalsaturationpositions.
     123   *
     124   * \param_globalsaturationpositions
     125   */
     126  void saturate(const GlobalSaturationPositions_t &_globalsaturationpositions);
    105127
    106128  /** Replaces all cut bonds with respect to the given atom by hydrogens.
     
    118140   */
    119141  atom * const getHydrogenReplacement(atom * const replacement);
     142
     143  /** Sets a saturation hydrogen at the given position in place of \a _father.
     144   *
     145   * \param _OwnerAtom atom "owning" the hydrogen (i.e. the one getting saturated)
     146   * \param _position new position relative to \a _OwnerAtom
     147   * \param _distance scale factor to the distance (default 1.)
     148   * \param _father bond partner of \a _OwnerAtom that is replaced
     149   */
     150  const atom& setHydrogenReplacement(
     151      const atom * const _OwnerAtom,
     152      const Vector &_position,
     153      const double _distance,
     154      atom * const _father);
    120155
    121156  /** Leases and adds a Hydrogen atom in replacement for the given atom \a *partner in bond with a *origin.
  • src/Fragmentation/Exporters/unittests/SaturatedFragmentUnitTest.cpp

    rbdd5a8 r98a293b  
    6969  ASSERT_DO(Assert::Throw);
    7070
     71  SaturatedFragment::GlobalSaturationPositions_t globalpositions;
    7172  set = new KeySet;
    72   fragment = new SaturatedFragment(*set, KeySetsInUse, hydrogens, ExcludeHydrogen, DoSaturate);
     73  fragment = new SaturatedFragment(
     74      *set,
     75      KeySetsInUse,
     76      hydrogens,
     77      ExcludeHydrogen,
     78      DoSaturate,
     79      globalpositions);
    7380}
    7481
  • src/Fragmentation/Summation/Converter/DataConverter.hpp

    rbdd5a8 r98a293b  
    113113    MPQCDataForceMap_t instance;
    114114    // must convert int to index_t
     115    if (DoLog(5)) {
     116      std::stringstream output;
     117      for (KeySetsContainer::IntVector::const_iterator outiter = arrayiter->begin();
     118          outiter != arrayiter->end(); ++outiter) {
     119        output << *outiter << "\t";
     120      }
     121      LOG(5, "DEBUG: indices are " << output.str());
     122    }
    115123    IndexedVectors::indices_t indices(arrayiter->begin(), arrayiter->end());
    116124    boost::fusion::at_key<MPQCDataFused::forces>(instance) =
Note: See TracChangeset for help on using the changeset viewer.