47template<
typename T,
typename S,
bool>
class SmoothIndicatorSphere3D;
48template<
typename T,
typename DESCRIPTOR>
class RadiativeUnitConverter;
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;
77template <
unsigned D,
typename T,
typename S>
89 bool operator() (T output[],
const S x[])
override;
91 template<
typename V,
typename U>
94 template<
typename V,
typename U>
101template <
unsigned D,
typename T,
typename S>
105 std::vector<T> _mean;
109 bool operator() (T output[],
const S x[])
override;
113template <
unsigned D,
typename T,
typename S>
117 std::random_device
rd;
122template <
unsigned D,
typename T,
typename S,
unsigned seed>
126 std::random_device
rd;
131template <
unsigned D,
typename T,
typename S>
135 bool operator() (T output[],
const S x[])
override;
137 std::uniform_real_distribution<T> distro;
141template <
unsigned D,
typename T,
typename S>
145 bool operator() (T output[],
const S x[])
override;
151template <
unsigned D,
typename T,
typename S,
unsigned seed>
155 bool operator() (T output[],
const S x[])
override;
162template <
unsigned D,
typename T,
typename S>
166 bool operator() (T output[],
const S x[])
override;
174template <
unsigned D,
typename T,
typename S>
178 bool operator() (T output[],
const S x[])
override;
187template <
typename T,
typename S,
typename DESCRIPTOR>
197 bool operator()(T output[],
const S input[])
override;
206template <
typename T,
typename S,
typename DESCRIPTOR>
218 bool operator()(T output[],
const S input[])
override;
225template <
unsigned D,
typename T,
typename S>
229 bool operator() (T output[],
const S x[])
override;
238template <
unsigned D,
typename T,
typename S>
242 bool operator() (T output[],
const S x[])
override;
260template <
unsigned D,
typename U,
typename T,
typename S,
261 bool ComponentWise,
bool ReturnArray>
275 template <
typename G>
285 static_assert(ComponentWise);
286 static_assert(! std::is_pointer_v<U>);
293 template<
typename wrapped_U>
298 static_assert(! ComponentWise);
305 template<
typename wrapped_U>
310 static_assert(! ComponentWise);
314 T outputTmp[
_f.getTargetDim()];
316 if constexpr (ComponentWise) {
317 for (
int i = 0; i <
_f.getTargetDim(); ++i) {
318 output[i] =
_g(outputTmp[i]);
321 if constexpr (ReturnArray) {
323 const auto* outputTmp2 =
_g(outputTmp);
324 output[i] = outputTmp2[i];
327 output[0] =
_g(outputTmp);
334template <
unsigned D,
typename T,
typename S,
typename G>
337 std::remove_pointer_t<
decltype(
338 g(std::conditional_t<std::is_invocable_v<G,T>,T,T*>{}))>,T,S,
339 std::is_invocable_v<G,T>,
340 std::is_pointer_v<
decltype(
341 g(std::conditional_t<std::is_invocable_v<G,T>,T,T*>{}))>>;
344template <
unsigned D,
typename T,
typename S,
typename U=T>
348template <
unsigned D,
typename wrapped_U,
typename T,
typename S>
351 false,std::is_pointer_v<wrapped_U>>;
353template <
unsigned D,
typename wrapped_U,
typename T,
typename S>
356 false,std::is_pointer_v<wrapped_U>>;
360template <
typename T,
typename S>
362template <
typename T,
typename S>
364template <
typename T,
typename S>
367template <
typename T,
typename S>
369template <
typename T,
typename S>
372template <
typename T,
typename S>
374template <
typename T,
typename S>
376template <
typename T,
typename S>
391template <
typename T,
typename S>
399 bool operator() (T output[],
const S x[])
override;
401 template<
typename V,
typename U>
404 template<
typename V,
typename U>
413template <
typename T,
typename S>
421 bool operator() (T output[],
const S x[])
override;
426template <
typename T,
typename S>
433 bool operator() (T output[],
const S x[])
override;
438template <
typename T,
typename S>
445 bool operator() (T output[],
const S x[])
override;
449template <
typename T,
typename S>
455 Sinus (T period=1, T amplitude=1);
456 bool operator() (T output[],
const S x[])
override;
460template <
typename T,
typename S>
466 Cosinus(T period=1, T amplitude=1);
467 bool operator() (T output[],
const S x[])
override;
469 template<
typename V,
typename U>
472 template<
typename V,
typename U>
479template <
typename T,
typename S>
487 bool operator() (T output[],
const S x[])
override;
495template <
typename T,
typename S>
504 bool operator() (T output[],
const S x[])
override;
506 template<
typename V,
typename U>
509 template<
typename V,
typename U>
516template <
typename T,
typename S>
530template <
typename T,
typename S>
539 AnalyticalLinear3D(S x0, S y0, S z0, T v0, S x1, S y1, S z1, T v1, S x2, S y2,
540 S z2, T v2, S x3, S y3, S z3, T v3);
541 bool operator() (T output[],
const S x[])
override;
545template <
typename T,
typename S>
552 bool operator() (T output[],
const S x[])
override;
556template <
typename T,
typename S,
typename DESCRIPTOR>
560 T _physDiffusionCoefficient;
563 bool operator()(T output[1],
const S x[3])
override;
567template <
typename T,
typename S,
typename DESCRIPTOR>
571 T _physDiffusionCoefficient;
575 bool operator()(T output[1],
const S x[3])
override;
583template <
typename T,
typename S>
591 bool operator()(T output[1],
const S x[3])
override;
595template <
typename T,
typename S>
603 bool operator()(T output[1],
const S x[2])
override;
607template <
typename T,
typename S>
618 bool operator()(T output[1],
const S x[2])
override;
629template <
unsigned D,
typename T,
typename S>
632 const unsigned _numberOfCuboids;
634 std::shared_ptr<const CuboidGeometry<T,D>> _cuboids;
635 const std::vector<T> _values;
639 const std::vector<T>& values,
unsigned targetDim=D)
641 _numberOfCuboids(values.size()),
643 sGeometry.getCuboidGeometry().getMotherCuboid(),
647 this->
getName() =
"cuboidwiseConst";
651 const auto index = _cuboids->get_iC(input[0], input[1], input[2]);
653 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.
bool operator()(U output[], const S x[]) override
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()
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
Returns a constant value on every cuboids.
bool operator()(T output[], const S input[]) override
has to be implemented for 'every' derived class
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.
AnalyticalLinear1D: 1D -> 1D troughout given points (x0,v0) and (x1,v1)
bool operator()(T output[], const S x[]) override
returns line _a*x + _b
AnalyticalLinear1D(T a, T b)
AnalyticalLinear2D: 2D -> 1D troughout given points (x0,y0,v0), (x1,y1,v1), (x2,y2,...
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
AnalyticalLinear2D(T a, T b, T c)
3D//////////////////////////////////////////// AnalyticalLinear3D: 3D -> 1D troughout given points (x...
AnalyticalLinear3D(T a, T b, T c, T d)
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
AnalyticalNormal: DD -> XD, where XD is defined by value.size()
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
AnalyticalNormal(std::vector< T > mean, T stdDev)
AnalyticalRandom2D: 2D -> 1D with maxValue in the center decreasing linearly with the distrance to th...
bool operator()(T output[], const S x[])
has to be implemented for 'every' derived class
AnalyticalParticleAdsorptionLinear2D(T center[], T radius, T maxValue)
AnalyticalRandomBase: virtual base class for all the random functionals.
AnalyticalRandomNormal: DD -> 1D with random image in (0,1)
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
std::normal_distribution< T > distro
AnalyticalRandomNormal(T mean=0., T stdDev=1.)
AnalyticalRandomOld: DD -> 1D with random image in (0,1)
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
AnalyticalRamdomSeededBase: alternative version with seed specification.
AnalyticalRandomSeededBase()
AnalyticalRamdomSeededNormal: alternative version with seed specification.
AnalyticalRandomSeededNormal(T mean=0., T stdDev=1.)
std::normal_distribution< T > distro
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
AnalyticalRandomNormal: DD -> 1D with random image in (0,1) Normal distribution cut off outside [mean...
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
AnalyticalRandomTruncatedNormal(T mean=0., T stdDev=1., T n=3.)
AnalyticalScaled3D: 3D -> Image(AnalyticalF) scales AnalyticalF by _scale.
AnalyticalScaled3D(AnalyticalF3D< T, S > &f, T scale)
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
Smoothed square wave. epsilon = width of the mollified interval.
AnalyticalSmoothedSquareWave(T period=1, T amplitude=1, T difference=0.5, T epsilon=1.e-3)
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
represents an inverse parabola profile like it is used in Poiseuille inflow note: output depends only...
AnalyticalSquare1D(S cp, S r, T maxi)
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
Square wave with given period length, amplitude, difference (= length of positive time / length of pe...
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
AnalyticalSquareWave(T period=1, T amplitude=1, T difference=0.5)
CosinusComposite: Composition of two Cosinus to shift the low point within a period - difference deno...
CosinusComposite(T period=1, T amplitude=1, T difference=1)
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
Cosinus: Cosinus with period and amplitude.
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
Cosinus(T period=1, T amplitude=1)
Computes resulting lattice velocity of an object from translational and rotational velocity.
Vector< T, DESCRIPTOR::d > _position
UnitConverter< T, DESCRIPTOR > const & _converter
EccentricLatticeVelocityField(Vector< T, DESCRIPTOR::d > position, Vector< T, DESCRIPTOR::d > velocity, Vector< T, utilities::dimensions::convert< DESCRIPTOR::d >::rotation > angularVelocity, UnitConverter< T, DESCRIPTOR > const &converter)
Vector< T, utilities::dimensions::convert< DESCRIPTOR::d >::rotation > _angularVelocity
bool operator()(T output[], const S input[]) override
has to be implemented for 'every' derived class
Vector< T, DESCRIPTOR::d > _velocity
Computes resulting velocity of an object from translational and rotational velocity.
bool operator()(T output[], const S input[]) override
has to be implemented for 'every' derived class
Vector< T, DESCRIPTOR::d > _velocity
Vector< T, utilities::dimensions::convert< DESCRIPTOR::d >::rotation > _angularVelocity
Vector< T, DESCRIPTOR::d > _position
EccentricVelocityField(Vector< T, DESCRIPTOR::d > position, Vector< T, DESCRIPTOR::d > velocity, Vector< T, utilities::dimensions::convert< DESCRIPTOR::d >::rotation > angularVelocity)
8.6.1 Gauss Hill inital values
bool operator()(T output[1], const S x[2]) override
GaussianHill2D(T sigma, Vector< T, 2 > x0, T c0)
8.6.1 Gauss Hill time evolution
bool operator()(T output[1], const S x[2]) override
GaussianHillTimeEvolution2D(T sigma0, T D, T t, Vector< T, 2 > x0, Vector< T, 2 > u, T c0)
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
bool operator()(T output[1], const S x[3]) override
LightSourceCylindrical3D(RadiativeUnitConverter< T, DESCRIPTOR > const &converter, Vector< T, 3 > center={T(0), T(0), T(0)})
see Mink et al. 2016 in Sec.3.1.
PLSsolution3D(RadiativeUnitConverter< T, DESCRIPTOR > const &converter)
bool operator()(T output[1], const S x[3]) override
PolynomialStartScale: 1D -> 1D a start curve based on a polynomial fifth order for a continuous trans...
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
PolynomialStartScale(S numTimeSteps=S(1), T maxValue=T(1))
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.
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
SinusStartScale(int numTimeSteps=1, T maxValue=1)
Sinus: Sinus with period and amplitude.
bool operator()(T output[], const S x[]) override
has to be implemented for 'every' derived class
Sinus(T period=1, T amplitude=1)
bool operator()(T output[1], const S x[3]) override
Spotlight(Vector< T, 3 > position, Vector< T, 3 > direction, T falloff)
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::conditional_t< D==2, CuboidGeometry2D< T >, CuboidGeometry3D< T > > CuboidGeometry
AnalyticalConcatenation(AnalyticalF< D, T, S > &, G g, unsigned _=1) -> AnalyticalConcatenation< D, std::remove_pointer_t< decltype(g(std::conditional_t< std::is_invocable_v< G, T >, T, T * >{}))>, T, S, std::is_invocable_v< G, T >, std::is_pointer_v< decltype(g(std::conditional_t< std::is_invocable_v< G, T >, T, T * >{}))> >
Converts dimensions by deriving from given cartesian dimension D.
Representation of a parallel 2D geometry – header file.