24#ifndef SUPER_PLANE_INTEGRAL_F_3D_HH
25#define SUPER_PLANE_INTEGRAL_F_3D_HH
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];
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);
67 :
SuperF3D<T>(f->getSuperStructure(), 2 + f->getTargetDim()),
70 _integrationIndicatorF(std::move(integrationIndicator)),
71 _subplaneIndicatorF(std::move(subplaneIndicator)),
76 _origin(hyperplaneLattice.getHyperplane().origin),
77 _u(hyperplaneLattice.getVectorU()),
78 _v(hyperplaneLattice.getVectorV()),
79 _normal(hyperplaneLattice.getHyperplane().normal)
81 this->
getName() =
"SuperPlaneIntegralF3D";
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);
99 const T physOnHyperplane[2] {
100 physRelativeToOrigin *
_u,
101 physRelativeToOrigin *
_v
125 std::forward<decltype(f)>(f),
128 std::forward<decltype(integrationIndicator)>(integrationIndicator),
129 std::forward<decltype(subplaneIndicator)>(subplaneIndicator),
141 std::forward<decltype(f)>(f),
144 std::forward<decltype(integrationIndicator)>(integrationIndicator),
154 std::vector<int> materials,
157 std::forward<decltype(f)>(f),
160 geometry.getMaterialIndicator(std::forward<decltype(materials)>(materials)),
171 std::forward<decltype(f)>(f),
174 std::vector<int>(1,1),
183 std::vector<int> materials,
186 std::forward<decltype(f)>(f),
189 geometry.getMaterialIndicator(std::forward<decltype(materials)>(materials)),
200 std::forward<decltype(f)>(f),
203 std::vector<int>(1,1),
212 std::vector<int> materials,
215 std::forward<decltype(f)>(f),
218 .centeredIn(geometry.getCuboidGeometry().getMotherCuboid())
220 geometry.getMaterialIndicator(std::forward<decltype(materials)>(materials)),
231 std::forward<decltype(f)>(f),
234 std::vector<int>(1,1),
245 std::forward<decltype(f)>(f),
247 Hyperplane3D<T>().originAt(circle.getCenter()).normalTo(circle.getNormal()),
248 geometry.getMaterialIndicator(std::forward<std::vector<int>>(materials)),
260 std::forward<decltype(f)>(f),
263 std::vector<int>(1,1),
270 this->getSuperStructure().communicate();
272 _reductionF.update();
276 std::vector<T> flow(flowDim,0.);
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) };
282 _reductionF(outputTmp, inputTmp);
284 for (
int j = 0; j < flowDim; j++ ) {
285 flow[j] += outputTmp[j];
289 int vox = _rankLocalSubplane.size();
291#ifdef PARALLEL_MODE_MPI
292 for (
int j = 0; j < flowDim; j++ ) {
298 const T h = _reductionF.getPhysSpacing();
302 output[0] = flow[0] * h * h;
312 output[1] = vox * h * h;
314 std::copy_n(flow.cbegin(), flowDim, &output[2]);
Groups all include files for the directory genericFunctions.
Smart pointer for managing the various ways of passing functors around.
int getTargetDim() const
read only access to member variable _n
std::string & getName()
read and write access to name
Parametrization of a hyperplane lattice.
indicator function for a 2D circle
indicator function for a 3D circle
IndicatorF2D is an application from .
represents all functors that operate on a SuperStructure<T,3> in general
Representation of a statistic for a parallel 2D geometry.
Base indicator functor (discrete)
Surface integral of a subset of a interpolated hyperplane.
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.
bool operator()(T output[], const int input[]) override
Returns the plane integral in the following structure:
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...
void reduceAndBcast(T &reductVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
Reduction operation, followed by a broadcast.
Top level namespace for all of OpenLB.
BlockDataReductionMode
Mode of reducing block data from given, possibly higher dimensional data.
constexpr Vector< T, D > normalize(const ScalarVector< T, D, IMPL > &a, T scale=T{1})
BlockDataSyncMode
Mode of synchronizing functor block data between processes.
@ None
optimize for usage in e.g. SuperLatticeFlux3D, only rank-local data available
Definition of a analytical 2D plane embedded in 3D space.