Changeset a1c8fa for src/Atom/atom_bondedparticleinfo.cpp
- Timestamp:
- Oct 20, 2016, 8:54:23 PM (9 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, Candidate_v1.7.0, Candidate_v1.7.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_ForceAnnealing, Fix_ParseParticles, 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, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
- Children:
- 72e40d0
- Parents:
- 064b34
- git-author:
- Frederik Heber <heber@…> (09/27/16 09:58:43)
- git-committer:
- Frederik Heber <heber@…> (10/20/16 20:54:23)
- File:
-
- 1 edited
-
src/Atom/atom_bondedparticleinfo.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Atom/atom_bondedparticleinfo.cpp
r064b34 ra1c8fa 45 45 BondList BondedParticleInfo::emptyList; 46 46 47 /** Constructor of class BondedParticleInfo.48 */49 BondedParticleInfo::BondedParticleInfo() :50 AdaptiveOrder(0),51 MaxOrder(0)52 {}53 54 /** Destructor of class BondedParticleInfo.55 */56 BondedParticleInfo::~BondedParticleInfo()57 {}58 59 47 void BondedParticleInfo::AppendTrajectoryStep(const unsigned int _step) 60 48 { … … 74 62 } 75 63 64 template <class List_t> 65 void setEntryInList( 66 List_t &_list, 67 const typename List_t::key_type _step, 68 const typename List_t::mapped_type &_value) 69 { 70 typename List_t::iterator iter = 71 _list.find(_step); 72 if (iter != _list.end()) 73 iter->second = _value; 74 else 75 _list.insert( std::make_pair(_step, _value) ); 76 } 77 78 template <class List_t> 79 const typename List_t::mapped_type& getEntryInList( 80 const List_t &_list, 81 const typename List_t::key_type _step, 82 const typename List_t::mapped_type &_empty) 83 { 84 typename List_t::const_iterator iter = 85 _list.find(_step); 86 if (iter != _list.end()) 87 return iter->second; 88 return _empty; 89 } 90 76 91 const BondList& BondedParticleInfo::getListOfBondsAtStep(unsigned int _step) const 77 92 { 78 BondTrajectory_t::const_iterator iter = 79 ListOfBonds.find(_step); 80 if (iter != ListOfBonds.end()) 81 return iter->second; 82 return emptyList; 93 return getEntryInList<BondTrajectory_t>(ListOfBonds, _step, emptyList); 83 94 } 95 96 const unsigned char& BondedParticleInfo::getMaxOrder() const 97 { 98 return getMaxOrder(WorldTime::getTime()); 99 } 100 101 const unsigned char& BondedParticleInfo::getMaxOrder(unsigned int _step) const 102 { 103 static unsigned char emptyOrder=0; 104 return getEntryInList<OrderTrajectory_t>(MaxOrder, _step, emptyOrder); 105 } 106 107 void BondedParticleInfo::setMaxOrder(unsigned char _value) 108 { 109 setMaxOrder(WorldTime::getTime(), _value); 110 } 111 112 void BondedParticleInfo::setMaxOrder(unsigned int _step, const unsigned char _value) 113 { 114 setEntryInList<OrderTrajectory_t>(MaxOrder, _step, _value); 115 } 116 117 const unsigned char& BondedParticleInfo::getAdaptiveOrder() const 118 { 119 return getAdaptiveOrder(WorldTime::getTime()); 120 } 121 122 const unsigned char& BondedParticleInfo::getAdaptiveOrder(unsigned int _step) const 123 { 124 static unsigned char emptyOrder=0; 125 return getEntryInList<OrderTrajectory_t>(AdaptiveOrder, _step, emptyOrder); 126 } 127 128 void BondedParticleInfo::setAdaptiveOrder(unsigned char _value) 129 { 130 setAdaptiveOrder(WorldTime::getTime(), _value); 131 } 132 133 void BondedParticleInfo::setAdaptiveOrder(unsigned int _step, const unsigned char _value) 134 { 135 setEntryInList<OrderTrajectory_t>(AdaptiveOrder, _step, _value); 136 } 137
Note:
See TracChangeset
for help on using the changeset viewer.
