Changeset f1eabd
- Timestamp:
- Oct 19, 2014, 5:08:50 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:
- 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)
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/userguide/userguide.xml
r98d166 rf1eabd 2109 2109 a fragment of order 1, e.g. a single hydrogen atom.</para> 2110 2110 </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 2111 2117 2112 2118 <para>Another way is using a file containing a specific set of … … 2143 2149 with this file.</para> 2144 2150 </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 2145 2173 2146 2174 <section xml:id='potentials.fit-particle-charges'> -
src/Actions/GlobalListOfActions.hpp
r98d166 rf1eabd 83 83 (PotentialFitParticleCharges) \ 84 84 (PotentialParseHomologies) \ 85 (PotentialParsePotentials) \ 85 86 (PotentialSaveHomologies) \ 86 87 (ParserParseTremoloPotentials) \ -
src/Actions/Makefile.am
r98d166 rf1eabd 351 351 Actions/PotentialAction/FitParticleChargesAction.cpp \ 352 352 Actions/PotentialAction/ParseHomologiesAction.cpp \ 353 Actions/PotentialAction/ParsePotentialsAction.cpp \ 353 354 Actions/PotentialAction/SaveHomologiesAction.cpp 354 355 POTENTIALACTIONHEADER = \ 355 356 Actions/PotentialAction/FitParticleChargesAction.hpp \ 356 357 Actions/PotentialAction/ParseHomologiesAction.hpp \ 358 Actions/PotentialAction/ParsePotentialsAction.hpp \ 357 359 Actions/PotentialAction/SaveHomologiesAction.hpp 358 360 POTENTIALACTIONDEFS = \ 359 361 Actions/PotentialAction/FitParticleChargesAction.def \ 360 362 Actions/PotentialAction/ParseHomologiesAction.def \ 363 Actions/PotentialAction/ParsePotentialsAction.def \ 361 364 Actions/PotentialAction/SaveHomologiesAction.def 362 365 -
src/Actions/PotentialAction/FitCompoundPotentialAction.cpp
r98d166 rf1eabd 49 49 #include "Fragmentation/Homology/HomologyGraph.hpp" 50 50 #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"55 51 #include "Potentials/PotentialTrainer.hpp" 56 52 #include "Potentials/SerializablePotential.hpp" … … 65 61 66 62 ActionState::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 107 64 HomologyContainer &homologies = World::getInstance().getHomologies(); 108 65 … … 118 75 } 119 76 77 // fragment specifies the homology fragment to use 78 SerializablePotential::ParticleTypes_t fragmentnumbers = 79 PotentialTrainer::getNumbersFromElements(params.fragment.get()); 80 120 81 // then we ought to pick the right HomologyGraph ... 121 82 const HomologyGraph graph = … … 129 90 } 130 91 131 // training92 // next we use the set of homologous fragments for training from the present potentials 132 93 PotentialTrainer trainer; 133 94 const bool status = trainer( -
src/Actions/PotentialAction/FitCompoundPotentialAction.def
r98d166 rf1eabd 17 17 #include "Parameters/Validators/STLVectorValidator.hpp" 18 18 #include "Parameters/Validators/Specific/ElementValidator.hpp" 19 #include "Parameters/Validators/Specific/FilePresentValidator.hpp"20 19 #include "Parameters/Validators/Specific/FileSuffixValidator.hpp" 21 20 #include "Parameters/Validators/Specific/PotentialTypeValidator.hpp" … … 31 30 #define paramvalids \ 32 31 (DummyValidator<boost::filesystem::path>()) \ 33 (File PresentValidator() && FileSuffixValidator("potentials")) \32 (FileSuffixValidator("potentials")) \ 34 33 (STLVectorValidator< std::vector<const element *> >(1,99, ElementValidator())) \ 35 34 (PositiveValidator<unsigned int>()) \ -
tests/Python/AllActions/options.dat
r98d166 rf1eabd 124 124 output-types "xyz mpqc" 125 125 parse-homologies "homology.dat" 126 parse-potentials "water.potentials" 126 127 parse-tremolo-potentials "argon.potentials" 127 128 parse-tremolo-potentials "tensid.potentials"
Note:
See TracChangeset
for help on using the changeset viewer.