chombo-discharge
CD_TracerParticle.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2022 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_TracerParticle_H
13 #define CD_TracerParticle_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 
31 template <size_t M, size_t N>
32 class TracerParticle : public GenericParticle<M, N>
33 {
34 public:
38  inline TracerParticle();
39 
44  inline TracerParticle(const TracerParticle<M, N>& a_other);
45 
49  inline virtual ~TracerParticle();
50 
55  inline Real&
56  weight();
57 
62  inline const Real&
63  weight() const;
64 
69  inline RealVect&
70  velocity();
71 
76  inline const RealVect&
77  velocity() const;
78 
82  inline virtual int
83  size() const override;
84 
90  inline virtual void
91  linearOut(void* a_buffer) const override;
92 
97  inline virtual void
98  linearIn(void* a_buffer) override;
99 
100 protected:
104  Real m_weight;
105 
109  RealVect m_velocity;
110 };
111 
117 template <size_t M, size_t N>
118 inline std::ostream&
119 operator<<(std::ostream& ostr, const TracerParticle<M, N>& p);
120 
121 #include <CD_NamespaceFooter.H>
122 
123 #include <CD_TracerParticleImplem.H>
124 
125 #endif
Declaration of a generic particle class.
Implementation of CD_TracerParticle.H.
std::ostream & operator<<(std::ostream &ostr, const TracerParticle< M, N > &p)
Particle printing function.
Definition: CD_TracerParticleImplem.H:158
A generic particle class, holding the position and a specified number of real and vector values.
Definition: CD_GenericParticle.H:33
A tracer particle class. This is templated for holding extra storage (useful for kernels).
Definition: CD_TracerParticle.H:33
TracerParticle()
Default constructor – initializes everything to zero.
Definition: CD_TracerParticleImplem.H:20
RealVect m_velocity
Particle velocity.
Definition: CD_TracerParticle.H:109
RealVect & velocity()
Get the particle velocity.
Definition: CD_TracerParticleImplem.H:65
virtual void linearOut(void *a_buffer) const override
Write a linear binary representation of the internal data. Assumes that sufficient memory for the buf...
Definition: CD_TracerParticleImplem.H:86
virtual ~TracerParticle()
Destructor (deallocates runtime memory storage)
Definition: CD_TracerParticleImplem.H:46
Real m_weight
Particle "weight".
Definition: CD_TracerParticle.H:104
virtual void linearIn(void *a_buffer) override
Read a linear binary representation of the internal data. Assumes that the buffer has the correct dat...
Definition: CD_TracerParticleImplem.H:121
virtual int size() const override
Returns the size, in number of bytes, of a flat representation of the data in this object.
Definition: CD_TracerParticleImplem.H:79
Real & weight()
Get the particle "weight".
Definition: CD_TracerParticleImplem.H:51