OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
olb::SuperPlaneIntegralF3D< T > Class Template Reference

Surface integral of a subset of a interpolated hyperplane. More...

#include <superPlaneIntegralF3D.h>

+ Inheritance diagram for olb::SuperPlaneIntegralF3D< T >:
+ Collaboration diagram for olb::SuperPlaneIntegralF3D< T >:

Public Member Functions

 SuperPlaneIntegralF3D (FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const HyperplaneLattice3D< T > &hyperplaneLattice, FunctorPtr< SuperIndicatorF3D< T > > &&integrationIndicator, FunctorPtr< IndicatorF2D< T > > &&subplaneIndicator, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
 Primary constructor.
 
 SuperPlaneIntegralF3D (FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const Hyperplane3D< T > &hyperplane, FunctorPtr< SuperIndicatorF3D< T > > &&integrationIndicator, FunctorPtr< IndicatorF2D< T > > &&subplaneIndicator, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
 Constructor providing automatic lattice generation.
 
 SuperPlaneIntegralF3D (FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const Hyperplane3D< T > &hyperplane, FunctorPtr< SuperIndicatorF3D< T > > &&integrationIndicator, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
 Constructor providing automatic lattice generation and omitting subplane restriction.
 
 SuperPlaneIntegralF3D (FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const Vector< T, 3 > &origin, const Vector< T, 3 > &u, const Vector< T, 3 > &v, std::vector< int > materials, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
 Constructor providing automatic lattice and material indicator instantiation.
 
 SuperPlaneIntegralF3D (FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const Vector< T, 3 > &origin, const Vector< T, 3 > &u, const Vector< T, 3 > &v, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
 Constructor providing automatic lattice parametrization, only interpolating material 1.
 
 SuperPlaneIntegralF3D (FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const Vector< T, 3 > &origin, const Vector< T, 3 > &normal, std::vector< int > materials, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
 Constructor providing automatic lattice and material indicator instantiation.
 
 SuperPlaneIntegralF3D (FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const Vector< T, 3 > &origin, const Vector< T, 3 > &normal, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
 Constructor providing automatic lattice parametrization, only interpolating material 1.
 
 SuperPlaneIntegralF3D (FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const Vector< T, 3 > &normal, std::vector< int > materials, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
 Constructor providing automatic lattice and material indicator instantiation.
 
 SuperPlaneIntegralF3D (FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const Vector< T, 3 > &normal, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
 Constructor providing automatic lattice parametrization, only interpolating material 1.
 
 SuperPlaneIntegralF3D (FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const IndicatorCircle3D< T > &circle, std::vector< int > materials, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
 Constructor providing automatic lattice parametrization to fit a given circle.
 
 SuperPlaneIntegralF3D (FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const IndicatorCircle3D< T > &circle, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
 Constructor providing automatic lattice parametrization to fit a given circle and only interpolating material 1.
 
bool operator() (T output[], const int input[]) override
 Returns the plane integral in the following structure:
 
- Public Member Functions inherited from olb::SuperF3D< T, W >
SuperF3D< T, W > & operator- (SuperF3D< T, W > &rhs)
 
SuperF3D< T, W > & operator+ (SuperF3D< T, W > &rhs)
 
SuperF3D< T, W > & operator* (SuperF3D< T, W > &rhs)
 
SuperF3D< T, W > & operator/ (SuperF3D< T, W > &rhs)
 
SuperStructure< T, 3 > & getSuperStructure ()
 
int getBlockFSize () const
 
BlockF3D< W > & getBlockF (int iCloc)
 
bool operator() (W output[], const int input[])
 
- Public Member Functions inherited from olb::GenericF< T, S >
virtual ~GenericF ()=default
 
int getSourceDim () const
 read only access to member variable _m
 
int getTargetDim () const
 read only access to member variable _n
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
virtual bool operator() (T output[], const S input[])=0
 has to be implemented for 'every' derived class
 
bool operator() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], S input0)
 
bool operator() (T output[], S input0, S input1)
 
bool operator() (T output[], S input0, S input1, S input2)
 
bool operator() (T output[], S input0, S input1, S input2, S input3)
 

Protected Member Functions

bool isToBeIntegrated (const Vector< T, 3 > &physR, int iC)
 This is determined using the _integrationIndicatorF indicated subset of the 2d plane reduced by _reductionF.
 
- Protected Member Functions inherited from olb::SuperF3D< T, W >
 SuperF3D (SuperStructure< T, 3 > &superStructure, int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, S >
 GenericF (int targetDim, int sourceDim)
 

Protected Attributes

SuperGeometry< T, 3 > & _geometry
 
FunctorPtr< SuperF3D< T > > _f
 Functor to be integrated on the plane.
 
FunctorPtr< SuperIndicatorF3D< T > > _integrationIndicatorF
 Indicator describing relevant discrete integration points.
 
FunctorPtr< IndicatorF2D< T > > _subplaneIndicatorF
 Indicator describing the relevant subset of the interpolated hyperplane.
 
BlockReduction3D2D< T > _reductionF
 Functor describing plane to be interpolated and integrated.
 
Vector< T, 3 > _origin
 Origin vector as given by hyperplane definition, (0,0) in respect to the subplane indicator _subplaneIndicatorF.
 
Vector< T, 3 > _u
 Span vector u as given by hyperplane definition, normalized to h.
 
Vector< T, 3 > _v
 Span vector v as given by hyperplane definition, normalized to h.
 
Vector< T, 3 > _normal
 Orthogonal vector to _u and _v.
 
std::vector< std::tuple< int, int > > _rankLocalSubplane
 Subset of the discrete plane points given by _reductionF as indicated by _integrationIndicatorF.
 
- Protected Attributes inherited from olb::SuperF3D< T, W >
SuperStructure< T, 3 > & _superStructure
 
std::vector< std::unique_ptr< BlockF3D< W > > > _blockF
 Super functors may consist of several BlockF3D<W> derived functors.
 

Additional Inherited Members

- Public Types inherited from olb::SuperF3D< T, W >
using identity_functor_type = SuperIdentity3D<T,W>
 
- Public Types inherited from olb::GenericF< T, S >
using targetType = T
 
using sourceType = S
 
- Public Attributes inherited from olb::GenericF< T, S >
std::shared_ptr< GenericF< T, S > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Static Public Attributes inherited from olb::SuperF3D< T, W >
static constexpr bool isSuper = true
 
static constexpr unsigned d = 3
 

Detailed Description

template<typename T>
class olb::SuperPlaneIntegralF3D< T >

Surface integral of a subset of a interpolated hyperplane.

Definition at line 45 of file superPlaneIntegralF3D.h.

Constructor & Destructor Documentation

◆ SuperPlaneIntegralF3D() [1/11]

template<typename T >
olb::SuperPlaneIntegralF3D< T >::SuperPlaneIntegralF3D ( FunctorPtr< SuperF3D< T > > && f,
SuperGeometry< T, 3 > & geometry,
const HyperplaneLattice3D< T > & hyperplaneLattice,
FunctorPtr< SuperIndicatorF3D< T > > && integrationIndicator,
FunctorPtr< IndicatorF2D< T > > && subplaneIndicator,
BlockDataReductionMode mode = BlockDataReductionMode::Analytical )

Primary constructor.

All other constructors defer the actual construction to this constructor.

Parameters
f(non-)owning pointer or reference to SuperF3D<T>.
hyperplaneLatticeParametrization of the hyperplane lattice to be interpolated.
integrationIndicator(non-)owning pointer or reference to SuperIndicatorF3D<T>. Describes the set of lattice points relevant for integration.
subplaneIndicator(non-)owning pointer or reference to IndicatorF2D<T>. Describes the relevant subplane of the interpolated hyperplane.
modeDefines how the values of the discrete hyperplane are determined. i.e. if they are interpolated or read directly from lattice points. Note: BlockDataReductionMode::Analytical imposes restrictions on hyperplane definition and discretization. If you are not sure consider providing only a hyperplane defintion instead of both a definition and a discretization.

Definition at line 60 of file superPlaneIntegralF3D.hh.

67 : SuperF3D<T>(f->getSuperStructure(), 2 + f->getTargetDim()),
68 _geometry(geometry),
69 _f(std::move(f)),
70 _integrationIndicatorF(std::move(integrationIndicator)),
71 _subplaneIndicatorF(std::move(subplaneIndicator)),
73 hyperplaneLattice,
75 mode),
76 _origin(hyperplaneLattice.getHyperplane().origin),
77 _u(hyperplaneLattice.getVectorU()),
78 _v(hyperplaneLattice.getVectorV()),
79 _normal(hyperplaneLattice.getHyperplane().normal)
80{
81 this->getName() = "SuperPlaneIntegralF3D";
82
84 _u = normalize(_u);
85 _v = normalize(_v);
86
87 for ( const std::tuple<int,int,int>& pos : _reductionF.getRankLocalSubplane() ) {
88 const int& i = std::get<0>(pos);
89 const int& j = std::get<1>(pos);
90 const int& iC = std::get<2>(pos);
91 const Vector<T,3> physR = _reductionF.getPhysR(i, j);
92 if (isToBeIntegrated(physR, iC)) {
93 // check if interpolated hyperplane is to be restricted further
94 // e.g. using IndicatorCircle2D
95 if ( _subplaneIndicatorF ) {
96 // determine physical coordinates relative to original hyperplane origin
97 // [!] different from _reductionF._origin in the general case.
98 const Vector<T,3> physRelativeToOrigin = physR - _origin;
99 const T physOnHyperplane[2] {
100 physRelativeToOrigin * _u,
101 physRelativeToOrigin * _v
102 };
103
104 if ( _subplaneIndicatorF->operator()(physOnHyperplane) ) {
105 _rankLocalSubplane.emplace_back(i, j);
106 }
107 }
108 else {
109 // plane is not restricted further
110 _rankLocalSubplane.emplace_back(i, j);
111 }
112 }
113 }
114}
std::string & getName()
read and write access to name
Definition genericF.hh:51
FunctorPtr< SuperIndicatorF3D< T > > _integrationIndicatorF
Indicator describing relevant discrete integration points.
BlockReduction3D2D< T > _reductionF
Functor describing plane to be interpolated and integrated.
Vector< T, 3 > _v
Span vector v as given by hyperplane definition, normalized to h.
Vector< T, 3 > _origin
Origin vector as given by hyperplane definition, (0,0) in respect to the subplane indicator _subplane...
FunctorPtr< IndicatorF2D< T > > _subplaneIndicatorF
Indicator describing the relevant subset of the interpolated hyperplane.
Vector< T, 3 > _u
Span vector u as given by hyperplane definition, normalized to h.
std::vector< std::tuple< int, int > > _rankLocalSubplane
Subset of the discrete plane points given by _reductionF as indicated by _integrationIndicatorF.
Vector< T, 3 > _normal
Orthogonal vector to _u and _v.
bool isToBeIntegrated(const Vector< T, 3 > &physR, int iC)
This is determined using the _integrationIndicatorF indicated subset of the 2d plane reduced by _redu...
SuperGeometry< T, 3 > & _geometry
FunctorPtr< SuperF3D< T > > _f
Functor to be integrated on the plane.
constexpr Vector< T, D > normalize(const ScalarVector< T, D, IMPL > &a, T scale=T{1})
Definition vector.h:245
@ None
optimize for usage in e.g. SuperLatticeFlux3D, only rank-local data available

References olb::SuperPlaneIntegralF3D< T >::_normal, olb::SuperPlaneIntegralF3D< T >::_origin, olb::SuperPlaneIntegralF3D< T >::_rankLocalSubplane, olb::SuperPlaneIntegralF3D< T >::_reductionF, olb::SuperPlaneIntegralF3D< T >::_subplaneIndicatorF, olb::SuperPlaneIntegralF3D< T >::_u, olb::SuperPlaneIntegralF3D< T >::_v, olb::GenericF< T, S >::getName(), olb::SuperPlaneIntegralF3D< T >::isToBeIntegrated(), and olb::normalize().

+ Here is the call graph for this function:

◆ SuperPlaneIntegralF3D() [2/11]

template<typename T >
olb::SuperPlaneIntegralF3D< T >::SuperPlaneIntegralF3D ( FunctorPtr< SuperF3D< T > > && f,
SuperGeometry< T, 3 > & geometry,
const Hyperplane3D< T > & hyperplane,
FunctorPtr< SuperIndicatorF3D< T > > && integrationIndicator,
FunctorPtr< IndicatorF2D< T > > && subplaneIndicator,
BlockDataReductionMode mode = BlockDataReductionMode::Analytical )

Constructor providing automatic lattice generation.

Parameters
f(non-)owning pointer or reference to SuperF3D<T>.
hyperplaneParametrization of the hyperplane to be integrated. The lattice resolution is set to CuboidGeometry3D<T>::getMinDeltaR.
integrationIndicator(non-)owning pointer or reference to SuperIndicatorF3D<T>. Describes the set of lattice points relevant for integration.
subplaneIndicator(non-)owning pointer or reference to IndicatorF2D<T>. Describes the relevant subplane of the interpolated hyperplane.
modeDefines how the values of the discrete hyperplane are determined. i.e. if they are interpolated or read directly from lattice points.

Definition at line 117 of file superPlaneIntegralF3D.hh.

125 std::forward<decltype(f)>(f),
126 geometry,
127 HyperplaneLattice3D<T>(geometry.getCuboidGeometry(), hyperplane),
128 std::forward<decltype(integrationIndicator)>(integrationIndicator),
129 std::forward<decltype(subplaneIndicator)>(subplaneIndicator),
130 mode)
131{ }
SuperPlaneIntegralF3D(FunctorPtr< SuperF3D< T > > &&f, SuperGeometry< T, 3 > &geometry, const HyperplaneLattice3D< T > &hyperplaneLattice, FunctorPtr< SuperIndicatorF3D< T > > &&integrationIndicator, FunctorPtr< IndicatorF2D< T > > &&subplaneIndicator, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
Primary constructor.
CuboidGeometry< T, D > & getCuboidGeometry()
Read and write access to cuboid geometry.

◆ SuperPlaneIntegralF3D() [3/11]

template<typename T >
olb::SuperPlaneIntegralF3D< T >::SuperPlaneIntegralF3D ( FunctorPtr< SuperF3D< T > > && f,
SuperGeometry< T, 3 > & geometry,
const Hyperplane3D< T > & hyperplane,
FunctorPtr< SuperIndicatorF3D< T > > && integrationIndicator,
BlockDataReductionMode mode = BlockDataReductionMode::Analytical )

Constructor providing automatic lattice generation and omitting subplane restriction.

i.e. the intersection between geometry and hyperplane is integrated wherever _integrationIndicatorF allows.

Parameters
f(non-)owning pointer or reference to SuperF3D<T>.
hyperplaneParametrization of the hyperplane to be integrated. The lattice resolution is set to the cuboid geometry's minDeltaR.
integrationIndicator(non-)owning pointer or reference to SuperIndicatorF3D<T>. Describes the set of lattice points relevant for integration.
modeDefines how the values of the discrete hyperplane are determined. i.e. if they are interpolated or read directly from lattice points.

Definition at line 134 of file superPlaneIntegralF3D.hh.

141 std::forward<decltype(f)>(f),
142 geometry,
143 hyperplane,
144 std::forward<decltype(integrationIndicator)>(integrationIndicator),
145 nullptr,
146 mode)
147{ }

◆ SuperPlaneIntegralF3D() [4/11]

template<typename T >
olb::SuperPlaneIntegralF3D< T >::SuperPlaneIntegralF3D ( FunctorPtr< SuperF3D< T > > && f,
SuperGeometry< T, 3 > & geometry,
const Vector< T, 3 > & origin,
const Vector< T, 3 > & u,
const Vector< T, 3 > & v,
std::vector< int > materials,
BlockDataReductionMode mode = BlockDataReductionMode::Analytical )

Constructor providing automatic lattice and material indicator instantiation.

Parameters
f(non-)owning pointer or reference to SuperF3D<T>.
originhyperplane origin
uhyperplane span vector
vhyperplane span vector
materialsmaterial numbers relevant for hyperplane integration
modedefines how the values of the discrete hyperplane are determined

Definition at line 150 of file superPlaneIntegralF3D.hh.

157 std::forward<decltype(f)>(f),
158 geometry,
159 Hyperplane3D<T>().originAt(origin).spannedBy(u, v),
160 geometry.getMaterialIndicator(std::forward<decltype(materials)>(materials)),
161 mode)
162{ }
std::unique_ptr< SuperIndicatorF< T, D > > getMaterialIndicator(std::vector< int > &&materials)
Returns a material indicator using the given vector of materials.

◆ SuperPlaneIntegralF3D() [5/11]

template<typename T >
olb::SuperPlaneIntegralF3D< T >::SuperPlaneIntegralF3D ( FunctorPtr< SuperF3D< T > > && f,
SuperGeometry< T, 3 > & geometry,
const Vector< T, 3 > & origin,
const Vector< T, 3 > & u,
const Vector< T, 3 > & v,
BlockDataReductionMode mode = BlockDataReductionMode::Analytical )

Constructor providing automatic lattice parametrization, only interpolating material 1.

Parameters
f(non-)owning pointer or reference to SuperF3D<T>.
originhyperplane origin
uhyperplane span vector
vhyperplane span vector
modeDefines how the values of the discrete hyperplane are determined.

Definition at line 165 of file superPlaneIntegralF3D.hh.

171 std::forward<decltype(f)>(f),
172 geometry,
173 origin, u, v,
174 std::vector<int>(1,1),
175 mode)
176{ }

◆ SuperPlaneIntegralF3D() [6/11]

template<typename T >
olb::SuperPlaneIntegralF3D< T >::SuperPlaneIntegralF3D ( FunctorPtr< SuperF3D< T > > && f,
SuperGeometry< T, 3 > & geometry,
const Vector< T, 3 > & origin,
const Vector< T, 3 > & normal,
std::vector< int > materials,
BlockDataReductionMode mode = BlockDataReductionMode::Analytical )

Constructor providing automatic lattice and material indicator instantiation.

Parameters
f(non-)owning pointer or reference to SuperF3D<T>.
originhyperplane origin
normalhyperplane normal
materialsmaterial numbers relevant for hyperplane integration
modedefines how the values of the discrete hyperplane are determined

Definition at line 179 of file superPlaneIntegralF3D.hh.

186 std::forward<decltype(f)>(f),
187 geometry,
188 Hyperplane3D<T>().originAt(origin).normalTo(normal),
189 geometry.getMaterialIndicator(std::forward<decltype(materials)>(materials)),
190 mode)
191{ }

◆ SuperPlaneIntegralF3D() [7/11]

template<typename T >
olb::SuperPlaneIntegralF3D< T >::SuperPlaneIntegralF3D ( FunctorPtr< SuperF3D< T > > && f,
SuperGeometry< T, 3 > & geometry,
const Vector< T, 3 > & origin,
const Vector< T, 3 > & normal,
BlockDataReductionMode mode = BlockDataReductionMode::Analytical )

Constructor providing automatic lattice parametrization, only interpolating material 1.

Parameters
f(non-)owning pointer or reference to SuperF3D<T>.
originhyperplane origin
normalhyperplane normal
modedefines how the values of the discrete hyperplane are determined

Definition at line 194 of file superPlaneIntegralF3D.hh.

200 std::forward<decltype(f)>(f),
201 geometry,
202 origin, normal,
203 std::vector<int>(1,1),
204 mode)
205{ }

◆ SuperPlaneIntegralF3D() [8/11]

template<typename T >
olb::SuperPlaneIntegralF3D< T >::SuperPlaneIntegralF3D ( FunctorPtr< SuperF3D< T > > && f,
SuperGeometry< T, 3 > & geometry,
const Vector< T, 3 > & normal,
std::vector< int > materials,
BlockDataReductionMode mode = BlockDataReductionMode::Analytical )

Constructor providing automatic lattice and material indicator instantiation.

Parameters
f(non-)owning pointer or reference to SuperF3D<T>.
normalhyperplane normal (centered in mother cuboid)
materialsmaterial numbers relevant for hyperplane integration
modedefines how the values of the discrete hyperplane are determined

Definition at line 208 of file superPlaneIntegralF3D.hh.

215 std::forward<decltype(f)>(f),
216 geometry,
217 Hyperplane3D<T>()
218 .centeredIn(geometry.getCuboidGeometry().getMotherCuboid())
219 .normalTo(normal),
220 geometry.getMaterialIndicator(std::forward<decltype(materials)>(materials)),
221 mode)
222{ }

◆ SuperPlaneIntegralF3D() [9/11]

template<typename T >
olb::SuperPlaneIntegralF3D< T >::SuperPlaneIntegralF3D ( FunctorPtr< SuperF3D< T > > && f,
SuperGeometry< T, 3 > & geometry,
const Vector< T, 3 > & normal,
BlockDataReductionMode mode = BlockDataReductionMode::Analytical )

Constructor providing automatic lattice parametrization, only interpolating material 1.

Parameters
f(non-)owning pointer or reference to SuperF3D<T>.
normalhyperplane normal (centered in mother cuboid)
modedefines how the values of the discrete hyperplane are determined

Definition at line 225 of file superPlaneIntegralF3D.hh.

231 std::forward<decltype(f)>(f),
232 geometry,
233 normal,
234 std::vector<int>(1,1),
235 mode)
236{ }

◆ SuperPlaneIntegralF3D() [10/11]

template<typename T >
olb::SuperPlaneIntegralF3D< T >::SuperPlaneIntegralF3D ( FunctorPtr< SuperF3D< T > > && f,
SuperGeometry< T, 3 > & geometry,
const IndicatorCircle3D< T > & circle,
std::vector< int > materials,
BlockDataReductionMode mode = BlockDataReductionMode::Analytical )

Constructor providing automatic lattice parametrization to fit a given circle.

Parameters
f(non-)owning pointer or reference to SuperF3D<T>.
circlecircle indicator to be used for hyperplane subset parametrization
materialsmaterial numbers relevant for hyperplane interpolation
modedefines how the values of the discrete hyperplane are determined

Definition at line 239 of file superPlaneIntegralF3D.hh.

245 std::forward<decltype(f)>(f),
246 geometry,
247 Hyperplane3D<T>().originAt(circle.getCenter()).normalTo(circle.getNormal()),
248 geometry.getMaterialIndicator(std::forward<std::vector<int>>(materials)),
249 std::unique_ptr<IndicatorF2D<T>>(new IndicatorCircle2D<T>({0,0}, circle.getRadius())),
250mode)
251{ }

◆ SuperPlaneIntegralF3D() [11/11]

template<typename T >
olb::SuperPlaneIntegralF3D< T >::SuperPlaneIntegralF3D ( FunctorPtr< SuperF3D< T > > && f,
SuperGeometry< T, 3 > & geometry,
const IndicatorCircle3D< T > & circle,
BlockDataReductionMode mode = BlockDataReductionMode::Analytical )

Constructor providing automatic lattice parametrization to fit a given circle and only interpolating material 1.

Parameters
f(non-)owning pointer or reference to SuperF3D<T>.
circlecircle indicator to be used for hyperplane subset parametrization
modedefines how the values of the discrete hyperplane are determined

Definition at line 254 of file superPlaneIntegralF3D.hh.

260 std::forward<decltype(f)>(f),
261 geometry,
262 circle,
263 std::vector<int>(1,1),
264 mode)
265{ }

Member Function Documentation

◆ isToBeIntegrated()

template<typename T >
bool olb::SuperPlaneIntegralF3D< T >::isToBeIntegrated ( const Vector< T, 3 > & physR,
int iC )
protected

This is determined using the _integrationIndicatorF indicated subset of the 2d plane reduced by _reductionF.

Returns
true iff the given physical position is to be integrated

Definition at line 35 of file superPlaneIntegralF3D.hh.

36{
37 Vector<int,4> latticeR;
38 //get nearest lattice point
39 if ( _geometry.getCuboidGeometry().getFloorLatticeR(physR, latticeR) ) {
40 const int& iX = latticeR[1];
41 const int& iY = latticeR[2];
42 const int& iZ = latticeR[3];
43
44 // interpolation is possible iff all neighbours are within the indicated subset
45 return _integrationIndicatorF->operator()( iC, iX, iY, iZ )
46 && _integrationIndicatorF->operator()(iC, iX, iY, iZ+1)
47 && _integrationIndicatorF->operator()(iC, iX, iY+1, iZ )
48 && _integrationIndicatorF->operator()(iC, iX, iY+1, iZ+1)
49 && _integrationIndicatorF->operator()(iC, iX+1, iY, iZ )
50 && _integrationIndicatorF->operator()(iC, iX+1, iY, iZ+1)
51 && _integrationIndicatorF->operator()(iC, iX+1, iY+1, iZ )
52 && _integrationIndicatorF->operator()(iC, iX+1, iY+1, iZ+1);
53 }
54 else {
55 return false;
56 }
57}
+ Here is the caller graph for this function:

◆ operator()()

template<typename T >
bool olb::SuperPlaneIntegralF3D< T >::operator() ( T output[],
const int input[] )
override

Returns the plane integral in the following structure:

output[0] = integral, e.g. flow[0] * h^2 for 1-dimensional target sizes
output[1] = #voxels * h^2 i.e. area
output[2..2+f.getTargetSize()] = flow

Note: output[0] contains the flux value if applicable

Parameters
inputirrelevant

Definition at line 268 of file superPlaneIntegralF3D.hh.

269{
271
272 _reductionF.update();
273
274 const int flowDim = _reductionF.getTargetDim();
275
276 std::vector<T> flow(flowDim,0.);
277
278 for ( std::tuple<int,int>& pos : _rankLocalSubplane ) {
279 T outputTmp[flowDim];
280 const int inputTmp[2] { std::get<0>(pos), std::get<1>(pos) };
281
282 _reductionF(outputTmp, inputTmp);
283
284 for ( int j = 0; j < flowDim; j++ ) {
285 flow[j] += outputTmp[j];
286 }
287 }
288
289 int vox = _rankLocalSubplane.size();
290
291#ifdef PARALLEL_MODE_MPI
292 for ( int j = 0; j < flowDim; j++ ) {
293 singleton::mpi().reduceAndBcast(flow[j], MPI_SUM);
294 }
295 singleton::mpi().reduceAndBcast(vox, MPI_SUM);
296#endif
297
298 const T h = _reductionF.getPhysSpacing();
299
300 switch ( flowDim ) {
301 case 1: {
302 output[0] = flow[0] * h * h;
303 break;
304 }
305 case 3: {
306 output[0] = (h*h * Vector<T,3>(flow)) * _normal;
307 break;
308 }
309 }
310
311 // area
312 output[1] = vox * h * h;
313 // write flow to output[2..]
314 std::copy_n(flow.cbegin(), flowDim, &output[2]);
315
316 return true;
317}
SuperStructure< T, 3 > & getSuperStructure()
virtual void communicate()
void reduceAndBcast(T &reductVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
Reduction operation, followed by a broadcast.
MpiManager & mpi()

References olb::GenericF< T, S >::getTargetDim(), olb::singleton::mpi(), and olb::singleton::MpiManager::reduceAndBcast().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _f

template<typename T >
FunctorPtr<SuperF3D<T> > olb::SuperPlaneIntegralF3D< T >::_f
protected

Functor to be integrated on the plane.

Definition at line 50 of file superPlaneIntegralF3D.h.

◆ _geometry

template<typename T >
SuperGeometry<T,3>& olb::SuperPlaneIntegralF3D< T >::_geometry
protected

Definition at line 47 of file superPlaneIntegralF3D.h.

◆ _integrationIndicatorF

template<typename T >
FunctorPtr<SuperIndicatorF3D<T> > olb::SuperPlaneIntegralF3D< T >::_integrationIndicatorF
protected

Indicator describing relevant discrete integration points.

Definition at line 52 of file superPlaneIntegralF3D.h.

◆ _normal

template<typename T >
Vector<T,3> olb::SuperPlaneIntegralF3D< T >::_normal
protected

Orthogonal vector to _u and _v.

Definition at line 71 of file superPlaneIntegralF3D.h.

◆ _origin

template<typename T >
Vector<T,3> olb::SuperPlaneIntegralF3D< T >::_origin
protected

Origin vector as given by hyperplane definition, (0,0) in respect to the subplane indicator _subplaneIndicatorF.

Note: The reduced plane _reductionF calculates its own origin based on _origin as its spans the maximum size possible given the span vectors, origin and geometry size.

Definition at line 65 of file superPlaneIntegralF3D.h.

◆ _rankLocalSubplane

template<typename T >
std::vector<std::tuple<int, int> > olb::SuperPlaneIntegralF3D< T >::_rankLocalSubplane
protected

Subset of the discrete plane points given by _reductionF as indicated by _integrationIndicatorF.

i.e. the points used to interpolate the hyperplane

Definition at line 75 of file superPlaneIntegralF3D.h.

◆ _reductionF

template<typename T >
BlockReduction3D2D<T> olb::SuperPlaneIntegralF3D< T >::_reductionF
protected

Functor describing plane to be interpolated and integrated.

Definition at line 56 of file superPlaneIntegralF3D.h.

◆ _subplaneIndicatorF

template<typename T >
FunctorPtr<IndicatorF2D<T> > olb::SuperPlaneIntegralF3D< T >::_subplaneIndicatorF
protected

Indicator describing the relevant subset of the interpolated hyperplane.

Definition at line 54 of file superPlaneIntegralF3D.h.

◆ _u

template<typename T >
Vector<T,3> olb::SuperPlaneIntegralF3D< T >::_u
protected

Span vector u as given by hyperplane definition, normalized to h.

Definition at line 67 of file superPlaneIntegralF3D.h.

◆ _v

template<typename T >
Vector<T,3> olb::SuperPlaneIntegralF3D< T >::_v
protected

Span vector v as given by hyperplane definition, normalized to h.

Definition at line 69 of file superPlaneIntegralF3D.h.


The documentation for this class was generated from the following files: