chombo-discharge
CD_ItoParticleImplem.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_ItoParticleImplem_H
13 #define CD_ItoParticleImplem_H
14 
15 // Std includes
16 #include <string>
17 #include <typeinfo>
18 #include <cstdio>
19 #include <cmath>
20 
21 // Our includes
22 #include <CD_ItoParticle.H>
23 #include <CD_NamespaceHeader.H>
24 
26 {
27  this->define(1.0, RealVect::Zero, RealVect::Zero, 0.0, 0.0, 0.0);
28 }
29 
30 inline ItoParticle::ItoParticle(const Real a_weight,
31  const RealVect& a_position,
32  const RealVect& a_velocity,
33  const Real a_diffusion,
34  const Real a_mobility,
35  const Real a_energy)
36 {
37  this->define(a_weight, a_position, a_velocity, a_diffusion, a_mobility, a_energy);
38 }
39 
40 inline ItoParticle::ItoParticle(const ItoParticle& a_other)
41 {
42  this->weight() = a_other.weight();
43  this->position() = a_other.position();
44  this->oldPosition() = a_other.oldPosition();
45  this->velocity() = a_other.velocity();
46  this->diffusion() = a_other.diffusion();
47  this->mobility() = a_other.mobility();
48  this->energy() = a_other.energy();
49 }
50 
52 {}
53 
54 inline void
55 ItoParticle::define(const Real a_weight,
56  const RealVect& a_position,
57  const RealVect& a_velocity,
58  const Real a_diffusion,
59  const Real a_mobility,
60  const Real a_energy)
61 {
62  this->weight() = a_weight;
63  this->position() = a_position;
64  this->velocity() = a_velocity;
65  this->diffusion() = a_diffusion;
66  this->mobility() = a_mobility;
67  this->energy() = a_energy;
68 }
69 
70 inline Real&
72 {
73  return this->real<0>();
74 }
75 
76 inline const Real&
78 {
79  return this->real<0>();
80 }
81 
82 inline Real&
84 {
85  return this->real<1>();
86 }
87 
88 inline const Real&
90 {
91  return this->real<1>();
92 }
93 
94 inline Real&
96 {
97  return this->real<2>();
98 }
99 
100 inline const Real&
102 {
103  return this->real<2>();
104 }
105 
106 inline Real&
108 {
109  return this->real<3>();
110 }
111 
112 inline const Real&
114 {
115  return this->real<3>();
116 }
117 
118 inline RealVect&
120 {
121  return this->vect<0>();
122 }
123 
124 inline const RealVect&
126 {
127  return this->vect<0>();
128 }
129 
130 inline RealVect&
132 {
133  return this->vect<1>();
134 }
135 
136 inline const RealVect&
138 {
139  return this->vect<1>();
140 }
141 
142 inline Real
144 {
145  return this->weight() * this->mobility();
146 }
147 
148 inline Real
150 {
151  return this->weight() * this->diffusion();
152 }
153 
154 inline Real
156 {
157  return this->weight() * this->energy();
158 }
159 
160 inline Real&
162 {
163  return this->real<4>();
164 }
165 
166 inline const Real&
168 {
169  return this->real<4>();
170 }
171 
172 inline RealVect&
174 {
175  return this->vect<2>();
176 }
177 
178 inline const RealVect&
180 {
181  return this->vect<2>();
182 }
183 
184 #include <CD_NamespaceFooter.H>
185 
186 #include <CD_ItoParticleImplem.H>
187 
188 #endif
Implementation of CD_ItoParticle.H.
Declaration of a particle class for Ito diffusion.
RealVect & position()
Get the particle position.
Definition: CD_GenericParticleImplem.H:47
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
Real totalEnergy() const
Get the total energy.
Definition: CD_ItoParticleImplem.H:155
Real & weight()
Get particle weight.
Definition: CD_ItoParticleImplem.H:71
RealVect & velocity()
Get the particle velocity.
Definition: CD_ItoParticleImplem.H:131
Real & tmpReal()
Return scratch scalar storage.
Definition: CD_ItoParticleImplem.H:161