OpenLB 1.7
|
BlockReduction2D1D reduces the data of a SuperF2D functor to the intersection between a given 2D hyperplane and the super geometry. More...
#include <blockReduction2D1D.h>
Public Member Functions | |
BlockReduction2D1D (FunctorPtr< SuperF2D< T > > &&f, const HyperplaneLattice2D< T > &lattice, BlockDataSyncMode syncMode=BlockDataSyncMode::ReduceAndBcast, BlockDataReductionMode reductionMode=BlockDataReductionMode::Analytical) | |
Construction using functor and hyperplane lattice. | |
BlockReduction2D1D (FunctorPtr< SuperF2D< T > > &&f, const Hyperplane2D< T > &hyperplane, BlockDataSyncMode syncMode=BlockDataSyncMode::ReduceAndBcast, BlockDataReductionMode reductionMode=BlockDataReductionMode::Analytical) | |
Construction using functor and hyperplane. | |
BlockReduction2D1D (FunctorPtr< SuperF2D< T > > &&f, const Hyperplane2D< T > &hyperplane, int resolution=600, BlockDataSyncMode mode=BlockDataSyncMode::ReduceAndBcast) | |
Construction using functor, hyperplane and resolution. | |
BlockReduction2D1D (FunctorPtr< SuperF2D< T > > &&f, const Vector< T, 2 > &origin, const Vector< T, 2 > &direction, int resolution=600, BlockDataSyncMode mode=BlockDataSyncMode::ReduceAndBcast) | |
Construction using functor, origin, direction and resolution. | |
bool | operator() (T output[], int i) |
Custom operator for easier access to 1-dimensional block data. | |
void | initialize () |
Initialize rank-local list of plane points to be stored in _blockData. | |
void | update () |
Updates and writes the data to _blockData using _rankLocalSubplane. | |
BlockStructureD< 2 > & | getBlockStructure () override |
Overload of virtual function from class BlockF2D. | |
const std::vector< std::tuple< int, int > > & | getRankLocalSubplane () const |
Public Member Functions inherited from olb::HyperplaneLattice2D< T > | |
HyperplaneLattice2D (CuboidGeometry2D< T > &geometry, Hyperplane2D< T > hyperplane) | |
Constructor for automatic discretization. | |
HyperplaneLattice2D (CuboidGeometry2D< T > &geometry, Hyperplane2D< T > hyperplane, int resolution) | |
Constructor for discretization of a given resolution. | |
HyperplaneLattice2D (CuboidGeometry2D< T > &geometry, Hyperplane2D< T > hyperplane, T h) | |
Constructor for discretization of a given grid width. | |
HyperplaneLattice2D (const HyperplaneLattice2D &)=default | |
const Hyperplane2D< T > & | getHyperplane () const |
Vector< T, 2 > | getPhysR (const int &n) const |
Transform 1d lattice coordinates to their physical 2d location. | |
int | getN () const |
T | getPhysSpacing () const |
Vector< T, 2 > | getPhysOrigin () const |
Vector< T, 2 > | getVectorU () const |
Public Member Functions inherited from olb::BlockDataF2D< T, T > | |
BlockDataF2D (BlockData< 2, T, T > &blockData) | |
Constructor. | |
BlockDataF2D (BlockF2D< T > &f) | |
to store functor data, constuctor creates _blockData with functor data | |
~BlockDataF2D () | |
BlockData< 2, T, T > & | getBlockData () |
returns _blockData | |
bool | operator() (T output[], const int input[]) override |
access to _blockData via its get() | |
Public Member Functions inherited from olb::BlockF2D< T > | |
void | setBlockStructure (BlockStructureD< 2 > *blockStructure) |
BlockF2D< T > & | operator- (BlockF2D< T > &rhs) |
BlockF2D< T > & | operator+ (BlockF2D< T > &rhs) |
BlockF2D< T > & | operator* (BlockF2D< T > &rhs) |
BlockF2D< T > & | operator/ (BlockF2D< T > &rhs) |
Public Member Functions inherited from olb::GenericF< T, int > | |
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 int 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[], int input0) |
bool | operator() (T output[], int input0, int input1) |
bool | operator() (T output[], int input0, int input1, int input2) |
bool | operator() (T output[], int input0, int input1, int input2, int input3) |
Additional Inherited Members | |
Public Types inherited from olb::GenericF< T, int > | |
using | targetType |
using | sourceType |
Public Attributes inherited from olb::GenericF< T, int > | |
std::shared_ptr< GenericF< T, int > > | _ptrCalcC |
memory management, frees resouces (calcClass) | |
Protected Member Functions inherited from olb::BlockDataF2D< T, T > | |
BlockDataF2D (int nx, int ny, int size=1) | |
Protected Member Functions inherited from olb::BlockF2D< T > | |
BlockF2D (BlockStructureD< 2 > &blockStructure, int targetDim) | |
BlockF2D (int targetDim) | |
Protected Member Functions inherited from olb::GenericF< T, int > | |
GenericF (int targetDim, int sourceDim) | |
Protected Attributes inherited from olb::HyperplaneLattice2D< T > | |
const Hyperplane2D< T > | _hyperplane |
Vector< T, 2 > | _origin |
Origin vector of the lattice. | |
Vector< T, 2 > | _u |
Direction vector of the lattice, normalized to grid width _h. | |
T | _h |
Distance between discrete lattice points. | |
int | _n |
Number of lattice points in the direction of _u. | |
Protected Attributes inherited from olb::BlockDataF2D< T, T > | |
BlockData< 2, T, T > * | _blockData |
bool | _owning |
Protected Attributes inherited from olb::BlockF2D< T > | |
BlockStructureD< 2 > * | _blockStructure |
BlockReduction2D1D reduces the data of a SuperF2D functor to the intersection between a given 2D hyperplane and the super geometry.
This intersection is interpolated at a set of discrete points according to the given resolution and exposed as a 1-dimensional BlockDataF2D functor.
The hyperplane is parametrized by a origin and a single directionb vector u. Definition of hyperplanes using e.g. origin and normal vectors is supported via the Hyperplane2D interface.
Definition at line 54 of file blockReduction2D1D.h.
olb::BlockReduction2D1D< T >::BlockReduction2D1D | ( | FunctorPtr< SuperF2D< T > > && | f, |
const HyperplaneLattice2D< T > & | lattice, | ||
BlockDataSyncMode | syncMode = BlockDataSyncMode::ReduceAndBcast, | ||
BlockDataReductionMode | reductionMode = BlockDataReductionMode::Analytical ) |
Construction using functor and hyperplane lattice.
f | Functor to be reduced as a (non-)owning pointer or reference to SuperF2D<T>. |
lattice | Hyperplane lattice parametrization |
syncMode | Defines MPI synchronization strategy of the interpolated block data. |
reductionMode | Defines whether data is interpolated or read from discrete lattice locations. Note: BlockDataReductionMode::Analytical imposes restrictions on hyperplane definition and discretization. |
Definition at line 93 of file blockReduction2D1D.hh.
References olb::Discrete, olb::HyperplaneLattice2D< T >::getHyperplane(), olb::CuboidGeometry2D< T >::getMinDeltaR(), olb::GenericF< T, int >::getName(), olb::HyperplaneLattice2D< T >::getPhysSpacing(), olb::BlockReduction2D1D< T >::initialize(), olb::Hyperplane2D< T >::isParallelToX(), olb::Hyperplane2D< T >::isParallelToY(), and olb::BlockReduction2D1D< T >::update().
olb::BlockReduction2D1D< T >::BlockReduction2D1D | ( | FunctorPtr< SuperF2D< T > > && | f, |
const Hyperplane2D< T > & | hyperplane, | ||
BlockDataSyncMode | syncMode = BlockDataSyncMode::ReduceAndBcast, | ||
BlockDataReductionMode | reductionMode = BlockDataReductionMode::Analytical ) |
Construction using functor and hyperplane.
f | Functor to be reduced as a (non-)owning pointer or reference to SuperF2D<T>. |
hyperplane | Hyperplane parametrization |
syncMode | Defines MPI synchronization strategy of the interpolated block data. |
reductionMode | Defines whether data is interpolated or read from discrete lattice locations. |
Definition at line 130 of file blockReduction2D1D.hh.
olb::BlockReduction2D1D< T >::BlockReduction2D1D | ( | FunctorPtr< SuperF2D< T > > && | f, |
const Hyperplane2D< T > & | hyperplane, | ||
int | resolution = 600, | ||
BlockDataSyncMode | mode = BlockDataSyncMode::ReduceAndBcast ) |
Construction using functor, hyperplane and resolution.
f | Functor to be reduced as a (non-)owning pointer or reference to SuperF2D<T>. |
hyperplane | Hyperplane parametrization |
resolution | Defines the number of voxel of the longest side. If it equals zero, _h is set to the cuboid geometry's minDeltaR. |
mode | Defines MPI synchronization strategy of the interpolated block data. |
Definition at line 144 of file blockReduction2D1D.hh.
olb::BlockReduction2D1D< T >::BlockReduction2D1D | ( | FunctorPtr< SuperF2D< T > > && | f, |
const Vector< T, 2 > & | origin, | ||
const Vector< T, 2 > & | direction, | ||
int | resolution = 600, | ||
BlockDataSyncMode | mode = BlockDataSyncMode::ReduceAndBcast ) |
Construction using functor, origin, direction and resolution.
f | Functor to be reduced as a (non-)owning pointer or reference to SuperF2D<T>. |
direction | Direction vector |
origin | Origin vector |
resolution | Defines the number of voxel of the longest side. If it equals zero, _h is set to the cuboid geometry's minDeltaR. |
mode | Defines MPI synchronization strategy of the interpolated block data. |
Definition at line 156 of file blockReduction2D1D.hh.
|
overridevirtual |
Overload of virtual function from class BlockF2D.
Reimplemented from olb::BlockF2D< T >.
Definition at line 242 of file blockReduction2D1D.hh.
const std::vector< std::tuple< int, int > > & olb::BlockReduction2D1D< T >::getRankLocalSubplane | ( | ) | const |
Definition at line 248 of file blockReduction2D1D.hh.
void olb::BlockReduction2D1D< T >::initialize | ( | ) |
Initialize rank-local list of plane points to be stored in _blockData.
Definition at line 173 of file blockReduction2D1D.hh.
References olb::CuboidGeometry2D< T >::getC(), and olb::LoadBalancer< T >::isLocal().
bool olb::BlockReduction2D1D< T >::operator() | ( | T | output[], |
int | i ) |
Custom operator for easier access to 1-dimensional block data.
Definition at line 166 of file blockReduction2D1D.hh.
void olb::BlockReduction2D1D< T >::update | ( | ) |
Updates and writes the data to _blockData using _rankLocalSubplane.
Definition at line 196 of file blockReduction2D1D.hh.
References olb::Analytical, olb::singleton::MpiManager::bCast(), olb::Discrete, olb::singleton::mpi(), olb::None, olb::singleton::MpiManager::reduce(), olb::ReduceAndBcast, and olb::ReduceOnly.