Changeset c5e75f3 for src/Potentials
- Timestamp:
- Nov 4, 2016, 9:37:50 AM (8 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, 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_ChronosMutex, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
- Children:
- d5ca1a
- Parents:
- c7aac9
- git-author:
- Frederik Heber <heber@…> (10/03/16 10:35:00)
- git-committer:
- Frederik Heber <heber@…> (11/04/16 09:37:50)
- Location:
- src/Potentials
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Potentials/CompoundPotential.cpp
rc7aac9 rc5e75f3 70 70 potential->getParticleTypes(); 71 71 72 // create charges73 Fragment::charges_t charges;74 charges.resize(types.size());75 std::transform(types.begin(), types.end(),76 charges.begin(), boost::lambda::_1);77 72 // convert into count map 78 Extractors::elementcounts_t counts_per_ charge=79 Extractors::_detail::getElementCounts( charges);80 // ASSERT( !counts_per_ charge.empty(),81 // "getFirstGraphwithSpecifiedElements() - chargecounts are empty?");82 LOG(2, "DEBUG: counts_per_ charge is " << counts_per_charge<< ".");73 Extractors::elementcounts_t counts_per_element = 74 Extractors::_detail::getElementCounts(types); 75 // ASSERT( !counts_per_element.empty(), 76 // "getFirstGraphwithSpecifiedElements() - element counts are empty?"); 77 LOG(2, "DEBUG: counts_per_element is " << counts_per_element << "."); 83 78 84 79 // check whether graph contains suitable types 85 Extractors::elementcounts_t::const_iterator countiter = counts_per_ charge.begin();86 for (; countiter != counts_per_ charge.end(); ++countiter)80 Extractors::elementcounts_t::const_iterator countiter = counts_per_element.begin(); 81 for (; countiter != counts_per_element.end(); ++countiter) 87 82 if (!graph.hasGreaterEqualTimesAtomicNumber( 88 83 static_cast<size_t>(countiter->first), … … 91 86 break; 92 87 // if we have a match for every count, store model 93 if( countiter == counts_per_ charge.end()) {88 if( countiter == counts_per_element.end()) { 94 89 LOG(1, "INFO: Potential " << potentialiter->first << " matches with fragment."); 95 90 models.push_back(static_cast<FunctionModel*>(potential)); -
src/Potentials/PotentialTrainer.cpp
rc7aac9 rc5e75f3 193 193 ASSERT( !types.empty(), 194 194 "getFirstGraphwithSpecifiedElements() - charges is empty?"); 195 // create charges 196 Fragment::charges_t charges; 197 charges.resize(types.size()); 198 std::transform(types.begin(), types.end(), 199 charges.begin(), boost::lambda::_1); 195 200 196 // convert into count map 201 Extractors::elementcounts_t counts_per_ charge=202 Extractors::_detail::getElementCounts( charges);203 ASSERT( !counts_per_ charge.empty(),204 "getFirstGraphwithSpecifiedElements() - chargecounts are empty?");205 LOG(1, "DEBUG: counts_per_ charge is " << counts_per_charge<< ".");197 Extractors::elementcounts_t counts_per_element = 198 Extractors::_detail::getElementCounts(types); 199 ASSERT( !counts_per_element.empty(), 200 "getFirstGraphwithSpecifiedElements() - element counts are empty?"); 201 LOG(1, "DEBUG: counts_per_element is " << counts_per_element << "."); 206 202 // we want to check each (unique) key only once 207 203 HomologyContainer::const_key_iterator olditer = homologies.key_end(); … … 216 212 // check whether we have the same set of atomic numbers 217 213 const HomologyGraph::nodes_t &nodes = (*iter).getNodes(); 218 Extractors::elementcounts_t nodes_counts_per_ charge;214 Extractors::elementcounts_t nodes_counts_per_element; 219 215 for (HomologyGraph::nodes_t::const_iterator nodeiter = nodes.begin(); 220 216 nodeiter != nodes.end(); ++nodeiter) { 221 217 const Extractors::element_t elem = nodeiter->first.getAtomicNumber(); 222 218 const std::pair<Extractors::elementcounts_t::iterator, bool> inserter = 223 nodes_counts_per_ charge.insert( std::make_pair(elem, (Extractors::count_t)nodeiter->second ) );219 nodes_counts_per_element.insert( std::make_pair(elem, (Extractors::count_t)nodeiter->second ) ); 224 220 if (!inserter.second) 225 221 inserter.first->second += (Extractors::count_t)nodeiter->second; 226 222 } 227 LOG(1, "DEBUG: Node (" << *iter << ")'s counts_per_ charge is " << nodes_counts_per_charge<< ".");228 if (counts_per_ charge == nodes_counts_per_charge)223 LOG(1, "DEBUG: Node (" << *iter << ")'s counts_per_element is " << nodes_counts_per_element << "."); 224 if (counts_per_element == nodes_counts_per_element) 229 225 return *iter; 230 226 } -
src/Potentials/SerializablePotential.hpp
rc7aac9 rc5e75f3 39 39 public: 40 40 //!> typedef for particle designation 41 typedef int ParticleType_t;41 typedef unsigned int ParticleType_t; 42 42 //!> typedef for a vector of particle designations 43 43 typedef std::vector<ParticleType_t> ParticleTypes_t;
Note:
See TracChangeset
for help on using the changeset viewer.