chombo-discharge
CD_ItoParticle.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_ItoParticle_H
13 #define CD_ItoParticle_H
14 
15 // Std includes
16 #include <string>
17 #include <typeinfo>
18 #include <cstdio>
19 #include <cmath>
20 
21 // Our includes
22 #include <CD_GenericParticle.H>
23 #include <CD_NamespaceHeader.H>
24 
39 class ItoParticle : public GenericParticle<5, 3>
40 {
41 public:
45  static std::vector<std::string> s_realVariables;
46 
50  static std::vector<std::string> s_vectVariables;
51 
56  inline ItoParticle();
57 
68  inline ItoParticle(const Real a_weight,
69  const RealVect& a_position,
70  const RealVect& a_velocity = RealVect::Zero,
71  const Real a_diffusion = 0.0,
72  const Real a_mobility = 1.0,
73  const Real a_energy = 0.0);
74 
79  inline ItoParticle(const ItoParticle& a_other);
80 
84  inline virtual ~ItoParticle();
85 
95  inline void
96  define(const Real a_weight,
97  const RealVect& a_position,
98  const RealVect& a_velocity = RealVect::Zero,
99  const Real a_diffusion = 0.0,
100  const Real a_mobility = 1.0,
101  const Real a_energy = 0.0);
102 
107  inline Real&
108  weight();
109 
114  inline const Real&
115  weight() const;
116 
121  inline Real&
122  diffusion();
123 
128  inline const Real&
129  diffusion() const;
130 
135  inline Real&
136  mobility();
137 
142  inline const Real&
143  mobility() const;
144 
149  inline Real&
150  energy();
151 
156  inline const Real&
157  energy() const;
158 
163  inline RealVect&
164  oldPosition();
165 
170  inline const RealVect&
171  oldPosition() const;
172 
177  inline RealVect&
178  velocity();
179 
184  inline const RealVect&
185  velocity() const;
186 
191  inline Real
192  totalEnergy() const;
193 
198  inline Real
199  conductivity() const;
200 
205  inline Real
206  diffusivity() const;
207 
211  inline Real&
212  tmpReal();
213 
217  inline const Real&
218  tmpReal() const;
219 
223  inline RealVect&
224  tmpVect();
225 
229  inline const RealVect&
230  tmpVect() const;
231 };
232 
233 #include <CD_NamespaceFooter.H>
234 
235 #include <CD_ItoParticleImplem.H>
236 
237 #endif
Declaration of a generic particle class.
Implementation of CD_ItoParticle.H.
A generic particle class, holding the position and a specified number of real and vector values.
Definition: CD_GenericParticle.H:33
A particle class for use with ItoSolvers, i.e. drifting Brownian walkers.
Definition: CD_ItoParticle.H:40
Real & energy()
Get average particle energy.
Definition: CD_ItoParticleImplem.H:107
Real conductivity() const
Get the particle conductivity.
Definition: CD_ItoParticleImplem.H:143
virtual ~ItoParticle()
Destructor (deallocates runtime memory storage)
Definition: CD_ItoParticleImplem.H:51
Real & diffusion()
Get particle diffusion coefficient.
Definition: CD_ItoParticleImplem.H:95
ItoParticle()
Default constructor – user should subsequently set the variables or call define.
Definition: CD_ItoParticleImplem.H:25
Real & mobility()
Get mobility coefficient.
Definition: CD_ItoParticleImplem.H:83
RealVect & oldPosition()
Get the old particle position.
Definition: CD_ItoParticleImplem.H:119
RealVect & tmpVect()
Return scratch RealVect storage.
Definition: CD_ItoParticleImplem.H:173
void define(const Real a_weight, const RealVect &a_position, const RealVect &a_velocity=RealVect::Zero, const Real a_diffusion=0.0, const Real a_mobility=1.0, const Real a_energy=0.0)
Full define function.
Definition: CD_ItoParticleImplem.H:55
Real diffusivity() const
Get the particle diffusivity.
Definition: CD_ItoParticleImplem.H:149
static std::vector< std::string > s_vectVariables
Naming convention for vector fields.
Definition: CD_ItoParticle.H:50
Real totalEnergy() const
Get the total energy.
Definition: CD_ItoParticleImplem.H:155
Real & weight()
Get particle weight.
Definition: CD_ItoParticleImplem.H:71
static std::vector< std::string > s_realVariables
Naming convention for scalar fields.
Definition: CD_ItoParticle.H:45
RealVect & velocity()
Get the particle velocity.
Definition: CD_ItoParticleImplem.H:131
Real & tmpReal()
Return scratch scalar storage.
Definition: CD_ItoParticleImplem.H:161