CompositeSource< A, B > Struct Template ReferenceΒΆ

adc_cpp: pops::CompositeSource< A, B > 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::CompositeSource< A, B > Struct Template Reference

SUM of two source bricks: S(U, aux) = A.apply(U, aux) + B.apply(U, aux). More...

#include <source.hpp>

+ Collaboration diagram for pops::CompositeSource< A, B >:

Public Member Functions

template<class State >
POPS_HD State apply (const State &u, const Aux &ax) const
 

Public Attributes

a {}
 
b {}
 

Static Public Attributes

static constexpr int n_aux = aux_comps<A>() > aux_comps<B>() ? aux_comps<A>() : aux_comps<B>()
 

Detailed Description

template<class A, class B>
struct pops::CompositeSource< A, B >

SUM of two source bricks: S(U, aux) = A.apply(U, aux) + B.apply(U, aux).

Allows COMPOSING several pointwise forces in the SINGLE Source slot of CompositeModel (e.g. electrostatic PotentialForce + magnetic MagneticLorentzForce for a magnetized E x B plasma). Generic over state size (StateVec addition is defined component-wise, cf. core/state.hpp).

CONTRACT: pointwise SOURCE brick, device-callable (POPS_HD), no global state beyond the two sub-bricks (themselves POD). PROPAGATES the aux channel: n_aux = max(aux_comps<A>, aux_comps<B>) -> if a sub-brick reads B_z (n_aux=4), the composite exposes it and CompositeModel raises it to the system.

Member Function Documentation

◆ apply()

template<class A , class B >
template<class State >
POPS_HD State pops::CompositeSource< A, B >::apply ( const State &  u,
const Aux ax 
) const
inline

Member Data Documentation

◆ a

template<class A , class B >
A pops::CompositeSource< A, B >::a {}

◆ b

template<class A , class B >
B pops::CompositeSource< A, B >::b {}

◆ n_aux

template<class A , class B >
constexpr int pops::CompositeSource< A, B >::n_aux = aux_comps<A>() > aux_comps<B>() ? aux_comps<A>() : aux_comps<B>()
staticconstexpr

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