- Timestamp:
- Feb 24, 2011, 6:36:33 PM (14 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:
- fb9eba
- Parents:
- fb0b62
- git-author:
- Frederik Heber <heber@…> (02/24/11 14:48:51)
- git-committer:
- Frederik Heber <heber@…> (02/24/11 18:36:33)
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/TesselPoint.cpp
rfb0b62 re2373df 20 20 #include "CodePatterns/MemDebug.hpp" 21 21 22 #include "CodePatterns/Log.hpp" 23 22 24 #include "TesselPoint.hpp" 23 25 … … 35 37 {}; 36 38 39 void TesselPoint::UpdateSteps() 40 { 41 ASSERT(0, "TesselPoint::UpdateSteps() should never be called, TesselPoints don't have trajectories."); 42 AtomInfo::AppendTrajectoryStep(); 43 }; 44 37 45 std::ostream & TesselPoint::operator << (std::ostream &ost) const 38 46 { -
src/TesselPoint.hpp
rfb0b62 re2373df 26 26 ~TesselPoint(); 27 27 28 /** Pushes back another step in all trajectory vectors. 29 * 30 * This allows to extend all trajectories contained in different classes 31 * consistently. This is implemented by the topmost class which calls the 32 * real functions, \sa AppendTrajectoryStep(), by all necessary subclasses. 33 * 34 * Note that this function is actually not sensible with TesselPoints 35 * as they should not have trajectories but is implemented as they can be 36 * used stand-alone. 37 * 38 */ 39 virtual void UpdateSteps(); 40 28 41 std::ostream & operator << (std::ostream &ost) const; 29 42 }; -
src/atom.cpp
rfb0b62 re2373df 21 21 #include "atom.hpp" 22 22 #include "bond.hpp" 23 #include "CodePatterns/Log.hpp" 23 24 #include "config.hpp" 24 25 #include "element.hpp" … … 78 79 }; 79 80 81 82 void atom::UpdateSteps() 83 { 84 LOG(4,"atom::UpdateSteps() called."); 85 // append to position, velocity and force vector 86 AtomInfo::AppendTrajectoryStep(); 87 } 80 88 81 89 /** Climbs up the father list until NULL, last is returned. -
src/atom.hpp
rfb0b62 re2373df 52 52 53 53 virtual atom *clone(); 54 55 /** Pushes back another step in all trajectory vectors. 56 * 57 * This allows to extend all trajectories contained in different classes 58 * consistently. This is implemented by the topmost class which calls the 59 * real functions, \sa AppendTrajectoryStep(), by all necessary subclasses. 60 */ 61 virtual void UpdateSteps(); 54 62 55 63 bool OutputIndexed(ofstream * const out, const int ElementNo, const int AtomNo, const char *comment = NULL) const; -
src/atom_atominfo.cpp
rfb0b62 re2373df 74 74 }; 75 75 76 void AtomInfo::AppendTrajectoryStep() 77 { 78 AtomicPosition.push_back(zeroVec); 79 AtomicVelocity.push_back(zeroVec); 80 AtomicForce.push_back(zeroVec); 81 } 82 76 83 const element *AtomInfo::getType() const 77 84 { … … 191 198 AtomicVelocity[_step] = _newvelocity; 192 199 } else if (_step == size) { 193 AtomicVelocity.push_back(_newvelocity); 200 UpdateSteps(); 201 AtomicVelocity[_step] = _newvelocity; 194 202 } 195 203 } … … 232 240 AtomicForce[_step] = _newforce; 233 241 } else if (_step == size) { 234 AtomicForce.push_back(_newforce); 242 UpdateSteps(); 243 AtomicForce[_step] = _newforce; 235 244 } 236 245 } … … 266 275 AtomicPosition[_step] = _vector; 267 276 } else if (_step == size) { 268 AtomicPosition.push_back(_vector); 277 UpdateSteps(); 278 AtomicPosition[_step] = _vector; 269 279 } 270 280 //cout << "AtomInfo::setPosition: " << getType()->symbol << " at " << getPosition() << endl; … … 438 448 void AtomInfo::ResizeTrajectory(size_t MaxSteps) 439 449 { 440 if (AtomicPosition.size() <= (unsigned int)(MaxSteps)) { 441 DoLog(0) && (Log() << Verbose(0) << "Increasing size for trajectory array from " << AtomicPosition.size() << " to " << (MaxSteps+1) << "." << endl); 442 AtomicPosition.resize(MaxSteps+1, zeroVec); 443 AtomicVelocity.resize(MaxSteps+1, zeroVec); 444 AtomicForce.resize(MaxSteps+1, zeroVec); 445 } 446 for (size_t i = AtomicPosition.size(); i <= MaxSteps; ++i) { 447 AtomicPosition[i] = zeroVec; 448 AtomicVelocity[i] = zeroVec; 449 AtomicForce[i] = zeroVec; 450 } 451 }; 450 for (;AtomicPosition.size() <= (unsigned int)(MaxSteps);) 451 UpdateSteps(); 452 } 452 453 453 454 size_t AtomInfo::getTrajectorySize() const -
src/atom_atominfo.hpp
rfb0b62 re2373df 41 41 AtomInfo(const VectorInterface &_v); 42 42 virtual ~AtomInfo(); 43 44 /** Pushes back another step in all trajectory vectors. 45 * 46 * This allows to extend all trajectories contained in different classes 47 * consistently. This is implemented by the topmost class which calls the 48 * real functions, \sa AppendTrajectoryStep(), by all necessary subclasses. 49 */ 50 virtual void UpdateSteps()=0; 43 51 44 52 /** Getter for AtomicElement. … … 242 250 243 251 protected: 252 /** Function used by this and inheriting classes to extend the trajectory 253 * vectors. 254 */ 255 void AppendTrajectoryStep(); 256 244 257 // make these protected only such that deriving atom class still has full 245 258 // access needed for clone and alike
Note:
See TracChangeset
for help on using the changeset viewer.