OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
olb::SuperData< D, T, U > Class Template Reference

#include <superData.h>

+ Inheritance diagram for olb::SuperData< D, T, U >:
+ Collaboration diagram for olb::SuperData< D, T, U >:

Public Types

using block_t = ConcretizableBlockData<D,T,U>
 
- Public Types inherited from olb::SuperStructure< T, D >
using value_t = T
 

Public Member Functions

 SuperData (CuboidGeometry< T, D > &cuboidGeometry, LoadBalancer< T > &loadBalancer, int overlap=2, int size=1)
 
virtual ~SuperData ()=default
 
 SuperData (SuperF< D, T, U > &rhs)
 
const BlockData< D, T, U > & getBlock (int iC) const
 
BlockData< D, T, U > & getBlock (int iC)
 
template<typename BLOCK = BlockData<D,T,U>>
BLOCK & getBlock (int iC)
 
template<typename BLOCK = BlockData<D,T,U>>
const BLOCK & getBlock (int iC) const
 
void communicate () override
 Communicate overlaps.
 
int getDataSize () const
 Read only access to the dim of the data of the super structure.
 
int getDataTypeSize () const
 Read only access to the data type dim of the data of the super structure.
 
- Public Member Functions inherited from olb::SuperStructure< T, D >
virtual ~SuperStructure ()
 Virtual Destructor for inheritance.
 
 SuperStructure (CuboidGeometry< T, D > &cuboidGeometry, LoadBalancer< T > &loadBalancer, int overlap=2)
 Construction of a super structure.
 
 SuperStructure (int overlap=1)
 Default Constructor for empty SuperStructure.
 
CuboidGeometry< T, D > & getCuboidGeometry ()
 Read and write access to cuboid geometry.
 
CuboidGeometry< T, D > const & getCuboidGeometry () const
 Read only access to cuboid geometry.
 
int getOverlap ()
 Read and write access to the overlap.
 
int getOverlap () const
 Read only access to the overlap.
 
LoadBalancer< T > & getLoadBalancer ()
 Read and write access to the load balancer.
 
LoadBalancer< T > const & getLoadBalancer () const
 Read only access to the load balancer.
 
template<typename F >
void forCorePhysLocations (F f) const
 Iterate over discrete physical locations.
 
template<typename F >
void forCorePhysLocations (PhysR< T, D > min, PhysR< T, D > max, F f) const
 Iterate over discrete physical locations between min and max.
 
template<typename F >
void forCoreSpatialLocations (F f) const
 Iterate over spatial locations NOTE: Based on physical locations (as opposed to its blockStructure version)
 
template<typename F >
void forCoreSpatialLocations (PhysR< T, D > min, PhysR< T, D > max, F f) const
 Iterate over spatial locations between min and max NOTE: Based on physical locations (as opposed to its blockStructure version)
 

Static Public Attributes

static constexpr unsigned d = D
 

Protected Attributes

const std::size_t _size
 Dimension of the data field.
 
std::vector< std::unique_ptr< BlockData< D, T, U > > > _block
 Vector of BlockData.
 
std::unique_ptr< SuperCommunicator< T, SuperData > > _communicator
 Inter-block communicator.
 
- Protected Attributes inherited from olb::SuperStructure< T, D >
CuboidGeometry< T, D > & _cuboidGeometry
 The grid structure is stored here.
 
LoadBalancer< T > & _loadBalancer
 Distribution of the cuboids of the cuboid structure.
 
int _overlap
 Size of ghost cell layer (must be greater than 1 and greater_overlapBC, default =1)
 
OstreamManager clout
 class specific output stream
 

Detailed Description

template<unsigned D, typename T, typename U>
class olb::SuperData< D, T, U >

Definition at line 45 of file superData.h.

Member Typedef Documentation

◆ block_t

template<unsigned D, typename T , typename U >
using olb::SuperData< D, T, U >::block_t = ConcretizableBlockData<D,T,U>

Definition at line 57 of file superData.h.

Constructor & Destructor Documentation

◆ SuperData() [1/2]

template<unsigned D, typename T , typename U >
olb::SuperData< D, T, U >::SuperData ( CuboidGeometry< T, D > & cuboidGeometry,
LoadBalancer< T > & loadBalancer,
int overlap = 2,
int size = 1 )

Definition at line 40 of file superData.hh.

43 : SuperStructure<T,D>(cuboidGeometry, loadBalancer, overlap),
44 _size(size)
45{
46 auto& load = this->getLoadBalancer();
47 for (int iC=0; iC < load.size(); ++iC) {
48 _block.emplace_back(
49 new BlockData<D,T,U>(cuboidGeometry.get(load.glob(iC)), overlap, size));
50 }
51
52 if (overlap >= 1) {
53 _communicator = std::make_unique<SuperCommunicator<T,SuperData>>(*this);
54 _communicator->template requestField<typename BlockData<D,T,U>::DUMMY_FIELD>();
55 _communicator->requestOverlap(overlap);
56 _communicator->exchangeRequests();
57 }
58}
const std::size_t _size
Dimension of the data field.
Definition superData.h:48
std::unique_ptr< SuperCommunicator< T, SuperData > > _communicator
Inter-block communicator.
Definition superData.h:52
std::vector< std::unique_ptr< BlockData< D, T, U > > > _block
Vector of BlockData.
Definition superData.h:50
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.

References olb::SuperData< D, T, U >::_block, olb::SuperData< D, T, U >::_communicator, and olb::SuperStructure< T, D >::getLoadBalancer().

+ Here is the call graph for this function:

◆ ~SuperData()

template<unsigned D, typename T , typename U >
virtual olb::SuperData< D, T, U >::~SuperData ( )
virtualdefault

◆ SuperData() [2/2]

template<unsigned D, typename T , typename U >
olb::SuperData< D, T, U >::SuperData ( SuperF< D, T, U > & rhs)

Definition at line 61 of file superData.hh.

62 : SuperData(rhs.getSuperStructure().getCuboidGeometry(),
63 rhs.getSuperStructure().getLoadBalancer(),
64 rhs.getSuperStructure().getOverlap(),
65 rhs.getTargetDim())
66{
67 auto& load = this->getLoadBalancer();
68
69 int input[D+1];
70 U output[rhs.getTargetDim()];
71
72 for (int iC=0; iC < load.size(); ++iC) {
73 auto& block = getBlock(iC);
74 input[0] = load.glob(iC);
75 block.forCoreSpatialLocations([&](LatticeR<D> latticeR) {
76 for (unsigned iD=0; iD < D; ++iD) {
77 input[1+iD] = latticeR[iD];
78 }
79 rhs(output, input);
80 for (unsigned iD=0; iD < rhs.getTargetDim(); ++iD) {
81 block.get(latticeR,iD) = output[iD];
82 }
83 });
84 }
85}
const BlockData< D, T, U > & getBlock(int iC) const
Definition superData.hh:88
SuperData(CuboidGeometry< T, D > &cuboidGeometry, LoadBalancer< T > &loadBalancer, int overlap=2, int size=1)
Definition superData.hh:40

Member Function Documentation

◆ communicate()

template<unsigned D, typename T , typename U >
void olb::SuperData< D, T, U >::communicate ( )
overridevirtual

Communicate overlaps.

Reimplemented from olb::SuperStructure< T, D >.

Definition at line 114 of file superData.hh.

115{
116 if (_communicator) {
117 _communicator->communicate();
118 }
119}

◆ getBlock() [1/4]

template<unsigned D, typename T , typename U >
BlockData< D, T, U > & olb::SuperData< D, T, U >::getBlock ( int iC)

Definition at line 94 of file superData.hh.

95{
96 return *_block[iC];
97}

◆ getBlock() [2/4]

template<unsigned D, typename T , typename U >
template<typename BLOCK >
BLOCK & olb::SuperData< D, T, U >::getBlock ( int iC)

Definition at line 101 of file superData.hh.

102{
103 return *_block[iC];
104}

◆ getBlock() [3/4]

template<unsigned D, typename T , typename U >
const BlockData< D, T, U > & olb::SuperData< D, T, U >::getBlock ( int iC) const

Definition at line 88 of file superData.hh.

89{
90 return *_block[iC];
91}
+ Here is the caller graph for this function:

◆ getBlock() [4/4]

template<unsigned D, typename T , typename U >
template<typename BLOCK >
const BLOCK & olb::SuperData< D, T, U >::getBlock ( int iC) const

Definition at line 108 of file superData.hh.

109{
110 return *_block[iC];
111}

◆ getDataSize()

template<unsigned D, typename T , typename U >
int olb::SuperData< D, T, U >::getDataSize ( ) const

Read only access to the dim of the data of the super structure.

Definition at line 122 of file superData.hh.

123{
124 return _size;
125}

◆ getDataTypeSize()

template<unsigned D, typename T , typename U >
int olb::SuperData< D, T, U >::getDataTypeSize ( ) const

Read only access to the data type dim of the data of the super structure.

Definition at line 128 of file superData.hh.

129{
130 return sizeof(U);
131}

Member Data Documentation

◆ _block

template<unsigned D, typename T , typename U >
std::vector<std::unique_ptr<BlockData<D,T,U> > > olb::SuperData< D, T, U >::_block
protected

Vector of BlockData.

Definition at line 50 of file superData.h.

◆ _communicator

template<unsigned D, typename T , typename U >
std::unique_ptr<SuperCommunicator<T,SuperData> > olb::SuperData< D, T, U >::_communicator
protected

Inter-block communicator.

Definition at line 52 of file superData.h.

◆ _size

template<unsigned D, typename T , typename U >
const std::size_t olb::SuperData< D, T, U >::_size
protected

Dimension of the data field.

Definition at line 48 of file superData.h.

◆ d

template<unsigned D, typename T , typename U >
constexpr unsigned olb::SuperData< D, T, U >::d = D
staticconstexpr

Definition at line 55 of file superData.h.


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