chombo-discharge
Loading...
Searching...
No Matches
CD_NonCommParticleImplem.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_NONCOMMPARTICLEIMPLEM_H
14#define CD_NONCOMMPARTICLEIMPLEM_H
15
16// Our includes
17#include <CD_NonCommParticle.H>
18#include <CD_NamespaceHeader.H>
19
20template <size_t M, size_t N>
22{
23 for (auto& s : m_scalars) {
24 s = 0.0;
25 }
26
27 for (auto& v : m_vectors) {
29 }
30}
31
32template <size_t M, size_t N>
34{
35 this->m_scalars = a_other.m_scalars;
36 this->m_vectors = a_other.m_vectors;
37}
38
39template <size_t M, size_t N>
42
43template <size_t M, size_t N>
44template <size_t K>
45inline Real&
47{
48 return std::get<K>(m_scalars);
49}
50
51template <size_t M, size_t N>
52template <size_t K>
53inline const Real&
55{
56 return std::get<K>(m_scalars);
57}
58
59template <size_t M, size_t N>
60template <size_t K>
61inline RealVect&
63{
64 return std::get<K>(m_vectors);
65}
66
67template <size_t M, size_t N>
68template <size_t K>
69inline const RealVect&
71{
72 return std::get<K>(m_vectors);
73}
74
75template <size_t M, size_t N>
76inline bool
78{
79 return (m_scalars = a_other.m_scalars) && (m_vectors == a_other.m_vectors);
80}
81
82template <size_t M, size_t N>
83inline bool
85{
86 return !(*this == a_other);
87}
88
89#include <CD_NamespaceFooter.H>
90
91#endif
Declaration of a generic particle class.
bool operator!=(const NonCommParticle< M, N > &a_other) const
Comparison operator with other particle.
Definition CD_NonCommParticleImplem.H:84
RealVect & vect()
Get one of the RealVects.
Definition CD_NonCommParticleImplem.H:62
NonCommParticle()
Default constructor – initializes everything to zero.
Definition CD_NonCommParticleImplem.H:21
bool operator==(const NonCommParticle< M, N > &a_other) const
Comparison operator with other particle.
Definition CD_NonCommParticleImplem.H:77
virtual ~NonCommParticle()
Destructor (deallocates runtime memory storage)
Definition CD_NonCommParticleImplem.H:40
Real & real()
Get one of the scalars.
Definition CD_NonCommParticleImplem.H:46
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