Changeset 035c0d


Ignore:
Timestamp:
Feb 27, 2013, 12:43:29 PM (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:
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)
Message:

Removed typedef charges_t from FunctionModel, using SerializationPotential's instead.

Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/FunctionApproximation/FunctionModel.hpp

    rda2d5c r035c0d  
    4545  //!> typedef for a function containing how to extract required information from a Fragment.
    4646  typedef boost::function< arguments_t (const Fragment &, const size_t)> extractor_t;
    47   //!> typedef for a vector of particle tyoes
    48   typedef std::vector< double > charges_t;
    4947  //!> typedef for the magic triple function that gets the other two distances for a given argument
    5048  typedef boost::function< std::vector<arguments_t>(const argument_t &, const double)> triplefunction_t;
  • src/LevMartester.cpp

    rda2d5c r035c0d  
    4545#include <boost/foreach.hpp>
    4646#include <boost/function.hpp>
     47#include <boost/lambda/lambda.hpp>
    4748#include <boost/program_options.hpp>
    4849
     
    8384HomologyGraph getFirstGraphwithSpecifiedElements(
    8485    const HomologyContainer &homologies,
    85     const FunctionModel::charges_t &charges)
     86    const SerializablePotential::ParticleTypes_t &types)
    8687{
    87   ASSERT( !charges.empty(),
     88  ASSERT( !types.empty(),
    8889      "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);
    8995  // convert into count map
    9096  Extractors::elementcounts_t counts_per_charge =
     
    187193  std::cout << "Hello to the World from LevMar!" << std::endl;
    188194
     195//  setVerbosity(4);
     196
    189197  // load homology file
    190198  po::options_description desc("Allowed options");
     
    193201      ("homology-file", po::value< boost::filesystem::path >(), "homology file to parse")
    194202      ("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")
    197205  ;
    198206
     
    226234
    227235  // charges
    228   FunctionModel::charges_t charges;
     236  SerializablePotential::ParticleTypes_t charges;
    229237  if (vm.count("charges")) {
    230     charges = vm["charges"].as< FunctionModel::charges_t >();
     238    charges = vm["charges"].as< SerializablePotential::ParticleTypes_t >();
    231239  } else {
    232240    ELOG(0, "Vector of charges specifying the potential (charges) was not set.");
     
    235243
    236244  // fragment
    237   FunctionModel::charges_t fragment;
     245  SerializablePotential::ParticleTypes_t fragment;
    238246  if (vm.count("fragment")) {
    239     fragment = vm["fragment"].as< FunctionModel::charges_t >();
     247    fragment = vm["fragment"].as< SerializablePotential::ParticleTypes_t >();
    240248  } else {
    241249    ELOG(0, "Vector of charges specifying the fragment (charges) was not set.");
  • src/Potentials/PotentialFactory.cpp

    rda2d5c r035c0d  
    7171FunctionModel *PotentialFactory::createInstance(
    7272    const std::string &potentialtype,
    73     const FunctionModel::charges_t &charges) const
     73    const SerializablePotential::ParticleTypes_t &types) const
    7474{
    7575  ASSERT (NameToType.count(potentialtype),
    7676      "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);
    8077  switch (NameToType[potentialtype]) {
    8178  case tersoff:
  • src/Potentials/PotentialFactory.hpp

    rda2d5c r035c0d  
    1919
    2020#include "FunctionApproximation/FunctionModel.hpp"
     21#include "Potentials/SerializablePotential.hpp"
    2122
    2223/** Class that creates instances of potentials.
     
    3839  FunctionModel *createInstance(
    3940      const std::string &potentialtype,
    40       const FunctionModel::charges_t &charges) const;
     41      const SerializablePotential::ParticleTypes_t &charges) const;
    4142
    4243  //!> enumeration of all known and createable potentials
  • src/Potentials/Specifics/SaturationPotential.cpp

    rda2d5c r035c0d  
    422422    // only that saturation potential never has its middle element twice!
    423423    // 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;
    426426    returnfunction =
    427427//        boost::bind(&Extractors::reorderArgumentsByParticleTypes,
Note: See TracChangeset for help on using the changeset viewer.