Ignore:
Timestamp:
Feb 2, 2016, 5:50:29 PM (9 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:
9ae11c
Parents:
d1831e (diff), 62d092 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'Enhancing_Interdistance' into Candidate_v1.5.1

File:
1 edited

Legend:

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

    rd1831e r3690e4  
    7272#include "Fragmentation/Summation/SetValues/Eigenvalues.hpp"
    7373#include "Fragmentation/Summation/SetValues/Fragment.hpp"
     74#include "Fragmentation/Summation/SetValues/FragmentForces.hpp"
    7475#include "Fragmentation/Summation/SetValues/Histogram.hpp"
    7576#include "Fragmentation/Summation/SetValues/IndexedVectors.hpp"
     
    240241    const FragmentationLongRangeResults &results)
    241242{
    242   // print tables (without eigenvalues, they go extra)
     243  // print tables per keyset(without grids, they go extra)
    243244
    244245  {
     
    252253  }
    253254
     255  if (results.hasLongRangeForces()) {
     256    const std::string forceresult =
     257        writeTable<VMGDataForceMap_t, VMGDataForceVector_t>()(
     258            results.Result_ForceLongRange_fused, results.getMaxLevel());
     259    LOG(2, "DEBUG: Force table is \n" << forceresult);
     260    std::string filename;
     261    filename += FRAGMENTPREFIX + std::string("_VMGForces.dat");
     262    writeToFile(filename, forceresult);
     263  }
     264
    254265  {
    255266    const std::string gridresult =
     
    260271    filename += FRAGMENTPREFIX + std::string("_LongRangeEnergy.dat");
    261272    writeToFile(filename, gridresult);
     273  }
     274
     275  if (results.hasLongRangeForces()) {
     276    const std::string forceresult =
     277        writeTable<VMGDataLongRangeForceMap_t, VMGDataLongRangeForceVector_t >()(
     278            results.Result_ForcesLongRangeIntegrated_fused, results.getMaxLevel(), 1);
     279    LOG(2, "DEBUG: ForcesLongRange table is \n" << forceresult);
     280    std::string filename;
     281    filename += FRAGMENTPREFIX + std::string("_LongRangeForces.dat");
     282    writeToFile(filename, forceresult);
    262283  }
    263284}
     
    325346
    326347      // obtain potential distribution
    327       std::map<IndexSet::ptr, std::pair< VMGDataMap_t, VMGDataMap_t> >::const_iterator potentialiter
    328           = longrangeresults.Result_perIndexSet_LongRange.find(index);
    329       ASSERT( potentialiter != longrangeresults.Result_perIndexSet_LongRange.end(),
     348      std::map<IndexSet::ptr, std::pair< VMGDataGridMap_t, VMGDataGridMap_t> >::const_iterator potentialiter
     349          = longrangeresults.Result_perIndexSet_LongRange_Grid.find(index);
     350      ASSERT( potentialiter != longrangeresults.Result_perIndexSet_LongRange_Grid.end(),
    330351          "appendToHomologyFile() - cannot find index "+toString(*index)
    331352          +" in FragmentResults.");
    332353      // add e+n potentials
    333       value.potential_distribution = boost::fusion::at_key<VMGDataFused::both_sampled_potential>(potentialiter->second.second); // contributions
     354      value.potential_distribution =
     355          boost::fusion::at_key<VMGDataFused::both_sampled_potential>(potentialiter->second.second); // contributions
    334356//      // and re-average to zero (integral is times volume_element which we don't need here)
    335357//      const double sum =
     
    625647  if (DoLongrange) {
    626648    if ( const_cast<const World &>(World::getInstance()).getAllAtoms().size() == 0) {
    627       STATUS("Please load the full molecule intostd::map<JobId_t, VMGData> longrangeData the world before starting this action.");
     649      STATUS("Please load the full molecule into std::map<JobId_t, VMGData> longrangeData the world before starting this action.");
    628650      return Action::failure;
    629651    }
     
    635657    // remove full solution corresponding to full_sample from map (must be highest ids), has to be treated extra
    636658    std::map<JobId_t, VMGData>::iterator iter = longrangeData.end();
    637     for (size_t i=0;i<full_sample.size();++i)
    638       --iter;
     659    std::advance(iter, -full_sample.size());
    639660    std::map<JobId_t, VMGData>::iterator remove_iter = iter;
    640661    std::vector<VMGData> fullsolutionData;
    641662    for (; iter != longrangeData.end(); ++iter)
    642663      fullsolutionData.push_back(iter->second);
    643     longrangeData.erase(remove_iter, longrangeData.end());
     664    if (longrangeData.size() > 1) // when there's just a single fragment, it corresponds to full solution
     665      longrangeData.erase(remove_iter, longrangeData.end());
    644666
    645667    // Final phase: sum up and print result
Note: See TracChangeset for help on using the changeset viewer.