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

#include <superLatticeTimeAveraged3D.h>

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

Public Member Functions

 SuperLatticeTimeAveraged3DL2Norm (SuperF3D< T, T > &sFunctorM, SuperF3D< T, T > &sFunctorN, SuperGeometry< T, 3 > &sGeometry, int material)
 
bool operator() (T output[], const int input[])
 
- Public Member Functions inherited from olb::SuperF3D< T, T >
SuperF3D< T, T > & operator- (SuperF3D< T, T > &rhs)
 
SuperF3D< T, T > & operator+ (SuperF3D< T, T > &rhs)
 
SuperF3D< T, T > & operator* (SuperF3D< T, T > &rhs)
 
SuperF3D< T, T > & operator/ (SuperF3D< T, T > &rhs)
 
SuperStructure< T, 3 > & getSuperStructure ()
 
int getBlockFSize () const
 
BlockF3D< T > & getBlockF (int iCloc)
 
bool operator() (T 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)
 

Additional Inherited Members

- Public Types inherited from olb::SuperF3D< T, T >
using identity_functor_type
 
- 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, T >
static constexpr bool isSuper
 
static constexpr unsigned d
 
- Protected Member Functions inherited from olb::SuperF3D< T, T >
 SuperF3D (SuperStructure< T, 3 > &superStructure, int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, S >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::SuperF3D< T, T >
SuperStructure< T, 3 > & _superStructure
 
std::vector< std::unique_ptr< BlockF3D< T > > > _blockF
 Super functors may consist of several BlockF3D<W> derived functors.
 

Detailed Description

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

Definition at line 101 of file superLatticeTimeAveraged3D.h.

Constructor & Destructor Documentation

◆ SuperLatticeTimeAveraged3DL2Norm()

template<typename T >
olb::SuperLatticeTimeAveraged3DL2Norm< T >::SuperLatticeTimeAveraged3DL2Norm ( SuperF3D< T, T > & sFunctorM,
SuperF3D< T, T > & sFunctorN,
SuperGeometry< T, 3 > & sGeometry,
int material )

Definition at line 234 of file superLatticeTimeAveraged3D.hh.

235 : SuperF3D<T,T>(sFunctorM.getSuperStructure(),sFunctorM.getTargetDim()), _sFunctorM(sFunctorM), _sFunctorN(sFunctorN), _sGeometry(sGeometry),_material(material)
236{
237 this->getName() = "SuperLatticeTimeAveraged3DL2Norm";
238};
int getTargetDim() const
read only access to member variable _n
Definition genericF.hh:45
std::string & getName()
read and write access to name
Definition genericF.hh:51
SuperStructure< T, 3 > & getSuperStructure()

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

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

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

Definition at line 241 of file superLatticeTimeAveraged3D.hh.

242{
243 output[0]=0;
244 CuboidGeometry3D<T>& geometry = _sFunctorM.getSuperStructure().getCuboidGeometry();
245
246 int inputTmp[4];
247 T tmpM[_sFunctorM.getTargetDim()];
248 T tmpN[_sFunctorN.getTargetDim()];
249 for (int iC = 0; iC < _sFunctorM.getSuperStructure().getLoadBalancer().size(); ++iC) {
250 Cuboid3D<T>& cuboid = geometry.get(_sFunctorM.getSuperStructure().getLoadBalancer().glob(iC));
251
252 const int nX = cuboid.getNx();
253 const int nY = cuboid.getNy();
254 const int nZ = cuboid.getNz();
255
256 inputTmp[0] = _sFunctorM.getSuperStructure().getLoadBalancer().glob(iC);
257
258 for (inputTmp[1] = 0; inputTmp[1] < nX; ++inputTmp[1]) {
259 for (inputTmp[2] = 0; inputTmp[2] < nY; ++inputTmp[2]) {
260 for (inputTmp[3] = 0; inputTmp[3] < nZ; ++inputTmp[3]) {
261 _sFunctorM(tmpM, inputTmp);
262 _sFunctorN(tmpN, inputTmp);
263 for (int iDim = 0; iDim < _sFunctorM.getTargetDim()/2; ++iDim) {
264 output[0] += (tmpM[iDim]-tmpN[iDim])*(tmpM[iDim]-tmpN[iDim]);
265 }
266 }
267
268 }
269 }
270 }
271
272#ifdef PARALLEL_MODE_MPI
273 singleton::mpi().reduceAndBcast(output[0],MPI_SUM);
274#endif
275
276 Cuboid3D<T>& cuboid = geometry.get(_sFunctorM.getSuperStructure().getLoadBalancer().glob(0));
277 const T weight = cuboid.getDeltaR();
278
279 output[0]=util::sqrt(output[0])*weight;
280 return true;
281
282};
CuboidGeometry< T, D > & getCuboidGeometry()
Read and write access to cuboid geometry.
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
void reduceAndBcast(T &reductVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
Reduction operation, followed by a broadcast.
MpiManager & mpi()
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100

References olb::CuboidGeometry3D< T >::get(), olb::Cuboid3D< T >::getDeltaR(), olb::Cuboid3D< T >::getNx(), olb::Cuboid3D< T >::getNy(), olb::Cuboid3D< T >::getNz(), olb::singleton::mpi(), olb::singleton::MpiManager::reduceAndBcast(), and olb::util::sqrt().

+ Here is the call graph for this function:

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