Changeset f1eabd


Ignore:
Timestamp:
Oct 19, 2014, 5:08:50 PM (11 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:
0ea063
Parents:
98d166
git-author:
Frederik Heber <heber@…> (09/12/14 07:39:58)
git-committer:
Frederik Heber <heber@…> (10/19/14 17:08:50)
Message:

Extracted ParsePotentialsAction from FitCompoundPotentialAction.

Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • doc/userguide/userguide.xml

    r98d166 rf1eabd  
    21092109            a fragment of order 1, e.g. a single hydrogen atom.</para>
    21102110          </note>
     2111        </section>
     2112
     2113        <section xml:id='potentials.fit-compound-potential'>
     2114          <title xml:id='potentials.fit-compound-potential.title'>Fitting
     2115          many empirical potentials simultaneously</title>
     2116
    21112117
    21122118          <para>Another way is using a file containing a specific set of
     
    21432149          with this file.</para>
    21442150        </section>
     2151
     2152       
     2153        <section xml:id='potentials.parse-potential'>
     2154          <title xml:id='potentials.parse-potential.title'>Parsing an
     2155          empirical potentials file</title>
     2156
     2157          <para>Responsible for the compound potential is every potential
     2158          function whose signature matches with the designated fragment-charges
     2159          and who is currently known to an internal instance called the
     2160          PotentialRegistry.</para>
     2161
     2162          <para>More potentials can be registered (fit-potential will also
     2163          register the potential it fits) by parsing them from a file.</para>
     2164
     2165          <programlisting>
     2166                ... --parse-potentials water.potentials
     2167          </programlisting>
     2168
     2169          <note>Currently, only <productname>TREMOLO</productname> potential
     2170          files are understood and can be parsed.</note>
     2171        </section>
     2172
    21452173
    21462174        <section xml:id='potentials.fit-particle-charges'>
  • src/Actions/GlobalListOfActions.hpp

    r98d166 rf1eabd  
    8383  (PotentialFitParticleCharges) \
    8484  (PotentialParseHomologies) \
     85  (PotentialParsePotentials) \
    8586  (PotentialSaveHomologies) \
    8687  (ParserParseTremoloPotentials) \
  • src/Actions/Makefile.am

    r98d166 rf1eabd  
    351351  Actions/PotentialAction/FitParticleChargesAction.cpp \
    352352  Actions/PotentialAction/ParseHomologiesAction.cpp \
     353  Actions/PotentialAction/ParsePotentialsAction.cpp \
    353354  Actions/PotentialAction/SaveHomologiesAction.cpp
    354355POTENTIALACTIONHEADER = \
    355356  Actions/PotentialAction/FitParticleChargesAction.hpp \
    356357  Actions/PotentialAction/ParseHomologiesAction.hpp \
     358  Actions/PotentialAction/ParsePotentialsAction.hpp \
    357359  Actions/PotentialAction/SaveHomologiesAction.hpp
    358360POTENTIALACTIONDEFS = \
    359361  Actions/PotentialAction/FitParticleChargesAction.def  \
    360362  Actions/PotentialAction/ParseHomologiesAction.def \
     363  Actions/PotentialAction/ParsePotentialsAction.def \
    361364  Actions/PotentialAction/SaveHomologiesAction.def
    362365
  • src/Actions/PotentialAction/FitCompoundPotentialAction.cpp

    r98d166 rf1eabd  
    4949#include "Fragmentation/Homology/HomologyGraph.hpp"
    5050#include "Fragmentation/Summation/SetValues/Fragment.hpp"
    51 #include "Potentials/Exceptions.hpp"
    52 #include "Potentials/PotentialDeserializer.hpp"
    53 #include "Potentials/PotentialFactory.hpp"
    54 #include "Potentials/PotentialRegistry.hpp"
    5551#include "Potentials/PotentialTrainer.hpp"
    5652#include "Potentials/SerializablePotential.hpp"
     
    6561
    6662ActionState::ptr PotentialFitCompoundPotentialAction::performCall() {
    67   // fragment specifies the homology fragment to use
    68   SerializablePotential::ParticleTypes_t fragmentnumbers =
    69       PotentialTrainer::getNumbersFromElements(params.fragment.get());
    70 
    71   // either charges and a potential is specified or a file
    72   if (boost::filesystem::exists(params.potential_file.get())) {
    73     std::ifstream returnstream(params.potential_file.get().string().c_str());
    74     if (returnstream.good()) {
    75       try {
    76         PotentialDeserializer deserialize(returnstream);
    77         deserialize();
    78       } catch (SerializablePotentialMissingValueException &e) {
    79         if (const std::string *key = boost::get_error_info<SerializablePotentialKey>(e))
    80           STATUS("Missing value when parsing information for potential "+*key+".");
    81         else
    82           STATUS("Missing value parsing information for potential with unknown key.");
    83         return Action::failure;
    84       } catch (SerializablePotentialIllegalKeyException &e) {
    85         if (const std::string *key = boost::get_error_info<SerializablePotentialKey>(e))
    86           STATUS("Illegal key parsing information for potential "+*key+".");
    87         else
    88           STATUS("Illegal key parsing information for potential with unknown key.");
    89         return Action::failure;
    90       }
    91     } else {
    92       STATUS("Failed to parse from "+params.potential_file.get().string()+".");
    93       return Action::failure;
    94     }
    95     returnstream.close();
    96 
    97     LOG(0, "STATUS: I'm training now a set of potentials parsed from "
    98         << params.potential_file.get().string() << " on a fragment "
    99         << fragmentnumbers << " on data from World's homologies.");
    100 
    101   } else {
    102       STATUS("No existing potential file given!");
    103       return Action::failure;
    104   }
    105 
    106   // parse homologies into container
     63  // get homologies container
    10764  HomologyContainer &homologies = World::getInstance().getHomologies();
    10865
     
    11875  }
    11976
     77  // fragment specifies the homology fragment to use
     78  SerializablePotential::ParticleTypes_t fragmentnumbers =
     79      PotentialTrainer::getNumbersFromElements(params.fragment.get());
     80
    12081  // then we ought to pick the right HomologyGraph ...
    12182  const HomologyGraph graph =
     
    12990  }
    13091
    131   // training
     92  // next we use the set of homologous fragments for training from the present potentials
    13293  PotentialTrainer trainer;
    13394  const bool status = trainer(
  • src/Actions/PotentialAction/FitCompoundPotentialAction.def

    r98d166 rf1eabd  
    1717#include "Parameters/Validators/STLVectorValidator.hpp"
    1818#include "Parameters/Validators/Specific/ElementValidator.hpp"
    19 #include "Parameters/Validators/Specific/FilePresentValidator.hpp"
    2019#include "Parameters/Validators/Specific/FileSuffixValidator.hpp"
    2120#include "Parameters/Validators/Specific/PotentialTypeValidator.hpp"
     
    3130#define paramvalids \
    3231(DummyValidator<boost::filesystem::path>()) \
    33 (FilePresentValidator() && FileSuffixValidator("potentials")) \
     32(FileSuffixValidator("potentials")) \
    3433(STLVectorValidator< std::vector<const element *> >(1,99, ElementValidator())) \
    3534(PositiveValidator<unsigned int>()) \
  • tests/Python/AllActions/options.dat

    r98d166 rf1eabd  
    124124output-types    "xyz mpqc"
    125125parse-homologies        "homology.dat"
     126parse-potentials        "water.potentials"
    126127parse-tremolo-potentials        "argon.potentials"
    127128parse-tremolo-potentials        "tensid.potentials"
Note: See TracChangeset for help on using the changeset viewer.