OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::BlockLatticeAverage2D< T, DESCRIPTOR > Class Template Referencefinal

BlockLatticeAverage2D returns pointwise local average of a passed functor with a given material and radius on local lattice. More...

#include <latticeAverage2D.h>

+ Inheritance diagram for olb::BlockLatticeAverage2D< T, DESCRIPTOR >:
+ Collaboration diagram for olb::BlockLatticeAverage2D< T, DESCRIPTOR >:

Public Member Functions

 BlockLatticeAverage2D (BlockLatticeF2D< T, DESCRIPTOR > &f, BlockGeometry< T, 2 > &blockGeometry, int material, T radius)
 
bool operator() (T output[], const int input[]) override
 has to be implemented for 'every' derived class
 
- Public Member Functions inherited from olb::BlockLatticeF2D< T, DESCRIPTOR >
BlockLattice< T, DESCRIPTOR > & getBlock ()
 Copy Constructor.
 
- Public Member Functions inherited from olb::BlockF2D< T >
virtual BlockStructureD< 2 > & getBlockStructure ()
 virtual destructor for defined behaviour
 
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
 
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::BlockLatticeF2D< T, DESCRIPTOR >
 BlockLatticeF2D (BlockLattice< T, DESCRIPTOR > &blockLattice, int targetDim)
 
- 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::BlockLatticeF2D< T, DESCRIPTOR >
BlockLattice< T, DESCRIPTOR > & _blockLattice
 
- Protected Attributes inherited from olb::BlockF2D< T >
BlockStructureD< 2 > * _blockStructure
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::BlockLatticeAverage2D< T, DESCRIPTOR >

BlockLatticeAverage2D returns pointwise local average of a passed functor with a given material and radius on local lattice.

the output data must be of the same size and dimension like f.

Definition at line 42 of file latticeAverage2D.h.

Constructor & Destructor Documentation

◆ BlockLatticeAverage2D()

template<typename T , typename DESCRIPTOR >
olb::BlockLatticeAverage2D< T, DESCRIPTOR >::BlockLatticeAverage2D ( BlockLatticeF2D< T, DESCRIPTOR > & f,
BlockGeometry< T, 2 > & blockGeometry,
int material,
T radius )

Definition at line 45 of file latticeAverage2D.hh.

48 : BlockLatticeF2D<T,DESCRIPTOR>(f.getBlock(), f.getTargetDim()),
49 _f(f), _blockGeometry(blockGeometry), _material(material), _radius(radius)
50{
51 this->getName() = "Average("+f.getName()+")";
52}
std::string & getName()
read and write access to name
Definition genericF.hh:51

References olb::GenericF< T, S >::getName(), and olb::GenericF< T, int >::getName().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename T , typename DESCRIPTOR >
bool olb::BlockLatticeAverage2D< T, DESCRIPTOR >::operator() ( T output[],
const int input[] )
overridevirtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, int >.

Definition at line 56 of file latticeAverage2D.hh.

57{
58 // CuboidGeometry2D<T>& cGeometry = f.getBlockLattice2D().get_cGeometry();
59 // loadBalancer& load = f.getBlockLattice2D().get_load();
60
61 // //create boolean indicator functor isInSphere
62 // std::vector<T> center(3,0);
63 // center[0] = (int)cGeometry.get(load.glob(input[0])).get_globPosX() + input[1];
64 // center[1] = (int)cGeometry.get(load.glob(input[0])).get_globPosY() + input[2];
65 // center[2] = (int)cGeometry.get(load.glob(input[0])).get_globPosZ() + input[3];
66 // SphereAnalyticalF2D<bool,T> isInSphere(center,radius);
67
68 // iterate over all cuboids & points and test for material && isInSphere
69 // std::vector<T> tmp( this->_n, T() );
70 // int numVoxels(0);
71 // if (this->_blockGeometry.getMaterial({center[0],center[1],center[2]}) == material) {
72 // for (int iC=0; iC<load.size(); iC++) {
73 // int nX = cGeometry.get(load.glob(iC)).getNx();
74 // int nY = cGeometry.get(load.glob(iC)).getNy();
75 // int nZ = cGeometry.get(load.glob(iC)).getNz();
76 // for (int iX=0; iX<nX; ++iX) {
77 // for (int iY=0; iY<nY; ++iY) {
78 // for (int iZ=0; iZ<nZ; iZ++) {
79 // std::vector<T> glob(3,0);
80 // glob[0] = (int)cGeometry.get(load.glob(iC)).get_globPosX() + iX;
81 // glob[1] = (int)cGeometry.get(load.glob(iC)).get_globPosY() + iY;
82 // glob[2] = (int)cGeometry.get(load.glob(iC)).get_globPosZ() + iZ;
83 // if (this->_blockGeometry.getMaterial({glob[0],glob[1],glob[2]}) == material
84 // && isInSphere(glob)[0]==true) {
85 // for (unsigned iD=0; iD<f(load.glob(0),0,0,0).size(); iD++) {
86 // tmp[iD]+=f(load.glob(iC),iX,iY,iZ)[iD];
87 // }
88 // numVoxels++;
89 // }
90 // }
91 // }
92 // }
93 // }
94
95 //#ifdef PARALLEL_MODE_MPI
96 // singleton::mpi().reduceAndBcast(numVoxels, MPI_SUM);
97 //#endif
98 // for (int iD=0; iD<f.getTargetDim(); iD++) {
99 //#ifdef PARALLEL_MODE_MPI
100 // singleton::mpi().reduceAndBcast(tmp[iD], MPI_SUM);
101 //#endif
102 // if (numVoxels>0) {
103 // tmp[iD] /= numVoxels;
104 // }
105 // }
106 // }
107 // return tmp;
108
109 return false;
110}

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