Changeset 0f5d38 for src/Potentials/CompoundPotential.cpp
- Timestamp:
- Aug 9, 2013, 2:20:35 PM (11 years ago)
- 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:
- 51e0e3
- Parents:
- f0025d
- git-author:
- Frederik Heber <heber@…> (06/25/13 10:54:50)
- git-committer:
- Frederik Heber <heber@…> (08/09/13 14:20:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Potentials/CompoundPotential.cpp
rf0025d r0f5d38 53 53 #include "FunctionApproximation/Extractors.hpp" 54 54 #include "Potentials/EmpiricalPotential.hpp" 55 #include "Potentials/helpers.hpp" 55 56 #include "Potentials/PotentialRegistry.hpp" 56 57 … … 433 434 { 434 435 // create initial returnfunction 435 particletypes_per_model_t::const_iterator typesiter = particletypes_per_model.begin();436 Fragment::charges_t charges;437 {438 charges.resize((*typesiter).size());439 std::transform((*typesiter).begin(), (*typesiter).end(),440 charges.begin(), boost::lambda::_1);441 }442 436 FunctionModel::extractor_t returnfunction = 443 boost::bind(&Extractors::gatherAllDistancesFromFragment, 444 boost::bind(&Fragment::getPositions, _1), 445 boost::bind(&Fragment::getCharges, _1), 446 charges, // no crefs here as are temporaries! 447 _2); 437 boost::bind(&Helpers::returnEmptyArguments); 448 438 449 439 // every following fragments combines its arguments with the initial function 450 for (; typesiter != particletypes_per_model.end(); ++typesiter) { 440 for (particletypes_per_model_t::const_iterator typesiter = particletypes_per_model.begin(); 441 typesiter != particletypes_per_model.end(); ++typesiter) { 451 442 Fragment::charges_t charges; 452 443 { … … 468 459 return returnfunction; 469 460 } 461 462 FunctionModel::filter_t CompoundPotential::getSpecificFilter() const 463 { 464 // we must concatenate all filtered arguments here 465 // create initial returnfunction 466 FunctionModel::filter_t returnfunction = 467 boost::bind(&Helpers::returnEmptyArguments); 468 469 // every following fragments combines its arguments with the initial function 470 for (models_t::const_iterator modeliter = models.begin(); 471 modeliter != models.end(); ++modeliter) { 472 returnfunction = 473 boost::bind(&Extractors::concatenateArguments, 474 boost::bind(returnfunction, _1), 475 boost::bind((*modeliter)->getSpecificFilter(), _1) 476 ); 477 } 478 return returnfunction; 479 } 480 481 size_t CompoundPotential::getSpecificArgumentCount() const 482 { 483 std::vector<size_t> argument_counts(models.size(), 0); 484 std::transform(models.begin(), models.end(), argument_counts.begin(), 485 boost::bind(&FunctionModel::getSpecificArgumentCount, _1)); 486 return std::accumulate(argument_counts.begin(), argument_counts.end(), 0, 487 std::plus<size_t>()); 488 } 489
Note:
See TracChangeset
for help on using the changeset viewer.