24#ifndef SMOOTH_INDICATOR_BASE_F_2D_HH
25#define SMOOTH_INDICATOR_BASE_F_2D_HH
34template <
typename T,
typename S>
37 _myMin(S()), _myMax(S()), _pos(S()), _rotMat(S()), _circumRadius(S()), _theta(S()), _epsilon(S())
40template <
typename T,
typename S>
43 _rotMat = util::calculateInverseRotationMatrix<T,2>(
Vector<T,1>(this->_theta) );
46template <
typename T,
typename S>
52template <
typename T,
typename S>
58template <
typename T,
typename S>
64template <
typename T,
typename S>
70template <
typename T,
typename S>
76template <
typename T,
typename S>
82template <
typename T,
typename S>
88template <
typename T,
typename S>
94template <
typename T,
typename S>
100template <
typename T,
typename S>
107template <
typename T,
typename S>
113template <
typename T,
typename S>
118 return S(std::numeric_limits<
BaseType<S>>::quiet_NaN());
121template <
typename T,
typename S>
129template <
typename T,
typename S>
132 return surfaceNormal(pos, meshSize, [&](
const Vector<S,2>& pos) {
137template <
typename T,
typename S>
142 return this->signedDistance( transformPos(pos) );
146template <
typename T,
typename S>
151 return std::numeric_limits<double>::quiet_NaN();
154template <
typename T,
typename S>
157 S
const halfEps = this->getEpsilon() * 0.5;
164 originValue = this->signedDistance(origin) <= halfEps;
165 currentValue = this->signedDistance(currentPoint) <= halfEps;
167 while (currentValue == originValue && this->isInsideCircumRadius(currentPoint)) {
168 currentPoint += direction;
170 currentValue = this->signedDistance(currentPoint) <= halfEps;
174 if (!this->isInsideCircumRadius(currentPoint) && !originValue) {
179 while (pitch >= precision) {
180 if (!this->isInsideCircumRadius(currentPoint) && originValue) {
181 currentPoint -= pitch * direction;
185 currentValue = this->signedDistance(currentPoint) <= halfEps;
186 if (currentValue == originValue) {
187 currentPoint += pitch * direction;
191 currentPoint -= pitch * direction;
197 distance =
norm(currentPoint - origin);
201template <
typename T,
typename S>
204 T
const signedDist = this->signedDistance(input);
208template <
typename T,
typename S>
211 return norm(input) <= this->getCircumRadius();
216template <
typename T,
typename S>
225template <
typename T,
typename S>
234template <
typename T,
typename S>
237 _circumRadius(S()), _epsilon(S())
240template <
typename T,
typename S>
243 return _circumRadius;
246template <
typename T,
typename S>
252template <
typename T,
typename S>
258template <
typename T,
typename S>
264template <
typename T,
typename S>
269 return std::numeric_limits<double>::quiet_NaN();
272template <
typename T,
typename S>
277 return S(std::numeric_limits<
BaseType<S>>::quiet_NaN());
280template <
typename T,
typename S>
283 return surfaceNormal(pos, meshSize, [&](
const Vector<S,2>& pos) {
288template <
typename T,
typename S>
293 return this->signedDistance( transformPos(pos) );
297template <
typename T,
typename S>
302 return std::numeric_limits<double>::quiet_NaN();
305template <
typename T,
typename S>
308 S
const halfEps = this->getEpsilon() * 0.5;
315 originValue = this->signedDistance(origin) <= halfEps;
316 currentValue = this->signedDistance(currentPoint) <= halfEps;
318 while (currentValue == originValue && this->isInsideCircumRadius(currentPoint)) {
319 currentPoint += direction;
321 currentValue = this->signedDistance(currentPoint) <= halfEps;
325 if (!this->isInsideCircumRadius(currentPoint) && !originValue) {
330 while (pitch >= precision) {
331 if (!this->isInsideCircumRadius(currentPoint) && originValue) {
332 currentPoint -= pitch * direction;
336 currentValue = this->signedDistance(currentPoint) <= halfEps;
337 if (currentValue == originValue) {
338 currentPoint += pitch * direction;
342 currentPoint -= pitch * direction;
348 distance =
norm(currentPoint - origin);
352template <
typename T,
typename S>
357 clout <<
"WARNING: SmoothIndicatorF2D::operator() a particle (= true) SmoothIndicator does not consider the current position of the particle. Please use the evalSolidVolumeFraction method for this." << std::endl;
359 T
const signedDist = this->signedDistance(input);
363template <
typename T,
typename S>
366 return norm(input) <= this->getCircumRadius();
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, 2 > & getMax() const
const Vector< S, 2 > & getMin() const
SmoothIndicatorIdentity2D(SmoothIndicatorF2D< T, S, false > &f)
SmoothIndicatorF2D< T, S, false > & _f
bool operator()(T output[], const S input[]) override
has to be implemented for 'every' derived class
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.