OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::BlockConst3D< T, W > Class Template Referencefinal

#include <blockBaseF3D.h>

+ Inheritance diagram for olb::BlockConst3D< T, W >:
+ Collaboration diagram for olb::BlockConst3D< T, W >:

Public Member Functions

 BlockConst3D (BlockStructureD< 3 > &blockStructure, std::vector< W > v)
 Constructor accepting std::vector.
 
 BlockConst3D (BlockStructureD< 3 > &blockStructure, W scalar)
 Constructor accepting single scalar.
 
template<unsigned Size>
 BlockConst3D (BlockStructureD< 3 > &blockStructure, Vector< W, Size > v)
 Constructor template accepting vectors.
 
bool operator() (W output[], const int input[]) override
 
- Public Member Functions inherited from olb::BlockF3D< T >
 ~BlockF3D () override
 virtual destructor for defined behaviour
 
virtual BlockStructureD< 3 > & getBlockStructure () const
 
BlockF3D< T > & operator- (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator+ (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator* (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator/ (BlockF3D< 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)
 

Protected Attributes

const std::vector< W > _c
 
- Protected Attributes inherited from olb::BlockF3D< T >
BlockStructureD< 3 > & _blockStructure
 

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::BlockF3D< T >
 BlockF3D (BlockStructureD< 3 > &blockStructure, int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, int >
 GenericF (int targetDim, int sourceDim)
 

Detailed Description

template<typename T, typename W = T>
class olb::BlockConst3D< T, W >

Definition at line 190 of file blockBaseF3D.h.

Constructor & Destructor Documentation

◆ BlockConst3D() [1/3]

template<typename T , typename W >
olb::BlockConst3D< T, W >::BlockConst3D ( BlockStructureD< 3 > & blockStructure,
std::vector< W > v )

Constructor accepting std::vector.

Parameters
blockStructureOnly required to instantiate underlying BlockF3D
vstd::vector to be copied to output by operator. Size determines target dimension.

Definition at line 237 of file blockBaseF3D.hh.

238 : BlockF3D<W>(blockStructure, v.size()),
239 _c{std::move(v)}
240{
241 this->getName() = "const(" + std::to_string(_c.size()) + ")";
242}
const std::vector< W > _c
std::string & getName()
Definition genericF.hh:51

References olb::BlockConst3D< T, W >::_c, and olb::GenericF< T, int >::getName().

+ Here is the call graph for this function:

◆ BlockConst3D() [2/3]

template<typename T , typename W >
olb::BlockConst3D< T, W >::BlockConst3D ( BlockStructureD< 3 > & blockStructure,
W scalar )

Constructor accepting single scalar.

Definition at line 245 of file blockBaseF3D.hh.

246 : BlockConst3D(blockStructure, std::vector<W>(1, scalar))
247{ }
BlockConst3D(BlockStructureD< 3 > &blockStructure, std::vector< W > v)
Constructor accepting std::vector.

◆ BlockConst3D() [3/3]

template<typename T , typename W = T>
template<unsigned Size>
olb::BlockConst3D< T, W >::BlockConst3D ( BlockStructureD< 3 > & blockStructure,
Vector< W, Size > v )
inline

Constructor template accepting vectors.

Definition at line 206 of file blockBaseF3D.h.

207 : BlockConst3D(blockStructure, v.toStdVector()) { };

Member Function Documentation

◆ operator()()

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

Definition at line 250 of file blockBaseF3D.hh.

251{
252 for (int i = 0; i < this->getTargetDim(); ++i) {
253 output[i] = _c[i];
254 }
255 return true;
256}
int getTargetDim() const
Definition genericF.hh:45

Member Data Documentation

◆ _c

template<typename T , typename W = T>
const std::vector<W> olb::BlockConst3D< T, W >::_c
protected

Definition at line 192 of file blockBaseF3D.h.


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