Ignore:
Timestamp:
Oct 17, 2013, 7:24:25 AM (11 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:
16893f
Parents:
47cee7
git-author:
Frederik Heber <heber@…> (09/28/13 09:35:15)
git-committer:
Frederik Heber <heber@…> (10/17/13 07:24:25)
Message:

Summed up results are now handed-over to FragmentationResultContainer by AnalyseFragmentationResultsAction.

  • we do not use fusion::maps here but write out real maps with IndexSet::ptr to MPQCData (but we fill in only energy_t.total so far).
  • TESTFIX: index was not written and tab/newline-hiccup in .._IndexedEnergy.dat
Location:
src/Fragmentation/Summation
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Summation/Containers/FragmentationResultContainer.cpp

    r47cee7 rc8d13f5  
    9696}
    9797
     98void FragmentationResultContainer::addShortRangeSummedResults(
     99    const FragmentationShortRangeResults::summedshortrange_t &_summedshortrange
     100    )
     101{
     102  OBSERVE;
     103  summedshortrange.insert(_summedshortrange.begin(), _summedshortrange.end());
     104}
     105
    98106#ifdef HAVE_VMG
    99107const FragmentationResultContainer::longrangedata_t&
  • src/Fragmentation/Summation/Containers/FragmentationResultContainer.hpp

    r47cee7 rc8d13f5  
    2929
    3030#include "Fragmentation/KeySetsContainer.hpp"
     31#include "Fragmentation/Summation/IndexSet.hpp"
     32#include "Fragmentation/Summation/Containers/FragmentationShortRangeResults.hpp"
    3133#include "Fragmentation/Summation/Containers/MPQCData.hpp"
     34#include "Fragmentation/Summation/Containers/MPQCDataMap.hpp"
    3235#ifdef HAVE_VMG
    3336#include "Fragmentation/Summation/Containers/VMGData.hpp"
     
    9497      );
    9598
     99  /** Adds a a set of summed short range results.
     100   *
     101   * Adds all the containers to the ones present in this instance.
     102   *
     103   * \param _summedshortrange energy results per index set
     104   */
     105  void addShortRangeSummedResults(
     106      const FragmentationShortRangeResults::summedshortrange_t &_summedshortrange
     107      );
     108
    96109  /** Adds given cycles to internal keyset list.
    97110   *
     
    111124    forcekeysets.clear();
    112125    shortrangedata.clear();
     126    summedshortrange.clear();
    113127#ifdef HAVE_VMG
    114128    longrangedata.clear();
     
    121135  const KeySetsContainer &getForceKeySets() const  { return forcekeysets; }
    122136  const shortrangedata_t& getShortRangeResults() const  { return shortrangedata; }
     137  const FragmentationShortRangeResults::summedshortrange_t& getShortRangeSummedResults() const  { return summedshortrange; }
    123138#ifdef HAVE_VMG
    124139  const longrangedata_t& getLongRangeResults() const;
     
    141156  //! container of all cycle keysets
    142157  KeySetsContainer cycles;
     158  //!> container for summed up results per index set
     159  FragmentationShortRangeResults::summedshortrange_t summedshortrange;
    143160
    144161#ifdef HAVE_VMG
     
    158175    if (version > 0)
    159176      ar & cycles;
     177    if (version > 1)
     178      ar & summedshortrange;
    160179#ifdef HAVE_VMG
    161180    ar & longrangedata;
     
    165184
    166185// version for serialized information associated to FragmentationResultContainer
    167 BOOST_CLASS_VERSION(FragmentationResultContainer, 1)
     186BOOST_CLASS_VERSION(FragmentationResultContainer, 2)
    168187
    169188#endif /* FRAGMENTATIONRESULTCONTAINER_HPP_ */
  • src/Fragmentation/Summation/Containers/FragmentationShortRangeResults.cpp

    r47cee7 rc8d13f5  
    3939#include "FragmentationShortRangeResults.hpp"
    4040
     41#include <boost/fusion/container/map.hpp>
    4142#include <boost/mpl/for_each.hpp>
    4243#include <boost/mpl/remove.hpp>
     
    117118  }
    118119}
     120
     121const FragmentationShortRangeResults::summedshortrange_t
     122FragmentationShortRangeResults::getSummedShortRangeResults() const
     123{
     124  summedshortrange_t results;
     125  typedef std::map<IndexSet::ptr, std::pair<MPQCDataEnergyMap_t,MPQCDataEnergyMap_t> > maptype_t;
     126  for (typename maptype_t::const_iterator resultiter = Result_perIndexSet_Energy.begin();
     127      resultiter != Result_perIndexSet_Energy.end(); ++resultiter) {
     128    MPQCData values;
     129    values.energies.total = boost::fusion::at_key<MPQCDataFused::energy_total>(resultiter->second.first);
     130    MPQCData contributions;
     131    contributions.energies.total = boost::fusion::at_key<MPQCDataFused::energy_total>(resultiter->second.second);
     132    results.insert( std::make_pair( resultiter->first, std::make_pair(values, contributions) ) );
     133  }
     134  return results;
     135}
  • src/Fragmentation/Summation/Containers/FragmentationShortRangeResults.hpp

    r47cee7 rc8d13f5  
    7979  }
    8080
     81  typedef std::map<IndexSet::ptr, std::pair<MPQCData,MPQCData> > summedshortrange_t;
     82  const summedshortrange_t getSummedShortRangeResults() const;
     83
    8184private:
    8285  void initLookups(
  • src/Fragmentation/Summation/IndexSet.hpp

    r47cee7 rc8d13f5  
    1313#include <config.h>
    1414#endif
     15
     16#include <boost/serialization/access.hpp>
     17#include <boost/serialization/base_object.hpp>
     18#include <boost/serialization/set.hpp>
     19#include <boost/serialization/shared_ptr.hpp>
    1520
    1621#include <boost/shared_ptr.hpp>
     
    4752
    4853private:
     54  friend class boost::serialization::access;
     55  // serialization
     56  template <typename Archive>
     57  void serialize(Archive& ar, const unsigned int version)
     58  {
     59    ar & boost::serialization::base_object< std::set<Index_t> >(*this);
     60  }
    4961};
    5062
     
    7183std::ostream & operator<<(std::ostream &ost, const IndexSet &indexset);
    7284
     85BOOST_SERIALIZATION_SHARED_PTR(IndexSet)
     86
    7387#endif /* INDEXSET_HPP_ */
  • src/Fragmentation/Summation/writeIndexedTable.hpp

    r47cee7 rc8d13f5  
    4242
    4343    /// create header line for energy
    44     resultstream << "level\tkeyset";
     44    resultstream << "index\tlevel\tkeyset";
    4545    {
    4646      HeaderPrinter header("_value");
    4747      boost::mpl::for_each<VectorType>(boost::ref(header));
    48       resultstream << header.get() << std::endl;
     48      resultstream << header.get();
    4949    }
    5050    {
    5151      HeaderPrinter header("_contribution");
    5252      boost::mpl::for_each<VectorType>(boost::ref(header));
    53       resultstream << header.get() << std::endl;
     53      resultstream << header.get();
    5454    }
     55    resultstream << std::endl;
    5556
    5657    /// print values per line
     
    5859      ASSERT( results.size() >= (MaxLevel-StartLevel),
    5960          "writeIndexedTable<M,V>() - results has insufficient size.");
     61      size_t index = 0;
    6062      for (typename maptype_t::const_iterator resultiter = results.begin();
    61           resultiter != results.end(); ++resultiter) {
    62         resultstream << resultiter->first->size() << "\t" << "{";
     63          resultiter != results.end(); ++resultiter, ++index) {
     64        resultstream << index << "\t" << resultiter->first->size() << "\t" << "{";
    6365        for (IndexSet::const_iterator keyiter = resultiter->first->begin();
    6466            keyiter != resultiter->first->end(); ++keyiter)
Note: See TracChangeset for help on using the changeset viewer.