CoupledSystem< Blocks > Struct Template ReferenceΒΆ

adc_cpp: pops::CoupledSystem< Blocks > Struct Template Reference
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
pops::CoupledSystem< Blocks > Struct Template Reference

Heterogeneous collection of equation blocks, parameterized by their exact types. More...

#include <coupled_system.hpp>

+ Collaboration diagram for pops::CoupledSystem< Blocks >:

Public Member Functions

 CoupledSystem (Blocks... bs)
 
template<std::size_t I>
decltype(auto) block ()
 
template<std::size_t I>
decltype(auto) block () const
 
template<class F >
void for_each_block (F &&f)
 
template<class F >
void for_each_block (F &&f) const
 

Public Attributes

std::tuple< Blocks... > blocks
 

Static Public Attributes

static constexpr std::size_t n_blocks = sizeof...(Blocks)
 

Detailed Description

template<EquationBlockLike... Blocks>
struct pops::CoupledSystem< Blocks >

Heterogeneous collection of equation blocks, parameterized by their exact types.

Iteration over all blocks: for_each_block(f) calls f(block) for each block. Indexed access: block<I>() (compile time). n_blocks = sizeof...(Blocks).

INVARIANT: the blocks are owned by value in the tuple; the MultiFab they reference (via EquationBlock::state) must outlive the CoupledSystem. Construction by deduction: CoupledSystem{b1, b2} deduces the types via the deduction guide provided at the end of the file.

Constructor & Destructor Documentation

◆ CoupledSystem()

template<EquationBlockLike... Blocks>
pops::CoupledSystem< Blocks >::CoupledSystem ( Blocks...  bs)
inlineexplicit

Member Function Documentation

◆ block() [1/2]

template<EquationBlockLike... Blocks>
template<std::size_t I>
decltype(auto) pops::CoupledSystem< Blocks >::block ( )
inline

◆ block() [2/2]

template<EquationBlockLike... Blocks>
template<std::size_t I>
decltype(auto) pops::CoupledSystem< Blocks >::block ( ) const
inline

◆ for_each_block() [1/2]

template<EquationBlockLike... Blocks>
template<class F >
void pops::CoupledSystem< Blocks >::for_each_block ( F &&  f)
inline

◆ for_each_block() [2/2]

template<EquationBlockLike... Blocks>
template<class F >
void pops::CoupledSystem< Blocks >::for_each_block ( F &&  f) const
inline

Member Data Documentation

◆ blocks

template<EquationBlockLike... Blocks>
std::tuple<Blocks...> pops::CoupledSystem< Blocks >::blocks

◆ n_blocks

template<EquationBlockLike... Blocks>
constexpr std::size_t pops::CoupledSystem< Blocks >::n_blocks = sizeof...(Blocks)
staticconstexpr

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