Changeset f1eabd for src/Actions/PotentialAction
- Timestamp:
- Oct 19, 2014, 5:08:50 PM (10 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)
- Location:
- src/Actions/PotentialAction
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified 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( -
TabularUnified 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>()) \
Note:
See TracChangeset
for help on using the changeset viewer.