47template<
typename T,
typename S,
bool>
class SmoothIndicatorSphere3D;
54template <
unsigned D,
typename T,
typename S>
57 std::vector<std::reference_wrapper<AnalyticalF<D,T,S>>> _f;
59 template <
unsigned otherD=D,
typename =
typename std::enable_if_t<otherD==2>>
65 template <
unsigned otherD=D,
typename =
typename std::enable_if_t<otherD==3>>
72 bool operator() (T output[],
const S x[])
override;
76template <
unsigned D,
typename T,
typename S>
79 std::function<bool(T*,
const S*)> _f;
84 AnalyticalF<D,T,S>(typename decltype(std::function(f))::result_type{}.d),
85 _f([&,f](T* output, const S* input) -> bool {
87 for (
unsigned iD=0; iD <
typename decltype(std::function(f))::result_type{}.d; ++iD) {
94 bool operator() (T output[],
const S input[])
override {
95 return _f(output, input);
100template <
unsigned D,
typename T,
typename S>
112 bool operator() (T output[],
const S x[])
override;
114 template<
typename V,
typename U>
117 template<
typename V,
typename U>
124template <
unsigned D,
typename T,
typename S>
128 std::vector<T> _mean;
132 bool operator() (T output[],
const S x[])
override;
136template <
unsigned D,
typename T,
typename S>
140 std::random_device
rd;
145template <
unsigned D,
typename T,
typename S,
unsigned seed>
149 std::random_device
rd;
154template <
unsigned D,
typename T,
typename S>
158 bool operator() (T output[],
const S x[])
override;
160 std::uniform_real_distribution<T> distro;
164template <
unsigned D,
typename T,
typename S>
168 bool operator() (T output[],
const S x[])
override;
174template <
unsigned D,
typename T,
typename S,
unsigned seed>
178 bool operator() (T output[],
const S x[])
override;
185template <
unsigned D,
typename T,
typename S>
189 bool operator() (T output[],
const S x[])
override;
197template <
unsigned D,
typename T,
typename S>
201 bool operator() (T output[],
const S x[])
override;
210template <
typename T,
typename S,
typename DESCRIPTOR>
220 bool operator()(T output[],
const S input[])
override;
229template <
typename T,
typename S,
typename DESCRIPTOR>
241 bool operator()(T output[],
const S input[])
override;
248template <
unsigned D,
typename T,
typename S>
252 bool operator() (T output[],
const S x[])
override;
261template <
unsigned D,
typename T,
typename S>
265 bool operator() (T output[],
const S x[])
override;
283template <
unsigned D,
typename U,
typename T,
typename S,
284 bool ComponentWise,
bool ReturnArray>
298 template <
typename G>
300 :
AnalyticalF<D,U,S>((ComponentWise) ? f.getTargetDim() : targetDim),
307 :
AnalyticalF<D,U,S>(f.getTargetDim()), _f(f), _g(g) {
308 static_assert(ComponentWise);
309 static_assert(! std::is_pointer_v<U>);
316 template<
typename wrapped_U>
321 static_assert(! ComponentWise);
328 template<
typename wrapped_U>
333 static_assert(! ComponentWise);
336 bool operator() (U output[],
const S x[])
override {
339 if constexpr (ComponentWise) {
341 output[i] = _g(outputTmp[i]);
344 if constexpr (ReturnArray) {
345 for (
int i = 0; i < this->getTargetDim(); ++i) {
346 const auto* outputTmp2 = _g(outputTmp);
347 output[i] = outputTmp2[i];
350 output[0] = _g(outputTmp);
357template <
unsigned D,
typename T,
typename S,
typename G>
360 std::remove_pointer_t<
decltype(
361 g(std::conditional_t<std::is_invocable_v<G,T>,T,T*>{}))>,T,S,
362 std::is_invocable_v<G,T>,
363 std::is_pointer_v<
decltype(
364 g(std::conditional_t<std::is_invocable_v<G,T>,T,T*>{}))>>;
367template <
unsigned D,
typename T,
typename S,
typename U=T>
371template <
unsigned D,
typename wrapped_U,
typename T,
typename S>
374 false,std::is_pointer_v<wrapped_U>>;
376template <
unsigned D,
typename wrapped_U,
typename T,
typename S>
379 false,std::is_pointer_v<wrapped_U>>;
383template <
typename T,
typename S>
385template <
typename T,
typename S>
387template <
typename T,
typename S>
390template <
typename T,
typename S>
392template <
typename T,
typename S>
395template <
typename T,
typename S>
397template <
typename T,
typename S>
399template <
typename T,
typename S>
414template <
typename T,
typename S>
422 bool operator() (T output[],
const S x[])
override;
424 template<
typename V,
typename U>
427 template<
typename V,
typename U>
436template <
typename T,
typename S>
444 bool operator() (T output[],
const S x[])
override;
449template <
typename T,
typename S>
456 bool operator() (T output[],
const S x[])
override;
461template <
typename T,
typename S>
468 bool operator() (T output[],
const S x[])
override;
472template <
typename T,
typename S>
478 Sinus (T period=1, T amplitude=1);
479 bool operator() (T output[],
const S x[])
override;
483template <
typename T,
typename S>
489 Cosinus(T period=1, T amplitude=1);
490 bool operator() (T output[],
const S x[])
override;
492 template<
typename V,
typename U>
495 template<
typename V,
typename U>
502template <
typename T,
typename S>
510 bool operator() (T output[],
const S x[])
override;
518template <
typename T,
typename S>
527 bool operator() (T output[],
const S x[])
override;
529 template<
typename V,
typename U>
532 template<
typename V,
typename U>
539template <
typename T,
typename S>
547 bool operator() (T output[],
const S x[]);
553template <
typename T,
typename S>
562 AnalyticalLinear3D(S x0, S y0, S z0, T v0, S x1, S y1, S z1, T v1, S x2, S y2,
563 S z2, T v2, S x3, S y3, S z3, T v3);
564 bool operator() (T output[],
const S x[])
override;
568template <
typename T,
typename S>
575 bool operator() (T output[],
const S x[])
override;
579template <
typename T,
typename S,
typename DESCRIPTOR>
583 T _physDiffusionCoefficient;
586 bool operator()(T output[1],
const S x[3])
override;
590template <
typename T,
typename S,
typename DESCRIPTOR>
594 T _physDiffusionCoefficient;
598 bool operator()(T output[1],
const S x[3])
override;
606template <
typename T,
typename S>
614 bool operator()(T output[1],
const S x[3])
override;
618template <
typename T,
typename S>
626 bool operator()(T output[1],
const S x[2])
override;
630template <
typename T,
typename S>
641 bool operator()(T output[1],
const S x[2])
override;
652template <
unsigned D,
typename T,
typename S>
655 const unsigned _numberOfCuboids;
657 std::shared_ptr<const CuboidDecomposition<T,D>> _cuboids;
658 const std::vector<T> _values;
662 const std::vector<T>& values,
unsigned targetDim=D)
664 _numberOfCuboids(values.size()),
666 sGeometry.getCuboidDecomposition().getMotherCuboid(),
670 this->
getName() =
"cuboidwiseConst";
673 bool operator() (T output[],
const S input[])
override {
674 const auto index = _cuboids->getC(input);
675 for (
int i = 0; i < this->getTargetDim(); ++i) {
676 output[i] = _values[*index];
Some helper functions for the ADf data type.
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
AnalyticalComposed(AnalyticalF< D, T, S > &f0, AnalyticalF< D, T, S > &f1, AnalyticalF< D, T, S > &f2)
AnalyticalComposed(AnalyticalF< D, T, S > &f0, AnalyticalF< D, T, S > &f1)
AnalyticalF< D, T, S > & _f
AnalyticalConcatenation(AnalyticalF< D, T, S > &f, G g, unsigned targetDim=1)
concatenate functor f and some lambda expression g.
std::conditional_t< ReturnArray, U *, U > return_type_g
std::conditional_t< ComponentWise, std::function< return_type_g(T)>, std::function< return_type_g(T *)> > function_t
AnalyticalConcatenation(AnalyticalF< D, T, S > &f, wrapped_U(*g)(const T *), unsigned targetDim=1)
concatenate functor f and some function g.
AnalyticalConcatenation(AnalyticalF< D, T, S > &f, wrapped_U(*g)(T *), unsigned targetDim=1)
concatenate functor f and some function g.
AnalyticalConcatenation(AnalyticalF< D, T, S > &f, U(*g)(T))
concatenate functor f and some function g.
AnalyticalConst: DD -> XD, where XD is defined by value.size()
Returns a constant value on every cuboids.
AnalyticalCuboidwiseConst(SuperGeometry< T, D > &sGeometry, const std::vector< T > &values, unsigned targetDim=D)
AnalyticalF are applications from DD to XD, where X is set by the constructor.
User friendly AnalyticalF accepting strictly typed callables Vector<T,OUT>(Vector<S,...
AnalyticalFfromCallableF(F &&f)
AnalyticalLinear1D: 1D -> 1D troughout given points (x0,v0) and (x1,v1)
AnalyticalLinear2D: 2D -> 1D troughout given points (x0,y0,v0), (x1,y1,v1), (x2,y2,...
3D//////////////////////////////////////////// AnalyticalLinear3D: 3D -> 1D troughout given points (x...
AnalyticalNormal: DD -> XD, where XD is defined by value.size()
AnalyticalRandom2D: 2D -> 1D with maxValue in the center decreasing linearly with the distrance to th...
AnalyticalRandomBase: virtual base class for all the random functionals.
AnalyticalRandomNormal: DD -> 1D with random image in (0,1)
std::normal_distribution< T > distro
AnalyticalRandomOld: DD -> 1D with random image in (0,1)
AnalyticalRamdomSeededBase: alternative version with seed specification.
AnalyticalRamdomSeededNormal: alternative version with seed specification.
std::normal_distribution< T > distro
AnalyticalRandomNormal: DD -> 1D with random image in (0,1) Normal distribution cut off outside [mean...
AnalyticalScaled3D: 3D -> Image(AnalyticalF) scales AnalyticalF by _scale.
Smoothed square wave. epsilon = width of the mollified interval.
represents an inverse parabola profile like it is used in Poiseuille inflow note: output depends only...
Square wave with given period length, amplitude, difference (= length of positive time / length of pe...
CosinusComposite: Composition of two Cosinus to shift the low point within a period - difference deno...
Cosinus: Cosinus with period and amplitude.
Decomposition of a physical volume into a set of disjoint cuboids.
Computes resulting lattice velocity of an object from translational and rotational velocity.
Vector< T, DESCRIPTOR::d > _position
UnitConverter< T, DESCRIPTOR > const & _converter
Vector< T, utilities::dimensions::convert< DESCRIPTOR::d >::rotation > _angularVelocity
Vector< T, DESCRIPTOR::d > _velocity
Computes resulting velocity of an object from translational and rotational velocity.
Vector< T, DESCRIPTOR::d > _velocity
Vector< T, utilities::dimensions::convert< DESCRIPTOR::d >::rotation > _angularVelocity
Vector< T, DESCRIPTOR::d > _position
8.6.1 Gauss Hill inital values
8.6.1 Gauss Hill time evolution
int getTargetDim() const
read only access to member variable _n
std::string & getName()
read and write access to name
light source as a cylinder along z-axis
see Mink et al. 2016 in Sec.3.1.
PolynomialStartScale: 1D -> 1D a start curve based on a polynomial fifth order for a continuous trans...
Conversion between physical and lattice units, as well as discretization.
SinusStartScale: 1D -> 1D a start curve based on sinus for a continuous transition at 0 and 1.
Sinus: Sinus with period and amplitude.
Representation of a statistic for a parallel 2D geometry.
Conversion between physical and lattice units, as well as discretization.
Top level namespace for all of OpenLB.
std::string getName(OperatorScope scope)
Returns human-readable name of scope.
Converts dimensions by deriving from given cartesian dimension D.
Representation of a parallel 2D geometry – header file.