Changeset 9291d04


Ignore:
Timestamp:
Feb 27, 2013, 12:42:36 PM (12 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:
39a07a
Parents:
c7c615
git-author:
Frederik Heber <heber@…> (12/11/12 10:39:30)
git-committer:
Frederik Heber <heber@…> (02/27/13 12:42:36)
Message:

Split saturation with hydrogen of treatment of hydrogen.

Files:
17 edited

Legend:

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

    rc7c615 r9291d04  
    100100  }
    101101
    102   // get whether to saturate or not
    103   const enum HydrogenSaturation saturation =  params.DoSaturation.get() ? DoSaturate : DontSaturate;
    104 
    105102  // parse in Adjacency file
    106103  boost::shared_ptr<AdjacencyList> FileChecker;
     
    143140    LOG(2, "INFO: Fragmenting in molecule " << mol->getName() << " in " << clusters.count(mol)
    144141        << " atoms, out of " << mol->getAtomCount() << ".");
    145     Fragmentation Fragmenter(mol, *FileChecker, saturation);
     142    const enum HydrogenTreatment treatment =  params.HowtoTreatHydrogen.get() ? ExcludeHydrogen : IncludeHydrogen;
     143    Fragmentation Fragmenter(mol, *FileChecker, treatment);
    146144
    147145    // perform fragmentation
     
    167165  // store molecule's fragment to file
    168166  {
     167    const enum HydrogenSaturation saturation =  params.DoSaturation.get() ? DoSaturate : DontSaturate;
    169168    ExportGraph_ToFiles exporter(TotalGraph, saturation);
    170169    exporter.setPrefix(params.prefix.get());
  • src/Actions/FragmentationAction/FragmentationAction.def

    rc7c615 r9291d04  
    2020// ValueStorage by the token "Z" -> first column: int, Z, "Z"
    2121// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
    22 #define paramtypes (std::string)(double)(unsigned int)(bool)(std::vector<std::string>)
    23 #define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")("output-types")
    24 #define paramdescriptions ("prefix of each fragment file")("distance in space")("order of a discretization, dissection, ...")("do saturate dangling bonds with hydrogen")("type(s) of parsers that output fragment config files")
    25 #define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(true)) (PARAM_DEFAULT(std::vector<std::string>(1, std::string("pcp"))))
    26 #define paramreferences (prefix)(distance)(order)(DoSaturation)(types)
     22#define paramtypes (std::string)(double)(unsigned int)(bool)(bool)(std::vector<std::string>)
     23#define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")("ExcludeHydrogen")("output-types")
     24#define paramdescriptions ("prefix of each fragment file")("distance in space")("order of a discretization, dissection, ...")("do saturate dangling bonds with hydrogen")("whether to exclude hydrogen in the bond graph dissection or not")("type(s) of parsers that output fragment config files")
     25#define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(true))(PARAM_DEFAULT(true))(PARAM_DEFAULT(std::vector<std::string>(1, std::string("pcp"))))
     26#define paramreferences (prefix)(distance)(order)(DoSaturation)(HowtoTreatHydrogen)(types)
    2727#define paramvalids \
    2828(DummyValidator< std::string >()) \
    2929(BoxLengthValidator()) \
    3030(DummyValidator< unsigned int >()) \
     31(DummyValidator< bool >()) \
    3132(DummyValidator< bool >()) \
    3233(STLVectorValidator< std::vector<std::string> >(1, 10, ParserTypeValidator()))
  • src/Actions/FragmentationAction/FragmentationAutomationAction.cpp

    rc7c615 r9291d04  
    6565#include "Fragmentation/ForceMatrix.hpp"
    6666#include "Fragmentation/Fragmentation.hpp"
    67 #include "Fragmentation/HydrogenSaturation_enum.hpp"
    6867#include "Fragmentation/Homology/HomologyContainer.hpp"
    6968#include "Fragmentation/Homology/HomologyGraph.hpp"
  • src/Actions/GraphAction/DepthFirstSearchAction.cpp

    rc7c615 r9291d04  
    7171      LocalBackEdgeStack = new std::deque<bond::ptr >; // no need to have it Subgraphs->Leaf->BondCount size
    7272      DFS.PickLocalBackEdges(ListOfAtoms, LocalBackEdgeStack);
    73       CyclicStructureAnalysis CycleAnalysis(params.DoSaturation.get() ? DoSaturate : DontSaturate);
     73      CyclicStructureAnalysis CycleAnalysis(params.HowtoTreatHydrogen.get() ? ExcludeHydrogen : IncludeHydrogen);
    7474      CycleAnalysis(LocalBackEdgeStack);
    7575      delete(LocalBackEdgeStack);
  • src/Actions/GraphAction/DepthFirstSearchAction.def

    rc7c615 r9291d04  
    1515// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
    1616#define paramtypes (bool)
    17 #define paramtokens ("DoSaturate")
     17#define paramtokens ("ExcludeHydrogen")
    1818#define paramdescriptions ("whether to treat hydrogen special or not")
    1919#define paramdefaults (PARAM_DEFAULT(true))
    20 #define paramreferences (DoSaturation)
     20#define paramreferences (HowtoTreatHydrogen)
    2121#define paramvalids \
    2222(DummyValidator< bool >())
  • src/Fragmentation/BondsPerShortestPath.cpp

    rc7c615 r9291d04  
    122122 * \param _RootKeyNr index of root node
    123123 * \param RestrictedKeySet Restricted vertex set to use in context of molecule
    124  * \param saturation this tells whether to treat hydrogen special or not.
    125  */
    126 void BondsPerShortestPath::FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation)
     124 * \param treatment this tells whether to treat hydrogen special or not.
     125 */
     126void BondsPerShortestPath::FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment)
    127127{
    128128  // Actually, we should construct a spanning tree vom the root atom and select all edges therefrom and put them into
     
    173173        if ((RestrictedKeySet.find(OtherWalker->getNr()) != RestrictedKeySet.end())
    174174            // skip hydrogens if desired and restrict to fragment
    175             && ((saturation == DontSaturate) || (OtherWalker->getType()->getAtomicNumber() != 1))) {
     175            && ((treatment == IncludeHydrogen) || (OtherWalker->getType()->getAtomicNumber() != 1))) {
    176176          LOG(2, "Current partner is " << *OtherWalker << " with nr " << OtherWalker->getNr() << " in bond " << *(*Runner) << ".");
    177177          // set the label if not set (and push on root stack as well)
  • src/Fragmentation/BondsPerShortestPath.hpp

    rc7c615 r9291d04  
    3333  void SetSPList(atom *_Root);
    3434  void ResetSPList();
    35   void FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation);
     35  void FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment);
    3636  void OutputSPList();
    3737  int CountNumbersInBondsList();
  • src/Fragmentation/Fragmentation.cpp

    rc7c615 r9291d04  
    6464 * \param _mol molecule for internal use (looking up atoms)
    6565 * \param _FileChecker instance contains adjacency parsed from elsewhere
    66  * \param _saturation whether to treat hydrogen special and saturate dangling bonds or not
    67  */
    68 Fragmentation::Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum HydrogenSaturation _saturation) :
     66 * \param _treatment whether to treat hydrogen special and saturate dangling bonds or not
     67 */
     68Fragmentation::Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum HydrogenTreatment _treatment) :
    6969  mol(_mol),
    70   saturation(_saturation),
     70  treatment(_treatment),
    7171  FileChecker(_FileChecker)
    7272{}
     
    109109
    110110  LOG(0, std::endl);
    111   switch (saturation) {
    112     case DoSaturate:
    113       LOG(0, "I will treat hydrogen special and saturate dangling bonds with it.");
     111  switch (treatment) {
     112    case ExcludeHydrogen:
     113      LOG(0, "I will treat hydrogen special.");
    114114      break;
    115     case DontSaturate:
     115    case IncludeHydrogen:
    116116      LOG(0, "Hydrogen is treated just like the rest of the lot.");
    117117      break;
    118118    default:
    119       ASSERT(0, "Fragmentation::FragmentMolecule() - there is a saturation setting which I have no idea about.");
     119      ASSERT(0, "Fragmentation::FragmentMolecule() - there is a HydrogenTreatment setting which I have no idea about.");
    120120      break;
    121121  }
     
    137137  for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    138138    // remove in hydrogen and we do saturate
    139     if ((saturation == DoSaturate) && ((*iter)->getType()->getAtomicNumber() == 1)) // skip hydrogen
     139    if ((treatment == ExcludeHydrogen) && ((*iter)->getType()->getAtomicNumber() == 1)) // skip hydrogen
    140140      AtomMask.setFalse((*iter)->getNr());
    141141  }
     
    258258
    259259      // Create list of Graphs of current Bond Order (i.e. F_{ij})
    260       NumMoleculesOfOrder[RootNr] = PSG(CompleteMolecule, saturation);
     260      NumMoleculesOfOrder[RootNr] = PSG(CompleteMolecule, treatment);
    261261
    262262      // output resulting number
     
    309309    c = (ListOfBonds.size() > c) ? ListOfBonds.size() : c;
    310310  }
    311   FragmentCount = (saturation == DoSaturate ? mol->getNoNonHydrogen() : mol->getAtomCount()) *(1 << (c*order));
     311  FragmentCount = (treatment == ExcludeHydrogen ? mol->getNoNonHydrogen() : mol->getAtomCount()) *(1 << (c*order));
    312312  LOG(1, "Upper limit for this subgraph is " << FragmentCount << " for "
    313313      << mol->getNoNonHydrogen() << " non-H atoms with maximum bond degree of " << c << ".");
     
    466466    const atom * const Father = (*iter)->GetTrueFather();
    467467    if (AtomMask.isTrue(Father->getNr())) // apply mask
    468       if ((saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) // skip hydrogen
     468      if ((treatment == IncludeHydrogen) || ((*iter)->getType()->getAtomicNumber() != 1)) // skip hydrogen
    469469        RootStack.push_front((*iter)->getNr());
    470470  }
  • src/Fragmentation/Fragmentation.hpp

    rc7c615 r9291d04  
    3434{
    3535public:
    36   Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum HydrogenSaturation _saturation);
     36  Fragmentation(
     37      molecule *_mol,
     38      AdjacencyList &_FileChecker,
     39      const enum HydrogenTreatment _treatment);
    3740  ~Fragmentation();
    3841
     
    6164  //!> pointer to molecule that is fragmented
    6265  molecule *mol;
    63   //!> whether to saturate dangling bonds with hydrogen and hence treat hydrogen special
    64   const enum HydrogenSaturation saturation;
     66  //!> whether to treat hydrogen special
     67  const enum HydrogenTreatment treatment;
    6568  //!> reference to an external adjacency for comparison
    6669  AdjacencyList &FileChecker;
  • src/Fragmentation/HydrogenSaturation_enum.hpp

    rc7c615 r9291d04  
    1919};
    2020
     21enum HydrogenTreatment {
     22  ExcludeHydrogen, //!< exclude hydrogen from the bond graph, i.e. fragmentation treats hydrogen special
     23  IncludeHydrogen,   //!< include hydrogen from the bond graph, i.e. fragmentation treats hydrogen just as the rest
     24};
     25
    2126
    2227#endif /* HYDROGENSATURATION_ENUM_HPP_ */
  • src/Fragmentation/PowerSetGenerator.cpp

    rc7c615 r9291d04  
    191191 * with SP of 2, then those with SP of 3, then those with SP of 4 and so on.
    192192 * \param RestrictedKeySet Restricted vertex set to use in context of molecule
    193  * \param saturation whether to treat hydrogen special or not
     193 * \param treatment whether to treat hydrogen special or not
    194194 * \return number of inserted fragments
    195195 * \note ShortestPathList in FragmentSearch structure is probably due to NumberOfAtomsSPLevel and SP not needed anymore
    196196 */
    197 int PowerSetGenerator::operator()(KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation)
     197int PowerSetGenerator::operator()(KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment)
    198198{
    199199  int Counter = FragmentSearch->FragmentCounter; // mark current value of counter
     
    205205
    206206  // do a BFS search to fill the SP lists and label the found vertices
    207   BondsPerSPList.FillSPListandLabelVertices(FragmentSearch->getRoot()->GetTrueFather()->getNr(), RestrictedKeySet, saturation);
     207  BondsPerSPList.FillSPListandLabelVertices(FragmentSearch->getRoot()->GetTrueFather()->getNr(), RestrictedKeySet, treatment);
    208208
    209209  // outputting all list for debugging
  • src/Fragmentation/PowerSetGenerator.hpp

    rc7c615 r9291d04  
    3030
    3131  void SPFragmentGenerator(int RootDistance, std::vector<bond::ptr > &BondsSet, int SetDimension, int SubOrder);
    32   int operator()(KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation);
     32  int operator()(KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment);
    3333  void RemoveAllTouchedFromSnakeStack(int verbosity, KeySet *FragmentSet, int *&TouchedList, int &TouchedIndex);
    3434  int FillBondsList(std::vector<bond::ptr > &BondsList, std::list<bond::ptr >::const_iterator SetFirst, std::list<bond::ptr >::const_iterator SetLast, int *&TouchedList, int TouchedIndex);
  • src/Graph/CyclicStructureAnalysis.cpp

    rc7c615 r9291d04  
    4646#include "molecule.hpp"
    4747
    48 CyclicStructureAnalysis::CyclicStructureAnalysis(const enum HydrogenSaturation _saturation) :
    49   saturation(_saturation)
     48CyclicStructureAnalysis::CyclicStructureAnalysis(const enum HydrogenTreatment _treatment) :
     49  treatment(_treatment)
    5050{}
    5151
     
    117117      if ((*Runner) != BackEdge) { // only walk along DFS spanning tree (otherwise we always find SP of one being backedge Binder)
    118118        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    119         if ((saturation == DontSaturate) || (OtherAtom->getType()->getAtomicNumber() != 1)) {
     119        if ((treatment == IncludeHydrogen) || (OtherAtom->getType()->getAtomicNumber() != 1)) {
    120120          LOG(2, "INFO: Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl);
    121121          if (ColorList[OtherAtom->getNr()] == GraphEdge::white) {
  • src/Graph/CyclicStructureAnalysis.hpp

    rc7c615 r9291d04  
    2929{
    3030public:
    31   explicit CyclicStructureAnalysis(const enum HydrogenSaturation _saturation);
     31  explicit CyclicStructureAnalysis(const enum HydrogenTreatment _treatment);
    3232  ~CyclicStructureAnalysis();
    3333
     
    6060
    6161  //!> whether to treat hydrogen special or not
    62   const enum HydrogenSaturation saturation;
     62  const enum HydrogenTreatment treatment;
    6363
    6464  bool BackStepping;
  • src/molecule.hpp

    rc7c615 r9291d04  
    268268  void Align(Vector *n);
    269269  void Scale(const double ** const factor);
    270   void DeterminePeriodicCenter(Vector &center, const enum HydrogenSaturation _saturation = DoSaturate);
     270  void DeterminePeriodicCenter(Vector &center, const enum HydrogenTreatment _treatment = ExcludeHydrogen);
    271271  Vector * DetermineCenterOfGravity() const;
    272272  Vector * DetermineCenterOfAll() const;
  • src/molecule_geometry.cpp

    rc7c615 r9291d04  
    371371/** Determines center of molecule (yet not considering atom masses).
    372372 * \param center reference to return vector
    373  * \param saturation whether to treat hydrogen special or not
    374  */
    375 void molecule::DeterminePeriodicCenter(Vector &center, const enum HydrogenSaturation saturation)
     373 * \param treatment whether to treat hydrogen special or not
     374 */
     375void molecule::DeterminePeriodicCenter(Vector &center, const enum HydrogenTreatment treatment)
    376376{
    377377  const RealSpaceMatrix &matrix = World::getInstance().getDomain().getM();
     
    387387    flag = true;
    388388    for (const_iterator iter = begin(); iter != end(); ++iter) {
    389       if ((saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) {
     389      if ((treatment == IncludeHydrogen) || ((*iter)->getType()->getAtomicNumber() != 1)) {
    390390        Testvector = inversematrix * (*iter)->getPosition();
    391391        Translationvector.Zero();
     
    413413        Center += Testvector;
    414414        LOG(1, "vector is: " << Testvector);
    415         if (saturation == DoSaturate) {
     415        if (treatment == ExcludeHydrogen) {
    416416          // now also change all hydrogens
    417417          for (BondList::const_iterator Runner = ListOfBonds.begin();
  • tests/Python/AllActions/options.dat

    rc7c615 r9291d04  
    6666elements        "1 8"
    6767end-step        "1"
     68ExcludeHydrogen "1"
    6869fastparsing     "1"
    6970filename        "test.exttypes"
Note: See TracChangeset for help on using the changeset viewer.