31#ifndef PARTICLE_CONDITIONS_H
32#define PARTICLE_CONDITIONS_H
43 static constexpr bool value=
true;
48 template<
typename T,
typename PARTICLETYPE>
57 template<
typename T,
typename PARTICLETYPE>
66 template<
typename T,
typename PARTICLETYPE>
68 using namespace descriptors;
70 bool hasCentre =
true;
71 if constexpr ( PARTICLETYPE::template providesNested<PARALLELIZATION,IC>() ) {
72 hasCentre = (particle.template getField<PARALLELIZATION,IC>() == globiC);
74 return (valid && hasCentre);
81 template<
typename T,
typename PARTICLETYPE>
83 using namespace descriptors;
85 bool hasCentre =
true;
86 if constexpr ( PARTICLETYPE::template providesNested<PARALLELIZATION,IC>() ) {
87 hasCentre = (particle.template getField<PARALLELIZATION,IC>() == globiC);
89 return (valid && !hasCentre);
97 template<
typename T,
typename PARTICLETYPE>
99 using namespace descriptors;
102 return (active && valid);
110 template<
typename T,
typename PARTICLETYPE>
112 using namespace descriptors;
115 return (!active && valid);
123 template<
typename T,
typename PARTICLETYPE>
125 using namespace descriptors;
128 bool hasCentre =
true;
129 if constexpr ( PARTICLETYPE::template providesNested<PARALLELIZATION,IC>() ) {
130 hasCentre = (particle.template getField<PARALLELIZATION,IC>() == globiC);
132 return (active && valid && hasCentre);
138template<std::
size_t selectedID>
140 template<
typename T,
typename PARTICLETYPE>
142 using namespace descriptors;
144 if constexpr ( PARTICLETYPE::template providesNested<PARALLELIZATION,ID>() ) {
145 match = (particle.template getField<PARALLELIZATION,ID>() == selectedID);
147 match = (particle.
getId() == selectedID);
155template<std::
size_t selectedID>
157 template<
typename T,
typename PARTICLETYPE>
159 using namespace descriptors;
162 if constexpr ( PARTICLETYPE::template providesNested<PARALLELIZATION>() ) {
163 static_assert(PARTICLETYPE::template providesNested<PARALLELIZATION,ID>(),
"Field PARALLELIZATION:ID has to be provided");
164 match = (particle.template getField<PARALLELIZATION,ID>() == selectedID);
166 match = (particle.
getId() == selectedID);
168 return (valid && match);
std::size_t getId() const
Return memory ID of the currently represented particle.
bool isActive(Particle< T, PARTICLETYPE > particle)
bool isValid(Particle< T, PARTICLETYPE > particle)
Top level namespace for all of OpenLB.
static constexpr bool dynamic
static bool value(Particle< T, PARTICLETYPE > &particle, int globiC)
static constexpr bool dynamic
static bool value(Particle< T, PARTICLETYPE > &particle)
static constexpr bool dynamic
static constexpr bool value
static bool value(Particle< T, PARTICLETYPE > &particle)
static constexpr bool dynamic
static bool value(Particle< T, PARTICLETYPE > &particle)
static constexpr bool dynamic
static constexpr bool dynamic
static bool value(Particle< T, PARTICLETYPE > &particle)
static bool value(Particle< T, PARTICLETYPE > &particle, int globiC)
static constexpr bool dynamic
static bool value(Particle< T, PARTICLETYPE > &particle)
static constexpr bool dynamic
static constexpr bool dynamic
static bool value(Particle< T, PARTICLETYPE > &particle, int globiC)
static constexpr bool dynamic
static bool value(Particle< T, PARTICLETYPE > &particle)