GravityForce Struct 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::GravityForce Struct Reference
Gravitational force rho g (+ work if 4 variables). More...
#include <source.hpp>
Collaboration diagram for pops::GravityForce:Public Member Functions | |
| template<class State > | |
| POPS_HD State | apply (const State &u, const Aux &a) const |
Public Attributes | |
| int | c_rho = 0 |
| int | c_mx = 1 |
| int | c_my = 2 |
| int | c_E = 3 |
Detailed Description
Gravitational force rho g (+ work if 4 variables).
g = -grad phi.
CONTRACT: pointwise SOURCE brick, device-callable (POPS_HD), no global state. Formula: s[c_mx] += rho*gx, s[c_my] += rho*gy, s[c_E] += rho_u*gx + rho_v*gy (the c_E work term is active only if State::size() == 4: compressible Euler). No q/m coefficient (unlike PotentialForce): g is gravity directly.
ROLE-AWARE (audit section 5): c_rho/c_mx/c_my/c_E are members, defaults = canonical layout (rho=0, m_x=1, m_y=2, E=3), resolved by model_factory via the transport roles. Canonical indices == defaults for any native transport -> bit-identical. See PotentialForce for the full contract.
Member Function Documentation
◆ apply()
template<class State >
|
inline |
Member Data Documentation
◆ c_E
| int pops::GravityForce::c_E = 3 |
◆ c_mx
| int pops::GravityForce::c_mx = 1 |
◆ c_my
| int pops::GravityForce::c_my = 2 |
◆ c_rho
| int pops::GravityForce::c_rho = 0 |
The documentation for this struct was generated from the following file:
- include/pops/physics/bricks/source.hpp
Generated by