24#ifndef SMOOTH_INDICATOR_BASE_F_3D_HH
25#define SMOOTH_INDICATOR_BASE_F_3D_HH
35template <
typename T,
typename S>
38 _myMin(S()), _myMax(S()), _pos(S()), _rotMat(S()), _circumRadius(S()),
39 _theta(S()), _epsilon(S())
42template <
typename T,
typename S>
45 _rotMat = util::calculateInverseRotationMatrix<T,3>( this->_theta );
48template <
typename T,
typename S>
54template <
typename T,
typename S>
60template <
typename T,
typename S>
66template <
typename T,
typename S>
72template <
typename T,
typename S>
78template <
typename T,
typename S>
84template <
typename T,
typename S>
90template <
typename T,
typename S>
96template <
typename T,
typename S>
102template <
typename T,
typename S>
109template <
typename T,
typename S>
115template <
typename T,
typename S>
120 return S(std::numeric_limits<
BaseType<S>>::quiet_NaN());
123template <
typename T,
typename S>
131template <
typename T,
typename S>
139template <
typename T,
typename S>
142 T
const signedDist = this->signedDistance(input);
146template <
typename T,
typename S>
149 return norm(input-this->getPos()) <= this->getCircumRadius();
152template <
typename T,
typename S>
155 return surfaceNormal(pos, meshSize, [&](
const Vector<S,3>& pos) {
160template <
typename T,
typename S>
165 return this->signedDistance( transformPos(pos) );
169template <
typename T,
typename S>
174 return std::numeric_limits<double>::quiet_NaN();
177template <
typename T,
typename S>
180 S
const halfEps = this->getEpsilon() * 0.5;
187 originValue = this->signedDistance(origin) <= halfEps;
188 currentValue = this->signedDistance(currentPoint) <= halfEps;
190 while (currentValue == originValue && this->isInsideCircumRadius(currentPoint)) {
191 currentPoint += direction;
193 currentValue = this->signedDistance(currentPoint) <= halfEps;
197 if (!this->isInsideCircumRadius(currentPoint) && !originValue) {
202 while (pitch >= precision) {
203 if (!this->isInsideCircumRadius(currentPoint) && originValue) {
204 currentPoint -= pitch * direction;
208 currentValue = this->signedDistance(currentPoint) <= halfEps;
209 if (currentValue == originValue) {
210 currentPoint += pitch * direction;
214 currentPoint -= pitch * direction;
220 distance =
norm(currentPoint - origin);
226template <
typename T,
typename S>
235template <
typename T,
typename S>
244template <
typename T,
typename S>
247 _circumRadius(S()), _epsilon(S())
250template <
typename T,
typename S>
255 clout <<
"WARNING: SmoothIndicatorF3D::operator() a particle (= true) SmoothIndicator does not consider the current position of the particle. Please use the evalSolidVolumeFraction method for this." << std::endl;
257 T
const signedDist = this->signedDistance(input);
261template <
typename T,
typename S>
264 return norm(input) <= this->getCircumRadius();
267template <
typename T,
typename S>
270 return surfaceNormal(pos, meshSize, [&](
const Vector<S,3>& pos) {
275template <
typename T,
typename S>
280 return this->signedDistance( transformPos(pos) );
284template <
typename T,
typename S>
289 return std::numeric_limits<double>::quiet_NaN();
292template <
typename T,
typename S>
295 S
const halfEps = this->getEpsilon() * 0.5;
302 originValue = this->signedDistance(origin) <= halfEps;
303 currentValue = this->signedDistance(currentPoint) <= halfEps;
305 while (currentValue == originValue && this->isInsideCircumRadius(currentPoint)) {
306 currentPoint += direction;
308 currentValue = this->signedDistance(currentPoint) <= halfEps;
312 if (!this->isInsideCircumRadius(currentPoint) && !originValue) {
317 while (pitch >= precision) {
318 if (!this->isInsideCircumRadius(currentPoint) && originValue) {
319 currentPoint -= pitch * direction;
323 currentValue = this->signedDistance(currentPoint) <= halfEps;
324 if (currentValue == originValue) {
325 currentPoint += pitch * direction;
329 currentPoint -= pitch * direction;
335 distance =
norm(currentPoint - origin);
339template <
typename T,
typename S>
342 return _circumRadius;
345template <
typename T,
typename S>
351template <
typename T,
typename S>
357template <
typename T,
typename S>
363template <
typename T,
typename S>
368 return std::numeric_limits<double>::quiet_NaN();
371template <
typename T,
typename S>
376 return S(std::numeric_limits<
BaseType<S>>::quiet_NaN());
379template <
typename T,
typename S>
384 return S(std::numeric_limits<
BaseType<S>>::quiet_NaN());
AnalyticalF are applications from DD to XD, where X is set by the constructor.
std::shared_ptr< GenericF< T, S > > _ptrCalcC
memory management, frees resouces (calcClass)
class for marking output with some text
const Vector< S, 3 > & getMin() const
const Vector< S, 3 > & getMax() const
bool operator()(T output[], const S input[]) override
has to be implemented for 'every' derived class
SmoothIndicatorF3D< T, S, false > & _f
SmoothIndicatorIdentity3D(SmoothIndicatorF3D< T, S, false > &f)
bool evalSolidVolumeFraction(T output[], T signedDist, T eps) any_platform
Vector< S, D > surfaceNormal(const Vector< S, D > &pos, const S meshSize, F1 sdf)
Top level namespace for all of OpenLB.
typename util::BaseTypeHelper< T >::type BaseType
constexpr T norm(const ScalarVector< T, D, IMPL > &a)
Euclidean vector norm.