chombo-discharge
Loading...
Searching...
No Matches
CD_TracerParticle.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_TRACERPARTICLE_H
14#define CD_TRACERPARTICLE_H
15
16// Std includes
17#include <string>
18#include <typeinfo>
19#include <cstdio>
20#include <cmath>
21
22// Our includes
23#include <CD_GenericParticle.H>
24#include <CD_NamespaceHeader.H>
25
32template <size_t M, size_t N>
33class TracerParticle : public GenericParticle<M, N>
34{
35public:
39 inline TracerParticle();
40
46
50 inline virtual ~TracerParticle();
51
56 inline Real&
57 weight();
58
63 inline const Real&
64 weight() const;
65
70 inline RealVect&
71 velocity();
72
77 inline const RealVect&
78 velocity() const;
79
84 inline virtual int
85 size() const override;
86
92 inline virtual void
93 linearOut(void* const a_buffer) const override;
94
99 inline virtual void
100 linearIn(const void* const a_buffer) override;
101
107 inline virtual int
108 H5size() const;
109
115 inline virtual void
116 H5linearOut(void* const a_buffer) const;
117
123 inline virtual void
124 H5linearIn(const void* const a_buffer);
125
132 template <size_t K>
133 inline Real&
134 real();
135
142 template <size_t K>
143 inline const Real&
144 real() const;
145
152 template <size_t K>
153 inline RealVect&
154 vect();
155
162 template <size_t K>
163 inline const RealVect&
164 vect() const;
165
166protected:
171
176};
177
184template <size_t M, size_t N>
185inline std::ostream&
187
188#include <CD_NamespaceFooter.H>
189
191
192#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:278
A generic particle class, holding the position and a specified number of real and vector values.
Definition CD_GenericParticle.H:77
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26
A tracer particle class. This is templated for holding extra storage (useful for kernels).
Definition CD_TracerParticle.H:34
TracerParticle()
Default constructor – initializes everything to zero.
Definition CD_TracerParticleImplem.H:21
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:129
virtual void H5linearOut(void *const a_buffer) const
Linearize the Real components onto a buffer workable by HDF5.
Definition CD_TracerParticleImplem.H:180
RealVect & vect()
Get one of the RealVects.
Definition CD_TracerParticleImplem.H:263
RealVect m_velocity
Particle velocity.
Definition CD_TracerParticle.H:175
RealVect & velocity()
Get the particle velocity.
Definition CD_TracerParticleImplem.H:66
virtual int H5size() const
Function that is used when writing particles to HDF5.
Definition CD_TracerParticleImplem.H:165
virtual ~TracerParticle()
Destructor (deallocates runtime memory storage)
Definition CD_TracerParticleImplem.H:47
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:93
Real m_weight
Particle "weight".
Definition CD_TracerParticle.H:170
virtual void H5linearIn(const void *const a_buffer)
Delinearize the buffer onto the real components in the particle class.
Definition CD_TracerParticleImplem.H:213
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:80
Real & real()
Get one of the scalars.
Definition CD_TracerParticleImplem.H:247
Real & weight()
Get the particle "weight".
Definition CD_TracerParticleImplem.H:52