source: src/atom_atominfo.hpp@ 1b558c

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
Last change on this file since 1b558c was 6b020f, checked in by Frederik Heber <heber@…>, 14 years ago

AtomInfo::getter and setter's step is now unsigned int.

  • Property mode set to 100644
File size: 7.2 KB
Line 
1/*
2 * atom_atominfo.hpp
3 *
4 * Created on: Oct 19, 2009
5 * Author: heber
6 */
7
8#ifndef ATOM_ATOMINFO_HPP_
9#define ATOM_ATOMINFO_HPP_
10
11
12using namespace std;
13
14/*********************************************** includes ***********************************/
15
16// include config.h
17#ifdef HAVE_CONFIG_H
18#include <config.h>
19#endif
20
21#include <vector>
22
23#include "LinearAlgebra/Vector.hpp"
24#include "LinearAlgebra/VectorInterface.hpp"
25
26/****************************************** forward declarations *****************************/
27
28class AtomInfo;
29class config;
30class element;
31class ForceMatrix;
32class RealSpaceMatrix;
33
34/********************************************** declarations *******************************/
35
36class AtomInfo : public VectorInterface {
37
38public:
39 AtomInfo();
40 AtomInfo(const AtomInfo &_atom);
41 AtomInfo(const VectorInterface &_v);
42 virtual ~AtomInfo();
43
44 /** Getter for AtomicElement.
45 *
46 * @return constant reference to AtomicElement
47 */
48 const element *getType() const;
49 /** Setter for AtomicElement.
50 *
51 * @param _type new element by pointer to set
52 */
53 void setType(const element *_type);
54 /** Setter for AtomicElement.
55 *
56 * @param _typenr new element by index to set
57 */
58 void setType(const int _typenr);
59
60 /** Getter for AtomicVelocity.
61 *
62 * Current time step is used.
63 *
64 * @return constant reference to AtomicVelocity
65 */
66// Vector& getAtomicVelocity();
67 /** Getter for AtomicVelocity.
68 *
69 * @param _step time step to return
70 * @return constant reference to AtomicVelocity
71 */
72// Vector& getAtomicVelocity(const int _step);
73 /** Getter for AtomicVelocity.
74 *
75 * Current time step is used.
76 *
77 * @return constant reference to AtomicVelocity
78 */
79 const Vector& getAtomicVelocity() const;
80 /** Getter for AtomicVelocity.
81 *
82 * @param _step time step to return
83 * @return constant reference to AtomicVelocity
84 */
85 const Vector& getAtomicVelocityAtStep(const unsigned int _step) const;
86 /** Setter for AtomicVelocity.
87 *
88 * Current time step is used.
89 *
90 * @param _newvelocity new velocity to set
91 */
92 void setAtomicVelocity(const Vector &_newvelocity);
93 /** Setter for AtomicVelocity.
94 *
95 * @param _step time step to set
96 * @param _newvelocity new velocity to set
97 */
98 void setAtomicVelocityAtStep(const unsigned int _step, const Vector &_newvelocity);
99
100 /** Getter for AtomicForce.
101 *
102 * Current time step is used.
103 *
104 * @return constant reference to AtomicForce
105 */
106 const Vector& getAtomicForce() const;
107 /** Getter for AtomicForce.
108 *
109 * @param _step time step to return
110 * @return constant reference to AtomicForce
111 */
112 const Vector& getAtomicForceAtStep(const unsigned int _step) const;
113 /** Setter for AtomicForce.
114 *
115 * Current time step is used.
116 *
117 * @param _newvelocity new force vector to set
118 */
119 void setAtomicForce(const Vector &_newforce);
120 /** Setter for AtomicForce.
121 *
122 * @param _step time step to set
123 * @param _newvelocity new force vector to set
124 */
125 void setAtomicForceAtStep(const unsigned int _step, const Vector &_newforce);
126
127 /** Getter for FixedIon.
128 *
129 * @return constant reference to FixedIon
130 */
131 bool getFixedIon() const;
132 /** Setter for FixedIon.
133 *
134 * @param _fixedion new state of FixedIon
135 */
136 void setFixedIon(const bool _fixedion);
137
138 ///// manipulation of the atomic position
139
140 // Accessors ussually come in pairs... and sometimes even more than that
141 /** Getter for AtomicPosition.
142 *
143 * Current time step is used.
144 *
145 * @param i component of vector
146 * @return i-th component of atomic position
147 */
148 const double& operator[](size_t i) const;
149 /** Getter for AtomicPosition.
150 *
151 * Current time step is used.
152 *
153 * \sa operator[], this is if instance is a reference.
154 *
155 * @param i component of vector
156 * @return i-th component of atomic position
157 */
158 const double& at(size_t i) const;
159 /** Getter for AtomicPosition.
160 *
161 * \sa operator[], this is if instance is a reference.
162 *
163 * @param i index of component of AtomicPosition
164 * @param _step time step to return
165 * @return atomic position at time step _step
166 */
167 const double& atStep(size_t i, unsigned int _step) const;
168 /** Setter for AtomicPosition.
169 *
170 * Current time step is used.
171 *
172 * @param i component to set
173 * @param value value to set to
174 */
175 void set(size_t i, const double value);
176 /** Setter for AtomicPosition.
177 *
178 * @param i component to set
179 * @param _step time step to set
180 * @param value value to set to
181 */
182 void setAtStep(size_t i, unsigned int _step, const double value);
183 /** Getter for AtomicPosition.
184 *
185 * Current time step is used.
186 *
187 * @return atomic position
188 */
189 const Vector& getPosition() const;
190 /** Getter for AtomicPosition.
191 *
192 * @param _step time step to return
193 * @return atomic position at time step _step
194 */
195 const Vector& getPositionAtStep(unsigned int _step) const;
196
197 // Assignment operator
198 /** Setter for AtomicPosition.
199 *
200 * Current time step is used.
201 *
202 * @param _vector new position to set
203 */
204 void setPosition(const Vector& _vector);
205 /** Setter for AtomicPosition.
206 *
207 * @param _step time step to set
208 * @param _vector new position to set for time step _step
209 */
210 void setPositionAtStep(const unsigned int _step, const Vector& _vector);
211 class VectorInterface &operator=(const Vector& _vector);
212
213 // operators for mathematical operations
214 const VectorInterface& operator+=(const Vector& b);
215 const VectorInterface& operator-=(const Vector& b);
216 Vector const operator+(const Vector& b) const;
217 Vector const operator-(const Vector& b) const;
218
219 void Zero();
220 void One(const double one);
221 void LinearCombinationOfVectors(const Vector &x1, const Vector &x2, const Vector &x3, const double * const factors);
222
223 double distance(const Vector &point) const;
224 double DistanceSquared(const Vector &y) const;
225 double distance(const VectorInterface &_atom) const;
226 double DistanceSquared(const VectorInterface &_atom) const;
227
228 void ScaleAll(const double *factor);
229 void ScaleAll(const Vector &factor);
230 void Scale(const double factor);
231
232 // operations for trajectories
233 void ResizeTrajectory(size_t MaxSteps);
234 size_t getTrajectorySize() const;
235 void CopyStepOnStep(const unsigned int dest, const unsigned int src);
236 void VelocityVerletUpdate(int nr, const unsigned int MDSteps, config *configuration, ForceMatrix *Force, const size_t offset);
237 double getKineticEnergy(const unsigned int step) const;
238 Vector getMomentum(const unsigned int step) const;
239 double getMass() const;
240
241 std::ostream & operator << (std::ostream &ost) const;
242
243private:
244 std::vector<Vector> AtomicPosition; //!< coordinate vector of atom, giving last position within cell
245 std::vector<Vector> AtomicVelocity; //!< velocity vector of atom, giving last velocity within cell
246 std::vector<Vector> AtomicForce; //!< Force vector of atom, giving last force within cell
247
248 const element *AtomicElement; //!< pointing to element
249 bool FixedIon;
250};
251
252std::ostream & operator << (std::ostream &ost, const AtomInfo &a);
253
254const AtomInfo& operator*=(AtomInfo& a, const double m);
255AtomInfo const operator*(const AtomInfo& a, const double m);
256AtomInfo const operator*(const double m, const AtomInfo& a);
257
258#endif /* ATOM_ATOMINFO_HPP_ */
Note: See TracBrowser for help on using the repository browser.