OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::SuperFieldArrayD< T, DESCRIPTOR, FIELD > Class Template Referencefinal

Maintains per-block arrays of FIELD. More...

#include <superFieldArrayD.h>

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

Public Member Functions

 SuperFieldArrayD (CuboidDecomposition< T, DESCRIPTOR::d > &cGeometry, LoadBalancer< T > &loadBalancer)
 
AbstractFieldArrayD< T, DESCRIPTOR, FIELD > & getBlock (int iC)
 
template<Platform PLATFORM>
FieldArrayD< T, DESCRIPTOR, PLATFORM, FIELD > & getBlock (int iC)
 
- Public Member Functions inherited from olb::SuperStructure< T, DESCRIPTOR::d >
virtual ~SuperStructure ()
 Virtual Destructor for inheritance.
 
 SuperStructure (CuboidDecomposition< T, D > &cuboidDecomposition, LoadBalancer< T > &loadBalancer, int overlap=2)
 Construction of a super structure.
 
CuboidDecomposition< T, D > & getCuboidDecomposition ()
 Read and write access to cuboid geometry.
 
const CuboidDecomposition< T, D > & getCuboidDecomposition () 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.
 
virtual void communicate ()
 
void forCorePhysLocations (F f) const
 Iterate over discrete physical locations.
 
void forCorePhysLocations (PhysR< T, D > min, PhysR< T, D > max, F f) const
 Iterate over discrete physical locations between min and max.
 
void forCoreSpatialLocations (F f) const
 Iterate over spatial locations NOTE: Based on physical locations (as opposed to its blockStructure version)
 
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)
 

Additional Inherited Members

- Public Types inherited from olb::SuperStructure< T, DESCRIPTOR::d >
using value_t
 
- Protected Attributes inherited from olb::SuperStructure< T, DESCRIPTOR::d >
CuboidDecomposition< T, D > & _cuboidDecomposition
 The grid structure is referenced 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<typename T, typename DESCRIPTOR, typename FIELD>
class olb::SuperFieldArrayD< T, DESCRIPTOR, FIELD >

Maintains per-block arrays of FIELD.

Useful for storing additional data in the correct per-block platforms for usage in operators (by passing pointer as parameter).

Definition at line 35 of file superFieldArrayD.h.

Constructor & Destructor Documentation

◆ SuperFieldArrayD()

template<typename T , typename DESCRIPTOR , typename FIELD >
olb::SuperFieldArrayD< T, DESCRIPTOR, FIELD >::SuperFieldArrayD ( CuboidDecomposition< T, DESCRIPTOR::d > & cGeometry,
LoadBalancer< T > & loadBalancer )
inline

Definition at line 40 of file superFieldArrayD.h.

41 :
42 SuperStructure<T,DESCRIPTOR::d>(cGeometry, loadBalancer, 0)
43 {
44 auto& load = this->getLoadBalancer();
45 for (int iC = 0; iC < load.size(); ++iC) {
46 _block.emplace_back(
47 constructUsingConcretePlatform<ConcretizableFieldArrayD<T,DESCRIPTOR,FIELD>>(
48 load.platform(iC), 0));
49 }
50 }
CONCRETIZABLE::base_t * constructUsingConcretePlatform(Platform platform, ARGS &&... args)
Definition dispatch.h:107

References olb::constructUsingConcretePlatform(), and olb::SuperStructure< T, DESCRIPTOR::d >::getLoadBalancer().

+ Here is the call graph for this function:

Member Function Documentation

◆ getBlock() [1/2]

template<typename T , typename DESCRIPTOR , typename FIELD >
AbstractFieldArrayD< T, DESCRIPTOR, FIELD > & olb::SuperFieldArrayD< T, DESCRIPTOR, FIELD >::getBlock ( int iC)
inline

Definition at line 52 of file superFieldArrayD.h.

52 {
53 auto& load = this->getLoadBalancer();
55 load.platform(iC),
56 _block[iC].get(),
57 [&](auto* field) -> auto* {
58 return &(field->asAbstract());
59 });
60 }
std::enable_if_t< DESCRIPTOR::d==2, std::shared_ptr< SuperF2D< T > > > field(SuperLattice< T, DESCRIPTOR > &sLattice)
Returns external field functor.
int get()
Get current device.
Definition device.hh:71
auto callUsingConcretePlatform(Platform platform, typename CONCRETIZABLE::base_t *ptr, F f)
Dispatcher for concrete platform access.
Definition dispatch.h:41

References olb::callUsingConcretePlatform(), and olb::SuperStructure< T, DESCRIPTOR::d >::getLoadBalancer().

+ Here is the call graph for this function:

◆ getBlock() [2/2]

template<typename T , typename DESCRIPTOR , typename FIELD >
template<Platform PLATFORM>
FieldArrayD< T, DESCRIPTOR, PLATFORM, FIELD > & olb::SuperFieldArrayD< T, DESCRIPTOR, FIELD >::getBlock ( int iC)
inline

Definition at line 63 of file superFieldArrayD.h.

63 {
64 if (auto* ptr = dynamic_cast<FieldArrayD<T,DESCRIPTOR,PLATFORM,FIELD>*>(_block[iC].get());
65 ptr != nullptr) {
66 return *ptr;
67 } else {
68 throw std::invalid_argument("FieldArrayD is not of PLATFORM");
69 }
70 }

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