Changeset 0cd8cf for src


Ignore:
Timestamp:
Apr 15, 2013, 10:30:31 AM (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:
7b0494
Parents:
503acc1
git-author:
Frederik Heber <heber@…> (03/07/13 20:53:50)
git-committer:
Frederik Heber <heber@…> (04/15/13 10:30:31)
Message:

Split FragmentationResults into ..ShortRange.. and ..LongRange...

Location:
src
Files:
2 added
2 edited
2 moved

Legend:

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

    r503acc1 r0cd8cf  
    5858#include "Fragmentation/Automation/FragmentationChargeDensity.hpp"
    5959#include "Fragmentation/Automation/FragmentJobQueue.hpp"
    60 #include "Fragmentation/Automation/FragmentationResults.hpp"
     60#include "Fragmentation/Automation/FragmentationLongRangeResults.hpp"
     61#include "Fragmentation/Automation/FragmentationShortRangeResults.hpp"
    6162#include "Fragmentation/Automation/MPQCFragmentController.hpp"
    6263#include "Fragmentation/Automation/VMGDebugGridFragmentController.hpp"
     
    112113}
    113114
    114 /** Helper function to get number of atoms somehow.
    115  *
    116  * Here, we just parse the number of lines in the adjacency file as
    117  * it should correspond to the number of atoms, except when some atoms
    118  * are not bonded, but then fragmentation makes no sense.
    119  *
    120  * @param path path to the adjacency file
    121  */
    122 size_t getNoAtomsFromAdjacencyFile(const std::string &path)
    123 {
    124   size_t NoAtoms = 0;
    125 
    126   // parse in special file to get atom count (from line count)
    127   std::string filename(path);
    128   filename += FRAGMENTPREFIX;
    129   filename += ADJACENCYFILE;
    130   std::ifstream adjacency(filename.c_str());
    131   if (adjacency.fail()) {
    132     LOG(0, endl << "getNoAtomsFromAdjacencyFile() - Unable to open " << filename << ", is the directory correct?");
    133     return false;
    134   }
    135   std::string buffer;
    136   while (getline(adjacency, buffer))
    137     NoAtoms++;
    138   LOG(1, "INFO: There are " << NoAtoms << " atoms.");
    139 
    140   return NoAtoms;
    141 }
    142 
    143 
    144 
    145 /** Place results from FragmentResult into EnergyMatrix and ForceMatrix.
    146  *
    147  * @param fragmentData MPQCData resulting from the jobs
    148  * @param MatrixNrLookup Lookup up-map from job id to fragment number
    149  * @param FragmentCounter total number of fragments
    150  * @param NoAtoms total number of atoms
    151  * @param Energy energy matrix to be filled on return
    152  * @param Force force matrix to be filled on return
    153  * @return true - everything ok, false - else
    154  */
    155 bool putResultsintoMatrices(
    156     const std::map<JobId_t, MPQCData> &fragmentData,
    157     const std::map< JobId_t, size_t > &MatrixNrLookup,
    158     const size_t FragmentCounter,
    159     const size_t NoAtoms,
    160     EnergyMatrix &Energy,
    161     ForceMatrix &Force)
    162 {
    163   for (std::map<JobId_t, MPQCData>::const_iterator dataiter = fragmentData.begin();
    164       dataiter != fragmentData.end(); ++dataiter) {
    165     const MPQCData &extractedData = dataiter->second;
    166     const JobId_t &jobid = dataiter->first;
    167     std::map< JobId_t, size_t >::const_iterator nriter = MatrixNrLookup.find(jobid);
    168     ASSERT( nriter != MatrixNrLookup.end(),
    169         "putResultsintoMatrices() - MatrixNrLookup does not contain id "
    170         +toString(jobid)+".");
    171     // place results into EnergyMatrix ...
    172     {
    173       MatrixContainer::MatrixArray matrix;
    174       matrix.resize(1);
    175       matrix[0].resize(1, extractedData.energies.total);
    176       if (!Energy.AddMatrix(
    177           std::string("MPQCJob ")+toString(jobid),
    178           matrix,
    179           nriter->second)) {
    180         ELOG(1, "Adding energy matrix failed.");
    181         return false;
    182       }
    183     }
    184     // ... and ForceMatrix (with two empty columns in front)
    185     {
    186       MatrixContainer::MatrixArray matrix;
    187       const size_t rows = extractedData.forces.size();
    188       matrix.resize(rows);
    189       for (size_t i=0;i<rows;++i) {
    190         const size_t columns = 2+extractedData.forces[i].size();
    191         matrix[i].resize(columns, 0.);
    192   //      for (size_t j=0;j<2;++j)
    193   //        matrix[i][j] = 0.;
    194         for (size_t j=2;j<columns;++j)
    195           matrix[i][j] = extractedData.forces[i][j-2];
    196       }
    197       if (!Force.AddMatrix(
    198           std::string("MPQCJob ")+toString(jobid),
    199           matrix,
    200           nriter->second)) {
    201         ELOG(1, "Adding force matrix failed.");
    202         return false;
    203       }
    204     }
    205   }
    206   // add one more matrix (not required for energy)
    207   MatrixContainer::MatrixArray matrix;
    208   matrix.resize(1);
    209   matrix[0].resize(1, 0.);
    210   if (!Energy.AddMatrix(std::string("MPQCJob total"), matrix, FragmentCounter))
    211     return false;
    212   // but for energy because we need to know total number of atoms
    213   matrix.resize(NoAtoms);
    214   for (size_t i = 0; i< NoAtoms; ++i)
    215     matrix[i].resize(2+NDIM, 0.);
    216   if (!Force.AddMatrix(std::string("MPQCJob total"), matrix, FragmentCounter))
    217     return false;
    218 
    219   return true;
    220 }
    221 
    222 /** Print MPQCData from received results.
    223  *
    224  * @param fragmentData MPQCData resulting from the jobs, associated to job id
    225  * @param MatrixNrLookup map with enumerated jobids
    226  * @param KeySet KeySets of all (non-hydrogen) atoms
    227  * @param ForceKeySet KeySets of all atoms except those added by saturation
    228  * @param NoAtoms total number of atoms
    229  */
    230 bool printReceivedMPQCResults(
    231     const std::map<JobId_t, MPQCData> &fragmentData,
    232     const std::map< JobId_t, size_t > MatrixNrLookup,
    233     KeySetsContainer KeySet,
    234     const KeySetsContainer &ForceKeySet,
    235     size_t NoAtoms)
    236 {
    237   size_t FragmentCounter = MatrixNrLookup.size();
    238 
    239   // place results into maps
    240   EnergyMatrix Energy;
    241   ForceMatrix Force;
    242   if (!putResultsintoMatrices(fragmentData, MatrixNrLookup, FragmentCounter, NoAtoms, Energy, Force))
    243     return false;
    244 
    245   if (!Energy.InitialiseIndices()) return false;
    246 
    247   if (!Force.ParseIndices(ForceKeySet)) return false;
    248 
    249   // combine all found data
    250   if (!KeySet.ParseManyBodyTerms()) return false;
    251 
    252   EnergyMatrix EnergyFragments;
    253   ForceMatrix ForceFragments;
    254   if (!EnergyFragments.AllocateMatrix(Energy.Header, Energy.MatrixCounter, Energy.RowCounter, Energy.ColumnCounter)) return false;
    255   if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return false;
    256 
    257   if(!Energy.SetLastMatrix(0., 0)) return false;
    258   if(!Force.SetLastMatrix(0., 2)) return false;
    259 
    260   for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) {
    261     // --------- sum up energy --------------------
    262     LOG(1, "INFO: Summing energy of order " << BondOrder+1 << " ...");
    263     if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return false;
    264     if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return false;
    265 
    266     // --------- sum up Forces --------------------
    267     LOG(1, "INFO: Summing forces of order " << BondOrder+1 << " ...");
    268     if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return false;
    269     if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return false;
    270   }
    271 
    272   // for debugging print resulting energy and forces
    273   LOG(1, "INFO: Resulting energy is " << Energy.Matrix[ FragmentCounter ][0][0]);
    274   std::stringstream output;
    275   for (int i=0; i< Force.RowCounter[FragmentCounter]; ++i) {
    276     for (int j=0; j< Force.ColumnCounter[FragmentCounter]; ++j)
    277       output << Force.Matrix[ FragmentCounter ][i][j] << " ";
    278     output << "\n";
    279   }
    280   LOG(1, "INFO: Resulting forces are " << std::endl << output.str());
    281 
    282   return true;
    283 }
    284 
    285 /** Print MPQCData from received results.
    286  *
    287  * @param fragmentData MPQCData resulting from the jobs, associated to job id
    288  * @param KeySetFilename filename with keysets to associate forces correctly
    289  * @param NoAtoms total number of atoms
    290  */
    291 bool printReceivedMPQCResults(
    292     const std::map<JobId_t, MPQCData> &fragmentData,
    293     const std::string &KeySetFilename,
    294     size_t NoAtoms)
    295 {
    296   // create a vector of all job ids
    297   std::vector<JobId_t> jobids;
    298   std::transform(fragmentData.begin(),fragmentData.end(),
    299       std::back_inserter(jobids),
    300       boost::bind( &std::map<JobId_t,MPQCData>::value_type::first, boost::lambda::_1 )
    301   );
    302 
    303   // create lookup from job nr to fragment number
    304   size_t FragmentCounter = 0;
    305   const std::map< JobId_t, size_t > MatrixNrLookup =
    306       createMatrixNrLookup(jobids, FragmentCounter);
    307 
    308   // initialise keysets
    309   KeySetsContainer KeySet;
    310   parseKeySetFile(KeySet, KeySetFilename, FragmentCounter, NonHydrogenKeySets);
    311   KeySetsContainer ForceKeySet;
    312   parseKeySetFile(ForceKeySet, KeySetFilename, FragmentCounter, HydrogenKeySets);
    313 
    314   return printReceivedMPQCResults(
    315       fragmentData,
    316       MatrixNrLookup,
    317       KeySet,
    318       ForceKeySet,
    319       NoAtoms);
    320 }
    321 
    322 /** Print MPQCData from received results.
    323  *
    324  * @param fragmentData MPQCData resulting from the jobs, associated to job id
    325  * @param KeySet KeySets of all (non-hydrogen) atoms
    326  * @param ForceKeySet KeySets of all atoms except those added by saturation
    327  * @param NoAtoms total number of atoms
    328  */
    329 bool printReceivedMPQCResults(
    330     const std::map<JobId_t, MPQCData> &fragmentData,
    331     const KeySetsContainer &KeySet,
    332     const KeySetsContainer &ForceKeySet,
    333     size_t NoAtoms)
    334 {
    335   // create a vector of all job ids
    336   std::vector<JobId_t> jobids;
    337   std::transform(fragmentData.begin(),fragmentData.end(),
    338       std::back_inserter(jobids),
    339       boost::bind( &std::map<JobId_t,MPQCData>::value_type::first, boost::lambda::_1 )
    340   );
    341 
    342   // create lookup from job nr to fragment number
    343   size_t FragmentCounter = 0;
    344   const std::map< JobId_t, size_t > MatrixNrLookup =
    345       createMatrixNrLookup(jobids, FragmentCounter);
    346 
    347   return printReceivedMPQCResults(
    348       fragmentData,
    349       MatrixNrLookup,
    350       KeySet,
    351       ForceKeySet,
    352       NoAtoms);
    353 }
    354 
    355115void writeToFile(const std::string &filename, const std::string contents)
    356116{
     
    360120}
    361121
    362 /** Print MPQCData from received results.
     122/** Print (short range) energy, forces, and timings from received results.
    363123 *
    364124 * @param results summed up results container
    365125 */
    366 void printReceivedFullResults(
    367     const FragmentationResults &results)
     126void printReceivedShortResults(
     127    const FragmentationShortRangeResults &results)
    368128{
    369129  // print tables (without eigenvalues, they go extra)
     
    378138    filename += FRAGMENTPREFIX + std::string("_Energy.dat");
    379139    writeToFile(filename, energyresult);
    380   }
    381 
    382   if (results.Result_LongRange_fused.size() >= (results.getMaxLevel()-2))
    383   {
    384     const std::string gridresult =
    385         writeTable<VMGDataMap_t, VMGDataVector_t >()(
    386             results.Result_LongRange_fused, results.getMaxLevel(), 2);
    387     LOG(0, "VMG table is \n" << gridresult);
    388     std::string filename;
    389     filename += FRAGMENTPREFIX + std::string("_VMGEnergy.dat");
    390     writeToFile(filename, gridresult);
    391   }
    392 
    393   if (results.Result_LongRangeIntegrated_fused.size() >= (results.getMaxLevel()-2))
    394   {
    395     const std::string gridresult =
    396         writeTable<VMGDataLongRangeMap_t, VMGDataLongRangeVector_t >()(
    397             results.Result_LongRangeIntegrated_fused, results.getMaxLevel(), 2);
    398     LOG(0, "LongRange table is \n" << gridresult);
    399     std::string filename;
    400     filename += FRAGMENTPREFIX + std::string("_LongRangeEnergy.dat");
    401     writeToFile(filename, gridresult);
    402140  }
    403141
     
    436174}
    437175
     176
     177/** Print long range energy from received results.
     178 *
     179 * @param results summed up results container
     180 */
     181void printReceivedFullResults(
     182    const FragmentationLongRangeResults &results)
     183{
     184  // print tables (without eigenvalues, they go extra)
     185
     186  if (results.Result_LongRange_fused.size() >= (results.getMaxLevel()-2))
     187  {
     188    const std::string gridresult =
     189        writeTable<VMGDataMap_t, VMGDataVector_t >()(
     190            results.Result_LongRange_fused, results.getMaxLevel(), 2);
     191    LOG(0, "VMG table is \n" << gridresult);
     192    std::string filename;
     193    filename += FRAGMENTPREFIX + std::string("_VMGEnergy.dat");
     194    writeToFile(filename, gridresult);
     195  }
     196
     197  if (results.Result_LongRangeIntegrated_fused.size() >= (results.getMaxLevel()-2))
     198  {
     199    const std::string gridresult =
     200        writeTable<VMGDataLongRangeMap_t, VMGDataLongRangeVector_t >()(
     201            results.Result_LongRangeIntegrated_fused, results.getMaxLevel(), 2);
     202    LOG(0, "LongRange table is \n" << gridresult);
     203    std::string filename;
     204    filename += FRAGMENTPREFIX + std::string("_LongRangeEnergy.dat");
     205    writeToFile(filename, gridresult);
     206  }
     207}
     208
    438209bool appendToHomologyFile(
    439210    const boost::filesystem::path &homology_file,
    440     const FragmentationResults &results)
     211    const FragmentationShortRangeResults &shortrangeresults,
     212    const FragmentationLongRangeResults &longrangeresults
     213    )
    441214{
    442215  /// read homology container (if present)
     
    458231  /// append all fragments to a HomologyContainer
    459232  HomologyContainer::container_t values;
    460   const size_t FragmentCounter = results.Result_perIndexSet_Energy.size();
     233  const size_t FragmentCounter = shortrangeresults.Result_perIndexSet_Energy.size();
    461234
    462235  // convert KeySetContainer to IndexSetContainer
    463   IndexSetContainer::ptr ForceContainer(new IndexSetContainer(results.getForceKeySet()));
    464   const IndexSetContainer::Container_t &Indices = results.getContainer();
     236  IndexSetContainer::ptr ForceContainer(new IndexSetContainer(shortrangeresults.getForceKeySet()));
     237  const IndexSetContainer::Container_t &Indices = shortrangeresults.getContainer();
    465238  const IndexSetContainer::Container_t &ForceIndices = ForceContainer->getContainer();
    466239  IndexSetContainer::Container_t::const_iterator iter = Indices.begin();
     
    478251    // obtain fragment as key
    479252    std::map<IndexSet::ptr, std::pair< MPQCDataFragmentMap_t, MPQCDataFragmentMap_t> >::const_iterator fragmentiter
    480         = results.Result_perIndexSet_Fragment.find(index);
    481     ASSERT( fragmentiter != results.Result_perIndexSet_Fragment.end(),
     253        = longrangeresults.Result_perIndexSet_Fragment.find(index);
     254    ASSERT( fragmentiter != longrangeresults.Result_perIndexSet_Fragment.end(),
    482255        "appendToHomologyFile() - cannot find index "+toString(*index)
    483256        +" in FragmentResults.");
     
    486259    // obtain energy as value
    487260    std::map<IndexSet::ptr, std::pair< MPQCDataEnergyMap_t, MPQCDataEnergyMap_t> >::const_iterator energyiter
    488         = results.Result_perIndexSet_Energy.find(index);
    489     ASSERT( energyiter != results.Result_perIndexSet_Energy.end(),
     261        = shortrangeresults.Result_perIndexSet_Energy.find(index);
     262    ASSERT( energyiter != shortrangeresults.Result_perIndexSet_Energy.end(),
    490263        "appendToHomologyFile() - cannot find index "+toString(*index)
    491264        +" in FragmentResults.");
     
    557330  }
    558331
     332  FragmentationShortRangeResults shortrangeresults(
     333      fragmentData,
     334      FragmentJobQueue::getInstance().getKeySets(),
     335      FragmentJobQueue::getInstance().getFullKeySets());
     336  shortrangeresults(fragmentData);
     337  printReceivedShortResults(shortrangeresults);
     338
    559339#ifdef HAVE_VMG
    560340  if (params.DoLongrange.get()) {
     
    613393
    614394  // Final phase: sum up and print result
    615   FragmentationResults results(
     395  FragmentationLongRangeResults longrangeresults(
    616396      fragmentData,
    617397      longrangeData,
    618398      FragmentJobQueue::getInstance().getKeySets(),
    619399      FragmentJobQueue::getInstance().getFullKeySets());
    620   results(
     400  longrangeresults(
    621401      fragmentData,
    622402      longrangeData,
    623403      fullsolutionData,
    624404      full_sample);
    625   printReceivedFullResults(results);
     405  printReceivedFullResults(longrangeresults);
    626406
    627407  // append all keysets to homology file
     
    630410    if (homology_file.string() != "") {
    631411      LOG(1, "INFO: Appending HomologyGraphs to file " << homology_file.string() << ".");
    632       if (!appendToHomologyFile(homology_file, results))
     412      if (!appendToHomologyFile(homology_file, shortrangeresults, longrangeresults))
    633413        Exitflag = 1;
    634414    }
     
    651431  }
    652432  }
    653 #else
    654   // Final phase: print result
    655   {
    656     LOG(1, "INFO: Parsing fragment files from " << params.path.get() << ".");
    657     printReceivedMPQCResults(
    658         fragmentData,
    659         FragmentJobQueue::getInstance().getKeySets(),
    660         FragmentJobQueue::getInstance().getFullKeySets(),
    661         World::getInstance().getAllAtoms().size()));
    662   }
    663433#endif
    664434
  • src/Fragmentation/Automation/FragmentationLongRangeResults.cpp

    r503acc1 r0cd8cf  
    2222
    2323/*
    24  * FragmentationResults.cpp
     24 * FragmentationLongRangeResults.cpp
    2525 *
    2626 *  Created on: Aug 31, 2012
     
    3636#include "CodePatterns/MemDebug.hpp"
    3737
    38 #include "FragmentationResults.hpp"
     38#include "FragmentationLongRangeResults.hpp"
    3939
    4040#include <boost/mpl/for_each.hpp>
     
    5858#include "Helpers/defs.hpp"
    5959
    60 FragmentationResults::FragmentationResults(
     60FragmentationLongRangeResults::FragmentationLongRangeResults(
    6161    const std::map<JobId_t,MPQCData> &fragmentData,
    6262    std::map<JobId_t,VMGData> &longrangeData,
     
    8383}
    8484
    85 void FragmentationResults::operator()(
     85void FragmentationLongRangeResults::operator()(
    8686    const std::map<JobId_t,MPQCData> &fragmentData,
    8787    std::map<JobId_t,VMGData> &longrangeData,
     
    9494  {
    9595    ASSERT( ForceKeySet.KeySets.size() == fragmentData.size(),
    96         "FragmentationResults::FragmentationResults() - ForceKeySet's KeySets and fragmentData differ in size.");
     96        "FragmentationLongRangeResults::FragmentationLongRangeResults() - ForceKeySet's KeySets and fragmentData differ in size.");
    9797
    98     typedef boost::mpl::remove<MPQCDataEnergyVector_t, MPQCDataFused::energy_eigenvalues>::type MPQCDataEnergyVector_noeigenvalues_t;
    99     OrthogonalSumUpPerLevel<MPQCDataEnergyMap_t, MPQCData, MPQCDataEnergyVector_t>(
    100         fragmentData, MPQCMatrixNrLookup, container, subsetmap,
    101         Result_Energy_fused, Result_perIndexSet_Energy);
    10298    OrthogonalSumUpPerLevel<MPQCDataGridMap_t, MPQCData, MPQCDataGridVector_t>(
    10399        fragmentData, MPQCMatrixNrLookup, container, subsetmap,
    104100        Result_Grid_fused, Result_perIndexSet_Grid);
    105     SumUpPerLevel<MPQCDataTimeMap_t, MPQCData, MPQCDataTimeVector_t>(
    106         fragmentData, MPQCMatrixNrLookup, container, subsetmap,
    107         Result_Time_fused, Result_perIndexSet_Time);
    108101    OrthogonalSumUpPerLevel<MPQCDataFragmentMap_t, MPQCData, MPQCDataFragmentVector_t>(
    109102        fragmentData, MPQCMatrixNrLookup, container, subsetmap,
     
    120113        longrangeData, VMGMatrixNrLookup, container, subsetmap,
    121114        Result_LongRange_fused, Result_perIndexSet_LongRange);
    122 
    123     // force has extra data converter
    124     std::map<JobId_t, MPQCDataForceMap_t> MPQCData_Force_fused;
    125     convertMPQCDatatoForceMap(fragmentData, ForceKeySet, MPQCData_Force_fused);
    126     Result_Force_fused.resize(MaxLevel); // we need the results of correct size already
    127     AllLevelOrthogonalSummator<MPQCDataForceMap_t> forceSummer(
    128                 subsetmap,
    129                 MPQCData_Force_fused,
    130                 container->getContainer(),
    131                 MPQCMatrixNrLookup,
    132                 Result_Force_fused,
    133                 Result_perIndexSet_Force);
    134     boost::mpl::for_each<MPQCDataForceVector_t>(boost::ref(forceSummer));
    135115
    136116    Result_LongRangeIntegrated_fused.reserve(MaxLevel);
  • src/Fragmentation/Automation/FragmentationLongRangeResults.hpp

    r503acc1 r0cd8cf  
    11/*
    2  * FragmentationResults.hpp
     2 * FragmentationLongRangeResults.hpp
    33 *
    44 *  Created on: Aug 31, 2012
     
    66 */
    77
    8 #ifndef FRAGMENTATIONRESULTS_HPP_
    9 #define FRAGMENTATIONRESULTS_HPP_
     8#ifndef FRAGMENTATIONLONGRANGERESULTS_HPP_
     9#define FRAGMENTATIONLONGRANGERESULTS_HPP_
    1010
    1111
     
    3131#include "Jobs/Grid/SamplingGrid.hpp"
    3232
    33 /** FragmentationResults contains the summed up results per level resulting
     33/** FragmentationLongRangeResults contains the summed up results per level resulting
    3434 * from the fragmentation of the molecular system and clever combination of
    3535 * fragmentary energies, forces, timings, and so on.
     
    3939 *
    4040 */
    41 struct FragmentationResults
     41struct FragmentationLongRangeResults
    4242{
    43   /** Constructor for class FragmentationResults, based on KeySets.
     43  /** Constructor for class FragmentationLongRangeResults, based on KeySets.
    4444   *
    4545   * @param fragmentData results from short-range fragment calculations
     
    4848   * @param _ForceKeySet KeySets of all atoms except those added by saturation
    4949   */
    50   FragmentationResults(
     50  FragmentationLongRangeResults(
    5151      const std::map<JobId_t,MPQCData> &fragmentData,
    5252      std::map<JobId_t,VMGData> &longrangeData,
     
    9292
    9393public:
    94   //!> results per level of summed up energy
    95   std::vector<MPQCDataEnergyMap_t> Result_Energy_fused;
    9694  //!> results per level of summed up sampled grid charge
    9795  std::vector<MPQCDataGridMap_t> Result_Grid_fused;
    98   //!> results per level of summed up times
    99   std::vector<MPQCDataTimeMap_t> Result_Time_fused;
    10096  //!> results per level of summed up fragment positions and charges
    10197  std::vector<MPQCDataFragmentMap_t> Result_Fragment_fused;
    102   //!> results per level of summed up forces
    103   std::vector<MPQCDataForceMap_t> Result_Force_fused;
    10498  //!> results per level of summed up long range potential grids and energy
    10599  std::vector<VMGDataMap_t> Result_LongRange_fused;
     
    107101  std::vector<VMGDataLongRangeMap_t> Result_LongRangeIntegrated_fused;
    108102
    109   //!> results per IndexSet of summed up energy
    110   std::map<IndexSet::ptr, std::pair<MPQCDataEnergyMap_t,MPQCDataEnergyMap_t> > Result_perIndexSet_Energy;
    111103  //!> results per IndexSet of summed up sampled grid charge
    112104  std::map<IndexSet::ptr, std::pair<MPQCDataGridMap_t,MPQCDataGridMap_t> > Result_perIndexSet_Grid;
    113   //!> results per IndexSet of summed up times
    114   std::map<IndexSet::ptr, std::pair<MPQCDataTimeMap_t,MPQCDataTimeMap_t> > Result_perIndexSet_Time;
    115105  //!> results per IndexSet of summed up fragment positions and charges
    116106  std::map<IndexSet::ptr, std::pair<MPQCDataFragmentMap_t,MPQCDataFragmentMap_t> > Result_perIndexSet_Fragment;
    117   //!> results per IndexSet of summed up forces
    118   std::map<IndexSet::ptr, std::pair<MPQCDataForceMap_t, MPQCDataForceMap_t> > Result_perIndexSet_Force;
    119107  //!> results per IndexSet of summed up long range potential grids and energy
    120108  std::map<IndexSet::ptr, std::pair<VMGDataMap_t, VMGDataMap_t> > Result_perIndexSet_LongRange;
     
    128116
    129117
    130 #endif /* FRAGMENTATIONRESULTS_HPP_ */
     118#endif /* FRAGMENTATIONLONGRANGERESULTS_HPP_ */
  • src/Fragmentation/Automation/Makefile.am

    r503acc1 r0cd8cf  
    55        Fragmentation/Automation/createMatrixNrLookup.cpp \
    66        Fragmentation/Automation/FragmentationChargeDensity.cpp \
    7         Fragmentation/Automation/FragmentationResults.cpp \
     7        Fragmentation/Automation/FragmentationLongRangeResults.cpp \
     8        Fragmentation/Automation/FragmentationShortRangeResults.cpp \
    89        Fragmentation/Automation/FragmentJobQueue.cpp \
    910        Fragmentation/Automation/MPQCFragmentController.cpp \
     
    2122        Fragmentation/Automation/extractJobIds.hpp \
    2223        Fragmentation/Automation/FragmentationChargeDensity.hpp \
    23         Fragmentation/Automation/FragmentationResults.hpp \
     24        Fragmentation/Automation/FragmentationLongRangeResults.hpp \
     25        Fragmentation/Automation/FragmentationShortRangeResults.hpp \
    2426        Fragmentation/Automation/FragmentJobQueue.hpp \
    2527        Fragmentation/Automation/MPQCFragmentController.hpp \
Note: See TracChangeset for help on using the changeset viewer.