include/pops/physics/bricks/elliptic.hpp Source FileΒΆ

adc_cpp: include/pops/physics/bricks/elliptic.hpp Source File
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
elliptic.hpp
Go to the documentation of this file.
1#pragma once
2
5
12
13namespace pops {
14
24 Real q = 1;
25 int c_rho = 0; // default = density in component 0 (bit-identical)
26 template <class State>
27 POPS_HD Real rhs(const State& u) const {
28 return q * u[c_rho];
29 }
30};
31
40 Real alpha = 1, n0 = 0;
41 int c_rho = 0; // default = density in component 0 (bit-identical)
42 template <class State>
43 POPS_HD Real rhs(const State& u) const {
44 return alpha * (u[c_rho] - n0);
45 }
46};
47
56 Real sign = 1, four_pi_G = 1, rho0 = 1;
57 int c_rho = 0; // default = density in component 0 (bit-identical)
58 template <class State>
59 POPS_HD Real rhs(const State& u) const {
60 return sign * four_pi_G * (u[c_rho] - rho0);
61 }
62};
63
64} // namespace pops
Definition amr_hierarchy.hpp:29
double Real
Definition types.hpp:30
Pointwise types of the physics layer: StateVec<N> (conserved state) and Aux (auxiliary fields from th...
Neutralizing background f = alpha (n - n0).
Definition elliptic.hpp:39
int c_rho
Definition elliptic.hpp:41
Real n0
Definition elliptic.hpp:40
POPS_HD Real rhs(const State &u) const
Definition elliptic.hpp:43
Real alpha
Definition elliptic.hpp:40
Charge density f = q n.
Definition elliptic.hpp:23
Real q
Definition elliptic.hpp:24
POPS_HD Real rhs(const State &u) const
Definition elliptic.hpp:27
int c_rho
Definition elliptic.hpp:25
Self-consistent coupling f = sign * 4piG * (rho - rho0).
Definition elliptic.hpp:55
Real rho0
Definition elliptic.hpp:56
Real sign
Definition elliptic.hpp:56
POPS_HD Real rhs(const State &u) const
Definition elliptic.hpp:59
int c_rho
Definition elliptic.hpp:57
Real four_pi_G
Definition elliptic.hpp:56
Base scalar types and the POPS_HD macro (host+device portability).
#define POPS_HD
Definition types.hpp:25