Ignore:
Timestamp:
Nov 12, 2012, 4:04:54 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:
286a967
Parents:
7d92f1
git-author:
Frederik Heber <heber@…> (07/30/12 08:10:24)
git-committer:
Frederik Heber <heber@…> (11/12/12 16:04:54)
Message:

FragmentationAutomationAction now also sums up the forces from each fragment.

File:
1 edited

Legend:

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

    r7d92f1 re13990b  
    5252#include "Fragmentation/Fragmentation.hpp"
    5353#include "Fragmentation/SetValues/Histogram.hpp"
     54#include "Fragmentation/SetValues/IndexedVectors.hpp"
    5455#include "Fragmentation/HydrogenSaturation_enum.hpp"
    5556#include "Fragmentation/KeySet.hpp"
     
    279280  SubsetMap::ptr subsetmap(new SubsetMap(*container));
    280281
     282  /// convert all MPQCData to MPQCDataMap_t
    281283  {
    282     /// convert all MPQCData to MPQCDataMap_t
    283 
    284284    // energy_t
    285285    std::vector<MPQCDataEnergyMap_t> MPQCData_Energy_fused;
     
    303303
    304304    // forces
     305    const IndexSetContainer::Container_t &indices = container->getContainer();
     306    ASSERT( indices.size() == fragmentData.size(),
     307        "FragmentationAutomationAction::performCall() - indices and fragmentData differ in size.");
    305308    std::vector<MPQCDataForceMap_t> MPQCData_Force_fused;
    306309    MPQCData_Force_fused.reserve(fragmentData.size());
    307     for(std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
    308         dataiter != fragmentData.end(); ++dataiter) {
     310    std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
     311    IndexSetContainer::Container_t::const_iterator indexiter = indices.begin();
     312    for(;dataiter != fragmentData.end(); ++dataiter, ++indexiter) {
    309313      const MPQCData &extractedData = *dataiter;
    310314      LOG(2, "DEBUG: Current extracted Data is " << extractedData << ".");
    311315      MPQCDataForceMap_t instance;
    312       boost::fusion::at_key<MPQCDataFused::forces>(instance) = extractedData.forces;
     316      boost::fusion::at_key<MPQCDataFused::forces>(instance) =
     317          IndexedVectors(**indexiter, extractedData.forces);
    313318      MPQCData_Force_fused.push_back(instance);
    314319    }
     
    344349        );
    345350
    346     // TODO: We need to put forces into specific class and implement operators
    347 //    // sum up and print forces
    348 //    boost::mpl::for_each<MPQCDataForceVector_t>(
    349 //        printSum<MPQCDataForceMap_t>(
    350 //            subsetmap,
    351 //            MPQCData_Force_fused,
    352 //            jobids,
    353 //            container->getContainer(),
    354 //            MatrixNrLookup)
    355 //        );
     351    // sum up and print forces
     352    boost::mpl::for_each<MPQCDataForceVector_t>(
     353        printSum<MPQCDataForceMap_t>(
     354            subsetmap,
     355            MPQCData_Force_fused,
     356            jobids,
     357            container->getContainer(),
     358            MatrixNrLookup)
     359        );
    356360
    357361    // TODO: Times should just be summed not orthogonalized
Note: See TracChangeset for help on using the changeset viewer.