chombo-discharge
CD_NonCommParticle.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_NonCommParticle_H
13 #define CD_NonCommParticle_H
14 
15 // Std includes
16 #include <string>
17 #include <typeinfo>
18 #include <cstdio>
19 #include <cmath>
20 
21 // Chombo includes
22 #include <RealVect.H>
23 
24 // Our includes
25 #include <CD_NamespaceHeader.H>
26 
30 template <size_t M, size_t N>
32 {
33 public:
37  inline NonCommParticle();
38 
43  inline NonCommParticle(const NonCommParticle<M, N>& a_other);
44 
48  inline virtual ~NonCommParticle();
49 
56  template <size_t K>
57  inline Real&
58  real();
59 
66  template <size_t K>
67  inline const Real&
68  real() const;
69 
76  template <size_t K>
77  inline RealVect&
78  vect();
79 
86  template <size_t K>
87  inline const RealVect&
88  vect() const;
89 
95  inline bool
96  operator==(const NonCommParticle<M, N>& a_other) const;
97 
103  inline bool
104  operator!=(const NonCommParticle<M, N>& a_other) const;
105 
106 protected:
110  std::array<Real, M> m_scalars;
111 
115  std::array<RealVect, N> m_vectors;
116 };
117 
123 template <size_t M, size_t N>
124 inline std::ostream&
125 operator<<(std::ostream& ostr, const NonCommParticle<M, N>& p);
126 
127 #include <CD_NamespaceFooter.H>
128 
130 
131 #endif
Implementation of CD_NonCommParticle.H.
std::ostream & operator<<(std::ostream &ostr, const NonCommParticle< M, N > &p)
Particle printing function.
A generic non-communicated particle class.
Definition: CD_NonCommParticle.H:32
std::array< Real, M > m_scalars
Scalar storage array.
Definition: CD_NonCommParticle.H:110
bool operator!=(const NonCommParticle< M, N > &a_other) const
Comparison operator with other particle.
Definition: CD_NonCommParticleImplem.H:83
RealVect & vect()
Get one of the RealVects.
Definition: CD_NonCommParticleImplem.H:61
NonCommParticle()
Default constructor – initializes everything to zero.
Definition: CD_NonCommParticleImplem.H:20
bool operator==(const NonCommParticle< M, N > &a_other) const
Comparison operator with other particle.
Definition: CD_NonCommParticleImplem.H:76
std::array< RealVect, N > m_vectors
vector storage array
Definition: CD_NonCommParticle.H:115
virtual ~NonCommParticle()
Destructor (deallocates runtime memory storage)
Definition: CD_NonCommParticleImplem.H:39
Real & real()
Get one of the scalars.
Definition: CD_NonCommParticleImplem.H:45