include/pops/coupling/schur/core/schur_condensation.hpp File 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
|
BUILDER (NOT solver) of the Schur-condensed source stage of the implicit source coupling potential / velocity / Lorentz (design and references in docs/SCHUR_CONDENSATION_DESIGN.md). More...
#include <pops/core/foundation/types.hpp>#include <pops/core/state/variables.hpp>#include <pops/mesh/execution/for_each.hpp>#include <pops/mesh/geometry/geometry.hpp>#include <pops/mesh/storage/multifab.hpp>#include <pops/mesh/boundary/physical_bc.hpp>#include <pops/numerics/elliptic/poisson/poisson_operator.hpp>#include <pops/numerics/linalg/lorentz_eliminator.hpp>#include <stdexcept>
Include dependency graph for schur_condensation.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | pops::detail::SchurOperatorCoeffKernel |
| Coefficients of the tensor operator A_op = I + c rho B^{-1} ASSEMBLED per cell from the fluid state and the B_z field. More... | |
| struct | pops::detail::SchurExplicitFluxKernel |
| EXPLICIT flux F = rho B^{-1} v^n (v = (mx,my)/rho) ASSEMBLED per cell, WRITTEN at the center into fx/fy. More... | |
| struct | pops::detail::SchurRhsAssembleKernel |
| rhs(i,j) = lap(i,j) (= -Lap phi^n, already negated by the caller) - g * div F, second-order centered divergence of a flux F at the center (fx, fy, ghosts filled). More... | |
| struct | pops::detail::NegateKernel |
| neg(i,j) = -src(i,j) (negation of component 0). Device-clean NAMED functor. More... | |
| struct | pops::SchurCondensationOperator |
| Result of the Schur assembly: the coefficient MultiFab of the tensor operator A_op and the condensed right-hand side. More... | |
| class | pops::ElectrostaticLorentzCondensation |
| GENERIC builder of the condensed source stage for the electrostatic + Lorentz source (kind="electrostatic_lorentz" on the future Python facade side, PR5). More... | |
Namespaces | |
| namespace | pops |
| namespace | pops::detail |
Detailed Description
BUILDER (NOT solver) of the Schur-condensed source stage of the implicit source coupling potential / velocity / Lorentz (design and references in docs/SCHUR_CONDENSATION_DESIGN.md).
This header ONLY ASSEMBLES the coefficients of the tensor elliptic operator A_op and the condensed right-hand side; it does NOT solve and does NOT reconstruct the velocity (stage PR4, which will call the EllipticSolver concept, e.g. TensorKrylovSolver).
FIXED SIGN CONVENTION (docs/SCHUR_CONDENSATION_DESIGN.md section 2.1): We theta-discretize the source. The unknown is phi^{n+theta}. The condensed operator is L_schur(phi) = -Lap phi - theta^2 dt^2 alpha div( rho B^{-1} grad phi ) and its right-hand side RHS = -Lap phi^n - theta dt alpha div( rho B^{-1} v^n ), v^n = (mx, my) / rho. We write c = theta^2 dt^2 alpha (coefficient of the condensed term).
WRITING AS A FULL-TENSOR OPERATOR (poisson_operator.hpp). The elliptic path solves L(phi) = -div(A grad phi) + kappa phi, A = [[eps_x, a_xy], [a_yx, eps_y]]. We identify -Lap phi - c div(rho B^{-1} grad phi) = -div( (I + c rho B^{-1}) grad phi ), thus A = I + c rho B^{-1}, which gives PER CELL: eps_x = 1 + c rho binv_11 a_xy = c rho binv_12 a_yx = c rho binv_21 eps_y = 1 + c rho binv_22 with B^{-1} = (1/det) [[1, w], [-w, 1]], w = theta dt B_z, det = 1 + w^2 (LorentzEliminator). At B_z = 0: w = 0, binv = I, thus a_xy = a_yx = 0 and eps_x = eps_y = 1 + c rho. If in addition c = 0 (theta=0 or dt=0 or alpha=0), A = I and L_schur degenerates EXACTLY into the canonical Laplacian (standard Poisson). kappa stays NULL (no mass term in the condensation).
RIGHT-HAND SIDE DISCRETIZATION. -Lap phi^n is computed by apply_laplacian WITHOUT coefficient (canonical 5-point Laplacian = div(grad phi^n)), then negated. The divergence of the EXPLICIT flux F = rho B^{-1} v^n (vector field AT THE CELL CENTERS) is a centered FV divergence: div F (i,j) = (Fx(i+1,j) - Fx(i-1,j)) / (2 dx) + (Fy(i,j+1) - Fy(i,j-1)) / (2 dy), second order, consistent with the centered discretization of the operator (poisson_operator.hpp).
GENERICITY (docs/SCHUR_CONDENSATION_DESIGN.md section 4). This builder names NO scenario: it reads the ROLES Density / MomentumX / MomentumY (and Energy ignored here) of a VariableSet, plus an aux field B_z, alpha, theta, dt. Any fluid block that exposes these roles is eligible (ExB-drift polar ring OR magnetized multi-species) without one extra line of Schur code. The contract is validated at assembly (roles present, otherwise explicit exception on the HOST side, before any kernel).
DEVICE / MPI (docs/GPU_RUNTIME_PORT.md). All kernels are device-clean NAMED FUNCTORS (no extended lambda first-instantiated cross-TU, nvcc limitation #64/#97). The coefficients live in MultiFab (one field per entry). All loops iterate over local_size(): a rank WITHOUT box (local_size()==0, MPI decomposition) runs no kernel and never dereferences fab(0) -> MPI-clean.
Generated by