chombo-discharge
Loading...
Searching...
No Matches
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
31template <size_t M, size_t N>
32class TracerParticle : public GenericParticle<M, N>
33{
34public:
38 inline TracerParticle();
39
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* const a_buffer) const override;
92
97 inline virtual void
98 linearIn(const void* const a_buffer) override;
99
104 inline virtual int
105 H5size() const;
106
112 inline virtual void
113 H5linearOut(void* const a_buffer) const;
114
120 inline virtual void
121 H5linearIn(const void* const a_buffer);
122
129 template <size_t K>
130 inline Real&
131 real();
132
139 template <size_t K>
140 inline const Real&
141 real() const;
142
149 template <size_t K>
150 inline RealVect&
151 vect();
152
159 template <size_t K>
160 inline const RealVect&
161 vect() const;
162
163protected:
168
173};
174
180template <size_t M, size_t N>
181inline std::ostream&
183
184#include <CD_NamespaceFooter.H>
185
187
188#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:277
A generic particle class, holding the position and a specified number of real and vector values.
Definition CD_GenericParticle.H:76
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25
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
virtual void linearIn(const void *const a_buffer) override
Read a linear binary representation of the internal data. Assumes that the buffer has the correct dat...
Definition CD_TracerParticleImplem.H:128
virtual void H5linearOut(void *const a_buffer) const
Linearize the Real components onto a buffer workable by HDF5.
Definition CD_TracerParticleImplem.H:179
RealVect & vect()
Get one of the RealVects.
Definition CD_TracerParticleImplem.H:262
RealVect m_velocity
Particle velocity.
Definition CD_TracerParticle.H:172
RealVect & velocity()
Get the particle velocity.
Definition CD_TracerParticleImplem.H:65
virtual int H5size() const
Function that is used when writing particles to HDF5.
Definition CD_TracerParticleImplem.H:164
virtual ~TracerParticle()
Destructor (deallocates runtime memory storage)
Definition CD_TracerParticleImplem.H:46
virtual void linearOut(void *const a_buffer) const override
Write a linear binary representation of the internal data. Assumes that sufficient memory for the buf...
Definition CD_TracerParticleImplem.H:92
Real m_weight
Particle "weight".
Definition CD_TracerParticle.H:167
virtual void H5linearIn(const void *const a_buffer)
Delinearize the buffer onto the real components in the particle class.
Definition CD_TracerParticleImplem.H:212
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 & real()
Get one of the scalars.
Definition CD_TracerParticleImplem.H:246
Real & weight()
Get the particle "weight".
Definition CD_TracerParticleImplem.H:51