Ignore:
Timestamp:
Nov 21, 2012, 10:03:24 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:
f3bc5f
Parents:
c74fdb
git-author:
Frederik Heber <heber@…> (08/08/12 13:36:24)
git-committer:
Frederik Heber <heber@…> (11/21/12 10:03:24)
Message:

Added Fragment to MPQCData fusion maps and is used in FragmentationAutomationAction.

  • new helpers Fragment::getPositions() and ::getCharges().
  • SumUpChargeDensity() now also sums up a full Fragment.
  • the Fragment is used by createLongRangeJobs to extract required posittions and charges from.
File:
1 edited

Legend:

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

    rc74fdb r184943  
    5252#include "Fragmentation/ForceMatrix.hpp"
    5353#include "Fragmentation/Fragmentation.hpp"
     54#include "Fragmentation/SetValues/Fragment.hpp"
    5455#include "Fragmentation/SetValues/Histogram.hpp"
    5556#include "Fragmentation/SetValues/IndexedVectors.hpp"
     
    378379
    379380template <>
     381void convertMPQCDataTo<MPQCDataFragmentMap_t>(
     382    const std::vector<MPQCData> &fragmentData,
     383    std::vector<MPQCDataFragmentMap_t> &MPQCData_Fragment_fused)
     384{
     385  // fragment
     386  MPQCData_Fragment_fused.clear();
     387  MPQCData_Fragment_fused.reserve(fragmentData.size());
     388  for(std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
     389      dataiter != fragmentData.end(); ++dataiter) {
     390    const MPQCData &extractedData = *dataiter;
     391    LOG(2, "DEBUG: Current extracted Data is " << extractedData << ".");
     392    MPQCDataFragmentMap_t instance;
     393    boost::fusion::at_key<MPQCDataFused::fragment>(instance) =
     394        Fragment(extractedData.positions, extractedData.charges);
     395    MPQCData_Fragment_fused.push_back(instance);
     396  }
     397}
     398
     399template <>
    380400void convertMPQCDataTo<MPQCDataTimeMap_t>(
    381401    const std::vector<MPQCData> &fragmentData,
     
    429449 * @param KeySetFilename filename with keysets to associate forces correctly
    430450 * @param NoAtoms total number of atoms
    431  * @param full_sample summed up charge from fragments on return
     451 * @param full_sample summed up charge density of electrons from fragments on return
     452 * @param full_fragment summed up positions and charges of nuclei from fragments on return
    432453 */
    433454bool sumUpChargeDensity(
     
    435456    const std::vector<MPQCData> &fragmentData,
    436457    const std::string &KeySetFilename,
    437     SamplingGrid &full_sample)
     458    SamplingGrid &full_sample,
     459    Fragment &full_fragment)
    438460{
    439461  // create lookup from job nr to fragment number
     
    468490    SumUpPerLevel<MPQCDataGridMap_t, MPQCDataGridVector_t>(
    469491        fragmentData, jobids, MatrixNrLookup, container, subsetmap));
     492  std::vector<MPQCDataFragmentMap_t> Result_Fragment_fused(
     493    SumUpPerLevel<MPQCDataFragmentMap_t, MPQCDataFragmentVector_t>(
     494        fragmentData, jobids, MatrixNrLookup, container, subsetmap));
    470495  // obtain full grid
    471496  full_sample = boost::fusion::at_key<MPQCDataFused::sampled_grid>(Result_Grid_fused.back());
     497  full_fragment = boost::fusion::at_key<MPQCDataFused::fragment>(Result_Fragment_fused.back());
    472498
    473499  return true;
     
    673699    const FragmentationFragmentationAutomationAction::FragmentationFragmentationAutomationParameters &params,
    674700    const std::vector<MPQCData> &fragmentData,
    675     const SamplingGrid &full_sampled_grid)
     701    const SamplingGrid &full_sampled_grid,
     702    const Fragment &full_fragment)
    676703{
    677704  std::vector<FragmentJob::ptr> jobs;
     
    696723//    ASSERT( M.determinant() == size*size*size,
    697724//        "createLongRangeJobs() - current domain matrix "+toString(M)+" is not cubic.");
    698     const std::vector< std::vector<double> > positions;
    699     const std::vector<double> charges;
     725    const std::vector< std::vector<double> > positions(full_fragment.getPositions());
     726    const std::vector<double> charges(full_fragment.getCharges());
    700727    const JobId_t next_id = controller.getAvailableId();
    701728    LOG(1, "INFO: Creating full VMGJob with " << full_sampled_grid.sampled_grid.size()
     
    766793  LOG(1, "INFO: Parsing fragment files from " << params.path.get() << ".");
    767794  SamplingGrid full_sample;
     795  Fragment full_fragment;
    768796  sumUpChargeDensity(
    769797      MPQCresults,
    770798      fragmentData,
    771799      params.path.get(),
    772       full_sample);
     800      full_sample,
     801      full_fragment);
    773802
    774803  // Phase Four: obtain more ids
     
    777806
    778807  // Phase Five: create VMGJobs
    779   if (!createLongRangeJobs(controller, params, fragmentData, full_sample))
     808  if (!createLongRangeJobs(controller, params, fragmentData, full_sample, full_fragment))
    780809    return Action::failure;
    781810  RunService(io_service, "Adding VMGJobs");
Note: See TracChangeset for help on using the changeset viewer.