Changeset 035c0d
- Timestamp:
- Feb 27, 2013, 12:43:29 PM (12 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:
- 64bdfd
- Parents:
- da2d5c
- git-author:
- Frederik Heber <heber@…> (12/19/12 12:41:52)
- git-committer:
- Frederik Heber <heber@…> (02/27/13 12:43:29)
- Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/FunctionApproximation/FunctionModel.hpp
rda2d5c r035c0d 45 45 //!> typedef for a function containing how to extract required information from a Fragment. 46 46 typedef boost::function< arguments_t (const Fragment &, const size_t)> extractor_t; 47 //!> typedef for a vector of particle tyoes48 typedef std::vector< double > charges_t;49 47 //!> typedef for the magic triple function that gets the other two distances for a given argument 50 48 typedef boost::function< std::vector<arguments_t>(const argument_t &, const double)> triplefunction_t; -
src/LevMartester.cpp
rda2d5c r035c0d 45 45 #include <boost/foreach.hpp> 46 46 #include <boost/function.hpp> 47 #include <boost/lambda/lambda.hpp> 47 48 #include <boost/program_options.hpp> 48 49 … … 83 84 HomologyGraph getFirstGraphwithSpecifiedElements( 84 85 const HomologyContainer &homologies, 85 const FunctionModel::charges_t &charges)86 const SerializablePotential::ParticleTypes_t &types) 86 87 { 87 ASSERT( ! charges.empty(),88 ASSERT( !types.empty(), 88 89 "getFirstGraphwithSpecifiedElements() - charges is empty?"); 90 // create charges 91 Fragment::charges_t charges; 92 charges.resize(types.size()); 93 std::transform(types.begin(), types.end(), 94 charges.begin(), boost::lambda::_1); 89 95 // convert into count map 90 96 Extractors::elementcounts_t counts_per_charge = … … 187 193 std::cout << "Hello to the World from LevMar!" << std::endl; 188 194 195 // setVerbosity(4); 196 189 197 // load homology file 190 198 po::options_description desc("Allowed options"); … … 193 201 ("homology-file", po::value< boost::filesystem::path >(), "homology file to parse") 194 202 ("fit-potential", po::value< std::string >(), "potential type to fit") 195 ("charges", po::value< FunctionModel::charges_t >()->multitoken(), "charges specifying the potential")196 ("fragment", po::value< FunctionModel::charges_t >()->multitoken(), "all charges in the fragment")203 ("charges", po::value< SerializablePotential::ParticleTypes_t >()->multitoken(), "charges specifying the potential") 204 ("fragment", po::value< SerializablePotential::ParticleTypes_t >()->multitoken(), "all charges in the fragment") 197 205 ; 198 206 … … 226 234 227 235 // charges 228 FunctionModel::charges_t charges;236 SerializablePotential::ParticleTypes_t charges; 229 237 if (vm.count("charges")) { 230 charges = vm["charges"].as< FunctionModel::charges_t >();238 charges = vm["charges"].as< SerializablePotential::ParticleTypes_t >(); 231 239 } else { 232 240 ELOG(0, "Vector of charges specifying the potential (charges) was not set."); … … 235 243 236 244 // fragment 237 FunctionModel::charges_t fragment;245 SerializablePotential::ParticleTypes_t fragment; 238 246 if (vm.count("fragment")) { 239 fragment = vm["fragment"].as< FunctionModel::charges_t >();247 fragment = vm["fragment"].as< SerializablePotential::ParticleTypes_t >(); 240 248 } else { 241 249 ELOG(0, "Vector of charges specifying the fragment (charges) was not set."); -
src/Potentials/PotentialFactory.cpp
rda2d5c r035c0d 71 71 FunctionModel *PotentialFactory::createInstance( 72 72 const std::string &potentialtype, 73 const FunctionModel::charges_t &charges) const73 const SerializablePotential::ParticleTypes_t &types) const 74 74 { 75 75 ASSERT (NameToType.count(potentialtype), 76 76 "PotentialFactory::createInstance() - cannot find potential of name "+potentialtype); 77 SerializablePotential::ParticleTypes_t types;78 types.resize(charges.size());79 std::transform(charges.begin(), charges.end(), types.begin(), boost::lambda::_1);80 77 switch (NameToType[potentialtype]) { 81 78 case tersoff: -
src/Potentials/PotentialFactory.hpp
rda2d5c r035c0d 19 19 20 20 #include "FunctionApproximation/FunctionModel.hpp" 21 #include "Potentials/SerializablePotential.hpp" 21 22 22 23 /** Class that creates instances of potentials. … … 38 39 FunctionModel *createInstance( 39 40 const std::string &potentialtype, 40 const FunctionModel::charges_t &charges) const;41 const SerializablePotential::ParticleTypes_t &charges) const; 41 42 42 43 //!> enumeration of all known and createable potentials -
src/Potentials/Specifics/SaturationPotential.cpp
rda2d5c r035c0d 422 422 // only that saturation potential never has its middle element twice! 423 423 // hence, we skip the firstpair but keep the code for later generalization 424 charges_t secondpair(2, boost::cref(charges[1]));425 const charges_t &thirdpair = charges;424 Fragment::charges_t secondpair(2, boost::cref(charges[1])); 425 const Fragment::charges_t &thirdpair = charges; 426 426 returnfunction = 427 427 // boost::bind(&Extractors::reorderArgumentsByParticleTypes,
Note:
See TracChangeset
for help on using the changeset viewer.