25#ifndef INDIC_CALC_2D_HH
26#define INDIC_CALC_2D_HH
53 this->_f(output, input);
55 this->_g(&tmp, input);
70 this->_f(output, input);
72 this->_g(&tmp, input);
88 this->_f(output, input);
90 this->_g(&tmp, input);
100 auto tmp = std::make_shared< IndicPlus1D<S> >(*
this,rhs);
101 this->_ptrCalcC = tmp;
108 auto tmp = std::make_shared< IndicMinus1D<S> >(*
this,rhs);
109 this->_ptrCalcC = tmp;
116 auto tmp = std::make_shared< IndicMultiplication1D<S> >(*
this,rhs);
117 this->_ptrCalcC = tmp;
125template <
typename S,
template<
typename U>
class F>
130template <
typename S,
template<
typename U>
class F>
134 bool* outputF = output;
135 _f->operator()(outputF, input);
137 bool outputG[this->getTargetDim()];
138 _g->operator()(outputG, input);
140 for (
int i = 0; i < this->getTargetDim(); i++) {
141 output[i] = F<S>()(outputF[i], outputG[i]);
150 for (
int i=0; i<2; i++) {
159 return sdf::unify(this->_f->signedDistance(input), this->_g->signedDistance(input));
168 for (
int i=0; i<2; i++) {
169 this->
_myMin[i] = this->
_f->getMin()[i];
170 this->
_myMax[i] = this->
_f->getMax()[i];
177 return sdf::subtraction(this->_f->signedDistance(input), this->_g->signedDistance(input));
185 for (
int i=0; i<2; i++) {
194 return sdf::intersection(this->_f->signedDistance(input), this->_g->signedDistance(input));
202template<
typename S,
template <
typename U>
class F1,
template <
typename V>
class F2,
204std::shared_ptr<IndicatorF2D<S>>
operator+(std::shared_ptr<F1<S>> lhs, std::shared_ptr<F2<S>> rhs)
206 return std::make_shared<IndicPlus2D<S>>(lhs, rhs);
209template<
typename S,
template <
typename U>
class F1,
template <
typename V>
class F2,
211std::shared_ptr<IndicatorF2D<S>>
operator-(std::shared_ptr<F1<S>> lhs, std::shared_ptr<F2<S>> rhs)
213 return std::make_shared<IndicMinus2D<S>>(lhs, rhs);
216template<
typename S,
template <
typename U>
class F1,
template <
typename V>
class F2,
218std::shared_ptr<IndicatorF2D<S>>
operator*(std::shared_ptr<F1<S>> lhs, std::shared_ptr<F2<S>> rhs)
220 return std::make_shared<IndicMultiplication2D<S>>(lhs, rhs);
224template<
typename S,
template <
typename U>
class F1,
template <
typename V>
class F2,
226std::shared_ptr<IndicatorF2D<S>>
operator+(F1<S> & lhs, std::shared_ptr<F2<S>> rhs)
231template<
typename S,
template <
typename U>
class F1,
template <
typename V>
class F2,
233std::shared_ptr<IndicatorF2D<S>>
operator-(F1<S> & lhs, std::shared_ptr<F2<S>> rhs)
238template<
typename S,
template <
typename U>
class F1,
template <
typename V>
class F2,
240std::shared_ptr<IndicatorF2D<S>>
operator*(F1<S> & lhs, std::shared_ptr<F2<S>> rhs)
std::shared_ptr< GenericF< T, S > > _ptrCalcC
memory management, frees resouces (calcClass)
IndicCalc1D //////////////////////////////// arithmetic helper class for Indicator 1d functors.
IndicCalc1D(IndicatorF1D< S > &f, IndicatorF1D< S > &g)
indicCalc2D //////////////////////////////// arithmetic helper class for Indicator 2D functors
std::shared_ptr< IndicatorF2D< S > > _f
bool operator()(bool output[], const S input[3])
IndicCalc2D(std::shared_ptr< IndicatorF2D< S > > f, std::shared_ptr< IndicatorF2D< S > > g)
IndicMinus1D(IndicatorF1D< S > &f, IndicatorF1D< S > &g)
bool operator()(bool output[], const S input[]) override
has to be implemented for 'every' derived class
S signedDistance(const Vector< S, 2 > &input) override
Returns signed distance to the nearest point on the indicator surface.
IndicMinus2D(std::shared_ptr< IndicatorF2D< S > > f, std::shared_ptr< IndicatorF2D< S > > g)
bool operator()(bool output[], const S input[]) override
has to be implemented for 'every' derived class
IndicMultiplication1D(IndicatorF1D< S > &f, IndicatorF1D< S > &g)
IndicMultiplication2D(std::shared_ptr< IndicatorF2D< S > > f, std::shared_ptr< IndicatorF2D< S > > g)
S signedDistance(const Vector< S, 2 > &input) override
Returns signed distance to the nearest point on the indicator surface.
IndicPlus1D(IndicatorF1D< S > &f, IndicatorF1D< S > &g)
bool operator()(bool output[], const S input[]) override
has to be implemented for 'every' derived class
IndicPlus2D(std::shared_ptr< IndicatorF2D< S > > f, std::shared_ptr< IndicatorF2D< S > > g)
S signedDistance(const Vector< S, 2 > &input) override
Returns signed distance to the nearest point on the indicator surface.
IndicatorF1D is an application from .
IndicatorF1D< S > & operator-(IndicatorF1D< S > &rhs)
IndicatorF1D< S > & operator*(IndicatorF1D< S > &rhs)
virtual Vector< S, 1 > & getMin()
virtual Vector< S, 1 > & getMax()
IndicatorF1D< S > & operator+(IndicatorF1D< S > &rhs)
IndicatorF2D is an application from .
T intersection(T a, T b) any_platform
Volume which is shared by a and b creates a new object.
T unify(T a, T b) any_platform
Volume of a and volume of b are combined as a new object.
T subtraction(T a, T b) any_platform
Volume of a is subtracted from b.
cpu::simd::Pack< T > min(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
cpu::simd::Pack< T > max(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
Top level namespace for all of OpenLB.
constexpr meta::enable_if_arithmetic_t< U, Vector< T, D > > operator-(U a, const ScalarVector< T, D, IMPL > &b) any_platform
constexpr meta::enable_if_arithmetic_t< U, Vector< T, D > > operator+(U a, const ScalarVector< T, D, IMPL > &b) any_platform
constexpr meta::enable_if_arithmetic_t< U, Vector< decltype(T{} *U{}), D > > operator*(U a, const ScalarVector< T, D, IMPL > &b) any_platform