OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR > Class Template Reference

#include <serialization.h>

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

Public Member Functions

 BlockLatticeSerialDataF (BlockLattice< T, DESCRIPTOR > &blockLattice, Controller< T > &controller, const GeometrySerializer< T, d > &serializer, int iC, unsigned dataDim, std::function< T(T)> projection)
 
bool operator() (T output[], const int input[])
 

Protected Attributes

Controller< T > & _controller
 
const GeometrySerializer< T, d > & _serializer
 
const int _iC
 
std::function< T(T)> _projection
 

Static Protected Attributes

static constexpr unsigned d = DESCRIPTOR::d
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >

Definition at line 312 of file serialization.h.

Constructor & Destructor Documentation

◆ BlockLatticeSerialDataF()

template<typename T , typename DESCRIPTOR >
olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::BlockLatticeSerialDataF ( BlockLattice< T, DESCRIPTOR > & blockLattice,
Controller< T > & controller,
const GeometrySerializer< T, d > & serializer,
int iC,
unsigned dataDim,
std::function< T(T)> projection )
inline

Definition at line 320 of file serialization.h.

323 : BlockLatticeF<T,DESCRIPTOR>(blockLattice, dataDim),
324 _controller(controller), _serializer(serializer), _iC(iC),
325 _projection(projection)
326 {
327 this->getName() = "BlockLatticeSerialDataF";
328 }
const GeometrySerializer< T, d > & _serializer

Member Function Documentation

◆ operator()()

template<typename T , typename DESCRIPTOR >
bool olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::operator() ( T output[],
const int input[] )
inline

Definition at line 330 of file serialization.h.

331 {
332 if (this->getBlock().isInsideCore(input)) {
333 int latticeR[4] = {_iC, input[0], input[1], 0};
334 if constexpr (d == 3) {
335 latticeR[3] = input[2];
336 }
337 const auto index = _serializer.getSerializedComponentIndex(latticeR, 0, this->getTargetDim());
338 for (int i = 0; i < this->getTargetDim(); ++i) { // todo: benutze std::copy_n?
339 output[i] = _projection(_controller.getControl(index + i));
340 }
341 return true;
342 }
343 return false;
344 }
static constexpr unsigned d
S const & getControl(int i) const
Definition controller.h:59
std::size_t getSerializedComponentIndex(const int latticeR[], unsigned iD, unsigned fieldDim) const
Get index of field component from lattice coordinates and component index.

References olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::_controller, olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::_iC, olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::_projection, olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::_serializer, olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::d, olb::opti::Controller< S >::getControl(), and olb::opti::GeometrySerializer< S, dim >::getSerializedComponentIndex().

+ Here is the call graph for this function:

Member Data Documentation

◆ _controller

template<typename T , typename DESCRIPTOR >
Controller<T>& olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::_controller
protected

Definition at line 315 of file serialization.h.

◆ _iC

template<typename T , typename DESCRIPTOR >
const int olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::_iC
protected

Definition at line 317 of file serialization.h.

◆ _projection

template<typename T , typename DESCRIPTOR >
std::function<T(T)> olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::_projection
protected

Definition at line 318 of file serialization.h.

◆ _serializer

template<typename T , typename DESCRIPTOR >
const GeometrySerializer<T,d>& olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::_serializer
protected

Definition at line 316 of file serialization.h.

◆ d

template<typename T , typename DESCRIPTOR >
constexpr unsigned olb::opti::BlockLatticeSerialDataF< T, DESCRIPTOR >::d = DESCRIPTOR::d
staticconstexprprotected

Definition at line 314 of file serialization.h.


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