Ignore:
Timestamp:
Oct 14, 2013, 11:42:04 PM (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:
955051
Parents:
7d507c
git-author:
Frederik Heber <heber@…> (09/26/13 16:17:59)
git-committer:
Frederik Heber <heber@…> (10/14/13 23:42:04)
Message:

createMatrixNrLookup now requires a ValueMask.

Location:
src/Fragmentation/Summation/Containers
Files:
6 edited

Legend:

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

    r7d507c re0ae58d  
    6969  // create lookup from job nr to fragment number
    7070  size_t FragmentCounter = 0;
     71  std::vector<bool> ValueMask(fragmentData.size(), true);
    7172  const std::map< JobId_t, size_t > MatrixNrLookup =
    72       createMatrixNrLookup(jobids, FragmentCounter);
     73      createMatrixNrLookup(jobids, FragmentCounter, ValueMask);
    7374
    7475  /// prepare for OrthogonalSummation
  • src/Fragmentation/Summation/Containers/FragmentationLongRangeResults.cpp

    r7d507c re0ae58d  
    8181{
    8282  // create lookup from job nr to fragment number
    83   size_t MPQCFragmentCounter = 0;
    84   const std::vector<JobId_t> mpqcjobids = extractJobIds<MPQCData>(fragmentData);
    85   MPQCMatrixNrLookup =
    86       createMatrixNrLookup(mpqcjobids, MPQCFragmentCounter);
    87 
    88   size_t VMGFragmentCounter = 0;
    89   const std::vector<JobId_t> vmgjobids = extractJobIds<VMGData>(longrangeData);
    90   VMGMatrixNrLookup =
    91       createMatrixNrLookup(vmgjobids, VMGFragmentCounter);
     83  {
     84    size_t MPQCFragmentCounter = 0;
     85    std::vector<bool> ValueMask(fragmentData.size(), true);
     86    const std::vector<JobId_t> mpqcjobids = extractJobIds<MPQCData>(fragmentData);
     87    MPQCMatrixNrLookup =
     88        createMatrixNrLookup(mpqcjobids, MPQCFragmentCounter, ValueMask);
     89  }
     90
     91  {
     92    size_t VMGFragmentCounter = 0;
     93    std::vector<bool> ValueMask(longrangeData.size(), true);
     94    const std::vector<JobId_t> vmgjobids = extractJobIds<VMGData>(longrangeData);
     95    VMGMatrixNrLookup =
     96        createMatrixNrLookup(vmgjobids, VMGFragmentCounter, ValueMask);
     97  }
    9298}
    9399
  • src/Fragmentation/Summation/Containers/FragmentationShortRangeResults.cpp

    r7d507c re0ae58d  
    6262    const std::map<JobId_t,MPQCData> &fragmentData,
    6363    const KeySetsContainer& _KeySet,
    64     const KeySetsContainer& _ForceKeySet) :
     64    const KeySetsContainer& _ForceKeySet,
     65    std::vector<bool> &_ValueMask) :
    6566    KeySet(_KeySet),
    6667    ForceKeySet(_ForceKeySet)
    6768{
    68   initLookups(fragmentData);
     69  initLookups(fragmentData,_ValueMask);
    6970
    7071  // convert KeySetContainer to IndexSetContainer
     
    7576
    7677void FragmentationShortRangeResults::initLookups(
    77     const std::map<JobId_t,MPQCData> &fragmentData)
     78    const std::map<JobId_t,MPQCData> &fragmentData,
     79    std::vector<bool> &_ValueMask)
    7880{
    7981  // create lookup from job nr to fragment number
     
    8183  const std::vector<JobId_t> mpqcjobids = extractJobIds<MPQCData>(fragmentData);
    8284  MPQCMatrixNrLookup =
    83       createMatrixNrLookup(mpqcjobids, MPQCFragmentCounter);
     85      createMatrixNrLookup(mpqcjobids, MPQCFragmentCounter, _ValueMask);
    8486}
    8587
  • src/Fragmentation/Summation/Containers/FragmentationShortRangeResults.hpp

    r7d507c re0ae58d  
    4747   * @param _KeySet KeySets of all (non-hydrogen) atoms
    4848   * @param _ForceKeySet KeySets of all atoms except those added by saturation
     49   * @param _ValueMask masks whether to use a value (true) or not (false),
     50   *        default is true for all values
    4951   */
    5052  FragmentationShortRangeResults(
    5153      const std::map<JobId_t,MPQCData> &fragmentData,
    5254      const KeySetsContainer& _KeySet,
    53       const KeySetsContainer& _ForceKeySet);
     55      const KeySetsContainer& _ForceKeySet,
     56      std::vector<bool> &_ValueMask);
    5457
    5558  /** Performs the summation and fills all result vectors.
     
    7881private:
    7982  void initLookups(
    80       const std::map<JobId_t,MPQCData> &fragmentData);
     83      const std::map<JobId_t,MPQCData> &fragmentData,
     84      std::vector<bool> &_ValueMask);
    8185
    8286private:
  • src/Fragmentation/Summation/Containers/createMatrixNrLookup.cpp

    r7d507c re0ae58d  
    4545std::map< JobId_t, size_t > createMatrixNrLookup(
    4646    const std::vector<JobId_t> &jobids,
    47     size_t &FragmentCounter)
     47    size_t &FragmentCounter,
     48    std::vector<bool> &ValueMask)
    4849{
    4950  // align fragments
    5051  std::map< JobId_t, size_t > MatrixNrLookup;
    5152  FragmentCounter = 0;
     53  ASSERT( ValueMask.size() == jobids.size(),
     54      "createMatrixNrLookup() - jobids and ValueMask differ in size");
     55  std::vector<bool>::const_iterator maskiter = ValueMask.begin();
    5256  for (std::vector<JobId_t>::const_iterator iter = jobids.begin();
    53       iter != jobids.end(); ++iter) {
     57      iter != jobids.end(); ++iter, ++maskiter) {
    5458    LOG(3, "DEBUG: Inserting (" << *iter << "," << FragmentCounter << ").");
    5559#ifndef NDEBUG
    5660    std::pair< std::map< JobId_t, size_t >::iterator, bool> inserter =
    5761#endif
    58         MatrixNrLookup.insert( std::make_pair(*iter, FragmentCounter++) );
     62        // we either set to FragmentCounter or to -1 which is always outside
     63        // of range and hence skipped by (Orthogonal)Summator.
     64        MatrixNrLookup.insert(
     65            std::make_pair(
     66                *iter,
     67                (*maskiter ? FragmentCounter : (size_t)-1)
     68            )
     69        );
    5970    ASSERT( inserter.second,
    6071        "createMatrixNrLookup() - two results have same id "
    6172        +toString(*iter)+".");
     73    ++FragmentCounter;  // in any case needs to be increased to skip the result
    6274  }
    6375  LOG(1, "INFO: There are " << FragmentCounter << " fragments.");
  • src/Fragmentation/Summation/Containers/createMatrixNrLookup.hpp

    r7d507c re0ae58d  
    3232std::map< JobId_t, size_t > createMatrixNrLookup(
    3333    const std::vector<JobId_t> &jobids,
    34     size_t &FragmentCounter);
     34    size_t &FragmentCounter,
     35    std::vector<bool> &ValueMask);
    3536
    3637#endif /* CREATEMATRIXNRLOOKUP_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.