28#ifndef SMOOTHINDICATOR_INTERACTION_H
29#define SMOOTHINDICATOR_INTERACTION_H
43template <
typename T,
typename S,
typename PARTICLETYPE>
47 using namespace descriptors;
48 constexpr unsigned D = PARTICLETYPE::d;
50 const PhysR<T, D> position = particle.template getField<GENERAL, POSITION>();
51 if constexpr (PARTICLETYPE::template providesNested<SURFACE, ROT_MATRIX>()) {
54 particle.template getField<SURFACE, ROT_MATRIX>());
58 return input - position;
61 __builtin_unreachable();
64template <
typename T,
typename S,
typename PARTICLETYPE>
69 constexpr unsigned D = PARTICLETYPE::d;
70 using namespace descriptors;
72 if constexpr (PARTICLETYPE::template providesNested<SURFACE, ROT_MATRIX>()) {
75 particle.template getField<SURFACE, ROT_MATRIX>());
82 __builtin_unreachable();
85template <
typename T,
typename S,
typename PARTICLETYPE>
89 using namespace descriptors;
92 sIndicator->getCircumRadius();
95template <
typename T,
typename S,
typename PARTICLETYPE>
99 using namespace descriptors;
107 return sIndicator->signedDistance(newInput) <= 0;
110template <
typename T,
typename S,
typename PARTICLETYPE>
114 using namespace descriptors;
115 auto sIndicator = particle.template getField<SURFACE, SINDICATOR>();
120 const unsigned D = PARTICLETYPE::d;
124 return sIndicator->signedDistance(input);
129 constexpr bool symmetryCheck =
false;
133 return sIndicator->signedDistance(newInput);
137template <
typename T,
typename S,
typename PARTICLETYPE>
141 S precision, S pitch)
143 using namespace descriptors;
144 auto sIndicator = particle.template getField<SURFACE, SINDICATOR>();
150 distance, input, dir, precision, pitch,
151 [&](
bool output[1],
const T input[3]) {
152 output[0] = sIndicator->signedDistance(
158 return norm(pos) <= 1.5 * sIndicator->getCircumRadius();
165 clout <<
"WARNING: Distance to particle in direction "
166 <<
normalize(direction) <<
" couldn't be calculated." << std::endl;
171 __builtin_unreachable();
174template <
typename T,
typename S,
typename PARTICLETYPE>
180 using namespace descriptors;
181 auto sIndicator = particle.template getField<SURFACE, SINDICATOR>();
187 distance, input, dir, precision,
189 return sIndicator->signedDistance(input);
193 return norm(pos) <= 1.5 * sIndicator->getCircumRadius();
200 clout <<
"WARNING: Distance to particle in direction "
201 <<
normalize(direction) <<
" couldn't be calculated." << std::endl;
206 __builtin_unreachable();
209template <
typename T,
typename S,
typename PARTICLETYPE>
214 using namespace descriptors;
215 constexpr unsigned D = PARTICLETYPE::d;
216 auto sIndicator = particle.template getField<SURFACE, SINDICATOR>();
219 return sIndicator->surfaceNormal(pos, meshSize, [&](
const Vector<S, D>& pos) {
224template <
typename T,
typename S,
typename PARTICLETYPE>
228 using namespace descriptors;
229 auto sIndicator = particle.template getField<SURFACE, SINDICATOR>();
233 sIndicator->getEpsilon());
class for marking output with some text
Vector< T, PARTICLETYPE::d > getElongation(Particle< T, PARTICLETYPE > particle)
auto getSmoothIndicatorPtr(Particle< T, PARTICLETYPE > particle)
constexpr bool providesElongation()
Vector< T, PARTICLETYPE::d > getPosition(Particle< T, PARTICLETYPE > particle)
PhysR< S, PARTICLETYPE::d > transformDirection(Particle< T, PARTICLETYPE > &particle, const PhysR< S, PARTICLETYPE::d > &direction)
const S distanceToParticle(Particle< T, PARTICLETYPE > &particle, const Vector< S, PARTICLETYPE::d > &origin, const Vector< S, PARTICLETYPE::d > &direction, S precision, S pitch)
bool isInsideCircumRadius(Particle< T, PARTICLETYPE > &particle, const PhysR< S, PARTICLETYPE::d > &input)
PhysR< S, PARTICLETYPE::d > transformInput(Particle< T, PARTICLETYPE > &particle, const PhysR< S, PARTICLETYPE::d > &input)
Vector< S, PARTICLETYPE::d > normalOnParticleSurface(Particle< T, PARTICLETYPE > &particle, const Vector< S, PARTICLETYPE::d > &pos, const T meshSize)
bool isInsideParticle(Particle< T, PARTICLETYPE > &particle, const PhysR< S, PARTICLETYPE::d > &input)
const S signedDistanceToParticle(Particle< T, PARTICLETYPE > &particle, const PhysR< S, PARTICLETYPE::d > &input)
bool evalSolidVolumeFraction(T output[], const S input[], Particle< T, PARTICLETYPE > &particle)
T elongation(std::function< T(const Vector< T, 3 > &)> sdf, const Vector< T, 3 > &p, const Vector< T, 3 > &h, const Vector< T, 3 > ¢er=(T(0))) any_platform
Elongation splits the object in 2 (4 or 8) parts, moves them apart and connects them again The object...
bool evalSolidVolumeFraction(T output[], T signedDist, T eps) any_platform
bool distance(S &distance, const Vector< S, D > &origin, const Vector< S, D > &direction, S precision, S pitch, F1 isInside, F2 isInsideBoundingBox)
Vector< T, D > executeRotation(const Vector< T, D > &input, const Vector< T, utilities::dimensions::convert< D >::matrix > &rotationMatrix, const Vector< T, D > &rotationCenter=Vector< T, D >(0.))
Rotates the input around the rotationCenter with a given rotationMatrix.
Vector< T, utilities::dimensions::convert< D >::matrix > invertRotationMatrix(const Vector< T, utilities::dimensions::convert< D >::matrix > &rotationMatrix)
Top level namespace for all of OpenLB.
constexpr T norm(const ScalarVector< T, D, IMPL > &a) any_platform
Euclidean vector norm.
constexpr Vector< T, D > normalize(const ScalarVector< T, D, IMPL > &a, T scale=T{1})