Changeset 54b42e
- Timestamp:
- Feb 24, 2011, 4:35:59 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:
- 6625c3
- Parents:
- bce72c
- git-author:
- Frederik Heber <heber@…> (02/07/11 18:56:11)
- git-committer:
- Frederik Heber <heber@…> (02/24/11 16:35:59)
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/atom_atominfo.cpp
rbce72c r54b42e 29 29 AtomInfo::AtomInfo() : 30 30 AtomicElement(NULL) 31 {}; 31 { 32 AtomicPosition.reserve(1); 33 AtomicPosition.push_back(zeroVec); 34 AtomicVelocity.reserve(1); 35 AtomicVelocity.push_back(zeroVec); 36 AtomicForce.reserve(1); 37 AtomicForce.push_back(zeroVec); 38 }; 32 39 33 40 /** Copy constructor of class AtomInfo. … … 39 46 40 47 AtomInfo::AtomInfo(const VectorInterface &_v) : 41 AtomicPosition(_v.getPosition()),42 48 AtomicElement(NULL) 43 {}; 49 { 50 AtomicPosition[0] = _v.getPosition(); 51 }; 44 52 45 53 /** Destructor of class AtomInfo. … … 56 64 const double& AtomInfo::operator[](size_t i) const 57 65 { 58 return AtomicPosition[ i];66 return AtomicPosition[0][i]; 59 67 } 60 68 61 69 const double& AtomInfo::at(size_t i) const 62 70 { 63 return AtomicPosition .at(i);71 return AtomicPosition[0].at(i); 64 72 } 65 73 66 74 void AtomInfo::set(size_t i, const double value) 67 75 { 68 AtomicPosition .at(i) = value;76 AtomicPosition[0].at(i) = value; 69 77 } 70 78 71 79 const Vector& AtomInfo::getPosition() const 72 80 { 73 return AtomicPosition ;81 return AtomicPosition[0]; 74 82 } 75 83 … … 85 93 Vector& AtomInfo::getAtomicVelocity() 86 94 { 87 return AtomicVelocity ;95 return AtomicVelocity[0]; 88 96 } 89 97 90 98 const Vector& AtomInfo::getAtomicVelocity() const 91 99 { 92 return AtomicVelocity ;100 return AtomicVelocity[0]; 93 101 } 94 102 95 103 void AtomInfo::setAtomicVelocity(const Vector &_newvelocity) 96 104 { 97 AtomicVelocity = _newvelocity;105 AtomicVelocity[0] = _newvelocity; 98 106 } 99 107 100 108 const Vector& AtomInfo::getAtomicForce() const 101 109 { 102 return AtomicForce ;110 return AtomicForce[0]; 103 111 } 104 112 105 113 void AtomInfo::setAtomicForce(const Vector &_newforce) 106 114 { 107 AtomicForce = _newforce;115 AtomicForce[0] = _newforce; 108 116 } 109 117 110 118 void AtomInfo::setPosition(const Vector& _vector) 111 119 { 112 AtomicPosition = _vector;120 AtomicPosition[0] = _vector; 113 121 //cout << "AtomInfo::setPosition: " << getType()->symbol << " at " << getPosition() << endl; 114 122 } … … 116 124 const VectorInterface& AtomInfo::operator+=(const Vector& b) 117 125 { 118 AtomicPosition += b;126 AtomicPosition[0] += b; 119 127 return *this; 120 128 } … … 122 130 const VectorInterface& AtomInfo::operator-=(const Vector& b) 123 131 { 124 AtomicPosition -= b;132 AtomicPosition[0] -= b; 125 133 return *this; 126 134 } … … 128 136 Vector const AtomInfo::operator+(const Vector& b) const 129 137 { 130 Vector a(AtomicPosition );138 Vector a(AtomicPosition[0]); 131 139 a += b; 132 140 return a; … … 135 143 Vector const AtomInfo::operator-(const Vector& b) const 136 144 { 137 Vector a(AtomicPosition );145 Vector a(AtomicPosition[0]); 138 146 a -= b; 139 147 return a; … … 142 150 double AtomInfo::distance(const Vector &point) const 143 151 { 144 return AtomicPosition .distance(point);152 return AtomicPosition[0].distance(point); 145 153 } 146 154 147 155 double AtomInfo::DistanceSquared(const Vector &y) const 148 156 { 149 return AtomicPosition .DistanceSquared(y);157 return AtomicPosition[0].DistanceSquared(y); 150 158 } 151 159 152 160 double AtomInfo::distance(const VectorInterface &_atom) const 153 161 { 154 return _atom.distance(AtomicPosition );162 return _atom.distance(AtomicPosition[0]); 155 163 } 156 164 157 165 double AtomInfo::DistanceSquared(const VectorInterface &_atom) const 158 166 { 159 return _atom.DistanceSquared(AtomicPosition );167 return _atom.DistanceSquared(AtomicPosition[0]); 160 168 } 161 169 162 170 VectorInterface &AtomInfo::operator=(const Vector& _vector) 163 171 { 164 AtomicPosition = _vector;172 AtomicPosition[0] = _vector; 165 173 return *this; 166 174 } … … 168 176 void AtomInfo::ScaleAll(const double *factor) 169 177 { 170 AtomicPosition .ScaleAll(factor);178 AtomicPosition[0].ScaleAll(factor); 171 179 } 172 180 173 181 void AtomInfo::ScaleAll(const Vector &factor) 174 182 { 175 AtomicPosition .ScaleAll(factor);183 AtomicPosition[0].ScaleAll(factor); 176 184 } 177 185 178 186 void AtomInfo::Scale(const double factor) 179 187 { 180 AtomicPosition .Scale(factor);188 AtomicPosition[0].Scale(factor); 181 189 } 182 190 183 191 void AtomInfo::Zero() 184 192 { 185 AtomicPosition .Zero();193 AtomicPosition[0].Zero(); 186 194 } 187 195 188 196 void AtomInfo::One(const double one) 189 197 { 190 AtomicPosition .One(one);198 AtomicPosition[0].One(one); 191 199 } 192 200 193 201 void AtomInfo::LinearCombinationOfVectors(const Vector &x1, const Vector &x2, const Vector &x3, const double * const factors) 194 202 { 195 AtomicPosition .LinearCombinationOfVectors(x1,x2,x3,factors);203 AtomicPosition[0].LinearCombinationOfVectors(x1,x2,x3,factors); 196 204 } 197 205 -
src/atom_atominfo.hpp
rbce72c r54b42e 18 18 #include <config.h> 19 19 #endif 20 21 #include <vector> 20 22 21 23 #include "LinearAlgebra/Vector.hpp" … … 115 117 116 118 private: 117 VectorAtomicPosition; //!< coordinate vector of atom, giving last position within cell118 VectorAtomicVelocity; //!< velocity vector of atom, giving last velocity within cell119 VectorAtomicForce; //!< Force vector of atom, giving last force within cell119 std::vector<Vector> AtomicPosition; //!< coordinate vector of atom, giving last position within cell 120 std::vector<Vector> AtomicVelocity; //!< velocity vector of atom, giving last velocity within cell 121 std::vector<Vector> AtomicForce; //!< Force vector of atom, giving last force within cell 120 122 121 123 const element *AtomicElement; //!< pointing to element
Note:
See TracChangeset
for help on using the changeset viewer.