diff --git a/CHANGELOG.md b/CHANGELOG.md index 883288ef5..e7791e1e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -239,6 +239,15 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versioning ### Changed +- **`include/adc` deep re-nest, phase 5 (final): runtime split + coupling families finished** + (ADC-396, follow-up of ADC-395): `runtime/` keeps only the public facade at top (system, + amr_system, facade_options, export); `detail/` splits into `config/` (runtime_params, + dispatch_tags, model_spec), `context/` (grid_context, wall_predicate) and `dynamic/` (abi_key, + dynlib, dynamic_model, model_registry); `builders/` splits into `block/`, `compiled/` and + `factory/`. `coupling/static_system/` is renamed `coupling/system/`, and `coupling/schur/` splits + into `core/`, `source/` and `amr/`. Every internal `#include ` and the DSL emit (runtime + config/dynamic/builders paths) are repointed. Public include-path break (pre-1.0). Completes the + include/adc family layout. - **`include/adc` deep re-nest, phase 4: numerics split into sub-families** (ADC-395, follow-up of ADC-394): top-level numerics headers move to `linalg/` (dense_eig, lorentz_eliminator) and `fv/` (numerical_flux, reconstruction, spatial_discretisation); `spatial/` splits into `primitives/` diff --git a/README.md b/README.md index 7141c753d..4a09a4b37 100644 --- a/README.md +++ b/README.md @@ -187,10 +187,10 @@ Reference: [native-bricks](docs/sphinx/reference/native-bricks.md), | Layer | Role | Entry point | |---|---|---| -| `core/` | types, state, `PhysicalModel`, `EquationBlock`, `CoupledSystem` | [physical_model.hpp](include/adc/core/physical_model.hpp) | -| `physics/` | generic bricks composed into a `CompositeModel` | [composite.hpp](include/adc/physics/composite.hpp) | -| `numerics/` | reconstruction (Minmod / VanLeer / WENO5), flux (Rusanov / HLL / HLLC / Roe) | [reconstruction.hpp](include/adc/numerics/reconstruction.hpp) | -| `numerics/elliptic/` | `EllipticSolver` concept, geometric multigrid, FFT, composite FAC | [elliptic_solver.hpp](include/adc/numerics/elliptic/elliptic_solver.hpp) | +| `core/` | types, state, `PhysicalModel`, `EquationBlock`, `CoupledSystem` | [physical_model.hpp](include/adc/core/model/physical_model.hpp) | +| `physics/` | generic bricks composed into a `CompositeModel` | [composite.hpp](include/adc/physics/composition/composite.hpp) | +| `numerics/` | reconstruction (Minmod / VanLeer / WENO5), flux (Rusanov / HLL / HLLC / Roe) | [reconstruction.hpp](include/adc/numerics/fv/reconstruction.hpp) | +| `numerics/elliptic/` | `EllipticSolver` concept, geometric multigrid, FFT, composite FAC | [elliptic_solver.hpp](include/adc/numerics/elliptic/interface/elliptic_solver.hpp) | | `numerics/time/` | SSP-RK, multirate scheduler, IMEX, splitting, AMR engine | [numerics/time/](include/adc/numerics/time) | | `coupling/` | `Coupler`, `SystemCoupler`, `AmrSystemCoupler`, `AmrCouplerMP` | [coupler.hpp](include/adc/coupling/single/coupler.hpp) | | `amr/`, `mesh/`, `parallel/` | Berger-Rigoutsos clustering, regrid, MultiFab, MPI comm seam | [amr/](include/adc/amr) | diff --git a/bench/frontend_bench.cpp b/bench/frontend_bench.cpp index 01e5972b7..9651593f3 100644 --- a/bench/frontend_bench.cpp +++ b/bench/frontend_bench.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/bench/scaling_amr.cpp b/bench/scaling_amr.cpp index a2c92aff4..1425c87ac 100644 --- a/bench/scaling_amr.cpp +++ b/bench/scaling_amr.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #ifdef ADC_HAS_KOKKOS diff --git a/docs/ALGORITHMS.md b/docs/ALGORITHMS.md index 0797d92f0..fac5a2095 100644 --- a/docs/ALGORITHMS.md +++ b/docs/ALGORITHMS.md @@ -216,7 +216,7 @@ function HLLC(m, UL, AL, UR, AR, dir): # canonical Euler 2D fall ``` **Code.** Stateless policies in -[`include/adc/numerics/numerical_flux.hpp`](../include/adc/numerics/numerical_flux.hpp): `RusanovFlux`, +[`include/adc/numerics/fv/numerical_flux.hpp`](../include/adc/numerics/fv/numerical_flux.hpp): `RusanovFlux`, `HLLFlux`, `HLLCFlux`, `RoeFlux` (all `ADC_HD`). `RusanovFlux` loops component by component with `m.max_wave_speed`; `HLLFlux`/`HLLCFlux` share the free function `hll_speeds` (Davis estimates, requires `m.wave_speeds`); `HLLCFlux`/`RoeFlux` additionally require `m.pressure`. A non-Euler model @@ -231,7 +231,7 @@ independently of the limiter. The `SourceFreeModel` adapter (explicit IMEX half- IMEX half-step stays on an HLLC flux. A moment hierarchy (no fluid roles, no primitive `p`) can also drive a generic Roe via the DSL emitter `m.roe_from_jacobian()` (section 23): `|A|` is applied by `adc::roe_abs_apply` -([`include/adc/numerics/dense_eig.hpp`](../include/adc/numerics/dense_eig.hpp)) behind a real-spectrum +([`include/adc/numerics/linalg/dense_eig.hpp`](../include/adc/numerics/linalg/dense_eig.hpp)) behind a real-spectrum gate, with a spectral-radius Rusanov fallback when `|A|` is not a faithful real spectral function. **Constraints / remarks.** `RusanovFlux` is the only flux compatible with the minimal `PhysicalModel` @@ -351,7 +351,7 @@ function weno5z(vm2, vm1, v0, vp1, vp2): # face entre v0 et vp1 ``` **Code.** Pointwise `Limiter` policies in -[`include/adc/numerics/reconstruction.hpp`](../include/adc/numerics/reconstruction.hpp): `NoSlope` +[`include/adc/numerics/fv/reconstruction.hpp`](../include/adc/numerics/fv/reconstruction.hpp): `NoSlope` (`n_ghost = 1`, `operator()` returns `Real(0)`), `Minmod` and `VanLeer` (`n_ghost = 2`, `operator()(a,b)` returns the limited slope, absolute value coded by hand to stay device-safe without ``), `Weno5` (`n_ghost = 3`, a tag whose `operator()` is a no-op that just satisfies the `Limiter` concept). The @@ -438,16 +438,16 @@ concept TimeStepper = I.take_step(rhs, U, dt) compile ``` **Code.** Two expressions coexist, separating the mathematical scheme from its usage policy. -The tags [`include/adc/numerics/time/time_integrator.hpp`](../include/adc/numerics/time/time_integrator.hpp) +The tags [`include/adc/numerics/time/integrators/time_integrator.hpp`](../include/adc/numerics/time/integrators/time_integrator.hpp) (`SSPRK2`, `SSPRK3`, `UserTimeIntegrator`) name, per block, the temporal treatment via a `TimePolicy`; `TimePolicyTraits` reads these fields (and accepts a bare tag, then treated as `Explicit` with a single step). The aliases `ExplicitTime` / `ImplicitTime` / `IMEXTime` / `PrescribedTime` set the `TimeTreatment`. The object integrators -[`include/adc/numerics/time/time_steppers.hpp`](../include/adc/numerics/time/time_steppers.hpp) +[`include/adc/numerics/time/integrators/time_steppers.hpp`](../include/adc/numerics/time/integrators/time_steppers.hpp) (`ForwardEuler`, `SSPRK2Step`, `SSPRK3Step`) carry the method: each exposes `take_step(rhs, U, dt)` and allocates its scratch (`R`, stages `U1`/`U2`/`U3`) only from the layout of `U`, with no persistent state. The integrator sees only `rhs(U_stage, R)` (the method-of-lines arrow) -and the `saxpy`/`lincomb` operations of [`include/adc/mesh/mf_arith.hpp`](../include/adc/mesh/mf_arith.hpp): +and the `saxpy`/`lincomb` operations of [`include/adc/mesh/storage/mf_arith.hpp`](../include/adc/mesh/storage/mf_arith.hpp): it is agnostic of the model and of the discretization. The `TimeStepper` concept formalizes the contract, so that a case can provide its own `take_step` object exactly as it provides a `PhysicalModel`. @@ -536,10 +536,10 @@ function backward_euler_source(model, aux, U, dt, iters, mask): U(i,j,:) <- W) ``` -**Code.** [`include/adc/numerics/time/imex.hpp`](../include/adc/numerics/time/imex.hpp): +**Code.** [`include/adc/numerics/time/schemes/imex.hpp`](../include/adc/numerics/time/schemes/imex.hpp): `imex_euler_step(U, dt, Texpl, Simpl)` chains the in-place explicit transport then the in-place implicit source solve (two callables `TransportStep` / `ImplicitSourceSolve`). The implicit step lives in -[`include/adc/numerics/time/implicit_stepper.hpp`](../include/adc/numerics/time/implicit_stepper.hpp): +[`include/adc/numerics/time/integrators/implicit_stepper.hpp`](../include/adc/numerics/time/integrators/implicit_stepper.hpp): `newton_source_solve` (local per-cell Newton, forward-backward Euler for the partial IMEX), `detail::solve_dense` (dense `n x n` resolution by Gauss elimination with partial pivoting, a fixed constexpr array hence device-callable, no allocation), and `backward_euler_source` which applies @@ -614,7 +614,7 @@ function strang_step(U, dt, T, S): ``` **Code.** The two generic bricks are in -[`include/adc/numerics/time/splitting.hpp`](../include/adc/numerics/time/splitting.hpp): +[`include/adc/numerics/time/schemes/splitting.hpp`](../include/adc/numerics/time/schemes/splitting.hpp): `lie_step(MultiFab& U, Real dt, TransportStep T, SourceStep S)` and `strang_step(...)`. Both are templated on `TransportStep` / `SourceStep`: $T$ and $S$ are callables `(MultiFab&, Real) -> void` that advance their subsystem in place, so the integrator is @@ -731,14 +731,14 @@ function step_adaptive(cfl): # macro-pas = pas du bloc le return macro_dt ``` -**Code.** The skeleton is [`numerics/time/scheduler.hpp`](../include/adc/numerics/time/scheduler.hpp), +**Code.** The skeleton is [`numerics/time/scheduler.hpp`](../include/adc/numerics/time/schemes/scheduler.hpp), function `advance_subcycled` (two overloads: with and without `macro_step`). It reads `block_substeps_v`, `block_stride_v` and `block_time_treatment_v`, aliases of `TimePolicyTraits` -defined in [`numerics/time/time_integrator.hpp`](../include/adc/numerics/time/time_integrator.hpp) +defined in [`numerics/time/time_integrator.hpp`](../include/adc/numerics/time/integrators/time_integrator.hpp) (`TimePolicy`, aliases `ExplicitTime` / `ImplicitTime` / `IMEXTime` / `PrescribedTime`). A `TimeTreatment::Prescribed` block is skipped (the guard `!= Prescribed`). The step choice lives in -[`runtime/system_stepper.hpp`](../include/adc/runtime/system_stepper.hpp): `step_cfl`, +[`runtime/system_stepper.hpp`](../include/adc/runtime/system/system_stepper.hpp): `step_cfl`, `step_adaptive`, and the helper `stride_due(macro_step, stride)` that materializes the end of window $(k+1)\bmod m = 0$. The speed $w_b$ comes from `max_wave_speed_mf` ([`numerics/spatial_operator.hpp`](../include/adc/numerics/spatial_operator.hpp)), collective @@ -901,14 +901,14 @@ coarse multi-box distributed grid, otherwise the stopping criterion triggers at rank and desynchronizes the MPI fluxes). The `replicated` mode replicates each level on all ranks (per-fab V-cycle without communication), which is what the AMR coupler expects (level 0 replicated). -**Code.** [`numerics/elliptic/geometric_mg.hpp`](../include/adc/numerics/elliptic/geometric_mg.hpp): +**Code.** [`numerics/elliptic/geometric_mg.hpp`](../include/adc/numerics/elliptic/mg/geometric_mg.hpp): `GeometricMG` models the `EllipticSolver` concept (`rhs()`, `phi()`, `solve()`, `residual()`); `vcycle_rec` is the recursion, `solve(rel_tol, max_cycles)` iterates the cycles with warm-start (`phi` kept between calls, 1-2 V-cycles in the established regime). The 5-point Laplacian and the smoother are -the shared bricks of [`numerics/elliptic/poisson_operator.hpp`](../include/adc/numerics/elliptic/poisson_operator.hpp) +the shared bricks of [`numerics/elliptic/poisson_operator.hpp`](../include/adc/numerics/elliptic/poisson/poisson_operator.hpp) (`poisson_residual`, `gs_smooth` -> `gs_rb_sweep` -> `detail::gs_color`, named ADC_HD functors device-clean). Restriction / prolongation reuse the AMR transfer operators `average_down` -/ `interpolate` of [`mesh/refinement.hpp`](../include/adc/mesh/refinement.hpp). `solve_robust` +/ `interpolate` of [`mesh/refinement.hpp`](../include/adc/mesh/layout/refinement.hpp). `solve_robust` adds an anti-divergence safeguard (cf. below). **Constraints / remarks.** Fully on-device (the V-cycle goes through `for_each_cell`), @@ -953,13 +953,13 @@ function solve(): # DistributedFFTSolver, FFT p phi = re-empaqueter la bande locale ``` -**Code.** [`numerics/elliptic/poisson_fft_solver.hpp`](../include/adc/numerics/elliptic/poisson_fft_solver.hpp): +**Code.** [`numerics/elliptic/poisson_fft_solver.hpp`](../include/adc/numerics/elliptic/poisson/poisson_fft_solver.hpp): `PoissonFFTSolver` (single-rank, single box) and `DistributedFFTSolver` (FFT distributed by bands / slabs, 1 box per rank, `MPI_Alltoall` transpose internal to `PoissonFFT`). Both model the same `EllipticSolver` concept (`static_assert`) as multigrid, so the coupler is generic over the backend (`Coupler` interchangeable with `GeometricMG`). The residual reuses the canonical operator `poisson_residual` of -[`poisson_operator.hpp`](../include/adc/numerics/elliptic/poisson_operator.hpp); the +[`poisson_operator.hpp`](../include/adc/numerics/elliptic/poisson/poisson_operator.hpp); the distributed variant does a `fill_boundary` (inter-band halos) before the measurement and reduces by `all_reduce_max`. The FFT core lives in `poisson_fft.hpp` (a fix handles $n$ not a power of 2). @@ -1022,7 +1022,7 @@ function ApplyLaplacianKernel(i, j): # L = div(eps grad phi) - kap if hk (kappa actif): L(i,j) -= kappa(i,j) * p(i,j) ``` -**Code.** [`numerics/elliptic/geometric_mg.hpp`](../include/adc/numerics/elliptic/geometric_mg.hpp): +**Code.** [`numerics/elliptic/geometric_mg.hpp`](../include/adc/numerics/elliptic/mg/geometric_mg.hpp): `GeometricMG::set_epsilon(eps_fn | eps_fine)`, `set_reaction(kappa_fn | kappa_fine)`, `set_epsilon_anisotropic(eps_x, eps_y)`. Each field exists in two overloads: analytic (`std::function`, evaluated per level over the whole hierarchy -> exact permittivity at the coarse, @@ -1031,7 +1031,7 @@ order 2 preserved) and already-discretized (`MultiFab` of the fine level, compon `System`). The $\kappa$ term (0 ghost, diagonal), the $\epsilon$ / $\epsilon_y$ fields (1 ghost, ghosts filled by `eps_bc`: periodic preserved, physical boundary by zero-gradient extrapolation) live in the ADC_HD `for_each_cell` of the smoother, the residual and the apply -([`poisson_operator.hpp`](../include/adc/numerics/elliptic/poisson_operator.hpp): +([`poisson_operator.hpp`](../include/adc/numerics/elliptic/poisson/poisson_operator.hpp): `ApplyLaplacianKernel`, `PoissonResidualKernel`, `GsColorKernel`, `eps_harmonic`) -> device. The fine-level coefficient pointers are also exposed (`op_eps`, `op_kappa`, `op_eps_y`, ...) so the Krylov solver reuses an operator consistent with the MG residual. @@ -1054,7 +1054,7 @@ exact coefficient at each coarse resolution, which preserves the order 2 of the **Intuition.** When the elliptic operator carries cross terms $A_{xy} \neq A_{yx}$ (a non-self-adjoint operator, for example the rotation $B^{-1}$ coming from Schur condensation), geometric multigrid alone, whose Gauss-Seidel smoother assumes a self-adjoint operator, stagnates or diverges. A non-symmetric Krylov solver is needed, preconditioned by the MG V-cycle applied to the symmetric part of the operator. -**Formula / discretization.** We solve $A\,\phi = f$ with, in the convention of [`poisson_operator.hpp`](../include/adc/numerics/elliptic/poisson_operator.hpp) and of `GeometricMG`, +**Formula / discretization.** We solve $A\,\phi = f$ with, in the convention of [`poisson_operator.hpp`](../include/adc/numerics/elliptic/poisson/poisson_operator.hpp) and of `GeometricMG`, $$L_{\mathrm{int}}(\phi) = \mathrm{div}(A\,\nabla\phi) - \kappa\,\phi, \qquad A = \begin{pmatrix} A_{xx} & A_{xy} \\ A_{yx} & A_{yy}\end{pmatrix},$$ @@ -1115,7 +1115,7 @@ function apply_precond(in): # M^{-1} a CL homogenes return out ``` -**Code.** [`numerics/elliptic/krylov_solver.hpp`](../include/adc/numerics/elliptic/krylov_solver.hpp): class `TensorKrylovSolver`, methods `solve(rel_tol, max_iters)` (returns a `KrylovResult`: `iters`, `rel_residual`, `converged`), `apply_operator` / `apply_operator_lin` (affine and linear matvec), `precond_raw` / `apply_precond` (raw V-cycle and homogeneous-BC V-cycle), `prepare_solve` (one-time computation of the offsets $c_{bc}$, $d_{bc}$), `residual` (current global L2 residual). The constructor takes two distinct `GeometricMG`: `op` carries the full operator (matvec + storage of $\phi$/$rhs$), `precond` carries the symmetric part (same eps but `set_cross_terms` not called). They must be separate objects, enforced by `assert(&op != &precond)`: `apply_precond` overwrites `precond.rhs()`/`precond.phi()` at each iteration, and conflating them would overwrite the iterate and the right-hand side of the solve. +**Code.** [`numerics/elliptic/krylov_solver.hpp`](../include/adc/numerics/elliptic/linear/krylov_solver.hpp): class `TensorKrylovSolver`, methods `solve(rel_tol, max_iters)` (returns a `KrylovResult`: `iters`, `rel_residual`, `converged`), `apply_operator` / `apply_operator_lin` (affine and linear matvec), `precond_raw` / `apply_precond` (raw V-cycle and homogeneous-BC V-cycle), `prepare_solve` (one-time computation of the offsets $c_{bc}$, $d_{bc}$), `residual` (current global L2 residual). The constructor takes two distinct `GeometricMG`: `op` carries the full operator (matvec + storage of $\phi$/$rhs$), `precond` carries the symmetric part (same eps but `set_cross_terms` not called). They must be separate objects, enforced by `assert(&op != &precond)`: `apply_precond` overwrites `precond.rhs()`/`precond.phi()` at each iteration, and conflating them would overwrite the iterate and the right-hand side of the solve. **Constraints / remarks.** Iterative method, no CFL of its own; the cost depends on the conditioning of the Schur complement, hence the preconditioning by symmetric MG (1 to 2 V-cycles, parameter `n_precond_vcycles`). BiCGStab breakdown safeguards: if $|\rho|$, $|\omega|$ or $\mathrm{dot}(\hat r, v)$ fall below `kTiny` $= 10^{-300}$, the solve returns the current best effort without dividing by zero. Device/MPI: named functors only (`mf_arith`: `saxpy`/`lincomb`/`dot`, `apply_laplacian`, MG V-cycle), all device-clean. The scalar products `dot` are collective (`all_reduce_sum`) and called on all ranks, including a rank without a box (`local_size() == 0`): no short-circuit, hence no MPI deadlock nor desynchronization of the stopping criterion. Known limitation: the symmetric preconditioner loses efficiency when the antisymmetric part grows (high source CFL, large $\omega_c$); the iteration count then increases. @@ -1180,7 +1180,7 @@ function CondensedSchurSourceStepper.step(state, phi, bz_field, c_bz, theta, dt) device_fence() ; fill_ghosts(state, foextrap) ; fill_ghosts(phi, bcPhi) ``` -**Code.** [`numerics/lorentz_eliminator.hpp`](../include/adc/numerics/lorentz_eliminator.hpp): POD struct `LorentzEliminator(theta, dt, B_z)`, methods `apply_B`/`apply_Binv`, accessors `binv_11..binv_22`; trivially copyable (static_assert), capturable by value in a kernel. [`coupling/schur_condensation.hpp`](../include/adc/coupling/schur/schur_condensation.hpp) builds the operator and the RHS without solving nor reconstructing: class `ElectrostaticLorentzCondensation`, methods `assemble_operator` (functor `SchurOperatorCoeffKernel`), `assemble_rhs` (functors `SchurExplicitFluxKernel`, `SchurRhsAssembleKernel`, `NegateKernel`), `assemble` (into a `SchurCondensationOperator`), accessor `c_coeff()`; the Density/MomentumX/MomentumY roles contract is validated on the host (exception otherwise). [`coupling/condensed_schur_source_stepper.hpp`](../include/adc/coupling/schur/condensed_schur_source_stepper.hpp): class `CondensedSchurSourceStepper`, method `step` which composes the three bricks (assembler #124, `TensorKrylovSolver` #122, `LorentzEliminator` #118), functors `SchurReconstructKernel`, `SchurExtrapolateScalarKernel`, `SchurExtrapolateVelocityKernel`, `SchurEnergyKernel`, `ExtractVelocityKernel`, `CopyBzKernel`, diagnostic `last_solve()`. This is the production source stage (#126), opt-in via `adc.Split(source=CondensedSchur)`. +**Code.** [`numerics/lorentz_eliminator.hpp`](../include/adc/numerics/linalg/lorentz_eliminator.hpp): POD struct `LorentzEliminator(theta, dt, B_z)`, methods `apply_B`/`apply_Binv`, accessors `binv_11..binv_22`; trivially copyable (static_assert), capturable by value in a kernel. [`coupling/schur_condensation.hpp`](../include/adc/coupling/schur/core/schur_condensation.hpp) builds the operator and the RHS without solving nor reconstructing: class `ElectrostaticLorentzCondensation`, methods `assemble_operator` (functor `SchurOperatorCoeffKernel`), `assemble_rhs` (functors `SchurExplicitFluxKernel`, `SchurRhsAssembleKernel`, `NegateKernel`), `assemble` (into a `SchurCondensationOperator`), accessor `c_coeff()`; the Density/MomentumX/MomentumY roles contract is validated on the host (exception otherwise). [`coupling/condensed_schur_source_stepper.hpp`](../include/adc/coupling/schur/source/condensed_schur_source_stepper.hpp): class `CondensedSchurSourceStepper`, method `step` which composes the three bricks (assembler #124, `TensorKrylovSolver` #122, `LorentzEliminator` #118), functors `SchurReconstructKernel`, `SchurExtrapolateScalarKernel`, `SchurExtrapolateVelocityKernel`, `SchurEnergyKernel`, `ExtractVelocityKernel`, `CopyBzKernel`, diagnostic `last_solve()`. This is the production source stage (#126), opt-in via `adc.Split(source=CondensedSchur)`. **Constraints / remarks.** Stability: the theta-scheme is unconditionally stable for $\theta \geq 1/2$ ($\theta = 1$ pure implicit, the extrapolation is the identity; $\theta = 1/2$ Crank-Nicolson, extrapolation factor 2). The centered order-2 discretization (5-point Laplacian, centered divergence and gradient) fixes the spatial order. This is the source stage alone (transport frozen): $\rho$ is constant in the stage, $\rho^{n+1} = \rho^n$, and all the transport dynamics stays in the hyperbolic stage of the splitting. Safeguard: $c = 0$ and $B_z = 0$ give $A = I$, the solve becomes $\Delta\phi^{n+\theta} = \Delta\phi^n$ so $\phi^{n+\theta} = \phi^n$ (up to a constant), and the reconstruction degenerates into the explicit electrostatic push $v^{n+\theta} = v^n - \theta\, dt\,\nabla\phi^n$. The tolerance of the internal solve ($10^{-10}$, 400 iterations max) bounds the precision of the implicit relation $B v = v^n - \theta\, dt\,\nabla\phi$ (verified term by term). Device/MPI: all kernels are device-clean named functors (no extended cross-TU lambda, nvcc limit #64/#97); the MultiFab buffers are allocated once at construction and reused at each `step`; the loops iterate over `local_size()` (a rank without a box -> no kernel) and the Krylov solve is collective, so MPI-clean. @@ -1245,16 +1245,16 @@ function cut_distance(lc, ln, h): ``` **Code.** The cut geometry is centralized in -[`include/adc/numerics/elliptic/cut_fraction.hpp`](../include/adc/numerics/elliptic/cut_fraction.hpp): +[`include/adc/numerics/elliptic/eb/cut_fraction.hpp`](../include/adc/numerics/elliptic/eb/cut_fraction.hpp): `detail::cut_distance` (linear crossing of a face), `detail::cut_fraction` (the 4 half-distances + apertures + volume fraction `kappa`), and `detail::shortley_weller` which returns the 5 weights `ShortleyWellerWeights{w_xm, w_xp, w_ym, w_yp, w_diag}`. The V-cycle -[`include/adc/numerics/elliptic/geometric_mg.hpp`](../include/adc/numerics/elliptic/geometric_mg.hpp) +[`include/adc/numerics/elliptic/mg/geometric_mg.hpp`](../include/adc/numerics/elliptic/mg/geometric_mg.hpp) writes them once per level into its `coef` field (5 components) at setup (host) then reads them on-device; it skips the conductor cells (`m(i,j) == 0`). It is the same `cut_fraction` that the EB transport consumes (section 15): aperture geometry bit-consistent between Poisson and transport. The cut-cell and mask geometry is a named generic level-set contract in -[`include/adc/numerics/embedded_boundary.hpp`](../include/adc/numerics/embedded_boundary.hpp) (ADC-327): +[`include/adc/numerics/spatial/embedded_boundary/domain.hpp`](../include/adc/numerics/spatial/embedded_boundary/domain.hpp) (ADC-327): a domain exposes `ADC_HD Real level_set(x, y)` (negative inside) and is directly usable as the `LevelSet` argument of `cut_fraction` / `assemble_rhs_eb`. Built-ins are `DiscDomain` (circle) and `HalfPlaneDomain`; the `LevelSetDomain` concept in the same header is diagnostics-only (a `static_assert` @@ -1333,19 +1333,19 @@ function face_aperture(lc, ln): **Code.** `System::set_disc_domain(cx, cy, R, mode)` (#216, [`include/adc/runtime/system.hpp`](../include/adc/runtime/system.hpp), defined in [`python/system.cpp`](../python/system.cpp)) sets a `DiscDomain` -([`include/adc/numerics/embedded_boundary.hpp`](../include/adc/numerics/embedded_boundary.hpp), +([`include/adc/numerics/spatial/embedded_boundary/domain.hpp`](../include/adc/numerics/spatial/embedded_boundary/domain.hpp), `level_set`) and the transport mode; `set_geometry_mode(mode)` switches the mode alone; `disc_mask()` materializes the mask (all-active if no disc). The stepper routes each block: `assemble_rhs` (full), `assemble_rhs_masked` ([`include/adc/numerics/spatial_operator.hpp`](../include/adc/numerics/spatial_operator.hpp), 0/1 gate) or `assemble_rhs_eb` -([`include/adc/numerics/spatial_operator_eb.hpp`](../include/adc/numerics/spatial_operator_eb.hpp), +([`include/adc/numerics/spatial/embedded_boundary/operator.hpp`](../include/adc/numerics/spatial/embedded_boundary/operator.hpp), EB). The device kernels are named functors (`detail::EbFaceFluxXKernel`, `EbFaceFluxYKernel`, `EbAssembleRhsKernel`, and the adapter `detail::DiscLevelSet` which forwards `DiscDomain::level_set`) for cross-TU emission under nvcc; `eb_face_aperture` closes the face toward an inactive neighbor. The apertures and `kappa` come from -[`include/adc/numerics/elliptic/cut_fraction.hpp`](../include/adc/numerics/elliptic/cut_fraction.hpp) +[`include/adc/numerics/elliptic/eb/cut_fraction.hpp`](../include/adc/numerics/elliptic/eb/cut_fraction.hpp) (same geometry as the elliptic cut-cell of section 14); the reconstruction (`reconstruct<>`) and the numerical flux (`RusanovFlux`) are reused verbatim from the Cartesian operator. @@ -1431,17 +1431,17 @@ $m=0$ alone) or homogeneous Neumann (Foextrap, $\phi_{-1} = \phi_0$ -> $b_0 \mat + two Neumann boundaries: the radial operator has the constant in its kernel (singular tridiagonal); we fix the gauge by pinning $\hat\phi(0,0) = 0$ (row 0 replaced by the identity in Thomas). -**Code.** [`include/adc/mesh/geometry.hpp`](../include/adc/mesh/geometry.hpp)`::PolarGeometry` (ring, +**Code.** [`include/adc/mesh/geometry/geometry.hpp`](../include/adc/mesh/geometry/geometry.hpp)`::PolarGeometry` (ring, opt-in via `adc.PolarMesh`; `cfg.geometry == "polar"` on the [`python/system.cpp`](../python/system.cpp) side). Transport: -[`include/adc/numerics/spatial_operator_polar.hpp`](../include/adc/numerics/spatial_operator_polar.hpp)`::assemble_rhs_polar` +[`include/adc/numerics/spatial/operators/polar_operator.hpp`](../include/adc/numerics/spatial/operators/polar_operator.hpp)`::assemble_rhs_polar` (`recon_prim`, `wall_radial`), via the named functors `detail::PolarFaceFluxRKernel` (radial flux weighted by `r_face`, optional wall at the boundary faces), `PolarFaceFluxThetaKernel`, `PolarAssembleRhsKernel`; the physical source and the geometric source are routed by the concepts `PolarHasSource` / `PolarHasGeomSource` (`if constexpr`: zero codegen for a scalar brick, ExB path bit-identical). Instantiated via `runtime/block_builder_polar.hpp`, wired in `System::step` for `geometry == "polar"`. Poisson: -[`include/adc/numerics/elliptic/polar_poisson_solver.hpp`](../include/adc/numerics/elliptic/polar_poisson_solver.hpp)`::PolarPoissonSolver` +[`include/adc/numerics/elliptic/polar/polar_poisson_solver.hpp`](../include/adc/numerics/elliptic/polar/polar_poisson_solver.hpp)`::PolarPoissonSolver` (FFT-in-theta `fft1d` reused from `poisson_fft.hpp` + complex `thomas_solve` in r; models the concept `PolarEllipticSolver` `rhs()/phi()/solve()/residual()/geom()`). The aux is derived in the local basis $(e_r, e_\theta)$: `aux[1] = d phi/dr`, `aux[2] = (1/r) d phi/d theta` @@ -1452,7 +1452,7 @@ high $\omega_c$), the Schur condenses a full tensor operator $A = I + c\,\rho\, B^{-1}$ with cross terms $a_{rt}, a_{tr}$ and a theta-dependent coefficient: the FFT-in-theta of `PolarPoissonSolver` no longer applies (it requires a constant theta coefficient without cross coupling). -[`include/adc/numerics/elliptic/polar_tensor_operator.hpp`](../include/adc/numerics/elliptic/polar_tensor_operator.hpp)`::PolarTensorKrylovSolver` +[`include/adc/numerics/elliptic/polar/polar_tensor_operator.hpp`](../include/adc/numerics/elliptic/polar/polar_tensor_operator.hpp)`::PolarTensorKrylovSolver` then solves by matrix-free BiCGStab (handles the non-symmetric of the cross term), preconditioned `Jacobi` or `RadialLine` (radial Thomas per theta line, default). No MG V-cycle (stagnation on $1/r^2$). Singular operator (pure radial Neumann + periodic theta): gauge fixed by projection onto @@ -1541,17 +1541,17 @@ function subcycle_level(coarse_level, fine_level, dt, r=2): Uc(I,J) -= flux_register.at(I,J,k) ``` -**Code.** [`numerics/time/amr_reflux_mf.hpp`](../include/adc/numerics/time/amr_reflux_mf.hpp) is the +**Code.** [`numerics/time/amr_reflux_mf.hpp`](../include/adc/numerics/time/amr/reflux/amr_reflux_mf.hpp) is the umbrella that aggregates the sub-headers. The unified production entry is `advance_amr` in -[`numerics/time/amr_advance.hpp`](../include/adc/numerics/time/amr_advance.hpp) (a faithful facade of the +[`numerics/time/amr_advance.hpp`](../include/adc/numerics/time/amr/advance/amr_advance.hpp) (a faithful facade of the N-level multi-patch engine `detail::amr_step_multilevel_multipatch`). The roles are promoted to named types -in [`numerics/time/amr_patch_range.hpp`](../include/adc/numerics/time/amr_patch_range.hpp): +in [`numerics/time/amr_patch_range.hpp`](../include/adc/numerics/time/amr/levels/amr_patch_range.hpp): `SubcyclingSchedule` (cadence $r$, $\Delta t/r$, $\mathrm{frac}(s)=s/r$), `PatchRange` (coarse footprint $[I_0..I_1]\times[J_0..J_1]$ of a fine patch), `FluxRegister` (a global-index buffer, accumulation `add`/`set` then `gather`), `CoverageMask` (shadowed cells), `CoarseFineInterface::route_reflux` (bordering deposit). The inter-level transfers `average_down` (conservative average over $r\times r$ blocks), `interpolate` (piecewise-constant injection) and `parallel_copy` are in -[`mesh/refinement.hpp`](../include/adc/mesh/refinement.hpp). The per-cell fine ghost goes through +[`mesh/refinement.hpp`](../include/adc/mesh/layout/refinement.hpp). The per-cell fine ghost goes through `fill_cf_ghost_cell` (space + time interpolation), shared by the three variants `mf_fill_fine_ghosts_*`. **Constraints / remarks.** The temporal ratio is fixed at $r = 2$: `PatchRange` uses the @@ -1610,18 +1610,18 @@ function reflux_multipatch(coarse_level, fine_boxarray_global, registers, distri ``` **Code.** The coverage-aware types live in -[`numerics/time/amr_patch_range.hpp`](../include/adc/numerics/time/amr_patch_range.hpp): +[`numerics/time/amr_patch_range.hpp`](../include/adc/numerics/time/amr/levels/amr_patch_range.hpp): `CoverageMask` (built on the coarse region, `mark` marks the intersected footprint, `covered` is bounded outside the region), `CoarseFineInterface` (assembles the mask on `fine_ba.size()` global patches and exposes `route_reflux`, a named function templated on the register type `Reg`/`RegMP` hence safe under nvcc), `FluxRegister::gather` (inter-rank sum by `all_reduce_sum_inplace`). The MPI routing of the distributed coarse goes through `parallel_copy` in -[`mesh/refinement.hpp`](../include/adc/mesh/refinement.hpp) (general redistribution between two MultiFab +[`mesh/refinement.hpp`](../include/adc/mesh/layout/refinement.hpp) (general redistribution between two MultiFab on the same domain with different decompositions: local copies via `BoxHash::query`, then `MPI_Isend`/`MPI_Irecv` jobs enumerated deterministically, tag 1). The replicated coarse fills its periodic ghosts by `fill_periodic_local` (a purely local self-fold, without an MPI plan). The `coarse_replicated` flag of `LevelHierarchy` (default `true`) is passed to the engine by `advance_amr` in -[`numerics/time/amr_advance.hpp`](../include/adc/numerics/time/amr_advance.hpp); without this passing, a +[`numerics/time/amr_advance.hpp`](../include/adc/numerics/time/amr/advance/amr_advance.hpp); without this passing, a de-replicated coarse would revert to replicated mode (`mf_find_box` instead of `parallel_copy`). **Constraints / remarks.** Without a coverage mask, the fine-fine joint would be refluxed twice, hence @@ -1696,14 +1696,14 @@ function regrid_level(hierarchy, coarse_lev, crit, params): ``` **Code.** The clustering is `berger_rigoutsos` in -[`amr/cluster.hpp`](../include/adc/amr/cluster.hpp), with the helpers `detail::tag_bbox` (trim), +[`amr/cluster.hpp`](../include/adc/amr/tagging/cluster.hpp), with the helpers `detail::tag_bbox` (trim), `detail::signature`, `detail::best_hole`, `detail::best_inflection` (max $|D[k]-D[k-1]|$), `detail::cluster_rec` (recursion), and the final chop by `BoxArray::from_domain(b, max_box_size)`. The parameters are `ClusterParams` (`min_efficiency`, `min_box_size`, `max_box_size`). The regrid is -`regrid_level` in [`amr/regrid.hpp`](../include/adc/amr/regrid.hpp): `tag_cells` (generic predicate +`regrid_level` in [`amr/regrid.hpp`](../include/adc/amr/regridding/regrid.hpp): `tag_cells` (generic predicate on `ConstArray4`), `grow_tags` (square dilation bounded to the domain), `berger_rigoutsos`, then `Box2D::refine(ref_ratio)`, `interpolate` and `parallel_copy` (to preserve the values of the old fine) -of [`mesh/refinement.hpp`](../include/adc/mesh/refinement.hpp), finally `AmrHierarchy::install_level`. Without +of [`mesh/refinement.hpp`](../include/adc/mesh/layout/refinement.hpp), finally `AmrHierarchy::install_level`. Without a tag, `clear_above` removes the fine level and the finer ones. Under MPI, the global OR of the tags (`all_reduce_or_inplace`) must precede the clustering, otherwise the fine BoxArray would differ per rank. @@ -1804,13 +1804,13 @@ function fill_boundary_end(mf, h): unpack(recv buffers via for_each UnpackKernel) -> ghosts ``` -**Code.** [`mesh/box_array.hpp`](../include/adc/mesh/box_array.hpp) (`BoxArray::from_domain`, +**Code.** [`mesh/box_array.hpp`](../include/adc/mesh/layout/box_array.hpp) (`BoxArray::from_domain`, `split_range`, the vector order is the box identity); -[`mesh/distribution_mapping.hpp`](../include/adc/mesh/distribution_mapping.hpp) +[`mesh/distribution_mapping.hpp`](../include/adc/mesh/layout/distribution_mapping.hpp) (`DistributionMapping`, round-robin `i % nranks` by default, replicated metadata); -[`mesh/multifab.hpp`](../include/adc/mesh/multifab.hpp) (`MultiFab` allocates only the fabs where +[`mesh/multifab.hpp`](../include/adc/mesh/storage/multifab.hpp) (`MultiFab` allocates only the fabs where `dm_[i] == my_rank()`, iterates over `local_size()`, `global_index` / `local_index_of` bridge); -[`mesh/fill_boundary.hpp`](../include/adc/mesh/fill_boundary.hpp) (`fill_boundary_begin` / +[`mesh/fill_boundary.hpp`](../include/adc/mesh/boundary/fill_boundary.hpp) (`fill_boundary_begin` / `fill_boundary_end` non-blocking + `fill_boundary` blocking, `HaloExchange` owns the buffers and `MPI_Request`, kernels `CopyShiftedKernel` / `PackKernel` / `UnpackKernel` device-clean); [`parallel/load_balance.hpp`](../include/adc/parallel/load_balance.hpp) (`morton_key`, @@ -1869,15 +1869,15 @@ function make_grid(n, dx, dy, periodic, aux_in, naux): # compiled_block_abi.hpp fill ghosts (memes CL que le System) -> load_aux lit B_z / T_e ``` -**Code.** [`core/physical_model.hpp`](../include/adc/core/physical_model.hpp): +**Code.** [`core/physical_model.hpp`](../include/adc/core/model/physical_model.hpp): `aux_comps()` (detects `M::n_aux` via `requires`, falls back to `kAuxBaseComps = 3`), lives in the contract header so that `CompositeModel` propagates `n_aux` without pulling in the numerics; the concept `PhysicalModel` enforces `M::Aux == adc::Aux`. On the virtual dispatch side, -[`runtime/dynamic_model.hpp`](../include/adc/runtime/dynamic_model.hpp): +[`runtime/dynamic_model.hpp`](../include/adc/runtime/dynamic/dynamic_model.hpp): `IModel::n_aux()` (default `kAuxBaseComps`), `ModelAdapter::n_aux()` returns `aux_comps()`. The widening is anchored in `System::ensure_aux_width` (called by -[`runtime/dsl_block.hpp`](../include/adc/runtime/dsl_block.hpp) before `grid_context()`), and the -flat marshaling in [`runtime/compiled_block_abi.hpp`](../include/adc/runtime/compiled_block_abi.hpp) +[`runtime/dsl_block.hpp`](../include/adc/runtime/builders/compiled/dsl_block.hpp) before `grid_context()`), and the +flat marshaling in [`runtime/compiled_block_abi.hpp`](../include/adc/runtime/builders/compiled/compiled_block_abi.hpp) (`make_grid(..., naux)`, symbol `adc_compiled_naux()` = `aux_comps()`). **Constraints / remarks.** The widening must precede the capture of the aux address (otherwise the @@ -1943,7 +1943,7 @@ level via `same_layout_or_throw`, coarse Poisson co-located sum, conservation pe `add_coupled_source` for the inter-species sources, `n_blocks()`). On the coupling side: `coupling/system_coupler.hpp` (`SystemAssembler` assembles, `SystemDriver` advances), `coupling/amr_system_coupler.hpp` (the system carried over AMR). -[`runtime/model_factory.hpp`](../include/adc/runtime/model_factory.hpp): +[`runtime/model_factory.hpp`](../include/adc/runtime/builders/factory/model_factory.hpp): `dispatch_model` / `dispatch_transport` / `dispatch_source` / `dispatch_elliptic` assemble a `CompositeModel` from a `ModelSpec` (the core names no scenario). @@ -2008,14 +2008,14 @@ function residual(U, R, aux_in, n, dx, dy, periodic, lim, riem, recon_pri ``` **Code.** -- JIT: [`runtime/dynamic_model.hpp`](../include/adc/runtime/dynamic_model.hpp) (`IModel` +- JIT: [`runtime/dynamic_model.hpp`](../include/adc/runtime/dynamic/dynamic_model.hpp) (`IModel` virtual, `ModelAdapter`, `make_dynamic`); `System.add_dynamic_block` wires a virtual-dispatch model (host path, Rusanov, prototyping). -- AOT marshaled: [`runtime/compiled_block_abi.hpp`](../include/adc/runtime/compiled_block_abi.hpp) +- AOT marshaled: [`runtime/compiled_block_abi.hpp`](../include/adc/runtime/builders/compiled/compiled_block_abi.hpp) (`make_grid`, `fill_interior` / `extract`, `residual` / `advance` / `max_speed` / `poisson_rhs`, macro `ADC_DEFINE_COMPILED_BLOCK`, runtime params via `make_model_with_params` and the symbols `_p`); `System.add_compiled_block` (`extern "C"` ABI, without AMR nor MPI). -- AOT native: [`runtime/dsl_block.hpp`](../include/adc/runtime/dsl_block.hpp) (`add_compiled_model`, +- AOT native: [`runtime/dsl_block.hpp`](../include/adc/runtime/builders/compiled/dsl_block.hpp) (`add_compiled_model`, wires a `CompositeModel` known at compile time as a native block, `ensure_aux_width` + `grid_context` + `make_block` + `install_block` + `set_block_ghosts`). The device-clean machinery is `runtime/block_builder.hpp` (named functors `BlockRhsEval`, `AdvanceExplicit`, @@ -2024,7 +2024,7 @@ function residual(U, R, aux_in, n, dx, dy, periodic, lim, riem, recon_pri **Constraints / remarks.** The type-erased JIT costs an indirect jump per cell (out of the high-performance hot path); the AOT marshaled recopies the arrays at each call but stays mono-rank; the AOT native is the only zero-copy / GPU / MPI / AMR path. The native path loads a `.so` via a loader -([`runtime/native_loader.hpp`](../include/adc/runtime/native_loader.hpp)) which compares an ABI key +([`runtime/native_loader.hpp`](../include/adc/runtime/builders/compiled/native_loader.hpp)) which compares an ABI key (`abi_key`: header signature, compiler, C++ standard) between the model's `.so` and the module already loaded; a divergence is refused cleanly (no loading of an incompatible `.so`). The parity is locked at each level. @@ -2079,7 +2079,7 @@ function sync_host(): device_fence() # avant un acces hote (memo function sync_device(): pass # no-op sous SharedSpace (scaffolding) ``` -**Code.** [`mesh/for_each.hpp`](../include/adc/mesh/for_each.hpp): `for_each_cell` (`Kokkos::parallel_for` +**Code.** [`mesh/for_each.hpp`](../include/adc/mesh/execution/for_each.hpp): `for_each_cell` (`Kokkos::parallel_for` on the execution space chosen at install, `#error` without `ADC_HAS_KOKKOS`, guard `if constexpr` device, threshold `foreach_serial_threshold` for the internal small host loop), `for_each_cell_reduce_sum` / `_max` (reducers `Kokkos::Sum` / `Max` deterministic), the variants @@ -2087,7 +2087,7 @@ with a reducer functor `reduce_sum_cell` / `reduce_max_cell` (passed directly to without a wrapper lambda, a device-clean cross-TU path for a Model-template kernel), and the coherence seam `sync_host()` (= targeted `device_fence()`) / `sync_device()` (no-op under unified memory). The fabs and the reduction `sum(MultiFab)` (all-reduce on all ranks) live in -[`mesh/multifab.hpp`](../include/adc/mesh/multifab.hpp). The MPI collectives are wrapped in +[`mesh/multifab.hpp`](../include/adc/mesh/storage/multifab.hpp). The MPI collectives are wrapped in [`parallel/comm.hpp`](../include/adc/parallel/comm.hpp) (`all_reduce_sum`, `all_reduce_max`, `all_reduce_sum_inplace`, `all_reduce_or_inplace`, `barrier`, `comm_init` / `comm_finalize`), which degenerate into the serial identity. diff --git a/docs/AMR_CONDENSED_SCHUR_DESIGN.md b/docs/AMR_CONDENSED_SCHUR_DESIGN.md index 5d7546d86..b3d3ea76f 100644 --- a/docs/AMR_CONDENSED_SCHUR_DESIGN.md +++ b/docs/AMR_CONDENSED_SCHUR_DESIGN.md @@ -331,9 +331,9 @@ ROMEO-only = **V6**. Everything through V5 (incl. MPI up to np=4) runs on the la **Phase B -- changed:** - `include/adc/runtime/amr_system.hpp` -- `AmrBuildParams` += `has_state,state`; `AmrCompiledBlockBuilder` typedef += `state,has_state`; declare `set_conservative_state`, `coarse_state`. -- `include/adc/runtime/abi_key.hpp` -- **add glob-independent ABI sentinel** (`amr_builder_v=2`) [phaseB C1/H1]. +- `include/adc/runtime/dynamic/abi_key.hpp` -- **add glob-independent ABI sentinel** (`amr_builder_v=2`) [phaseB C1/H1]. - `include/adc/coupling/amr/amr_coupler_mp.hpp` -- **new** `coupler_write_coarse_state`; **new** `coupler_read_coarse_all`. -- `include/adc/runtime/amr_dsl_block.hpp` -- mono seed branch (90); `build_amr_block`/`dispatch_amr_block` (10 sites)/`multi_builder` += `state,has_state`. +- `include/adc/runtime/builders/compiled/amr_dsl_block.hpp` -- mono seed branch (90); `build_amr_block`/`dispatch_amr_block` (10 sites)/`multi_builder` += `state,has_state`. - `python/amr_system.cpp` -- `BlockSpec` += `has_state,state`; `make_build_params` packs state; 2 multi dispatches += args; **new** `set_conservative_state` + `coarse_state` bodies. - `python/bindings.cpp` -- **new** `set_conservative_state` (with `ndim()==3` guard) + `coarse_state` pybind. - `adc_cases/hoffart_euler_poisson_dsl/run.py` -- drift-seed `build_amr` (probe in try/except, `nc` guard); docstring (15-17) + metadata (464,482) honesty fix. @@ -342,13 +342,13 @@ ROMEO-only = **V6**. Everything through V5 (incl. MPI up to np=4) runs on the la **Phase C -- new:** - `include/adc/numerics/elliptic/amr_tensor_krylov_solver.hpp` -- multi-level BiCGStab; covered-excluded L2 reductions; per-level matvec with reflux + covered-slave; FGMRES fallback hook. - `include/adc/numerics/elliptic/amr_elliptic_reflux.hpp` -- `TensorFluxRegister` + `route_elliptic_reflux` (diagonal flux; conforming cross-flux if §2.3 option 1). -- `include/adc/coupling/schur/amr_condensed_schur_source_stepper.hpp` -- per-level scratch, `step()`, lazy build, full rebuild-on-regrid. +- `include/adc/coupling/schur/amr/amr_condensed_schur_source_stepper.hpp` -- per-level scratch, `step()`, lazy build, full rebuild-on-regrid. - `include/adc/numerics/elliptic/amr_mg_preconditioner.hpp` -- *(Tier 1 only)* MLAT V-cycle across AMR levels. - `python/tests/test_amr_schur_*.py` -- V0a/V0b/V1/V2/V3/V4 drivers. **Phase C -- changed:** -- `include/adc/numerics/elliptic/poisson_operator.hpp` -- *(only if §2.3 option 1)* `cross_div` refactor to emit C/F-conforming face cross-flux [recon-extrap G3, contradicts original "no modification"]. -- `include/adc/runtime/amr_runtime.hpp` -- `amr_schur_step`; Strang restructure (new phi-publish-without-resolve entry, half-step orchestration); **rebuild stepper after `regrid()`**; phi-restart contract (R0). +- `include/adc/numerics/elliptic/poisson/poisson_operator.hpp` -- *(only if §2.3 option 1)* `cross_div` refactor to emit C/F-conforming face cross-flux [recon-extrap G3, contradicts original "no modification"]. +- `include/adc/runtime/amr/amr_runtime.hpp` -- `amr_schur_step`; Strang restructure (new phi-publish-without-resolve entry, half-step orchestration); **rebuild stepper after `regrid()`**; phi-restart contract (R0). - `include/adc/runtime/amr_system.hpp` / `python/amr_system.cpp` / `python/bindings.cpp` -- `set_source_stage` + `set_time_scheme` (validation chain mirroring `system.cpp:922-990`). - `python/adc/__init__.py` -- remove `isinstance(time, Split)` AMR guards; route `set_source_stage`/`set_time_scheme`. diff --git a/docs/AMR_MULTIBLOCK_DESIGN.md b/docs/AMR_MULTIBLOCK_DESIGN.md index 64a5c69e8..db606844c 100644 --- a/docs/AMR_MULTIBLOCK_DESIGN.md +++ b/docs/AMR_MULTIBLOCK_DESIGN.md @@ -19,7 +19,7 @@ fields, refinement by the union of the criteria, never one hierarchy per species The code has been read directly. Two facts structure everything that follows. FACT 1: the multi-block AMR ENGINE ALREADY EXISTS, at the C++ template level, under the name -`AmrSystemCoupler` (`include/adc/coupling/static_system/amr_system_coupler.hpp`). It carries: +`AmrSystemCoupler` (`include/adc/coupling/system/amr_system_coupler.hpp`). It carries: - a hierarchy SHARED per block (`std::vector> block_levels_`). The ctor checks at assembly the layout consistency between blocks. CAUTION (owner correction): the old check compared ONLY the NUMBER of levels and the NUMBER of boxes per level @@ -52,7 +52,7 @@ if (p_->has_block || p_->has_compiled) ``` It wraps a single `AmrCouplerMP` (`include/adc/coupling/amr/amr_coupler_mp.hpp`), materialized by `detail::dispatch_amr_compiled` / `build_amr_compiled` -(`include/adc/runtime/amr_dsl_block.hpp`). The multi-block `AmrSystemCoupler` is NOT wired +(`include/adc/runtime/builders/compiled/amr_dsl_block.hpp`). The multi-block `AmrSystemCoupler` is NOT wired to this facade. The TWO real gaps for the Phase 1 target are therefore: @@ -148,9 +148,9 @@ they promote is indicated. ### 2.1 The compile-time block layer (exists) -- `EquationBlock` (`include/adc/core/equation_block.hpp`): carries +- `EquationBlock` (`include/adc/core/model/equation_block.hpp`): carries `Model`, `Spatial` (limiter + flux), `Time` (policy), `MultiFab* state`, `BCRec bc`. -- `CoupledSystem` (`include/adc/core/coupled_system.hpp`): tuple of blocks with +- `CoupledSystem` (`include/adc/core/model/coupled_system.hpp`): tuple of blocks with `n_blocks`, `block()`, `for_each_block(f)`. It is the compile-time "registry". - `AmrLevelMP { MultiFab U; const MultiFab* aux; Real dx, dy; }` (`amr_reflux_mf.hpp`, lines 791-795): a level of the multi-patch hierarchy. @@ -226,7 +226,7 @@ added. C++ signatures that fit the existing types are given. - `AmrScheduler`: honors `treatment` / `substeps` / `stride` / `evolve` per block. It is `AmrSystemCoupler::step` (lines 211-250) plus the stride semantics of - `advance_subcycled` (`include/adc/numerics/time/scheduler.hpp`) and of runtime `System` + `advance_subcycled` (`include/adc/numerics/time/schemes/scheduler.hpp`) and of runtime `System` (`stride_due`, `python/system.cpp:327`). The target contract (cf. 4.iv): - `Explicit` -> AMR transport by `advance_amr`; - `IMEX` -> explicit transport (`SourceFreeModel`) + implicit source by the @@ -289,7 +289,7 @@ LATER step, NOT this one. `AmrSystemCoupler` already mixes "assemble" (Poisson + aux) and "advance" (step + reflux), as its own comment notes (lines 371-375: alias `AmrSystemDriver`). The Assembler/Driver split is done on the mono-level side (`SystemAssembler` / `SystemDriver`, -`include/adc/coupling/static_system/system_coupler.hpp`). The `AmrRuntime` engine formalizes the same separation +`include/adc/coupling/system/system_coupler.hpp`). The `AmrRuntime` engine formalizes the same separation on the AMR side, but it is a COSMETIC refinement and deferred: the unified class is already validated. The priority remains the RUNTIME FACADE and the REGRID, not the pretty split. @@ -349,7 +349,7 @@ conservation blocker. The order is strict: each PR leaves the tree green. ### PR (i) -- Introduce `AmrBlock` + registry, NO change of physics WRITE-SET: -- `include/adc/coupling/static_system/amr_system_coupler.hpp`: extract `AmrHierarchyLayout` (promotion of the +- `include/adc/coupling/system/amr_system_coupler.hpp`: extract `AmrHierarchyLayout` (promotion of the `BoxArray`/`DistributionMapping`/`dx` already imposed identical), have each block carry an `AmrBlock` (name + levels + cons/prim VariableSet). No new behavior. - `include/adc/coupling/amr/amr_level_storage.hpp`: reused as is (address invariant). @@ -358,7 +358,7 @@ BIT-IDENTITY: the `step` does not change body -> `maxdiff == 0` vs current head ### PR (ii) -- Two explicit blocks, DIFFERENT schemes, without coupled source WRITE-SET: -- `include/adc/coupling/static_system/amr_system_coupler.hpp`: already N-blocks; add a test instantiating +- `include/adc/coupling/system/amr_system_coupler.hpp`: already N-blocks; add a test instantiating `CoupledSystem` where `BlockA::Spatial != BlockB::Spatial` (e.g. Minmod/Rusanov vs VanLeer/HLLC) on the SAME 2-level hierarchy. - `tests/CMakeLists.txt` + `tests/test_amr_system_twoblock.cpp` (new test). @@ -379,7 +379,7 @@ CONSERVATION: the total charge integrated on the coarse stays the expected sum. ### PR (iv) -- substeps / stride / evolve + step_cfl substeps-aware WRITE-SET: -- `include/adc/coupling/static_system/amr_system_coupler.hpp`: add `step_cfl(cfl)` modeled on +- `include/adc/coupling/system/amr_system_coupler.hpp`: add `step_cfl(cfl)` modeled on `System::step_cfl` (`python/system.cpp:1663-1693`), substeps-aware: `dt <= cfl * h * substeps_b / (stride_b * w_b)`, min over the evolving blocks; a block `evolve=false` does NOT constrain the step but stays in the Poisson RHS. @@ -400,9 +400,9 @@ alone then multiplied by M would violate the CFL by a factor M (explicit note of ### PR (v) -- Multi-block production DSL (INSTALL of a NAMED block) WRITE-SET: -- `include/adc/runtime/amr_dsl_block.hpp`: `add_compiled_model(AmrSystem&, name, Model{}, ...)` +- `include/adc/runtime/builders/compiled/amr_dsl_block.hpp`: `add_compiled_model(AmrSystem&, name, Model{}, ...)` must INSTALL A NAMED BLOCK (and not replace the unique block) -> symmetric of - `add_compiled_model(System&)` (`include/adc/runtime/dsl_block.hpp` + `block_builder.hpp`). + `add_compiled_model(System&)` (`include/adc/runtime/builders/compiled/dsl_block.hpp` + `block_builder.hpp`). - `include/adc/runtime/amr_system.hpp` + `python/amr_system.cpp`: `set_compiled_block` / `add_native_block` stop throwing at the 2nd call (cf. 3) and stack a spec. - `python/bindings.cpp`: expose the 2nd `add_block` (already wired, `bindings.cpp:239`), validate @@ -415,7 +415,7 @@ lambda cross-TU (harness #64/#97). ### PR (vi) -- Coupled sources on AMR (same cell, opposite contributions) WRITE-SET: -- `include/adc/coupling/static_system/amr_system_coupler.hpp`: `coupled_source_step` (already there) wired on the +- `include/adc/coupling/system/amr_system_coupler.hpp`: `coupled_source_step` (already there) wired on the named couplings (ionization/collision/exchange) AND on `CoupledSourceKernel` (`coupled_source_program.hpp`). - `python/amr_system.cpp` + `bindings.cpp`: `sim.add_coupling(adc.Ionization(...))` modeled on @@ -442,7 +442,7 @@ or after sync) conserved to the tolerance, to rule out the double counting of th ### PR (vii) -- Local IMEX on AMR WRITE-SET: -- `include/adc/coupling/static_system/amr_system_coupler.hpp`: the IMEX callback reuses +- `include/adc/coupling/system/amr_system_coupler.hpp`: the IMEX callback reuses `mf_apply_source_treatment(m, U, aux, dt, /*imex=*/true)` (`amr_reflux_mf.hpp:75-82`) -> `backward_euler_source` (named device functor `BackwardEulerSourceKernel`). The source stays cell-local, snapshotted, OUTSIDE reflux. @@ -452,7 +452,7 @@ conservation at the coarse-fine interfaces intact (Gap2 property). ### PR (viii) -- ONLY then: Schur / true global implicit / paper repro WRITE-SET: out of scope for Phase 1. Relies on `CondensedSchurSourceStepper` -(`include/adc/coupling/schur/condensed_schur_source_stepper.hpp`) and `schur_condensation.hpp`. The +(`include/adc/coupling/schur/source/condensed_schur_source_stepper.hpp`) and `schur_condensation.hpp`. The `treatment == Implicit` stays REJECTED by the `AmrScheduler` until a true global stepper exists. @@ -474,7 +474,7 @@ MULTI-BLOCK ALGORITHM (to write, `AmrRegridPolicy` / `AmrSystemCoupler::regrid`) 1. `solve_fields()` once (aux up to date, for the phi gradient criterion). 2. UNION OF THE TAGS on the parent level: for each block, `tag_cells(block.levels[pk].U, - pdom, crit_block)` (`include/adc/amr/regrid.hpp:30-42`), then logical OR of the `TagBox`: + pdom, crit_block)` (`include/adc/amr/regridding/regrid.hpp:30-42`), then logical OR of the `TagBox`: ``` tags = tags_electrons OR tags_ions OR tags_neutrals OR tags_phi OR tags_user ``` @@ -595,7 +595,7 @@ absence of a block on a patch. mono-block bit-identical (`dmax == 0`). Test `tests/test_amr_layout_guard.cpp`. - [x] multi-block RUNTIME FACADE (DELIVERED, runtime registry PR): `AmrSystem` accepts N native blocks co-located on ONE shared hierarchy via the type-erased engine `AmrRuntime` - (`include/adc/runtime/amr_runtime.hpp`), registry by name of closures + (`include/adc/runtime/amr/amr_runtime.hpp`), registry by name of closures (advance / add_elliptic_rhs / max_speed / mass / density / potential). SYSTEM Poisson with a SUMMED right-hand side co-located (Sum_b elliptic_rhs_b(U_b) = q0 n0 + q1 n1 on the shared coarse). Tests `tests/test_amr_system_twoblock.cpp`, `python/tests/test_amr_multiblock.py`. @@ -638,7 +638,7 @@ absence of a block on a patch. ## 9. Code references (all verified at this head) -- `include/adc/coupling/static_system/amr_system_coupler.hpp`: AMR multi-block engine (exists); NO +- `include/adc/coupling/system/amr_system_coupler.hpp`: AMR multi-block engine (exists); NO regrid. - `include/adc/coupling/amr/amr_coupler_mp.hpp`: MONO-BLOCK AMR coupler + `regrid` (delegates to `amr_regrid_finest`). @@ -650,22 +650,22 @@ absence of a block on a patch. - `include/adc/coupling/source/coupled_source_program.hpp`: `CoupledSourceKernel` (P5 #131, POD device-clean, opposite additive writes). - `include/adc/coupling/amr/amr_level_storage.hpp`: `AmrLevelStack` (aux address invariant). -- `include/adc/core/coupled_system.hpp`: `CoupledSystem`, `for_each_block`, +- `include/adc/core/model/coupled_system.hpp`: `CoupledSystem`, `for_each_block`, `ForEachBlockProbe` (named device-clean functor). -- `include/adc/core/equation_block.hpp`: `EquationBlock`. -- `include/adc/numerics/time/amr_reflux_mf.hpp`: `AmrLevelMP`, `LevelHierarchy`, `advance_amr`, +- `include/adc/core/model/equation_block.hpp`: `EquationBlock`. +- `include/adc/numerics/time/amr/reflux/amr_reflux_mf.hpp`: `AmrLevelMP`, `LevelHierarchy`, `advance_amr`, `FluxRegister`, `CoverageMask`, `CoarseFineInterface`, `mf_apply_source_treatment`, `mf_average_down_mb`. -- `include/adc/numerics/time/scheduler.hpp`: `advance_subcycled`, `block_substeps_v`, +- `include/adc/numerics/time/schemes/scheduler.hpp`: `advance_subcycled`, `block_substeps_v`, `block_stride_v`, `block_time_treatment_v`. -- `include/adc/coupling/static_system/system_coupler.hpp`: `SystemAssembler` / `SystemDriver` (mono-level +- `include/adc/coupling/system/system_coupler.hpp`: `SystemAssembler` / `SystemDriver` (mono-level split), `step_cfl` substeps-aware (`cfl*h*substeps/(stride*w)`). - `include/adc/runtime/system.hpp` + `python/system.cpp`: multi-block RUNTIME facade (model to imitate), `Species`, `stride_due` (HOLD-THEN-CATCH-UP), `step_cfl` (lines 1663-1693). - `include/adc/runtime/amr_system.hpp` + `python/amr_system.cpp`: MONO-BLOCK AMR RUNTIME facade (refusal of the 2nd block, lines 129-130 and 152-153). -- `include/adc/runtime/amr_dsl_block.hpp`: `add_compiled_model(AmrSystem&)` (a single block). -- `include/adc/runtime/block_builder.hpp`: `make_block` / `make_max_speed` / +- `include/adc/runtime/builders/compiled/amr_dsl_block.hpp`: `add_compiled_model(AmrSystem&)` (a single block). +- `include/adc/runtime/builders/block/block_builder.hpp`: `make_block` / `make_max_speed` / `make_poisson_rhs`, named device-clean functors. - `docs/COUPLER_HIERARCHY.md`, `docs/SCHUR_CONDENSATION_DESIGN.md`, `docs/GPU_RUNTIME_PORT.md` (device-clean harness), `docs/PAPER_ROADMAP.md`. diff --git a/docs/AMR_REGRID_UNION_TAGS_DESIGN.md b/docs/AMR_REGRID_UNION_TAGS_DESIGN.md index c0019e3e6..ce0156370 100644 --- a/docs/AMR_REGRID_UNION_TAGS_DESIGN.md +++ b/docs/AMR_REGRID_UNION_TAGS_DESIGN.md @@ -8,7 +8,7 @@ FROZEN multi-block AMR hierarchy ADAPTIVE. ## PROGRESS STATUS (Lot C.6 implementation) DELIVERED (runtime multi-block engine AmrRuntime): -- [x] (R3) helper `tag_union(span)` (cell-by-cell OR) -> `include/adc/amr/tag_box.hpp`. +- [x] (R3) helper `tag_union(span)` (cell-by-cell OR) -> `include/adc/amr/tagging/tag_box.hpp`. - [x] REFACTOR (section 6): `amr_regrid_finest` split into `regrid_compute_fine_layout` (tags -> grow -> all_reduce_or -> berger_rigoutsos -> clamp -> (fb, dmap)) + `regrid_field_on_layout` (re-grids ONE field on an IMPOSED layout) -> `include/adc/coupling/amr/amr_regrid_coupler.hpp`. @@ -17,7 +17,7 @@ DELIVERED (runtime multi-block engine AmrRuntime): tags on |grad phi| (D4), (R3) union + grow, (R4) all_reduce_or if coarse distributed, (R5) a single clustering -> shared layout, (R6) prolong/restrict of ALL blocks (including stride-held, D3) with ghost inherited per block, (R7) rebuild shared aux + re-wiring, (R8) re-solve (coverage - cascade). (V3) `same_layout_or_throw` post-regrid. -> `include/adc/runtime/amr_runtime.hpp`. + cascade). (V3) `same_layout_or_throw` post-regrid. -> `include/adc/runtime/amr/amr_runtime.hpp`. - [x] registration API: `set_regrid(every, grow, margin)` (D2: regrid BEFORE the step, macro-step cadence), `set_block_tag_predicate(b, crit)` (D1), `set_phi_tag_predicate(crit)` (D4). - [x] cadence in `AmrRuntime::step`: regrid every `regrid_every` macro-steps, BEFORE the step; @@ -45,8 +45,8 @@ OUT OF SCOPE (conforming to the boundaries): facade sets the per-block density predicate; phi stays opt-in on the engine side, mechanical to wire if needed). PROJECT FRAME. The multi-block runtime delivered so far (`AmrRuntime`, -`include/adc/runtime/amr_runtime.hpp`, runtime counterpart of `AmrSystemCoupler`, -`include/adc/coupling/static_system/amr_system_coupler.hpp`) is "Phase 1 multi-block with FROZEN hierarchy": +`include/adc/runtime/amr/amr_runtime.hpp`, runtime counterpart of `AmrSystemCoupler`, +`include/adc/coupling/system/amr_system_coupler.hpp`) is "Phase 1 multi-block with FROZEN hierarchy": N blocks (electrons, ions, neutrals, ...) co-located on ONE shared AMR hierarchy, a single coarse Poisson with SUMMED right-hand side, cell-by-cell coupled sources, multirate per block (substeps / stride / evolve), but a mesh that NEVER MOVES after construction. Neither @@ -81,7 +81,7 @@ orchestration is missing. FACT 2: the MONO-BLOCK REGRID IS ALREADY WIRED TO THE FACADE, but ONLY for the mono-block path. `AmrCouplerMP::regrid` (`include/adc/coupling/amr/amr_coupler_mp.hpp:321-325`) delegates to `amr_regrid_finest`, and the `h.step` closure of the mono-block path calls it periodically -(`include/adc/runtime/amr_dsl_block.hpp:101-104`: +(`include/adc/runtime/builders/compiled/amr_dsl_block.hpp:101-104`: `if (regrid_every > 0 && *step_state % regrid_every == 0) cpl->regrid(crit);`). The multi-block path, in contrast, goes through `AmrRuntime` which has no `regrid`: its hierarchy is frozen. @@ -93,7 +93,7 @@ would make the API CLAIM it does dynamic AMR while the mesh never moves the algorithm below is implemented and tested. FACT 4: the LAYOUT GUARD EXISTS and will be the natural safety net of the post-regrid. -`detail::same_layout_or_throw` (`include/adc/coupling/static_system/amr_system_coupler.hpp:122-140`, reused +`detail::same_layout_or_throw` (`include/adc/coupling/system/amr_system_coupler.hpp:122-140`, reused by `AmrRuntime` at the ctor, `amr_runtime.hpp:213-218`) compares EXACTLY, across all blocks: number of levels, then per level `BoxArray` (boxes AND order, via `ba.boxes() ==`), `DistributionMapping` (rank per box, via `dm.ranks() ==`) and `dx`/`dy` (bit for bit). It is the @@ -193,7 +193,7 @@ the phi-gradient criterion, exactly like `amr_runtime.hpp:413`). Snapshot of the block `mass(b)` BEFORE regrid (for verification (V1)). (R1) PER-BLOCK TAGS ON THE PARENT. For each block `b`, compute a `TagBox` on the parent level -via `tag_cells((*blocks_[b].levels)[pk].U, pdom, crit_b)` (`include/adc/amr/regrid.hpp:36-47`). +via `tag_cells((*blocks_[b].levels)[pk].U, pdom, crit_b)` (`include/adc/amr/regridding/regrid.hpp:36-47`). `crit_b` is a predicate `(ConstArray4 a, int i, int j) -> bool` on the density of the block (component 0) or a gradient. In v1 the criterion can be common to all blocks; the UNION below stays the contract. `TagBox` is a dense grid of `char` 0/1 on `pdom` (`tag_box.hpp`). @@ -222,7 +222,7 @@ reduction is INDISPENSABLE to cross-rank layout consistency: otherwise Berger-Ri would produce different patches per rank and the `DistributionMapping` would diverge. (R5) UNIQUE CLUSTERING -> SHARED LAYOUT. A SINGLE `berger_rigoutsos(grown, ClusterParams{})` -(`include/adc/amr/cluster.hpp:171-181`) on the reduced union tags. Apply the nesting clamp +(`include/adc/amr/tagging/cluster.hpp:171-181`) on the reduced union tags. Apply the nesting clamp (`margin`) and the parent coords -> fine coords conversion (parent x2) EXACTLY like `amr_regrid_finest:62-68`. Build A SINGLE fine `BoxArray fb` and A SINGLE `DistributionMapping((int)fb.size(), n_ranks())`. This is THE GOLDEN RULE: one rebuild, not one per @@ -450,22 +450,22 @@ OPEN DECISIONS (owner signature required). ## 9. Code references (all verified at this head) -- `include/adc/coupling/static_system/amr_system_coupler.hpp`: compile-time multi-block AMR engine (FROZEN +- `include/adc/coupling/system/amr_system_coupler.hpp`: compile-time multi-block AMR engine (FROZEN hierarchy, NO regrid); `AmrHierarchyLayout`, `detail::same_layout_or_throw` (layout guard). -- `include/adc/runtime/amr_runtime.hpp`: RUNTIME multi-block engine (type-erased registry by name, +- `include/adc/runtime/amr/amr_runtime.hpp`: RUNTIME multi-block engine (type-erased registry by name, shared aux, summed Poisson, coupled sources, multirate); NO regrid (target of this design). - `include/adc/coupling/amr/amr_coupler_mp.hpp`: MONO-BLOCK AMR coupler + `regrid` (`:321-325`, delegates to `amr_regrid_finest`); mono-block path UNTOUCHED. - `include/adc/coupling/amr/amr_regrid_coupler.hpp`: `amr_regrid_finest` (Berger-Rigoutsos, finest level); brick to SPLIT into "layout computation" + "re-grid a field on a given layout". -- `include/adc/amr/tag_box.hpp`: `TagBox` (dense grid of tags 0/1; union = cell-by-cell OR). -- `include/adc/amr/regrid.hpp`: `tag_cells`, `grow_tags`, `regrid_level` (generic bricks). -- `include/adc/amr/cluster.hpp`: `berger_rigoutsos`, `ClusterParams` (geometric clustering). -- `include/adc/amr/amr_hierarchy.hpp`: `AmrHierarchy` (level container; note: "the future conservative +- `include/adc/amr/tagging/tag_box.hpp`: `TagBox` (dense grid of tags 0/1; union = cell-by-cell OR). +- `include/adc/amr/regridding/regrid.hpp`: `tag_cells`, `grow_tags`, `regrid_level` (generic bricks). +- `include/adc/amr/tagging/cluster.hpp`: `berger_rigoutsos`, `ClusterParams` (geometric clustering). +- `include/adc/amr/hierarchy/amr_hierarchy.hpp`: `AmrHierarchy` (level container; note: "the future conservative multi-block AMR will have to share a common hierarchy", l. 31-32). - `include/adc/runtime/amr_system.hpp` + `python/amr_system.cpp`: RUNTIME facade (`regrid_every`; multi-block + `regrid_every > 0` REFUSAL at `amr_system.cpp:246-251`, lifted by this design). -- `include/adc/runtime/amr_dsl_block.hpp`: mono-block regrid wiring (`:101-104`), shared 2-level +- `include/adc/runtime/builders/compiled/amr_dsl_block.hpp`: mono-block regrid wiring (`:101-104`), shared 2-level FROZEN layout (`make_shared_amr_layout`) and per-block allocation (`build_amr_block`). - `include/adc/parallel/comm.hpp`: `all_reduce_or_inplace`, `n_ranks`, `my_rank` (MPI collectives). - `docs/AMR_MULTIBLOCK_DESIGN.md`: Phase 1 capstone (multi-block engine, layout guard, Phase 2 / diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 8fb0a20f0..66990fcb9 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -35,7 +35,7 @@ external edges: **Kokkos is required** (the only on-node backend: `ADC_USE_KOKKO found by `find_package` or fetched by FetchContent); MPI is optional (`ADC_USE_MPI`); pybind11 only serves the Python module. The sequential path goes through Kokkos Serial, not through a host loop without Kokkos. Fidelity note: the project embeds neither Eigen, nor fftw, nor Catch2; the FFT of -[`numerics/elliptic/poisson_fft.hpp`](../include/adc/numerics/elliptic/poisson_fft.hpp) is written +[`numerics/elliptic/poisson_fft.hpp`](../include/adc/numerics/elliptic/poisson/poisson_fft.hpp) is written by hand, and the tests are `int main` programs that link `adc::adc` (no third-party framework). @@ -125,24 +125,24 @@ flowchart TD adc_cpp is organized into five orthogonal layers. A high layer expresses the problem, a low layer executes it; a high layer never depends on an execution detail. The structuring separation: the containers (what stores) are distinct from the execution policy (how one loops and communicates). -**Physics (local, device-callable).** The `PhysicalModel` concept ([`include/adc/core/physical_model.hpp`](../include/adc/core/physical_model.hpp)) only exposes local and pointwise laws, all `ADC_HD`: `flux`, `source`, `max_wave_speed`, `elliptic_rhs`. No access to storage nor to parallelism; no allocation in hot loops, no `std::function`, no dynamic polymorphism. The core is model-agnostic: a model is a composition (`CompositeModel`, [`include/adc/physics/composite.hpp`](../include/adc/physics/composite.hpp)) of generic bricks ([`include/adc/physics/bricks.hpp`](../include/adc/physics/bricks.hpp)) on three axes (transport / source / elliptic), the scenario names living on the application side. The `aux` channel carries `(phi, grad_x, grad_y)` and is extensible (`B_z`, `T_e`). The geometry (cartesian / polar / disk) is a config axis of the mesh, not of the model. +**Physics (local, device-callable).** The `PhysicalModel` concept ([`include/adc/core/model/physical_model.hpp`](../include/adc/core/model/physical_model.hpp)) only exposes local and pointwise laws, all `ADC_HD`: `flux`, `source`, `max_wave_speed`, `elliptic_rhs`. No access to storage nor to parallelism; no allocation in hot loops, no `std::function`, no dynamic polymorphism. The core is model-agnostic: a model is a composition (`CompositeModel`, [`include/adc/physics/composition/composite.hpp`](../include/adc/physics/composition/composite.hpp)) of generic bricks ([`include/adc/physics/bricks/bricks.hpp`](../include/adc/physics/bricks/bricks.hpp)) on three axes (transport / source / elliptic), the scenario names living on the application side. The `aux` channel carries `(phi, grad_x, grad_y)` and is extensible (`B_z`, `T_e`). The geometry (cartesian / polar / disk) is a config axis of the mesh, not of the model. -**Numerics / discretization.** The local numerical logic: Riemann flux ([`include/adc/numerics/numerical_flux.hpp`](../include/adc/numerics/numerical_flux.hpp): Rusanov / HLL / HLLC / Roe, `ADC_HD` policies), MUSCL + WENO5-Z reconstruction ([`include/adc/numerics/reconstruction.hpp`](../include/adc/numerics/reconstruction.hpp)), the elliptic operator ([`include/adc/numerics/elliptic/`](../include/adc/numerics/elliptic/)) and the logical BCs ([`include/adc/mesh/physical_bc.hpp`](../include/adc/mesh/physical_bc.hpp)). We distinguish the point-wise policies (flux, reconstruction, stencil: they take states, see no container) from the grid operators (`assemble_rhs`, [`include/adc/numerics/spatial_operator.hpp`](../include/adc/numerics/spatial_operator.hpp)) which loop over a `Box` via a local view `Array4` but ignore the decomposition into boxes/ranks and the backend. The geometry variants are purely additive: [`spatial_operator_eb.hpp`](../include/adc/numerics/spatial_operator_eb.hpp) (cut-cell) and [`spatial_operator_polar.hpp`](../include/adc/numerics/spatial_operator_polar.hpp), the cartesian remaining bit-identical. +**Numerics / discretization.** The local numerical logic: Riemann flux ([`include/adc/numerics/fv/numerical_flux.hpp`](../include/adc/numerics/fv/numerical_flux.hpp): Rusanov / HLL / HLLC / Roe, `ADC_HD` policies), MUSCL + WENO5-Z reconstruction ([`include/adc/numerics/fv/reconstruction.hpp`](../include/adc/numerics/fv/reconstruction.hpp)), the elliptic operator ([`include/adc/numerics/elliptic/`](../include/adc/numerics/elliptic/)) and the logical BCs ([`include/adc/mesh/boundary/physical_bc.hpp`](../include/adc/mesh/boundary/physical_bc.hpp)). We distinguish the point-wise policies (flux, reconstruction, stencil: they take states, see no container) from the grid operators (`assemble_rhs`, [`include/adc/numerics/spatial_operator.hpp`](../include/adc/numerics/spatial_operator.hpp)) which loop over a `Box` via a local view `Array4` but ignore the decomposition into boxes/ranks and the backend. The geometry variants are purely additive: [`spatial_operator_eb.hpp`](../include/adc/numerics/spatial/embedded_boundary/operator.hpp) (cut-cell) and [`spatial_operator_polar.hpp`](../include/adc/numerics/spatial/operators/polar_operator.hpp), the cartesian remaining bit-identical. -**Mesh / data.** What stores: `box2d`, `box_array` ([`include/adc/mesh/box_array.hpp`](../include/adc/mesh/box_array.hpp)), `distribution_mapping` ([`include/adc/mesh/distribution_mapping.hpp`](../include/adc/mesh/distribution_mapping.hpp)), `multifab` ([`include/adc/mesh/multifab.hpp`](../include/adc/mesh/multifab.hpp)), `geometry` (cartesian + `PolarGeometry`, [`include/adc/mesh/geometry.hpp`](../include/adc/mesh/geometry.hpp)) and the AMR hierarchy. These containers carry the distributed fields and their halos; they do not know how one loops nor communicates. +**Mesh / data.** What stores: `box2d`, `box_array` ([`include/adc/mesh/layout/box_array.hpp`](../include/adc/mesh/layout/box_array.hpp)), `distribution_mapping` ([`include/adc/mesh/layout/distribution_mapping.hpp`](../include/adc/mesh/layout/distribution_mapping.hpp)), `multifab` ([`include/adc/mesh/storage/multifab.hpp`](../include/adc/mesh/storage/multifab.hpp)), `geometry` (cartesian + `PolarGeometry`, [`include/adc/mesh/geometry/geometry.hpp`](../include/adc/mesh/geometry/geometry.hpp)) and the AMR hierarchy. These containers carry the distributed fields and their halos; they do not know how one loops nor communicates. -**Execution (seams).** The execution policy, reduced to seams that only see minimal views (Box2D, `Array4`, scalar, rank), never `BoxArray` nor `DistributionMapping`: `for_each_cell` ([`include/adc/mesh/for_each.hpp`](../include/adc/mesh/for_each.hpp), serial / OpenMP / Kokkos dispatch) takes a box and an `ADC_HD(i, j)` lambda; the POD view `Array4` ([`include/adc/mesh/fab2d.hpp`](../include/adc/mesh/fab2d.hpp)) is identical host/device; `comm` ([`include/adc/parallel/comm.hpp`](../include/adc/parallel/comm.hpp)) does rank/size, all-reduce, barrier (serial / MPI identity); the allocator ([`include/adc/core/allocator.hpp`](../include/adc/core/allocator.hpp)) manages the storage of the Fabs. The halo exchange (`fill_boundary`) and the reductions / `saxpy` (`mf_arith`) are not this layer: they are grid operators that orchestrate the seams. +**Execution (seams).** The execution policy, reduced to seams that only see minimal views (Box2D, `Array4`, scalar, rank), never `BoxArray` nor `DistributionMapping`: `for_each_cell` ([`include/adc/mesh/execution/for_each.hpp`](../include/adc/mesh/execution/for_each.hpp), serial / OpenMP / Kokkos dispatch) takes a box and an `ADC_HD(i, j)` lambda; the POD view `Array4` ([`include/adc/mesh/storage/fab2d.hpp`](../include/adc/mesh/storage/fab2d.hpp)) is identical host/device; `comm` ([`include/adc/parallel/comm.hpp`](../include/adc/parallel/comm.hpp)) does rank/size, all-reduce, barrier (serial / MPI identity); the allocator ([`include/adc/core/foundation/allocator.hpp`](../include/adc/core/foundation/allocator.hpp)) manages the storage of the Fabs. The halo exchange (`fill_boundary`) and the reductions / `saxpy` (`mf_arith`) are not this layer: they are grid operators that orchestrate the seams. -**Time / coupling.** The layer that composes the operators without knowing their internal implementation: SSPRK ([`include/adc/numerics/time/ssprk.hpp`](../include/adc/numerics/time/ssprk.hpp)), IMEX asymptotic-preserving ([`include/adc/numerics/time/imex.hpp`](../include/adc/numerics/time/imex.hpp)), splitting `lie_step` / `strang_step` ([`include/adc/numerics/time/splitting.hpp`](../include/adc/numerics/time/splitting.hpp)). A `TimePolicy` ([`include/adc/numerics/time/time_integrator.hpp`](../include/adc/numerics/time/time_integrator.hpp)) names, per block, the temporal treatment and the number of substeps; the scheduler reads this policy and calls the adapted operator without knowing the flux formula. The fluid <-> Poisson coupling is carried by a `CouplingPolicy` ([`include/adc/coupling/base/coupling_policy.hpp`](../include/adc/coupling/base/coupling_policy.hpp)) which decides the order of operations and the synchronizations, without owning the data nor knowing the backend: `Coupler` single-model ([`include/adc/coupling/single/coupler.hpp`](../include/adc/coupling/single/coupler.hpp)), `SystemCoupler` multi-species single-level ([`include/adc/coupling/static_system/system_coupler.hpp`](../include/adc/coupling/static_system/system_coupler.hpp)), `AmrCouplerMP` AMR multi-box ([`include/adc/coupling/amr/amr_coupler_mp.hpp`](../include/adc/coupling/amr/amr_coupler_mp.hpp)). +**Time / coupling.** The layer that composes the operators without knowing their internal implementation: SSPRK ([`include/adc/numerics/time/integrators/ssprk.hpp`](../include/adc/numerics/time/integrators/ssprk.hpp)), IMEX asymptotic-preserving ([`include/adc/numerics/time/schemes/imex.hpp`](../include/adc/numerics/time/schemes/imex.hpp)), splitting `lie_step` / `strang_step` ([`include/adc/numerics/time/schemes/splitting.hpp`](../include/adc/numerics/time/schemes/splitting.hpp)). A `TimePolicy` ([`include/adc/numerics/time/integrators/time_integrator.hpp`](../include/adc/numerics/time/integrators/time_integrator.hpp)) names, per block, the temporal treatment and the number of substeps; the scheduler reads this policy and calls the adapted operator without knowing the flux formula. The fluid <-> Poisson coupling is carried by a `CouplingPolicy` ([`include/adc/coupling/base/coupling_policy.hpp`](../include/adc/coupling/base/coupling_policy.hpp)) which decides the order of operations and the synchronizations, without owning the data nor knowing the backend: `Coupler` single-model ([`include/adc/coupling/single/coupler.hpp`](../include/adc/coupling/single/coupler.hpp)), `SystemCoupler` multi-species single-level ([`include/adc/coupling/system/system_coupler.hpp`](../include/adc/coupling/system/system_coupler.hpp)), `AmrCouplerMP` AMR multi-box ([`include/adc/coupling/amr/amr_coupler_mp.hpp`](../include/adc/coupling/amr/amr_coupler_mp.hpp)). ## Grid conventions The code separates the index space (integer, without physical dimension) from the physical space -(cell centers). The index space is carried by [`Box2D`](../include/adc/mesh/box2d.hpp), +(cell centers). The index space is carried by [`Box2D`](../include/adc/mesh/index/box2d.hpp), a pair of inclusive corners `lo[2]` / `hi[2]` (AMReX convention); the box is empty as soon as `hi[d] < lo[d]`. The correspondence to the physical is carried by -[`Geometry`](../include/adc/mesh/geometry.hpp) (cartesian) and `PolarGeometry` (annular), both +[`Geometry`](../include/adc/mesh/geometry/geometry.hpp) (cartesian) and `PolarGeometry` (annular), both trivial PODs whose accessors are annotated `ADC_HD` to stay callable from a device kernel without returning garbage value under nvcc. @@ -251,10 +251,10 @@ graph LR ``` The mechanics is carried by -[`amr_reflux_mf.hpp`](../include/adc/numerics/time/amr_reflux_mf.hpp), which is only an umbrella +[`amr_reflux_mf.hpp`](../include/adc/numerics/time/amr/reflux/amr_reflux_mf.hpp), which is only an umbrella including the sub-headers; the types of the interface live in -[`amr_patch_range.hpp`](../include/adc/numerics/time/amr_patch_range.hpp) and the subcycling that -drives them in [`amr_subcycling.hpp`](../include/adc/numerics/time/amr_subcycling.hpp). +[`amr_patch_range.hpp`](../include/adc/numerics/time/amr/levels/amr_patch_range.hpp) and the subcycling that +drives them in [`amr_subcycling.hpp`](../include/adc/numerics/time/amr/levels/amr_subcycling.hpp). Three objects share the work. @@ -312,20 +312,20 @@ each block and sets the initial state. It is the macro-step that differs. ### Single-level: `System.step_cfl` The core is `SystemStepper::step_cfl` (and `step`), in -[`include/adc/runtime/system_stepper.hpp`](../include/adc/runtime/system_stepper.hpp). The order is an +[`include/adc/runtime/system/system_stepper.hpp`](../include/adc/runtime/system/system_stepper.hpp). The order is an explicit invariant (cf. the contract at the head of the file): `solve_fields` once at the head, then for each block DU (honored stride cadence) an `advance_transport` followed by a `run_source_stage` interleaved, then `apply_couplings`, then `advance the time` and `advance the macro-step counter`. The `solve_fields` delegates to `SystemFieldSolver` -([`include/adc/runtime/system_field_solver.hpp`](../include/adc/runtime/system_field_solver.hpp)): it +([`include/adc/runtime/system/system_field_solver.hpp`](../include/adc/runtime/system/system_field_solver.hpp)): it solves the system Poisson whose right-hand side is the sum of the elliptic bricks of the blocks ($f = \sum_b q_b\, n_b$), then derives the aux. The aux is the shared channel that carries $\phi$ and $\nabla\phi$ (components 1 and 2), plus optionally $B_z$ and $T_e$. The transport of a block, in turn, reads this aux: `advance_transport` routes toward the closure `s.advance` (full path) or its disk variants, and this closure does `fill_ghosts` then `assemble_rhs` (limited reconstruction then numerical flux -> $R = -\mathrm{div} F + S$) at each SSPRK stage (cf. -[`include/adc/numerics/time/ssprk.hpp`](../include/adc/numerics/time/ssprk.hpp), `SSPRK2Step` / +[`include/adc/numerics/time/integrators/ssprk.hpp`](../include/adc/numerics/time/integrators/ssprk.hpp), `SSPRK2Step` / `SSPRK3`). The step $dt$ returned by `step_cfl` is the min over the evolutive blocks of $cfl \cdot h \cdot \mathrm{substeps}_b / (\mathrm{stride}_b \cdot w_b)$, with $h = \min(dx, dy)$ in cartesian and $h = \min(dr,\, r_{\min}\, d\theta)$ in polar. @@ -375,7 +375,7 @@ $H(dt/2)\,;\,S(dt)\,;\,H(dt/2)$ and `solve_fields` is RE-solved before each stag On the adaptive hierarchy, `AmrSystem::step` ([`include/adc/runtime/amr_system.hpp`](../include/adc/runtime/amr_system.hpp)) forces the lazy build then delegates to the multi-block engine `AmrRuntime::step` -([`include/adc/runtime/amr_runtime.hpp`](../include/adc/runtime/amr_runtime.hpp)) (or, in single-block, to +([`include/adc/runtime/amr/amr_runtime.hpp`](../include/adc/runtime/amr/amr_runtime.hpp)) (or, in single-block, to the closure `step_fn` of an `AmrCouplerMP`). The engine adds two steps proper to the adaptive around the same skeleton. @@ -474,7 +474,7 @@ cmake -B build -DADC_USE_MPI=ON # + distribue (ADC_HAS_MPI **MPI: distributed, optional.** `-DADC_USE_MPI=ON` defines `ADC_HAS_MPI` and links `MPI::MPI_CXX`. The `if(ADC_HAS_MPI)` block of the CMake compiles the MPI-only tests (section 1h of [`docs/BACKEND_COVERAGE.md`](BACKEND_COVERAGE.md)), each replayed at np=1/2/4. Out of MPI (a single process), the seam `comm` ([`include/adc/parallel/comm.hpp`](../include/adc/parallel/comm.hpp)) degenerates to the identity (rank 0, size 1, all-reduce and barrier no-op), so that a binary linked MPI but launched single-process behaves like a single-rank run. MPI + Kokkos Cuda multi-GPU is validated on ROMEO for 10 Krylov/Schur/MPI-kernel tests (rank-invariant np=1/2/4, `dmax=0`). -**The seam `for_each_cell`.** The seam point that makes all this possible is `for_each_cell(box, f)` in [`include/adc/mesh/for_each.hpp`](../include/adc/mesh/for_each.hpp). It expresses an execution policy, not numerical logic: it takes a `Box` and an `ADC_HD(i, j)` lambda, and compiles into `Kokkos::parallel_for` (Serial / OpenMP / Cuda depending on the Kokkos install). The numerical logic stays in the lambda (layer 2: discretization), never in the seam; growing it into `for_each_cell(U, grid, ghosts, mpi, bc, amr, ...)` would recreate an opaque framework. A grid operator sees a local view `Array4` + `Box`, but neither the `DistributionMapping` nor the loop policy. The reductions share the same philosophy: `for_each_cell_reduce_sum` / `_max` carry the deterministic reducers `Kokkos::Sum` / `Max` (the `sum` reassociates the addition by tile -- deterministic/idempotent but not bit-identical to a lexicographic sum, for all the Kokkos spaces; the `max` stays exact). +**The seam `for_each_cell`.** The seam point that makes all this possible is `for_each_cell(box, f)` in [`include/adc/mesh/execution/for_each.hpp`](../include/adc/mesh/execution/for_each.hpp). It expresses an execution policy, not numerical logic: it takes a `Box` and an `ADC_HD(i, j)` lambda, and compiles into `Kokkos::parallel_for` (Serial / OpenMP / Cuda depending on the Kokkos install). The numerical logic stays in the lambda (layer 2: discretization), never in the seam; growing it into `for_each_cell(U, grid, ghosts, mpi, bc, amr, ...)` would recreate an opaque framework. A grid operator sees a local view `Array4` + `Box`, but neither the `DistributionMapping` nor the loop policy. The reductions share the same philosophy: `for_each_cell_reduce_sum` / `_max` carry the deterministic reducers `Kokkos::Sum` / `Max` (the `sum` reassociates the addition by tile -- deterministic/idempotent but not bit-identical to a lexicographic sum, for all the Kokkos spaces; the `max` stays exact). ## Thread safety @@ -504,13 +504,13 @@ target_link_libraries(mon_appli PRIVATE adc::adc) ``` The entry contract is the `PhysicalModel` concept, declared in -[`include/adc/core/physical_model.hpp`](../include/adc/core/physical_model.hpp). A type that satisfies it +[`include/adc/core/model/physical_model.hpp`](../include/adc/core/model/physical_model.hpp). A type that satisfies it exposes a flux, a source, a maximum wave speed (`max_wave_speed`) and a contribution to the elliptic right-hand side (`elliptic_rhs`), with `M::Aux == adc::Aux` explicitly required by the concept. The methods called in the kernels must carry `ADC_HD` (device callable); the concept does not verify it, it is an invariant in the charge of the model author. One obtains such a type either by composing generic bricks in `CompositeModel` -([`include/adc/physics/composite.hpp`](../include/adc/physics/composite.hpp)), or by writing one's own +([`include/adc/physics/composition/composite.hpp`](../include/adc/physics/composition/composite.hpp)), or by writing one's own struct. The model is then instantiated in a coupler, which closes the loop Poisson -> `aux` channel -> advance in @@ -521,7 +521,7 @@ template parameter, `GeometricMG` by default. For the multi-patch AMR ExB, it is ([`include/adc/coupling/amr/amr_coupler_mp.hpp`](../include/adc/coupling/amr/amr_coupler_mp.hpp)), which orders the operations (coarse Poisson -> `aux = grad phi` -> advance + regrid Berger-Rigoutsos) and outputs the hierarchy in `AmrLevelStack`. The multi-species coupler carried over AMR is `AmrSystemCoupler` -([`include/adc/coupling/static_system/amr_system_coupler.hpp`](../include/adc/coupling/static_system/amr_system_coupler.hpp)). +([`include/adc/coupling/system/amr_system_coupler.hpp`](../include/adc/coupling/system/amr_system_coupler.hpp)). The runtime facades `System` ([`include/adc/runtime/system.hpp`](../include/adc/runtime/system.hpp)) and `AmrSystem` ([`include/adc/runtime/amr_system.hpp`](../include/adc/runtime/amr_system.hpp)) wrap these @@ -536,14 +536,14 @@ silently), or are assumed scope boundaries. Poisson (`CompositeFacPoisson`, [`include/adc/numerics/elliptic/mg/composite_fac_poisson.hpp`](../include/adc/numerics/elliptic/mg/composite_fac_poisson.hpp)) and the AMR condensed Schur source stage (`AmrCondensedSchurSourceStepper`, - [`include/adc/coupling/schur/amr_condensed_schur_source_stepper.hpp`](../include/adc/coupling/schur/amr_condensed_schur_source_stepper.hpp)) + [`include/adc/coupling/schur/amr/amr_condensed_schur_source_stepper.hpp`](../include/adc/coupling/schur/amr/amr_condensed_schur_source_stepper.hpp)) are wired on the refined hierarchy. The supported scope is 2 levels, 1..N disjoint NON-adjacent fine patches, a replicated mono-block coarse, mono-rank; adjacent patches, more than 2 levels, MPI and multi-block are refused explicitly (Phase 4b). See ALGORITHMS.md section 25 for the full scope. - FFT under `System` in MPI np>1: supported since ADC-287. `System` distributes a single box in round-robin, so `PoissonFFTSolver` (which needs the whole grid) is kept only for `n_ranks()==1`; at - np>1 [`include/adc/runtime/system_field_solver.hpp`](../include/adc/runtime/system_field_solver.hpp) + np>1 [`include/adc/runtime/system/system_field_solver.hpp`](../include/adc/runtime/system/system_field_solver.hpp) now SELECTS a `RemappedFFTSolver` instead of raising: it hides a box-slab scatter/gather around `PoissonFFT` (the field-solve path is unchanged, it sees the single round-robin box outward). `set_poisson(solver="fft"|"fft_spectral")` therefore SUCCEEDS under MPI np>1 for the periodic, @@ -553,8 +553,8 @@ silently), or are assumed scope boundaries. - Polar: scalar ExB, single-rank. The polar geometry (global ring $r \in [r_{min}, r_{max}] \times \theta \in [0, 2\pi)$, `PolarGeometry`) wired in `System::step` carries the scalar ExB transport (`CompositeModel`, see - [`include/adc/physics/hyperbolic.hpp`](../include/adc/physics/hyperbolic.hpp)). The direct polar Poisson - `PolarPoissonSolver` ([`include/adc/numerics/elliptic/polar_poisson_solver.hpp`](../include/adc/numerics/elliptic/polar_poisson_solver.hpp)) + [`include/adc/physics/bricks/hyperbolic.hpp`](../include/adc/physics/bricks/hyperbolic.hpp)). The direct polar Poisson + `PolarPoissonSolver` ([`include/adc/numerics/elliptic/polar/polar_poisson_solver.hpp`](../include/adc/numerics/elliptic/polar/polar_poisson_solver.hpp)) is single-rank, on a single box covering the ring: its FFT-in-theta + tridiagonal-in-r requires the complete azimuthal line and the complete radial column on a same rank, so it raises if `n_ranks() > 1` or if `ba.size() != 1`. The parallel transpose is out of scope at this stage. diff --git a/docs/BUILD_UX_ROADMAP_2026-06-10.md b/docs/BUILD_UX_ROADMAP_2026-06-10.md index d8018daab..fdad1d952 100644 --- a/docs/BUILD_UX_ROADMAP_2026-06-10.md +++ b/docs/BUILD_UX_ROADMAP_2026-06-10.md @@ -25,7 +25,7 @@ Python Development Guide. | Fix | Detail | Validation | |---|---|---| -| **ABI key enriched with `kokkos=` + `stdlib=`** (the 2 confirmed UB holes) | [abi_key.hpp](../include/adc/runtime/abi_key.hpp): `;kokkos=<0|1>` (ADC_HAS_KOKKOS, allocator/types layouts) + `;stdlib=libc++_NNN|libstdc++_NNN` (libc++/libstdc++ mix). A single inline function -> module AND loader consistent automatically | key printed with/without `-DADC_HAS_KOKKOS` ; Python parsers (`std=`, `headers=`) insensitive (tested) | +| **ABI key enriched with `kokkos=` + `stdlib=`** (the 2 confirmed UB holes) | [abi_key.hpp](../include/adc/runtime/dynamic/abi_key.hpp): `;kokkos=<0|1>` (ADC_HAS_KOKKOS, allocator/types layouts) + `;stdlib=libc++_NNN|libstdc++_NNN` (libc++/libstdc++ mix). A single inline function -> module AND loader consistent automatically | key printed with/without `-DADC_HAS_KOKKOS` ; Python parsers (`std=`, `headers=`) insensitive (tested) | | **Kokkos OpenMP "via conda" in 1 command** | [scripts/kokkos_openmp_conda.sh](../scripts/kokkos_openmp_conda.sh): builds Kokkos Serial+OpenMP into `$CONDA_PREFIX` (~2 min, tooling already provided by the env). Answer to the conda-forge Serial-only package | **actually tested**: build OK, `KOKKOS_ENABLE_OPENMP` present, configure adc_cpp -> `Kokkos found = (OPENMP;SERIAL)` | | libomp hints before `find_package(Kokkos)` | `KokkosConfig.cmake` does `find_dependency(OpenMP REQUIRED)` -> was failing on macOS ; macro `adc_apple_libomp_hints()` factored out (conda then brew), called for both OpenMP AND Kokkos | configure against the test Kokkos OpenMP: OK | | **FetchContent consumer no longer compiles the tests** (HIGH confirmed) | `option(ADC_BUILD_TESTS ${PROJECT_IS_TOP_LEVEL})` + bump `cmake_minimum_required(3.21)` (aligned with presets) | test super-project: **0 test target** pulled, `app` links `adc::adc` and runs ; top-level unchanged (120 targets) | diff --git a/docs/COUPLER_HIERARCHY.md b/docs/COUPLER_HIERARCHY.md index c36c35b4c..228bbfec9 100644 --- a/docs/COUPLER_HIERARCHY.md +++ b/docs/COUPLER_HIERARCHY.md @@ -78,7 +78,7 @@ point with subcycling) call `SSPRK2Step::take_step` / ## 3. SystemAssembler / SystemDriver (alias SystemCoupler) -- multi-species, single-level -**File:** `include/adc/coupling/static_system/system_coupler.hpp` +**File:** `include/adc/coupling/system/system_coupler.hpp` **Instantiations:** - `adc::SystemAssembler` @@ -206,7 +206,7 @@ resynchronizes `aux` after regrid. ## 6. AmrSystemCoupler (alias AmrSystemDriver) -- multi-species, AMR -**File:** `include/adc/coupling/static_system/amr_system_coupler.hpp` +**File:** `include/adc/coupling/system/amr_system_coupler.hpp` **Instantiation:** `adc::AmrSystemCoupler` @@ -314,7 +314,7 @@ blocks AND on the potential. The concept requires `apply(system, aux, dt)`. ## 9. CondensedSchurSourceStepper -- implicit Schur source stage -**File:** `include/adc/coupling/schur/condensed_schur_source_stepper.hpp` +**File:** `include/adc/coupling/schur/source/condensed_schur_source_stepper.hpp` Added in PR #126 (branch `feat/schur-pr4-stepper`). diff --git a/docs/DSL_MODEL_DESIGN.md b/docs/DSL_MODEL_DESIGN.md index da7a462f8..305371c10 100644 --- a/docs/DSL_MODEL_DESIGN.md +++ b/docs/DSL_MODEL_DESIGN.md @@ -96,14 +96,14 @@ Sources read for this design: `add_dynamic_block`, `add_compiled_block`, and metadata (`read_block_meta`, `variable_names`/`variable_roles`/`block_gamma`), `set_poisson`, `step_cfl`/ `step_adaptive`. -- `include/adc/core/variables.hpp`: `VariableRole`/`VariableSet`/`role_from_name`/ +- `include/adc/core/state/variables.hpp`: `VariableRole`/`VariableSet`/`role_from_name`/ `ADC_EXPORT_BLOCK_METADATA`/`ADC_EXPORT_BLOCK_GAMMA`. -- `include/adc/core/physical_model.hpp`: contract `PhysicalModel`/ +- `include/adc/core/model/physical_model.hpp`: contract `PhysicalModel`/ `HyperbolicPhysicalModel`/`aux_comps`. -- `include/adc/runtime/compiled_block_abi.hpp`: AOT ABI `ADC_DEFINE_COMPILED_BLOCK`. -- `include/adc/runtime/dynamic_model.hpp`: `IModel`/`ModelAdapter` (JIT). -- `include/adc/runtime/dsl_block.hpp`: `add_compiled_model` (native, template). -- `include/adc/runtime/amr_dsl_block.hpp`: `add_compiled_model` on the `AmrSystem` side. +- `include/adc/runtime/builders/compiled/compiled_block_abi.hpp`: AOT ABI `ADC_DEFINE_COMPILED_BLOCK`. +- `include/adc/runtime/dynamic/dynamic_model.hpp`: `IModel`/`ModelAdapter` (JIT). +- `include/adc/runtime/builders/compiled/dsl_block.hpp`: `add_compiled_model` (native, template). +- `include/adc/runtime/builders/compiled/amr_dsl_block.hpp`: `add_compiled_model` on the `AmrSystem` side. - `docs/PAPER_ROADMAP.md` (basket 2), `docs/ARCHITECTURE.md` (runtime/DSL section). ENVIRONMENT NOTE. A sibling agent adds in parallel a real native `production` @@ -545,7 +545,7 @@ Delivered. It is dispatch wiring (no new numerics). ### Phase E: `m.param` runtime -- GAP (phase 2, engine change) 11. Mode (b) (section 2b): ABI with parameters + codegen with members, OR dedicated aux channel. - HEAVY WRITE-SET: `include/adc/runtime/compiled_block_abi.hpp`, + HEAVY WRITE-SET: `include/adc/runtime/builders/compiled/compiled_block_abi.hpp`, `python/system.cpp` (`add_compiled_block`), `python/adc/dsl.py` (codegen). Outside the critical path of the Hoffart reproduction (`PAPER_ROADMAP.md:147-150`, basket 2 transverse, optional). diff --git a/docs/GPU_ROMEO.md b/docs/GPU_ROMEO.md index effadaaa4..440a23831 100644 --- a/docs/GPU_ROMEO.md +++ b/docs/GPU_ROMEO.md @@ -44,7 +44,7 @@ GPU. ## Kokkos (parallel_for dispatch, CUDA backend) Beyond raw CUDA, we verify the generated brick through the REAL parallel dispatch that the solver -uses (`adc/mesh/for_each.hpp` -> `Kokkos::parallel_for`). We build Kokkos from sources +uses (`adc/mesh/execution/for_each.hpp` -> `Kokkos::parallel_for`). We build Kokkos from sources (no module on ROMEO) then a `Kokkos::parallel_for(KOKKOS_LAMBDA ...)` harness that computes the flux of `EulerGen` on the device and compares it against `adc::Euler` on the host. @@ -83,7 +83,7 @@ brick is correct through the Kokkos dispatch on GH200. We go beyond an isolated flux: a complete 2D Euler case (80 steps, CFL, Rusanov order 1, periodic) advances ENTIRELY on GPU through `adc::for_each_cell` / `for_each_cell_reduce_max|sum` -(`adc/mesh/for_each.hpp` -> `Kokkos::parallel_for` / `parallel_reduce`). We simulate the SAME thing with +(`adc/mesh/execution/for_each.hpp` -> `Kokkos::parallel_for` / `parallel_reduce`). We simulate the SAME thing with the generated brick `EulerGen` and with `adc::Euler`, and we compare the final fields + the mass. ```bash @@ -94,7 +94,7 @@ ssh romeo 'cd ~/adc_dsl_kk && srun --account= -p instant --constraint=ar --gres=gpu:1 --mem=16G -c 16 -t 25 bash kk_sim_build.sh' ``` -The harness defines `#define ADC_HAS_KOKKOS` then includes `adc/mesh/for_each.hpp`: the cell +The harness defines `#define ADC_HAS_KOKKOS` then includes `adc/mesh/execution/for_each.hpp`: the cell loops therefore go through the solver's REAL Kokkos dispatch (the same call site as on CPU). Result (obtained): @@ -108,7 +108,7 @@ over 80 steps). The complete case therefore runs on GPU through adc's Kokkos mac ## Limits / next steps -- The complete case goes through `adc/mesh/for_each.hpp` (the solver's REAL Kokkos seam), but we do not +- The complete case goes through `adc/mesh/execution/for_each.hpp` (the solver's REAL Kokkos seam), but we do not rebuild the whole runtime stack (System / AMR / MPI) on GPU here: the cell loops use the same dispatch as production, which is enough to validate the device. - Type-erased dispatch at runtime: DONE elsewhere (adc::IModel, see python/tests/test_dsl_dynamic.py). diff --git a/docs/GPU_RUNTIME_PORT.md b/docs/GPU_RUNTIME_PORT.md index 1c8eaed8a..21931a458 100644 --- a/docs/GPU_RUNTIME_PORT.md +++ b/docs/GPU_RUNTIME_PORT.md @@ -30,7 +30,7 @@ in our case). `SharedSpace` being a portable alias (`CudaUVMSpace` / `HIPManaged ## Design asset : the seam does not change the call sites -`adc/mesh/for_each.hpp` (`for_each_cell`, `for_each_cell_reduce_*`) switches CPU <-> GPU at +`adc/mesh/execution/for_each.hpp` (`for_each_cell`, `for_each_cell_reduce_*`) switches CPU <-> GPU at COMPILE TIME without touching the operators. `ADC_HD` makes the whole core device-callable. So the GPU port is mostly a job of data RESIDENCE on device + porting of the still-host steps, not a rewrite of the compute kernels. diff --git a/docs/PAPER_ROADMAP.md b/docs/PAPER_ROADMAP.md index bfa9cc977..d6e23e0b8 100644 --- a/docs/PAPER_ROADMAP.md +++ b/docs/PAPER_ROADMAP.md @@ -18,7 +18,7 @@ Sources read for this audit: - cases `adc_cases/diocotron/{run.py,README.md,band_instability.py}`, `adc_cases/diocotron_amr/run.py`, `adc_cases/two_fluid_ap/`, `adc_cases/cases_manifest.toml`; - bindings: `python/system.cpp`, `python/amr_system.cpp`, `python/bindings.cpp`, - `python/adc/__init__.py`, `python/adc/dsl.py`, `include/adc/numerics/elliptic/geometric_mg.hpp`. + `python/adc/__init__.py`, `python/adc/dsl.py`, `include/adc/numerics/elliptic/mg/geometric_mg.hpp`. ## Reproduction status (factual) @@ -44,7 +44,7 @@ candidate is the **Cartesian ring edge**. ## The structural blocker: Cartesian ring edge The Shortley-Weller cut-cell capability (`docs/ALGORITHMS.md` section 12) lives ONLY in -`include/adc/numerics/elliptic/geometric_mg.hpp`: it places the circular Dirichlet conducting wall +`include/adc/numerics/elliptic/mg/geometric_mg.hpp`: it places the circular Dirichlet conducting wall at its REAL position for the POISSON solver. But the hyperbolic transport (`numerics/spatial_operator.hpp`, `numerics/numerical_flux.hpp`, `numerics/reconstruction.hpp`) has NO notion of an embedded boundary: the charge ring is advected on the full Cartesian grid. diff --git a/docs/SAMRAI_BACKEND_PLAN.md b/docs/SAMRAI_BACKEND_PLAN.md index 0b77af640..c604f2690 100644 --- a/docs/SAMRAI_BACKEND_PLAN.md +++ b/docs/SAMRAI_BACKEND_PLAN.md @@ -49,13 +49,13 @@ To keep as the high-level surface: - `include/adc/runtime/amr_system.hpp` - `adc::runtime::AmrSystemConfig` - `adc::runtime::AmrSystem` -- `include/adc/runtime/amr_runtime.hpp` +- `include/adc/runtime/amr/amr_runtime.hpp` - runtime multi-block engine, shared hierarchy, regrid by union of tags. - `include/adc/coupling/amr/amr_coupler_mp.hpp` - historical mono-block path. -- `include/adc/coupling/static_system/amr_system_coupler.hpp` +- `include/adc/coupling/system/amr_system_coupler.hpp` - compile-time multi-block path. -- `include/adc/numerics/time/amr_advance.hpp` +- `include/adc/numerics/time/amr/advance/amr_advance.hpp` - `LevelHierarchy`, `advance_amr`. These APIs must keep compiling with the native backend without SAMRAI. @@ -94,18 +94,18 @@ Proposed addition: an optional backend selector, for example | Need | Current implementation | Current files | |---|---|---| -| AMR levels | `AmrHierarchy`, `AmrLevelStack`, `AmrLevelMP` | `include/adc/amr/amr_hierarchy.hpp`, `include/adc/coupling/amr/amr_level_storage.hpp`, `include/adc/numerics/time/amr_subcycling.hpp` | -| Patches | `Box2D`, `BoxArray`, local/global index of `MultiFab` | `include/adc/mesh/box2d.hpp`, `include/adc/mesh/box_array.hpp`, `include/adc/mesh/multifab.hpp` | +| AMR levels | `AmrHierarchy`, `AmrLevelStack`, `AmrLevelMP` | `include/adc/amr/hierarchy/amr_hierarchy.hpp`, `include/adc/coupling/amr/amr_level_storage.hpp`, `include/adc/numerics/time/amr/levels/amr_subcycling.hpp` | +| Patches | `Box2D`, `BoxArray`, local/global index of `MultiFab` | `include/adc/mesh/index/box2d.hpp`, `include/adc/mesh/layout/box_array.hpp`, `include/adc/mesh/storage/multifab.hpp` | | Hierarchy | vectors of levels and `MultiFab`, fixed ref ratio 2 | `amr_hierarchy.hpp`, `amr_runtime.hpp`, `amr_coupler_mp.hpp` | -| Distribution | `DistributionMapping` round-robin/explicit | `include/adc/mesh/distribution_mapping.hpp` | -| Data | `MultiFab` -> contiguous `Fab2D`, ghosts, `sync_host/device` | `include/adc/mesh/multifab.hpp`, `include/adc/mesh/fab2d.hpp` | -| Intra-level ghost fill | hand-rolled MPI halos | `include/adc/mesh/fill_boundary.hpp` | -| Physical BC | `BCRec`, `fill_physical_bc`, `fill_ghosts` | `include/adc/mesh/physical_bc.hpp` | -| Interpolation/restriction | `interpolate`, `average_down`, `parallel_copy` | `include/adc/mesh/refinement.hpp` | -| Tags and clustering | `TagBox`, `tag_cells`, `grow_tags`, `berger_rigoutsos` | `include/adc/amr/tag_box.hpp`, `include/adc/amr/regrid.hpp`, `include/adc/amr/cluster.hpp` | -| Regrid production | fine layout imposed, multi-block union already implemented | `include/adc/coupling/amr/amr_regrid_coupler.hpp`, `include/adc/runtime/amr_runtime.hpp` | -| Reflux | `FluxRegister`, `CoverageMask`, `CoarseFineInterface` | `include/adc/numerics/time/amr_patch_range.hpp`, `include/adc/numerics/time/amr_reflux*.hpp` | -| Subcycling | Berger-Oliger ratio 2, average-down, reflux | `include/adc/numerics/time/amr_subcycling.hpp` | +| Distribution | `DistributionMapping` round-robin/explicit | `include/adc/mesh/layout/distribution_mapping.hpp` | +| Data | `MultiFab` -> contiguous `Fab2D`, ghosts, `sync_host/device` | `include/adc/mesh/storage/multifab.hpp`, `include/adc/mesh/storage/fab2d.hpp` | +| Intra-level ghost fill | hand-rolled MPI halos | `include/adc/mesh/boundary/fill_boundary.hpp` | +| Physical BC | `BCRec`, `fill_physical_bc`, `fill_ghosts` | `include/adc/mesh/boundary/physical_bc.hpp` | +| Interpolation/restriction | `interpolate`, `average_down`, `parallel_copy` | `include/adc/mesh/layout/refinement.hpp` | +| Tags and clustering | `TagBox`, `tag_cells`, `grow_tags`, `berger_rigoutsos` | `include/adc/amr/tagging/tag_box.hpp`, `include/adc/amr/regridding/regrid.hpp`, `include/adc/amr/tagging/cluster.hpp` | +| Regrid production | fine layout imposed, multi-block union already implemented | `include/adc/coupling/amr/amr_regrid_coupler.hpp`, `include/adc/runtime/amr/amr_runtime.hpp` | +| Reflux | `FluxRegister`, `CoverageMask`, `CoarseFineInterface` | `include/adc/numerics/time/amr/levels/amr_patch_range.hpp`, `include/adc/numerics/time/amr_reflux*.hpp` | +| Subcycling | Berger-Oliger ratio 2, average-down, reflux | `include/adc/numerics/time/amr/levels/amr_subcycling.hpp` | | Elliptic | `GeometricMG`, limited `CompositeFacPoisson`, coarse solve + injection by default | `include/adc/numerics/elliptic/*`, `include/adc/coupling/amr/amr_coupler_mp.hpp` | | Physics | local models, fluxes, sources, CFL, DSL/native | `include/adc/physics`, `include/adc/numerics`, `include/adc/runtime` | @@ -407,7 +407,7 @@ Exit criterion: Files: - `include/adc/samrai/transfer_adapter.hpp` -- `include/adc/numerics/time/amr_flux_helpers.hpp` if a generic interface +- `include/adc/numerics/time/amr/reflux/amr_flux_helpers.hpp` if a generic interface is needed. - `tests/test_samrai_refinement.cpp` - `tests/test_samrai_cf_interface.cpp` @@ -456,8 +456,8 @@ Exit criterion: Files: - `include/adc/samrai/flux_register_adapter.hpp` -- `include/adc/numerics/time/amr_subcycling.hpp` -- `include/adc/numerics/time/amr_patch_range.hpp` +- `include/adc/numerics/time/amr/levels/amr_subcycling.hpp` +- `include/adc/numerics/time/amr/levels/amr_patch_range.hpp` - `include/adc/runtime/amr_system_samrai.hpp` - `tests/test_samrai_flux_register.cpp` - `tests/test_samrai_amr_diffusion.cpp` @@ -481,7 +481,7 @@ Files: - `include/adc/samrai/elliptic_adapter.hpp` - `include/adc/coupling/amr/amr_coupler_mp.hpp` -- `include/adc/runtime/amr_runtime.hpp` +- `include/adc/runtime/amr/amr_runtime.hpp` - `tests/test_samrai_amr_potential.cpp` Work: diff --git a/docs/SCHUR_CONDENSATION_DESIGN.md b/docs/SCHUR_CONDENSATION_DESIGN.md index 98c22d821..be58a7da9 100644 --- a/docs/SCHUR_CONDENSATION_DESIGN.md +++ b/docs/SCHUR_CONDENSATION_DESIGN.md @@ -20,7 +20,7 @@ The document relies on the architecture already in place (sources read): - the MERGED polar Phase 1 (#116, commit `004efca`): the MESH abstraction (`adc.CartesianMesh` / `adc.PolarMesh` -> `System(mesh=)`), with `adc.FiniteVolume` = recon + Riemann + variables ONLY (no geometry argument); -- `include/adc/core/variables.hpp` (`VariableRole`: `Density`, `MomentumX`, `MomentumY`, +- `include/adc/core/state/variables.hpp` (`VariableRole`: `Density`, `MomentumX`, `MomentumY`, `MomentumZ`, `Energy`, ...); - `docs/BIBLIOGRAPHY.md` section 3 (Hoffart entry). diff --git a/docs/TOOLCHAIN_ROBUSTESSE_AUDIT_2026-06-10.md b/docs/TOOLCHAIN_ROBUSTESSE_AUDIT_2026-06-10.md index c30b630b1..fb50c8476 100644 --- a/docs/TOOLCHAIN_ROBUSTESSE_AUDIT_2026-06-10.md +++ b/docs/TOOLCHAIN_ROBUSTESSE_AUDIT_2026-06-10.md @@ -6,7 +6,7 @@ same class "**build environment != runtime environment**": | # | Observed symptom | Root cause | Status | |---|---|---|---| | 1 | `error: invalid value 'c++23' in '-std=c++23'` (mambaforge env) | the DSL compiled its runtime `.so` files with the compiler from the **PATH** (old conda gcc/clang) and the literal **`c++23` spelling**, whereas `_adc` is built in `-std=c++2b` by another compiler | **FIXED** (3 safeguards, validated by repro) | -| 2 | `dlopen : symbol not found in flat namespace '__ZN3adc6System13install_block...'` | `_adc` module **stale** vs headers (build before a `git pull`): the DSL loader references a C++ signature that the old `.so` does not export; the ABI guard **never** runs because the dlopen fails before it ([native_loader.hpp:634](../include/adc/runtime/native_loader.hpp) dlopen < line 647 key read) | **FIXED** (pre-dlopen guard, validated by repro) | +| 2 | `dlopen : symbol not found in flat namespace '__ZN3adc6System13install_block...'` | `_adc` module **stale** vs headers (build before a `git pull`): the DSL loader references a C++ signature that the old `.so` does not export; the ABI guard **never** runs because the dlopen fails before it ([native_loader.hpp:634](../include/adc/runtime/builders/compiled/native_loader.hpp) dlopen < line 647 key read) | **FIXED** (pre-dlopen guard, validated by repro) | | 3 | `subprocess.CalledProcessError: Command [...] returned non-zero exit status 1` | `subprocess.run(check=True)` without capture: the compiler error is not surfaced in the exception | **FIXED** (`_run_compile`, stderr + remedies) | Audit conducted by a multi-agent workflow (4 lenses: `dsl.py`, CMake, env bug class, conda-forge diff --git a/docs/archive/ARCHITECTURE_CIBLE.md b/docs/archive/ARCHITECTURE_CIBLE.md index cbd92a454..97603dfde 100644 --- a/docs/archive/ARCHITECTURE_CIBLE.md +++ b/docs/archive/ARCHITECTURE_CIBLE.md @@ -180,7 +180,7 @@ the `Cuda` execution space (GH200; Kokkos 4.4 + CUDA 12.6, `HOPPER90`), == `adc: (5.6e-17, FMA contraction), cf. docs/GPU_ROMEO.md. It is the same dispatch primitive as `adc/mesh/for_each.hpp`. -(a) DONE: TYPE-ERASED interface `adc::IModel` + `ModelAdapter` (include/adc/runtime/dynamic_model.hpp) +(a) DONE: TYPE-ERASED interface `adc::IModel` + `ModelAdapter` (include/adc/runtime/dynamic/dynamic_model.hpp) AND wiring into the runtime. `System::add_dynamic_block(name, so)` loads at runtime (dlopen) a generated brick compiled into a `.so` and creates a block driven by the IModel (host Rusanov order 1), advanced via eval_rhs / step / step_cfl like any block; `dsl.HyperbolicModel.compile_so` does the JIT. diff --git a/docs/sphinx/advanced/cpp-extension-native-brick.md b/docs/sphinx/advanced/cpp-extension-native-brick.md index a803b1446..f6f286852 100644 --- a/docs/sphinx/advanced/cpp-extension-native-brick.md +++ b/docs/sphinx/advanced/cpp-extension-native-brick.md @@ -6,7 +6,7 @@ composition of generic bricks (state, transport, source, elliptic), and the per- computation stays compiled C++. To write a new native brick, one satisfies the `PhysicalModel` concept -(`include/adc/core/physical_model.hpp`). The minimal contract: +(`include/adc/core/model/physical_model.hpp`). The minimal contract: ```cpp template @@ -35,5 +35,5 @@ and is exposed at runtime like the existing bricks. (problem / operator / solver / post-processing): [ARCHITECTURE.md](https://github.com/wolf75222/adc_cpp/blob/master/docs/ARCHITECTURE.md). - The design choices (concepts + policies, `for_each_cell` seam, `EllipticSolver`): [CHOICES.md](https://github.com/wolf75222/adc_cpp/blob/master/docs/CHOICES.md). -- The concept and its extensions: `include/adc/core/physical_model.hpp`; - the reference composition: `include/adc/physics/composite.hpp`. +- The concept and its extensions: `include/adc/core/model/physical_model.hpp`; + the reference composition: `include/adc/physics/composition/composite.hpp`. diff --git a/docs/sphinx/advanced/polar-disc-geometry.md b/docs/sphinx/advanced/polar-disc-geometry.md index ff2e32950..4ad536a6a 100644 --- a/docs/sphinx/advanced/polar-disc-geometry.md +++ b/docs/sphinx/advanced/polar-disc-geometry.md @@ -50,7 +50,7 @@ by its radial walls `r_min` / `r_max`). `set_disc_domain` / `disc_mask` are the stable Python *compatibility* helpers for the circle (the Hoffart disc). Under them the geometry is a single, named, device-clean C++ contract in -`include/adc/numerics/embedded_boundary.hpp`: any POD type exposing +`include/adc/numerics/spatial/embedded_boundary/domain.hpp`: any POD type exposing `level_set(x, y)` (`< 0` inside), a callable `operator()`, and `cell_active` is an embedded boundary, with the same three transport modes (`none` / `staircase` / `cutcell`). The disc (`detail::DiscDomain`) is one instance; `detail::HalfPlaneDomain` is a built-in non-disc instance, @@ -63,6 +63,6 @@ callback path: a domain is a compile-time POD, never a `std::function`. - Bindings: `python/bindings.cpp` (`geometry` / `nr` / `ntheta` / `r_min` / `r_max`, `set_disc_domain`, `disc_mask`). -- Generic contract: `include/adc/numerics/embedded_boundary.hpp` (`DiscDomain`, `HalfPlaneDomain`, +- Generic contract: `include/adc/numerics/spatial/embedded_boundary/domain.hpp` (`DiscDomain`, `HalfPlaneDomain`, the `LevelSetDomain` concept). - Polar solver: `include/adc/numerics/elliptic/polar/polar_poisson_solver.hpp`. diff --git a/docs/sphinx/backends/backend-seams.md b/docs/sphinx/backends/backend-seams.md index 1a3bfbfe1..ecf567014 100644 --- a/docs/sphinx/backends/backend-seams.md +++ b/docs/sphinx/backends/backend-seams.md @@ -11,7 +11,7 @@ There are no "three layers" stacked. The architecture is MPI + Kokkos: - **Kokkos** parallelizes the local compute and abstracts the hardware through its `ExecutionSpace`: `Cuda` backend for NVIDIA GPUs, `Serial`/`OpenMP` for CPU. Everything goes through `for_each_cell` (and `for_each_cell_reduce_*`) from - [`include/adc/mesh/for_each.hpp`](https://github.com/wolf75222/adc_cpp/blob/master/include/adc/mesh/for_each.hpp), which switches + [`include/adc/mesh/execution/for_each.hpp`](https://github.com/wolf75222/adc_cpp/blob/master/include/adc/mesh/execution/for_each.hpp), which switches CPU <-> GPU at compile time without touching the call sites. No CUDA kernel is written by hand: the same `.cpp` targets CPU and GPU depending on the Kokkos diff --git a/docs/sphinx/backends/cmake-options.md b/docs/sphinx/backends/cmake-options.md index 808e2a8fe..36fb69fbb 100644 --- a/docs/sphinx/backends/cmake-options.md +++ b/docs/sphinx/backends/cmake-options.md @@ -18,7 +18,7 @@ Notes: - Kokkos is the only on-node backend and it is required: configuring without it (`-DADC_USE_KOKKOS=OFF`) is a fatal CMake error, and the - [`for_each.hpp`](https://github.com/wolf75222/adc_cpp/blob/master/include/adc/mesh/for_each.hpp) + [`for_each.hpp`](https://github.com/wolf75222/adc_cpp/blob/master/include/adc/mesh/execution/for_each.hpp) seam does not compile without `ADC_HAS_KOKKOS` (`#error`). - **Kokkos does not need to be pre-installed**: CMake does `find_package(Kokkos)` then, as a fallback, fetches + builds it via FetchContent (version `ADC_KOKKOS_FETCH_VERSION`, default 4.4.01, tarball verified by SHA256). The diff --git a/docs/sphinx/backends/kokkos-openmp.md b/docs/sphinx/backends/kokkos-openmp.md index 43c881cbb..f2ef89248 100644 --- a/docs/sphinx/backends/kokkos-openmp.md +++ b/docs/sphinx/backends/kokkos-openmp.md @@ -30,4 +30,4 @@ only (unlike the Serial gate, which runs on every PR). Status `ci-full`, > bit-identical to a hand-written lexicographic sum. Since there is only one > Kokkos path, this holds for all spaces (Serial, OpenMP, Cuda). The max reduction > (`Kokkos::Max`) is exact everywhere. Detail in the header of -> [`for_each.hpp`](https://github.com/wolf75222/adc_cpp/blob/master/include/adc/mesh/for_each.hpp). +> [`for_each.hpp`](https://github.com/wolf75222/adc_cpp/blob/master/include/adc/mesh/execution/for_each.hpp). diff --git a/docs/sphinx/models/index.md b/docs/sphinx/models/index.md index fbf90c961..48d087533 100644 --- a/docs/sphinx/models/index.md +++ b/docs/sphinx/models/index.md @@ -30,7 +30,7 @@ single closure. See [moments and closures](../concepts/moments-and-closures.md), ## PhysicalModel: the concept All bricks satisfy the same C++ contract, the `adc::PhysicalModel` concept -([include/adc/core/physical_model.hpp](https://github.com/wolf75222/adc_cpp/blob/master/include/adc/core/physical_model.hpp)). A +([include/adc/core/model/physical_model.hpp](https://github.com/wolf75222/adc_cpp/blob/master/include/adc/core/model/physical_model.hpp)). A `PhysicalModel` describes an equation as a set of pure functions of pointwise states, nothing more. It is the only "what to compute" axis of the architecture, separate from the "where / how to iterate" axis (mesh + dispatch) and from the "in what order" axis (integrator + coupler, cf. diff --git a/docs/sphinx/reference/cpp-api.md b/docs/sphinx/reference/cpp-api.md index 606e50df3..5ee84693b 100644 --- a/docs/sphinx/reference/cpp-api.md +++ b/docs/sphinx/reference/cpp-api.md @@ -39,7 +39,7 @@ to link for the core, you include the headers. The three design axes are orthogo | `AmrCouplerMP` | Multi-patch AMR coupler: Berger-Rigoutsos regrid, time subcycling of the fine levels, coverage-aware reflux at the coarse-fine interface. | (The canonical definitions of these symbols live respectively in -`include/adc/core/physical_model.hpp`, `include/adc/numerics/numerical_flux.hpp`, +`include/adc/core/model/physical_model.hpp`, `include/adc/numerics/fv/numerical_flux.hpp`, `include/adc/numerics/elliptic/interface/elliptic_solver.hpp`, `include/adc/runtime/system.hpp`, `include/adc/runtime/amr_system.hpp`, `include/adc/numerics/elliptic/mg/geometric_mg.hpp`, `include/adc/numerics/elliptic/poisson/poisson_fft_solver.hpp`, diff --git a/docs/sphinx/reference/known-limitations.md b/docs/sphinx/reference/known-limitations.md index 38b4f32bd..53c2aaf39 100644 --- a/docs/sphinx/reference/known-limitations.md +++ b/docs/sphinx/reference/known-limitations.md @@ -25,7 +25,7 @@ fixed 2D plane and add no third index. Source of truth: `adc.capabilities()['dimension']` (`== 2`), the decision record [ADR-0001](https://github.com/wolf75222/adc_cpp/blob/master/docs/adr/ADR-0001-genericity-contracts.md), -and the `include/adc/mesh/box2d.hpp` header comment. +and the `include/adc/mesh/index/box2d.hpp` header comment. ## GPU: validated manually on ROMEO, not in CI diff --git a/docs/sphinx/reference/native-bricks.md b/docs/sphinx/reference/native-bricks.md index e77af04c0..cac0b60d9 100644 --- a/docs/sphinx/reference/native-bricks.md +++ b/docs/sphinx/reference/native-bricks.md @@ -15,7 +15,7 @@ Euler-Poisson, two-fluid) lives in `adc` ; the named compositions live in state <-> transport coherence and reports the parameters into a `ModelSpec` (tags read on the C++ side by the model factory) ; an incoherent pairing raises an immediate `ValueError`. The builtin tags (transport / source / elliptic) have a single C++ source of truth, -`include/adc/runtime/model_registry.hpp` : the dispatch validates every tag against that registry +`include/adc/runtime/dynamic/model_registry.hpp` : the dispatch validates every tag against that registry (an unknown tag is rejected explicitly) and the supported-vs-not-routed combinations (e.g. `compressible` has no polar brick, a fluid force needs a transport with >= 3 variables) are encoded there as data. diff --git a/docs/sphinx/reference/symbolic-dsl.md b/docs/sphinx/reference/symbolic-dsl.md index 0f2b4af64..0ba472626 100644 --- a/docs/sphinx/reference/symbolic-dsl.md +++ b/docs/sphinx/reference/symbolic-dsl.md @@ -356,7 +356,7 @@ Argument semantics : + `abi_key` (+ backend / target / name). Cache hit (the `.so` already exists for this key) -> no recompilation. Passing `so_path=` forces that path and always recompiles. - `include=None` : auto-detected by `adc_include()` (`$ADC_INCLUDE`, otherwise the installed `adc` - package, otherwise the sibling repo). Validity criterion : `adc/mesh/multifab.hpp` exists ; otherwise `RuntimeError`. + package, otherwise the sibling repo). Validity criterion : `adc/mesh/storage/multifab.hpp` exists ; otherwise `RuntimeError`. - `cxx=None` : autodetect `c++` / `g++` / `clang++` (via `shutil.which`). - `std=None` : default per backend. For `production` (native), the loader standard via `loader_cxx_std()` (= `_adc.__cxx_std__` : c++20 under Kokkos because CUDA 12.x has no `-std=c++23`, diff --git a/docs/sphinx/tutorials/write-a-model-with-dsl.md b/docs/sphinx/tutorials/write-a-model-with-dsl.md index 0450b37ac..9981e79dd 100644 --- a/docs/sphinx/tutorials/write-a-model-with-dsl.md +++ b/docs/sphinx/tutorials/write-a-model-with-dsl.md @@ -156,7 +156,7 @@ formulas reproduce exactly the conventions of the native `ExB` and `BackgroundDe - Import error on `import adc`: the extension is pinned to the interpreter that built it. Import with the same Python, and run `python -c "import adc; adc.doctor()"` to check the environment. - `RuntimeError` about headers when compiling: set `ADC_INCLUDE` to the repository `include` - directory (Step 1). The DSL validates it by checking that `adc/mesh/multifab.hpp` exists there. + directory (Step 1). The DSL validates it by checking that `adc/mesh/storage/multifab.hpp` exists there. - The script reports that the `production` backend is unavailable and continues on `aot`: this is the documented fallback when `_adc` and the `.so` were not built with the same headers. The `aot` run is numerically identical; nothing further is required for this tutorial. diff --git a/docs/validation/GH200_HYQMOM15.md b/docs/validation/GH200_HYQMOM15.md index e521e7870..7c7d1a803 100644 --- a/docs/validation/GH200_HYQMOM15.md +++ b/docs/validation/GH200_HYQMOM15.md @@ -1,7 +1,7 @@ # GH200 device validation: dense_eig + hyqmom15 (.so), single + multi-GPU ADC-181. Validates on GH200 (ROMEO, NVIDIA GH200 120GB, aarch64) the device path of the exact -eigenvalue-based wave speeds: `include/adc/numerics/dense_eig.hpp` (`real_eig_minmax`: Hessenberg +eigenvalue-based wave speeds: `include/adc/numerics/linalg/dense_eig.hpp` (`real_eig_minmax`: Hessenberg reduction + Francis double-shift QR iteration, named `ADC_HD` functors, on-stack buffers, zero allocation) through the compiled hyqmom15 `.so` (DSL-emitted bricks, `exact_speeds=True`, `riemann="hll"`), wired by the `adc::add_compiled_model` compilation seam (full native path: device diff --git a/docs/validation/diocotron_amr_gpu.cpp b/docs/validation/diocotron_amr_gpu.cpp index 4530f44ce..9ede89f35 100644 --- a/docs/validation/diocotron_amr_gpu.cpp +++ b/docs/validation/diocotron_amr_gpu.cpp @@ -45,7 +45,7 @@ #include #include -#include // add_compiled_model(AmrSystem&, ...) +#include // add_compiled_model(AmrSystem&, ...) #include #include "hyqmom15_brick.hpp" diff --git a/docs/validation/diocotron_gpu.cpp b/docs/validation/diocotron_gpu.cpp index d0f1d280c..e0d4d6a02 100644 --- a/docs/validation/diocotron_gpu.cpp +++ b/docs/validation/diocotron_gpu.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "hyqmom15_brick.hpp" diff --git a/include/adc/coupling/schur/amr_condensed_schur_source_stepper.hpp b/include/adc/coupling/schur/amr/amr_condensed_schur_source_stepper.hpp similarity index 98% rename from include/adc/coupling/schur/amr_condensed_schur_source_stepper.hpp rename to include/adc/coupling/schur/amr/amr_condensed_schur_source_stepper.hpp index 369e6dcb1..9834dffe9 100644 --- a/include/adc/coupling/schur/amr_condensed_schur_source_stepper.hpp +++ b/include/adc/coupling/schur/amr/amr_condensed_schur_source_stepper.hpp @@ -1,8 +1,8 @@ #pragma once -#include // CondensedSchurSourceStepper (#126) + detail kernels +#include // CondensedSchurSourceStepper (#126) + detail kernels #include -#include // ElectrostaticLorentzCondensation (assemble per level) +#include // ElectrostaticLorentzCondensation (assemble per level) #include // CompositeFacPoisson (composite FAC elliptic solve) #include // mf_average_down_mb (fine -> coarse cascade) #include // AmrLevelMP (multi-patch hierarchy) diff --git a/include/adc/coupling/schur/schur_condensation.hpp b/include/adc/coupling/schur/core/schur_condensation.hpp similarity index 100% rename from include/adc/coupling/schur/schur_condensation.hpp rename to include/adc/coupling/schur/core/schur_condensation.hpp diff --git a/include/adc/coupling/schur/schur_source_kernels.hpp b/include/adc/coupling/schur/core/schur_source_kernels.hpp similarity index 100% rename from include/adc/coupling/schur/schur_source_kernels.hpp rename to include/adc/coupling/schur/core/schur_source_kernels.hpp diff --git a/include/adc/coupling/schur/condensed_schur_source_stepper.hpp b/include/adc/coupling/schur/source/condensed_schur_source_stepper.hpp similarity index 98% rename from include/adc/coupling/schur/condensed_schur_source_stepper.hpp rename to include/adc/coupling/schur/source/condensed_schur_source_stepper.hpp index 6efeb1109..a1a1f7859 100644 --- a/include/adc/coupling/schur/condensed_schur_source_stepper.hpp +++ b/include/adc/coupling/schur/source/condensed_schur_source_stepper.hpp @@ -2,8 +2,8 @@ #include #include -#include // ElectrostaticLorentzCondensation (builder #124) -#include // shared geometry-free kernels + validate_krylov_params (#263) +#include // ElectrostaticLorentzCondensation (builder #124) +#include // shared geometry-free kernels + validate_krylov_params (#263) #include #include #include diff --git a/include/adc/coupling/schur/polar_condensed_schur_source_stepper.hpp b/include/adc/coupling/schur/source/polar_condensed_schur_source_stepper.hpp similarity index 99% rename from include/adc/coupling/schur/polar_condensed_schur_source_stepper.hpp rename to include/adc/coupling/schur/source/polar_condensed_schur_source_stepper.hpp index fbbdc74c0..3ac484e32 100644 --- a/include/adc/coupling/schur/polar_condensed_schur_source_stepper.hpp +++ b/include/adc/coupling/schur/source/polar_condensed_schur_source_stepper.hpp @@ -2,7 +2,7 @@ #include #include -#include // shared geometry-free kernels + validate_krylov_params (#263) +#include // shared geometry-free kernels + validate_krylov_params (#263) #include #include // PolarGeometry #include diff --git a/include/adc/coupling/static_system/amr_system_coupler.hpp b/include/adc/coupling/system/amr_system_coupler.hpp similarity index 100% rename from include/adc/coupling/static_system/amr_system_coupler.hpp rename to include/adc/coupling/system/amr_system_coupler.hpp diff --git a/include/adc/coupling/static_system/system_coupler.hpp b/include/adc/coupling/system/system_coupler.hpp similarity index 100% rename from include/adc/coupling/static_system/system_coupler.hpp rename to include/adc/coupling/system/system_coupler.hpp diff --git a/include/adc/runtime/amr/amr_runtime.hpp b/include/adc/runtime/amr/amr_runtime.hpp index 645dbbf78..bf0319afd 100644 --- a/include/adc/runtime/amr/amr_runtime.hpp +++ b/include/adc/runtime/amr/amr_runtime.hpp @@ -6,7 +6,7 @@ #include // VariableSet, VariableRole, role_from_name (role -> component of coupled sources) #include // detail::coupler_inject_aux_mb (aux injection coarse->fine) #include // regrid_compute_fine_layout + regrid_field_on_layout (split bricks) -#include // detail::same_layout_or_throw (shared-layout guard) +#include // detail::same_layout_or_throw (shared-layout guard) #include // detail::derive_aux_bc (BC of the aux channel) #include // CoupledSourceKernel + CsProgram (flat ABI, P5 bytecode) #include // field_postprocess, FieldPostProcess diff --git a/include/adc/runtime/amr_system.hpp b/include/adc/runtime/amr_system.hpp index fcea03943..836be48d0 100644 --- a/include/adc/runtime/amr_system.hpp +++ b/include/adc/runtime/amr_system.hpp @@ -5,7 +5,7 @@ #include // NewtonOptions (Newton options of the IMEX source) #include // ADC_EXPORT: set_compiled_block resolved by the native AMR loader #include // SourceStageOptions / CoupledSourceProgram (facade PODs, ADC-214) -#include +#include #include #include diff --git a/include/adc/runtime/builders/amr_block_seam.hpp b/include/adc/runtime/builders/block/amr_block_seam.hpp similarity index 97% rename from include/adc/runtime/builders/amr_block_seam.hpp rename to include/adc/runtime/builders/block/amr_block_seam.hpp index 250a7b108..00527a61e 100644 --- a/include/adc/runtime/builders/amr_block_seam.hpp +++ b/include/adc/runtime/builders/block/amr_block_seam.hpp @@ -1,9 +1,9 @@ #pragma once #include // VariableSet/VariableRole/role_from_name (resolve mask) -#include // dispatch_amr_block / dispatch_amr_compiled + AmrBuildParams +#include // dispatch_amr_block / dispatch_amr_compiled + AmrBuildParams #include // AmrRuntimeBlock + AmrTimeMethod -#include // dispatch_model_for + compiled bricks + ModelSpec +#include // dispatch_model_for + compiled bricks + ModelSpec #include #include diff --git a/include/adc/runtime/builders/block_builder.hpp b/include/adc/runtime/builders/block/block_builder.hpp similarity index 99% rename from include/adc/runtime/builders/block_builder.hpp rename to include/adc/runtime/builders/block/block_builder.hpp index e52676ca7..418e47b5b 100644 --- a/include/adc/runtime/builders/block_builder.hpp +++ b/include/adc/runtime/builders/block/block_builder.hpp @@ -13,8 +13,8 @@ #include // assemble_rhs_eb (cut-cell EB) + detail::DiscLevelSet (T5-PR2) #include #include -#include // UNIQUE registry of tags (validate_limiter/riemann, limiter_n_ghost) -#include // GridContext + BlockClosures (shared lightweight header) +#include // UNIQUE registry of tags (validate_limiter/riemann, limiter_n_ghost) +#include // GridContext + BlockClosures (shared lightweight header) #include // detail::DiscDomain (built-in level-set domain instance) #include // std::sqrt (ARS(2,2,2) coefficients: gamma = 1 - 1/sqrt(2), host) diff --git a/include/adc/runtime/builders/block_builder_polar.hpp b/include/adc/runtime/builders/block/block_builder_polar.hpp similarity index 98% rename from include/adc/runtime/builders/block_builder_polar.hpp rename to include/adc/runtime/builders/block/block_builder_polar.hpp index 316db9333..a3eb45f3a 100644 --- a/include/adc/runtime/builders/block_builder_polar.hpp +++ b/include/adc/runtime/builders/block/block_builder_polar.hpp @@ -11,11 +11,11 @@ #include // SSPRK2Step / SSPRK3Step (core RK math) #include // all_reduce_max (MPI-safe collective reduction) #include // ExBVelocityPolar, CompositeModel, source/elliptic bricks -#include // UNIQUE registry of tags (validate_limiter/riemann) -#include // BlockClosures (light header) -#include // detail::dispatch_source / dispatch_elliptic (REUSED) -#include // transport_tags_csv: polar-wired transport list (ADC-331) -#include +#include // UNIQUE registry of tags (validate_limiter/riemann) +#include // BlockClosures (light header) +#include // detail::dispatch_source / dispatch_elliptic (REUSED) +#include // transport_tags_csv: polar-wired transport list (ADC-331) +#include #include #include diff --git a/include/adc/runtime/builders/block_seam.hpp b/include/adc/runtime/builders/block/block_seam.hpp similarity index 95% rename from include/adc/runtime/builders/block_seam.hpp rename to include/adc/runtime/builders/block/block_seam.hpp index 1c8d3a0fd..f07d5ba3c 100644 --- a/include/adc/runtime/builders/block_seam.hpp +++ b/include/adc/runtime/builders/block/block_seam.hpp @@ -1,9 +1,9 @@ #pragma once #include // VariableSet (block descriptor carried in BuiltBlock) -#include // make_block + makers + BlockClosures + NewtonOptions/Report -#include // make_block_polar + polar makers + PolarGridContext -#include // dispatch_model_for + resolve_implicit_components + ModelSpec +#include // make_block + makers + BlockClosures + NewtonOptions/Report +#include // make_block_polar + polar makers + PolarGridContext +#include // dispatch_model_for + resolve_implicit_components + ModelSpec #include #include diff --git a/include/adc/runtime/builders/amr_dsl_block.hpp b/include/adc/runtime/builders/compiled/amr_dsl_block.hpp similarity index 99% rename from include/adc/runtime/builders/amr_dsl_block.hpp rename to include/adc/runtime/builders/compiled/amr_dsl_block.hpp index 474b2a6de..38d7491d3 100644 --- a/include/adc/runtime/builders/amr_dsl_block.hpp +++ b/include/adc/runtime/builders/compiled/amr_dsl_block.hpp @@ -1,6 +1,6 @@ #pragma once -#include // GLOBAL condensed source stage (amr-schur) +#include // GLOBAL condensed source stage (amr-schur) #include // AmrCouplerMP, AmrLevelMP #include #include @@ -16,8 +16,8 @@ #include // n_ranks #include // AmrRuntimeBlock (type-erased multi-block registry) #include -#include // detail::make_poisson_rhs (rhs += elliptic_rhs(U)) -#include // UNIQUE tag registry (validate_limiter/riemann) +#include // detail::make_poisson_rhs (rhs += elliptic_rhs(U)) +#include // UNIQUE tag registry (validate_limiter/riemann) #include // std::find, std::sort (resolving the partial IMEX mask of a compiled block) #include diff --git a/include/adc/runtime/builders/compiled_block_abi.hpp b/include/adc/runtime/builders/compiled/compiled_block_abi.hpp similarity index 99% rename from include/adc/runtime/builders/compiled_block_abi.hpp rename to include/adc/runtime/builders/compiled/compiled_block_abi.hpp index 507b06245..007cb3363 100644 --- a/include/adc/runtime/builders/compiled_block_abi.hpp +++ b/include/adc/runtime/builders/compiled/compiled_block_abi.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -11,7 +11,7 @@ #include #include // aux_comps: aux channel width of the generated model -#include // RuntimeParams: RUNTIME params (P7-b) carried by the ABI +#include // RuntimeParams: RUNTIME params (P7-b) carried by the ABI #include #include diff --git a/include/adc/runtime/builders/dsl_block.hpp b/include/adc/runtime/builders/compiled/dsl_block.hpp similarity index 99% rename from include/adc/runtime/builders/dsl_block.hpp rename to include/adc/runtime/builders/compiled/dsl_block.hpp index efbe72f8c..32fae8ded 100644 --- a/include/adc/runtime/builders/dsl_block.hpp +++ b/include/adc/runtime/builders/compiled/dsl_block.hpp @@ -1,7 +1,7 @@ #pragma once #include // aux_comps: aux width requested by the model -#include +#include #include #include diff --git a/include/adc/runtime/builders/native_loader.hpp b/include/adc/runtime/builders/compiled/native_loader.hpp similarity index 99% rename from include/adc/runtime/builders/native_loader.hpp rename to include/adc/runtime/builders/compiled/native_loader.hpp index f744fcf12..861624ee8 100644 --- a/include/adc/runtime/builders/native_loader.hpp +++ b/include/adc/runtime/builders/compiled/native_loader.hpp @@ -7,15 +7,15 @@ #include #include #include // AuxHaloPolicy (ADC-369: per-field aux halo tail marshaling) -#include // adc::abi_key (ABI guard for the native loader) -#include // IModel: model loaded at runtime (dynamic block) -#include // GridContext +#include // adc::abi_key (ABI guard for the native loader) +#include // IModel: model loaded at runtime (dynamic block) +#include // GridContext #include // adc::System (install_block / grid_context / ensure_aux_width) #include #include #include -#include // portable dlopen<->LoadLibraryW layer (ADC-99); includes on POSIX +#include // portable dlopen<->LoadLibraryW layer (ADC-99); includes on POSIX #include #include #include diff --git a/include/adc/runtime/builders/model_factory.hpp b/include/adc/runtime/builders/factory/model_factory.hpp similarity index 98% rename from include/adc/runtime/builders/model_factory.hpp rename to include/adc/runtime/builders/factory/model_factory.hpp index 2a5ba7150..e68b491c1 100644 --- a/include/adc/runtime/builders/model_factory.hpp +++ b/include/adc/runtime/builders/factory/model_factory.hpp @@ -3,8 +3,8 @@ #include // ADC_COLD_FN: COLD-factory no-optimize attribute (ADC-337) #include // VariableSet/VariableRole/role_from_name/roles_csv (resolve_implicit_components) #include -#include // kTransports/kSources/kElliptics: builtin-brick tag registry (ADC-331) -#include +#include // kTransports/kSources/kElliptics: builtin-brick tag registry (ADC-331) +#include #include // std::find, std::sort (resolve_implicit_components) #include diff --git a/include/adc/runtime/detail/dispatch_tags.hpp b/include/adc/runtime/config/dispatch_tags.hpp similarity index 100% rename from include/adc/runtime/detail/dispatch_tags.hpp rename to include/adc/runtime/config/dispatch_tags.hpp diff --git a/include/adc/runtime/model_spec.hpp b/include/adc/runtime/config/model_spec.hpp similarity index 100% rename from include/adc/runtime/model_spec.hpp rename to include/adc/runtime/config/model_spec.hpp diff --git a/include/adc/runtime/detail/runtime_params.hpp b/include/adc/runtime/config/runtime_params.hpp similarity index 100% rename from include/adc/runtime/detail/runtime_params.hpp rename to include/adc/runtime/config/runtime_params.hpp diff --git a/include/adc/runtime/detail/grid_context.hpp b/include/adc/runtime/context/grid_context.hpp similarity index 100% rename from include/adc/runtime/detail/grid_context.hpp rename to include/adc/runtime/context/grid_context.hpp diff --git a/include/adc/runtime/detail/wall_predicate.hpp b/include/adc/runtime/context/wall_predicate.hpp similarity index 100% rename from include/adc/runtime/detail/wall_predicate.hpp rename to include/adc/runtime/context/wall_predicate.hpp diff --git a/include/adc/runtime/detail/abi_key.hpp b/include/adc/runtime/dynamic/abi_key.hpp similarity index 100% rename from include/adc/runtime/detail/abi_key.hpp rename to include/adc/runtime/dynamic/abi_key.hpp diff --git a/include/adc/runtime/detail/dynamic_model.hpp b/include/adc/runtime/dynamic/dynamic_model.hpp similarity index 100% rename from include/adc/runtime/detail/dynamic_model.hpp rename to include/adc/runtime/dynamic/dynamic_model.hpp diff --git a/include/adc/runtime/detail/dynlib.hpp b/include/adc/runtime/dynamic/dynlib.hpp similarity index 100% rename from include/adc/runtime/detail/dynlib.hpp rename to include/adc/runtime/dynamic/dynlib.hpp diff --git a/include/adc/runtime/detail/model_registry.hpp b/include/adc/runtime/dynamic/model_registry.hpp similarity index 100% rename from include/adc/runtime/detail/model_registry.hpp rename to include/adc/runtime/dynamic/model_registry.hpp diff --git a/include/adc/runtime/system.hpp b/include/adc/runtime/system.hpp index 9433e5060..c33901c93 100644 --- a/include/adc/runtime/system.hpp +++ b/include/adc/runtime/system.hpp @@ -4,8 +4,8 @@ #include // NewtonOptions (options of the IMEX source Newton) #include // ADC_EXPORT (methods resolved by the native loader through dlopen) #include // SourceStageOptions / CoupledSourceProgram (facade PODs, ADC-214) -#include // GridContext + BlockClosures (AOT-compiled block seam) -#include +#include // GridContext + BlockClosures (AOT-compiled block seam) +#include #include #include diff --git a/include/adc/runtime/system/system_field_solver.hpp b/include/adc/runtime/system/system_field_solver.hpp index b4a6999ab..719237bd7 100644 --- a/include/adc/runtime/system/system_field_solver.hpp +++ b/include/adc/runtime/system/system_field_solver.hpp @@ -10,8 +10,8 @@ #include #include // PolarPoissonSolver (direct polar Poisson) #include // n_ranks() (FFT MPI guard) -#include // derive_aux_polar (polar aux in local basis) -#include // detail::wall_predicate +#include // derive_aux_polar (polar aux in local basis) +#include // detail::wall_predicate #include // ADC_TRACE_SOLVE_FIELDS: device diagnostic trace (env-gated, inert by default) #include // getenv diff --git a/include/adc/runtime/system/system_stepper.hpp b/include/adc/runtime/system/system_stepper.hpp index 6acc9fd86..e04d46e47 100644 --- a/include/adc/runtime/system/system_stepper.hpp +++ b/include/adc/runtime/system/system_stepper.hpp @@ -5,7 +5,7 @@ #include // CoupledFreqKernel (per-cell coupled frequency) #include // reduce_max_cell (max mu over the cells, device-clean functor) #include // all_reduce_min/max (global bounds: identical dt on all ranks) -#include // GeometryMode (disk transport dispatch) +#include // GeometryMode (disk transport dispatch) #include // std::runtime_error (disk mode requested without disk advance on a block) diff --git a/python/adc/dsl.py b/python/adc/dsl.py index acd6c15a0..f46bcff2d 100644 --- a/python/adc/dsl.py +++ b/python/adc/dsl.py @@ -2679,7 +2679,7 @@ def roles_init(roles): "// Satisfait adc::HyperbolicModel : flux + max_wave_speed + conversions + descripteurs.", ] if rt_member: # RuntimeParams header only if a formula reads a runtime param - S.append("#include ") + S.append("#include ") # dense_eig.hpp : eigenvalues of dense blocks (exact wave_speeds) OU temoin de VP dans la # projection (m.projection + dsl.eig_max_im, ADC-289). Sans l'un ou l'autre : non inclus. eig_pairs = _collect_eig_witnesses(self._proj or []) @@ -3153,7 +3153,7 @@ def aux_locals(): "// apply(U, a) -> terme source S(U, aux) ; noms aux = champs de adc::Aux (grad_x, grad_y).", ] if rt_member: # RuntimeParams header only if a formula reads a runtime param - S.append("#include ") + S.append("#include ") if self._ws_jacobian is not None: # dense-block eigenvalues (exact wave_speeds) S.append("#include ") S += [ @@ -3280,7 +3280,7 @@ def emit_cpp_so_source(self, name=None, hoist_reciprocals=False): "(m.projection) non transportee par ce chemin ; utiliser " "backend='aot' ou 'production'") nv, bricks, composite = self._emit_bricks(name, hoist_reciprocals=hoist_reciprocals) - return ('#include \n' + return ('#include \n' '#include \n' # CompositeModel + NoSource + bricks '#include \n' + bricks @@ -3325,7 +3325,7 @@ def emit_cpp_aot_source(self, name=None, hoist_reciprocals=False): (assemble_rhs, the core's SSPRK2/IMEX) on the generated model: inlined numerics, identical to a native add_block block. As opposed to the "jit" backend (IModel, virtual dispatch).""" nv, bricks, composite = self._emit_bricks(name, hoist_reciprocals=hoist_reciprocals) - return ('#include \n' + return ('#include \n' '#include \n' # CompositeModel + NoSource + bricks '#include \n' + bricks @@ -3427,13 +3427,13 @@ def emit_cpp_native_loader(self, name=None, target="system", hoist_reciprocals=F '#include \n' '#include \n' '#include \n' - '#include \n' # ADC_ABI_KEY_LITERAL (key frozen at compile) + '#include \n' # ADC_ABI_KEY_LITERAL (key frozen at compile) '#include \n' # CompositeModel + NoSource + bricks '#include \n') # Header template of the target: dsl_block.hpp (System) or amr_dsl_block.hpp (AmrSystem). Included # selectively so as not to pull the AMR machinery into a System loader (and vice versa). - head += ('#include \n' if target == "system" - else '#include \n') + head += ('#include \n' if target == "system" + else '#include \n') # preprocessor LITERAL, no call to abi_key_string(): an inline would be interposed # (ELF/RTLD_GLOBAL) toward the module's copy -> module's key returned -> tautological guard. key = ('#if defined(_WIN32)\n' @@ -3856,7 +3856,7 @@ def emit_cpp_elliptic(self, name=None, namespace="adc_generated", cse=True, "// rhs(U) -> Real : second membre f(U) de l'operateur elliptique (p.ex. densite de charge).", ] if rt_member: # RuntimeParams header only if a formula reads a runtime param - out.append("#include ") + out.append("#include ") out += [ "namespace %s {" % namespace, "struct %s {" % nm, @@ -4738,7 +4738,7 @@ def _emit_aot_source(self): (aot backend: same flat ABI as emit_cpp_aot_source). The bricks (generated DSL or native binding structs) are stitched together, then assembled into adc::CompositeModel<...>.""" hyp, src, ell = self._slots - parts = ['#include \n', + parts = ['#include \n', '#include \n', # CompositeModel + native bricks '#include \n'] # ADC_EXPORT_BLOCK_METADATA / _GAMMA for slot in self._slots: @@ -4784,7 +4784,7 @@ def _emit_jit_source(self): Rusanov residual): fast iteration, to be plugged via System.add_dynamic_block. Hybrid counterpart of emit_cpp_so_source.""" bricks, composite = self._bricks_and_composite() - return ('#include \n' + return ('#include \n' '#include \n' '#include \n' + bricks @@ -4811,13 +4811,13 @@ def _emit_native_source(self, target="system"): if target not in ("system", "amr_system"): raise ValueError("_emit_native_source: target 'system' | 'amr_system' (got %r)" % (target,)) bricks, composite = self._bricks_and_composite() - head = ('#include \n' # ADC_ABI_KEY_LITERAL (key frozen at compile time) + head = ('#include \n' # ADC_ABI_KEY_LITERAL (key frozen at compile time) '#include \n' # CompositeModel + native bricks '#include \n' '#include \n') # Header template of the target (selective: do not pull the AMR machinery into a System loader). - head += ('#include \n' if target == "system" - else '#include \n') + head += ('#include \n' if target == "system" + else '#include \n') # Preprocessor LITERAL, no call to abi_key_string(): an inline would be interposed # (ELF/RTLD_GLOBAL) toward the module's copy -> module key returned -> tautological guard. key = ('#if defined(_WIN32)\n' diff --git a/python/amr_block_compressible.cpp b/python/amr_block_compressible.cpp index d62e6cbd4..dce345882 100644 --- a/python/amr_block_compressible.cpp +++ b/python/amr_block_compressible.cpp @@ -2,7 +2,7 @@ // leaf (all fluxes + the SourceFreeModel IMEX doubling). ADC-359 flux subdivision: this TU is now the thin // riemann dispatcher, routing to the per-flux build_amr_block_compressible_ seam TUs (each compiles // ONE flux's build_amr_block leaves in parallel). See amr_block_seam.hpp. -#include +#include namespace adc::detail { diff --git a/python/amr_block_compressible_hll.cpp b/python/amr_block_compressible_hll.cpp index 106f12c11..ca0633bba 100644 --- a/python/amr_block_compressible_hll.cpp +++ b/python/amr_block_compressible_hll.cpp @@ -1,7 +1,7 @@ // ADC-359 flux subdivision of the compressible (Euler) multi-block AMR seam: this TU instantiates ONLY // the hll flux's build_amr_block leaves, so it compiles in parallel with the other flux TUs. See // amr_block_seam.hpp / amr_block_compressible.cpp (the riemann dispatcher). -#include +#include namespace adc::detail { diff --git a/python/amr_block_compressible_hllc.cpp b/python/amr_block_compressible_hllc.cpp index d3e605a63..566bc722f 100644 --- a/python/amr_block_compressible_hllc.cpp +++ b/python/amr_block_compressible_hllc.cpp @@ -1,7 +1,7 @@ // ADC-359 flux subdivision of the compressible (Euler) multi-block AMR seam: this TU instantiates ONLY // the hllc flux's build_amr_block leaves, so it compiles in parallel with the other flux TUs. See // amr_block_seam.hpp / amr_block_compressible.cpp (the riemann dispatcher). -#include +#include namespace adc::detail { diff --git a/python/amr_block_compressible_roe.cpp b/python/amr_block_compressible_roe.cpp index ccfa336de..59d67cb32 100644 --- a/python/amr_block_compressible_roe.cpp +++ b/python/amr_block_compressible_roe.cpp @@ -1,7 +1,7 @@ // ADC-359 flux subdivision of the compressible (Euler) multi-block AMR seam: this TU instantiates ONLY // the roe flux's build_amr_block leaves, so it compiles in parallel with the other flux TUs. See // amr_block_seam.hpp / amr_block_compressible.cpp (the riemann dispatcher). -#include +#include namespace adc::detail { diff --git a/python/amr_block_compressible_rusanov.cpp b/python/amr_block_compressible_rusanov.cpp index dc7efec74..edaf405c6 100644 --- a/python/amr_block_compressible_rusanov.cpp +++ b/python/amr_block_compressible_rusanov.cpp @@ -1,7 +1,7 @@ // ADC-359 flux subdivision of the compressible (Euler) multi-block AMR seam: this TU instantiates ONLY // the rusanov flux's build_amr_block leaves, so it compiles in parallel with the other flux TUs. See // amr_block_seam.hpp / amr_block_compressible.cpp (the riemann dispatcher). -#include +#include namespace adc::detail { diff --git a/python/amr_block_exb.cpp b/python/amr_block_exb.cpp index 3f264ac6d..4dc934b43 100644 --- a/python/amr_block_exb.cpp +++ b/python/amr_block_exb.cpp @@ -1,6 +1,6 @@ // ADC-335 (P0-B): multi-block AMR seam for the ExB scalar transport. Instantiates only the ExBVelocity // build_amr_block leaves; compiled in parallel with the other transports. See amr_block_seam.hpp. -#include +#include namespace adc::detail { diff --git a/python/amr_block_isothermal.cpp b/python/amr_block_isothermal.cpp index 900edf54c..ae0cf9849 100644 --- a/python/amr_block_isothermal.cpp +++ b/python/amr_block_isothermal.cpp @@ -1,5 +1,5 @@ // ADC-335 (P0-B): multi-block AMR seam for the isothermal (3-var fluid) transport. See amr_block_seam.hpp. -#include +#include namespace adc::detail { diff --git a/python/amr_compiled_compressible.cpp b/python/amr_compiled_compressible.cpp index c1d092a77..87e391614 100644 --- a/python/amr_compiled_compressible.cpp +++ b/python/amr_compiled_compressible.cpp @@ -2,7 +2,7 @@ // flux subdivision: this TU is now the thin riemann dispatcher, routing to the per-flux // build_amr_compiled_compressible_ seam TUs (each compiles ONE flux's build_amr_compiled leaves in // parallel). See amr_block_seam.hpp. -#include +#include namespace adc::detail { diff --git a/python/amr_compiled_compressible_hll.cpp b/python/amr_compiled_compressible_hll.cpp index 5f941c525..16c34e01a 100644 --- a/python/amr_compiled_compressible_hll.cpp +++ b/python/amr_compiled_compressible_hll.cpp @@ -1,6 +1,6 @@ // ADC-359 flux subdivision of the compressible (Euler) single-block compiled AMR seam: only the hll // flux's build_amr_compiled leaves. See amr_compiled_compressible.cpp (the riemann dispatcher). -#include +#include namespace adc::detail { diff --git a/python/amr_compiled_compressible_hllc.cpp b/python/amr_compiled_compressible_hllc.cpp index 770e6b7da..a397e03fa 100644 --- a/python/amr_compiled_compressible_hllc.cpp +++ b/python/amr_compiled_compressible_hllc.cpp @@ -1,6 +1,6 @@ // ADC-359 flux subdivision of the compressible (Euler) single-block compiled AMR seam: only the hllc // flux's build_amr_compiled leaves. See amr_compiled_compressible.cpp (the riemann dispatcher). -#include +#include namespace adc::detail { diff --git a/python/amr_compiled_compressible_roe.cpp b/python/amr_compiled_compressible_roe.cpp index 9b1a91ab0..3d64cd41b 100644 --- a/python/amr_compiled_compressible_roe.cpp +++ b/python/amr_compiled_compressible_roe.cpp @@ -1,6 +1,6 @@ // ADC-359 flux subdivision of the compressible (Euler) single-block compiled AMR seam: only the roe // flux's build_amr_compiled leaves. See amr_compiled_compressible.cpp (the riemann dispatcher). -#include +#include namespace adc::detail { diff --git a/python/amr_compiled_compressible_rusanov.cpp b/python/amr_compiled_compressible_rusanov.cpp index e66df34f1..3f6b97bfa 100644 --- a/python/amr_compiled_compressible_rusanov.cpp +++ b/python/amr_compiled_compressible_rusanov.cpp @@ -1,6 +1,6 @@ // ADC-359 flux subdivision of the compressible (Euler) single-block compiled AMR seam: only the rusanov // flux's build_amr_compiled leaves. See amr_compiled_compressible.cpp (the riemann dispatcher). -#include +#include namespace adc::detail { diff --git a/python/amr_compiled_exb.cpp b/python/amr_compiled_exb.cpp index ee139031e..02fd424b7 100644 --- a/python/amr_compiled_exb.cpp +++ b/python/amr_compiled_exb.cpp @@ -1,6 +1,6 @@ // ADC-335 (P0-B): single-block AMR seam (AmrCouplerMP) for the ExB scalar transport. Instantiates only // the ExBVelocity build_amr_compiled leaves. See amr_block_seam.hpp. -#include +#include namespace adc::detail { diff --git a/python/amr_compiled_isothermal.cpp b/python/amr_compiled_isothermal.cpp index 0f519857a..98bf4fed8 100644 --- a/python/amr_compiled_isothermal.cpp +++ b/python/amr_compiled_isothermal.cpp @@ -1,5 +1,5 @@ // ADC-335 (P0-B): single-block AMR seam (AmrCouplerMP) for the isothermal transport. See amr_block_seam.hpp. -#include +#include namespace adc::detail { diff --git a/python/amr_system.cpp b/python/amr_system.cpp index 647cf609a..12598ee85 100644 --- a/python/amr_system.cpp +++ b/python/amr_system.cpp @@ -1,19 +1,19 @@ #include -#include // detail::abi_key_string: ABI key (header-only), compared to the loader's -#include // detail::dispatch_amr_compiled + build_amr_compiled (shared path) +#include // detail::abi_key_string: ABI key (header-only), compared to the loader's +#include // detail::dispatch_amr_compiled + build_amr_compiled (shared path) #include // AmrRuntime + AmrRuntimeBlock (multi-block runtime engine) -#include // ADC-335: per-transport AMR build seam (build_amr_block/_compiled_) -#include // detail::dispatch_model + compiled bricks -#include // unknown_transport_msg: single-source transport rejection (ADC-331) -#include // detail::wall_predicate (wall shared System/AmrSystem) +#include // ADC-335: per-transport AMR build seam (build_amr_block/_compiled_) +#include // detail::dispatch_model + compiled bricks +#include // unknown_transport_msg: single-source transport rejection (ADC-331) +#include // detail::wall_predicate (wall shared System/AmrSystem) #include // NewtonOptions + validate_newton_options (shared range check) #include // std::find, std::sort (partial IMEX mask resolution: sorted unique indices) #include #include #include // std::numeric_limits (global step bounds: neutralization to +inf before the min) -#include // portable dlopen<->LoadLibraryW layer (ADC-99); on POSIX +#include // portable dlopen<->LoadLibraryW layer (ADC-99); on POSIX #include #include #include diff --git a/python/bindings_detail.hpp b/python/bindings_detail.hpp index 797eff6cd..ee31f3747 100644 --- a/python/bindings_detail.hpp +++ b/python/bindings_detail.hpp @@ -12,7 +12,7 @@ #include // Kokkos_Core under ADC_HAS_KOKKOS (kokkos_is_initialized) #include // adc::my_rank / n_ranks: rank-0 guard of the multi-rank IO facade -#include // adc::abi_key: ABI key exposed to the DSL ("production" path) +#include // adc::abi_key: ABI key exposed to the DSL ("production" path) #include #include diff --git a/python/system.cpp b/python/system.cpp index 964a53bd4..d2cc55739 100644 --- a/python/system.cpp +++ b/python/system.cpp @@ -1,13 +1,13 @@ #include #include // VariableSet + VariableRole: role descriptor carried by each block -#include // adc::abi_key + detail::abi_key_string (ABI boundary of the native loader) -#include // GridContext + make_block/make_max_speed (compiled closures) -#include // ADC-335: per-transport build seam (build_block_exb/.../polar) -#include // detail::dispatch_model + compiled bricks -#include // unknown_transport_msg: single-source transport rejection (ADC-331) -#include // Schur-condensed source stage (adc.Split / CondensedSchur, #126) -#include // POLAR counterpart of the condensed source stage (Path A step 2c, #212) +#include // adc::abi_key + detail::abi_key_string (ABI boundary of the native loader) +#include // GridContext + make_block/make_max_speed (compiled closures) +#include // ADC-335: per-transport build seam (build_block_exb/.../polar) +#include // detail::dispatch_model + compiled bricks +#include // unknown_transport_msg: single-source transport rejection (ADC-331) +#include // Schur-condensed source stage (adc.Split / CondensedSchur, #126) +#include // POLAR counterpart of the condensed source stage (Path A step 2c, #212) #include // CoupledSourceKernel: generic coupled source (DSL P5, bytecode) #include #include @@ -15,7 +15,7 @@ #include // SystemFieldSolver: elliptic solve + field derivation (Batch B) #include // SystemStepper: time advance (step/advance/step_cfl/step_adaptive) (Batch B) #include // SystemBlockStore: block management (BlockState + registry + index/copy/write) (Batch B.3) -#include // POLAR block closures (assemble_rhs_polar, REUSED) +#include // POLAR block closures (assemble_rhs_polar, REUSED) #include // backward_euler_source #include // ForwardEuler, SSPRK2Step (core RK math) #include // assemble_rhs, SourceFreeModel, max_wave_speed_mf, load_state @@ -27,15 +27,15 @@ #include // sum #include #include // fill_ghosts, fill_boundary -#include // IModel: model loaded at runtime (dynamic block) -#include // .so loading (JIT/AOT/native) + ABI guard: VERBATIM, included after the Impl def below (templates instantiated lower down) -#include // detail::wall_predicate (wall shared by System/AmrSystem) +#include // IModel: model loaded at runtime (dynamic block) +#include // .so loading (JIT/AOT/native) + ABI guard: VERBATIM, included after the Impl def below (templates instantiated lower down) +#include // detail::wall_predicate (wall shared by System/AmrSystem) #include #include #include // ADC_TRACE_SOLVE_FIELDS: device diagnostic trace (env-gated, inert by default) #include // getenv -#include // portable dlopen<->LoadLibraryW layer (ADC-99); on POSIX +#include // portable dlopen<->LoadLibraryW layer (ADC-99); on POSIX #include #include // std::numeric_limits (per-block CFL: dt = min over blocks) #include // std::map (per-block runtime params registry, P7-b) diff --git a/python/system_compressible_hll.cpp b/python/system_compressible_hll.cpp index 951e51bbd..9dff3ed1c 100644 --- a/python/system_compressible_hll.cpp +++ b/python/system_compressible_hll.cpp @@ -1,6 +1,6 @@ // ADC-335 (P0-B flux subdivision): compressible (Euler) x HLL flux only. make_block_hll forwards // wave_speed_cache (the only flux that engages it). See system_compressible_rusanov.cpp. -#include +#include namespace adc::detail { diff --git a/python/system_compressible_hllc.cpp b/python/system_compressible_hllc.cpp index 459df56d3..b0bac7be6 100644 --- a/python/system_compressible_hllc.cpp +++ b/python/system_compressible_hllc.cpp @@ -1,6 +1,6 @@ // ADC-335 (P0-B flux subdivision): compressible (Euler) x HLLC flux only (contact-resolving algebra, // one of the two heaviest leaves). See system_compressible_rusanov.cpp. -#include +#include namespace adc::detail { diff --git a/python/system_compressible_roe.cpp b/python/system_compressible_roe.cpp index 55c0fa671..f7b7b98e0 100644 --- a/python/system_compressible_roe.cpp +++ b/python/system_compressible_roe.cpp @@ -1,6 +1,6 @@ // ADC-335 (P0-B flux subdivision): compressible (Euler) x Roe flux only (|A_roe| dissipation, the other // heaviest leaf). See system_compressible_rusanov.cpp. -#include +#include namespace adc::detail { diff --git a/python/system_compressible_rusanov.cpp b/python/system_compressible_rusanov.cpp index 33e4ddf30..db688fa1a 100644 --- a/python/system_compressible_rusanov.cpp +++ b/python/system_compressible_rusanov.cpp @@ -2,7 +2,7 @@ // heaviest TU, so it is split one .cpp per flux. This TU instantiates ONLY the RusanovFlux build_block // leaves of the compressible models (via make_block_rusanov), so they compile in parallel with the other // flux TUs. The flux is dispatched by System (riemann string); validation lives there (shared validate_*). -#include +#include namespace adc::detail { diff --git a/python/system_exb.cpp b/python/system_exb.cpp index 09783a27a..63f20fb64 100644 --- a/python/system_exb.cpp +++ b/python/system_exb.cpp @@ -1,7 +1,7 @@ // ADC-335 (P0-B): per-transport block-build seam for the ExB scalar transport. Instantiates ONLY the // ExBVelocity leaves of the System dispatch product (see block_seam.hpp); compiled in parallel with the // other transports' translation units. The TR construction matches dispatch_transport's "exb" branch. -#include +#include namespace adc::detail { diff --git a/python/system_isothermal_hll.cpp b/python/system_isothermal_hll.cpp index 782eaced0..59d66048f 100644 --- a/python/system_isothermal_hll.cpp +++ b/python/system_isothermal_hll.cpp @@ -1,6 +1,6 @@ // ADC-342 (P0-B flux subdivision): isothermal x HLL flux only. make_block_hll forwards wave_speed_cache // (the only flux that engages it). See system_isothermal_rusanov.cpp. -#include +#include namespace adc::detail { diff --git a/python/system_isothermal_rusanov.cpp b/python/system_isothermal_rusanov.cpp index 9fcfd967d..705bb844a 100644 --- a/python/system_isothermal_rusanov.cpp +++ b/python/system_isothermal_rusanov.cpp @@ -3,7 +3,7 @@ // is split one .cpp per flux like compressible. This TU instantiates ONLY the RusanovFlux build_block // leaves of the isothermal models (via make_block_rusanov), so they compile in parallel with the hll TU. // The flux is dispatched by System (riemann string); validation lives there (shared validate_*). -#include +#include namespace adc::detail { diff --git a/python/system_polar.cpp b/python/system_polar.cpp index 5e04e8e07..7db9c2595 100644 --- a/python/system_polar.cpp +++ b/python/system_polar.cpp @@ -3,7 +3,7 @@ // in its own translation unit. VERBATIM move of the dispatch_model_polar visitor body that used to live // in System::add_block; the polar makers read the System aux through the @p aux pointer (was &P->aux). // IMEX is rejected on the ring by add_block before this is called. -#include +#include namespace adc::detail { diff --git a/python/tests/gpu/amrmpi_integrated.cpp b/python/tests/gpu/amrmpi_integrated.cpp index d6706a5db..80c6556c9 100644 --- a/python/tests/gpu/amrmpi_integrated.cpp +++ b/python/tests/gpu/amrmpi_integrated.cpp @@ -18,7 +18,7 @@ // et on encadre la mesure de temps par Kokkos::fence() pour ne pas sous-estimer le cout device. #include #include -#include +#include #include #include diff --git a/python/tests/gpu/gpu_amrsys_facade_validate.cpp b/python/tests/gpu/gpu_amrsys_facade_validate.cpp index 983352aee..3605d966a 100644 --- a/python/tests/gpu/gpu_amrsys_facade_validate.cpp +++ b/python/tests/gpu/gpu_amrsys_facade_validate.cpp @@ -16,7 +16,7 @@ #include #include #include // ADC_HD -#include +#include #include // ChargeDensityRhs #include #include diff --git a/python/tests/gpu/gpu_dsl_production_validate.cpp b/python/tests/gpu/gpu_dsl_production_validate.cpp index b011870e2..e10633d2a 100644 --- a/python/tests/gpu/gpu_dsl_production_validate.cpp +++ b/python/tests/gpu/gpu_dsl_production_validate.cpp @@ -34,7 +34,7 @@ // est le chemin AMR, couvert ailleurs). #include // CompositeModel + Euler + PotentialForce + ChargeDensity -#include // add_compiled_model (gabarit natif du chemin production) +#include // add_compiled_model (gabarit natif du chemin production) #include #include diff --git a/python/tests/gpu/phase7_system.cpp b/python/tests/gpu/phase7_system.cpp index 6f639fdd7..86ec32f36 100644 --- a/python/tests/gpu/phase7_system.cpp +++ b/python/tests/gpu/phase7_system.cpp @@ -2,7 +2,7 @@ // euler_poisson : transport compressible (HLLC) + force de gravite + solve Poisson a CHAQUE pas + // pas de temps CFL. Exerce les phases 1 (transport/MultiFab), 2 (BCs) et 3 (Poisson) INTEGREES par le // System. On lie system.cpp et on compare CPU vs GPU. Portable seriel / Kokkos+CUDA. -#include +#include #include #include diff --git a/python/tests/test_dsl_abi_metadata.py b/python/tests/test_dsl_abi_metadata.py index c00a5e228..8b12cfded 100644 --- a/python/tests/test_dsl_abi_metadata.py +++ b/python/tests/test_dsl_abi_metadata.py @@ -80,7 +80,7 @@ def legacy_aot_so(so_path): """.so AOT a l'ABI HISTORIQUE : macro ADC_DEFINE_COMPILED_BLOCK seule, AUCUNE metadonnee emise.""" e = build_legacy_scalar() nv, bricks, composite = e._emit_bricks() - src = ('#include \n' + src = ('#include \n' '#include \n' '#include \n' + bricks @@ -93,7 +93,7 @@ def legacy_jit_so(so_path): """.so JIT a l'ABI HISTORIQUE : fabrique adc_make_model seule, AUCUNE metadonnee emise.""" e = build_legacy_scalar() nv, bricks, composite = e._emit_bricks() - src = ('#include \n' + src = ('#include \n' '#include \n' '#include \n' + bricks diff --git a/python/tests/test_dsl_dynamic.py b/python/tests/test_dsl_dynamic.py index 5a29b11fb..88203dda1 100644 --- a/python/tests/test_dsl_dynamic.py +++ b/python/tests/test_dsl_dynamic.py @@ -17,7 +17,7 @@ INCLUDE = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "include")) LIB = r""" -#include +#include #include %s extern "C" adc::IModel<4>* adc_make_model() { return new adc::ModelAdapter(); } @@ -26,7 +26,7 @@ MAIN = r""" #include -#include +#include #include #include #include diff --git a/tests/test_adaptive_multirate.cpp b/tests/test_adaptive_multirate.cpp index 9fba1bcd9..5f8f9a8ef 100644 --- a/tests/test_adaptive_multirate.cpp +++ b/tests/test_adaptive_multirate.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/test_amr_aux_bz.cpp b/tests/test_amr_aux_bz.cpp index ec2658efb..7705b7cad 100644 --- a/tests/test_amr_aux_bz.cpp +++ b/tests/test_amr_aux_bz.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tests/test_amr_compiled_model.cpp b/tests/test_amr_compiled_model.cpp index fdf709e9a..9e4c6de1a 100644 --- a/tests/test_amr_compiled_model.cpp +++ b/tests/test_amr_compiled_model.cpp @@ -9,9 +9,9 @@ // au chemin compile le MEME type (CompressibleFlux == Euler, cf. hyperbolic.hpp) -> parite exacte. #include // CompositeModel, GravityForce, GravityCoupling #include // Euler (= CompressibleFlux) -#include +#include #include -#include +#include #include #include diff --git a/tests/test_amr_composite_source_conservation.cpp b/tests/test_amr_composite_source_conservation.cpp index 29ad2ed5b..4b41f758c 100644 --- a/tests/test_amr_composite_source_conservation.cpp +++ b/tests/test_amr_composite_source_conservation.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include // AmrLevelMP #include #include diff --git a/tests/test_amr_condensed_schur_composite.cpp b/tests/test_amr_condensed_schur_composite.cpp index 86bedbfb2..6dea40f33 100644 --- a/tests/test_amr_condensed_schur_composite.cpp +++ b/tests/test_amr_condensed_schur_composite.cpp @@ -13,7 +13,7 @@ // // Serie (Kokkos OFF) : grossier mono-box, 1 patch fin mono-box (cadre Phase 3c ; MPI = Phase 4). -#include +#include #include #include diff --git a/tests/test_amr_condensed_schur_source_stepper.cpp b/tests/test_amr_condensed_schur_source_stepper.cpp index 078c5771b..a7b00a97d 100644 --- a/tests/test_amr_condensed_schur_source_stepper.cpp +++ b/tests/test_amr_condensed_schur_source_stepper.cpp @@ -27,8 +27,8 @@ // Serie (Kokkos OFF) : n_ranks() == 1. L'etage uniforme est par ailleurs deja rejoue MPI np=1/2/4 par // son propre test ; la parite mono-niveau est une propriete de composition, independante du rang. -#include -#include +#include +#include #include #include diff --git a/tests/test_amr_coupled_source_role_strict.cpp b/tests/test_amr_coupled_source_role_strict.cpp index af3b9cdc9..133989855 100644 --- a/tests/test_amr_coupled_source_role_strict.cpp +++ b/tests/test_amr_coupled_source_role_strict.cpp @@ -21,10 +21,10 @@ // couplees minimales et on assertit le succes / la levee. Backend CPU/Kokkos (ctor sous ScopeGuard). #include // CsOp (opcodes du bytecode P5) -#include // detail::make_shared_amr_layout / dispatch_amr_block +#include // detail::make_shared_amr_layout / dispatch_amr_block #include // AmrRuntime, AmrRuntimeBlock -#include // detail::dispatch_model -#include +#include // detail::dispatch_model +#include #include #include diff --git a/tests/test_amr_imex_native.cpp b/tests/test_amr_imex_native.cpp index 790b1133a..eb1e457d4 100644 --- a/tests/test_amr_imex_native.cpp +++ b/tests/test_amr_imex_native.cpp @@ -37,9 +37,9 @@ // CMake injecte ADC_TEST_CXX, ADC_TEST_INCLUDE, ADC_TEST_CXX_STD, ADC_TEST_TMPDIR (meme pattern que // test_amr_riemann_native). #include // CompositeModel, Euler, PotentialForce, ChargeDensity, BackgroundDensity -#include +#include #include -#include +#include #include #include @@ -146,8 +146,8 @@ std::string loader_source() { // emitted source verbatim. // clang-format off return R"CPP( -#include -#include +#include +#include #include #include #include diff --git a/tests/test_amr_layout_guard.cpp b/tests/test_amr_layout_guard.cpp index 4f60b70f1..d1873cc7a 100644 --- a/tests/test_amr_layout_guard.cpp +++ b/tests/test_amr_layout_guard.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include // AmrLevelMP #include #include diff --git a/tests/test_amr_multiblock_compiled.cpp b/tests/test_amr_multiblock_compiled.cpp index 701f67fe1..e29325133 100644 --- a/tests/test_amr_multiblock_compiled.cpp +++ b/tests/test_amr_multiblock_compiled.cpp @@ -34,9 +34,9 @@ #include // ChargeDensity #include // ExBVelocity #include // NoSource -#include // add_compiled_model(AmrSystem&, ...) +#include // add_compiled_model(AmrSystem&, ...) #include // facade AmrSystem -#include // ModelSpec (bloc natif, melange compile + natif) +#include // ModelSpec (bloc natif, melange compile + natif) #include #include diff --git a/tests/test_amr_multiblock_coupled_source.cpp b/tests/test_amr_multiblock_coupled_source.cpp index d26b5cf91..39d313d8d 100644 --- a/tests/test_amr_multiblock_coupled_source.cpp +++ b/tests/test_amr_multiblock_coupled_source.cpp @@ -23,10 +23,10 @@ // construit la hierarchie partagee et l'on accede aux densites/masses par bloc et au RHS Poisson. #include // CsOp (opcodes du bytecode P5) -#include // detail::make_shared_amr_layout / dispatch_amr_block +#include // detail::make_shared_amr_layout / dispatch_amr_block #include // AmrRuntime, AmrRuntimeBlock -#include // detail::dispatch_model -#include +#include // detail::dispatch_model +#include #include #include diff --git a/tests/test_amr_multiblock_imex.cpp b/tests/test_amr_multiblock_imex.cpp index e78e9ed59..01b3d8562 100644 --- a/tests/test_amr_multiblock_imex.cpp +++ b/tests/test_amr_multiblock_imex.cpp @@ -32,11 +32,11 @@ // La FACADE (4)(5) passe par AmrSystem (modeles ModelSpec : exb, potential). #include // CompositeModel, Euler, BackgroundDensity, ChargeDensity, PotentialForce -#include // detail::make_shared_amr_layout / build_amr_block / dispatch_amr_block +#include // detail::make_shared_amr_layout / build_amr_block / dispatch_amr_block #include // AmrRuntime, AmrRuntimeBlock #include // facade AmrSystem -#include // detail::dispatch_model -#include +#include // detail::dispatch_model +#include #include #include diff --git a/tests/test_amr_multiblock_regrid_union.cpp b/tests/test_amr_multiblock_regrid_union.cpp index ce218090b..b96338010 100644 --- a/tests/test_amr_multiblock_regrid_union.cpp +++ b/tests/test_amr_multiblock_regrid_union.cpp @@ -28,11 +28,11 @@ // des lambdas generiques sous concept : ils sont evalues dans la boucle HOTE de tag_cells (pas sur // device), donc une std::function les capturant est licite et compile partout (CPU + Kokkos). -#include // detail::make_shared_amr_layout / dispatch_amr_block +#include // detail::make_shared_amr_layout / dispatch_amr_block #include // AmrRuntime, AmrRuntimeBlock #include // facade AmrSystem (deverrouillage multi-blocs + regrid_every>0) -#include // detail::dispatch_model -#include +#include // detail::dispatch_model +#include #include #include diff --git a/tests/test_amr_multiblock_substeps.cpp b/tests/test_amr_multiblock_substeps.cpp index eebe3031d..0d373d158 100644 --- a/tests/test_amr_multiblock_substeps.cpp +++ b/tests/test_amr_multiblock_substeps.cpp @@ -19,11 +19,11 @@ // l'on accede aux niveaux/masses/RHS des blocs ; les regressions mono-bloc passent par la facade. #include // add_scaled_component (RHS de reference assemble main) -#include // detail::make_shared_amr_layout / dispatch_amr_block +#include // detail::make_shared_amr_layout / dispatch_amr_block #include // AmrRuntime, AmrRuntimeBlock #include // facade AmrSystem -#include // detail::dispatch_model -#include +#include // detail::dispatch_model +#include #include // norm_inf #include diff --git a/tests/test_amr_native_loader.cpp b/tests/test_amr_native_loader.cpp index 6bd849e36..3ef0e3400 100644 --- a/tests/test_amr_native_loader.cpp +++ b/tests/test_amr_native_loader.cpp @@ -17,7 +17,7 @@ // CMake injecte ADC_TEST_CXX (compilateur), ADC_TEST_INCLUDE (dossier des en-tetes adc) et // ADC_TEST_CXX_STD (norme C++ du build, pour que la cle d'ABI du loader concorde avec celle du test). #include // CompositeModel, Euler, NoSource, BackgroundDensity -#include +#include #include #include @@ -56,8 +56,8 @@ std::string loader_source() { // emitted source verbatim. // clang-format off return R"CPP( -#include -#include +#include +#include #include #include namespace adc_generated { diff --git a/tests/test_amr_potential.cpp b/tests/test_amr_potential.cpp index a99fda017..2d0466e7f 100644 --- a/tests/test_amr_potential.cpp +++ b/tests/test_amr_potential.cpp @@ -11,7 +11,7 @@ // Le modele est un transport ExB pur + fond neutralisant (briques exb / none / background), proche du // scenario diocotron qui echantillonne phi sur un cercle median (FFT azimutale). #include -#include +#include #include #include diff --git a/tests/test_amr_regrid_mpi_parity.cpp b/tests/test_amr_regrid_mpi_parity.cpp index dbff3eda0..97eb93856 100644 --- a/tests/test_amr_regrid_mpi_parity.cpp +++ b/tests/test_amr_regrid_mpi_parity.cpp @@ -31,7 +31,7 @@ // Independant du backend (Kokkos Serial CI, Kokkos Cuda GH200). Compile le runtime AmrSystem comme // test_mpi_amr_twoblock_parity (avec python/amr_system.cpp). #include -#include +#include #include // comm_init, my_rank, n_ranks, all_reduce_* #include "test_harness.hpp" // adc::test::checksum (somme des carres partagee) diff --git a/tests/test_amr_regrid_variable.cpp b/tests/test_amr_regrid_variable.cpp index c030cc126..f49eb7c40 100644 --- a/tests/test_amr_regrid_variable.cpp +++ b/tests/test_amr_regrid_variable.cpp @@ -15,8 +15,8 @@ #include // VariableSet, VariableRole, VariableKind #include // PatchBox (signature index-espace des patchs fins) #include // AmrSystem, AmrSystemConfig -#include // detail::resolve_selected_component (ADC-296) -#include +#include // detail::resolve_selected_component (ADC-296) +#include #include #include diff --git a/tests/test_amr_riemann_native.cpp b/tests/test_amr_riemann_native.cpp index e4a09d1ac..1dc097d40 100644 --- a/tests/test_amr_riemann_native.cpp +++ b/tests/test_amr_riemann_native.cpp @@ -19,9 +19,9 @@ // CMake injecte ADC_TEST_CXX, ADC_TEST_INCLUDE, ADC_TEST_CXX_STD, ADC_TEST_TMPDIR (meme pattern // que test_amr_weno5_native). #include // CompositeModel, Euler, NoSource, BackgroundDensity -#include +#include #include -#include +#include #include #include @@ -114,8 +114,8 @@ std::string loader_source() { // emitted source verbatim. // clang-format off return R"CPP( -#include -#include +#include +#include #include #include namespace adc_generated { diff --git a/tests/test_amr_seed_no_refine.cpp b/tests/test_amr_seed_no_refine.cpp index f881078eb..c7b3a12c2 100644 --- a/tests/test_amr_seed_no_refine.cpp +++ b/tests/test_amr_seed_no_refine.cpp @@ -12,9 +12,9 @@ // bit-a-bit du chemin raffine est verrouillee par test_amr_compiled_model / test_amr_riemann_native). #include // CompositeModel, GravityForce, GravityCoupling #include // Euler (= CompressibleFlux) -#include +#include #include -#include +#include #include #include diff --git a/tests/test_amr_source_covered_cells.cpp b/tests/test_amr_source_covered_cells.cpp index 564f69eea..3e1986926 100644 --- a/tests/test_amr_source_covered_cells.cpp +++ b/tests/test_amr_source_covered_cells.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include // AmrLevelMP #include #include diff --git a/tests/test_amr_stride_cadence.cpp b/tests/test_amr_stride_cadence.cpp index 1d479be85..1e7a53566 100644 --- a/tests/test_amr_stride_cadence.cpp +++ b/tests/test_amr_stride_cadence.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include // AmrLevelMP #include #include diff --git a/tests/test_amr_system_bz_multibox.cpp b/tests/test_amr_system_bz_multibox.cpp index d334736fe..a0791c392 100644 --- a/tests/test_amr_system_bz_multibox.cpp +++ b/tests/test_amr_system_bz_multibox.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include // ChargeDensityRhs #include #include diff --git a/tests/test_amr_system_bz_pop.cpp b/tests/test_amr_system_bz_pop.cpp index 114ec5609..2465d3c3f 100644 --- a/tests/test_amr_system_bz_pop.cpp +++ b/tests/test_amr_system_bz_pop.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include // ChargeDensityRhs #include #include diff --git a/tests/test_amr_system_contract.cpp b/tests/test_amr_system_contract.cpp index 31d4db0af..3391fe31a 100644 --- a/tests/test_amr_system_contract.cpp +++ b/tests/test_amr_system_contract.cpp @@ -7,7 +7,7 @@ // python/amr_system.cpp avec le test, la classe AmrSystem etant la facade des bindings. #include -#include +#include #include "test_harness.hpp" // adc::test::Checker (style verbose) + raises partages diff --git a/tests/test_amr_system_coupler.cpp b/tests/test_amr_system_coupler.cpp index b100826e1..e664feea9 100644 --- a/tests/test_amr_system_coupler.cpp +++ b/tests/test_amr_system_coupler.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include // AmrLevelMP #include #include diff --git a/tests/test_amr_system_twoblock.cpp b/tests/test_amr_system_twoblock.cpp index 862bfb3cc..9c1fb7acb 100644 --- a/tests/test_amr_system_twoblock.cpp +++ b/tests/test_amr_system_twoblock.cpp @@ -19,11 +19,11 @@ // niveaux des blocs ; les points (a)(c)(d)(e) au niveau de la facade AmrSystem. #include // add_scaled_component (RHS de reference assemble main) -#include // detail::make_shared_amr_layout / dispatch_amr_block +#include // detail::make_shared_amr_layout / dispatch_amr_block #include // AmrRuntime, AmrRuntimeBlock #include // facade AmrSystem -#include // detail::dispatch_model -#include +#include // detail::dispatch_model +#include #include // norm_inf #include diff --git a/tests/test_amr_weno5_native.cpp b/tests/test_amr_weno5_native.cpp index 107ca2394..cfe1f4896 100644 --- a/tests/test_amr_weno5_native.cpp +++ b/tests/test_amr_weno5_native.cpp @@ -22,9 +22,9 @@ // CMake injecte ADC_TEST_CXX (compilateur), ADC_TEST_INCLUDE (en-tetes adc), ADC_TEST_CXX_STD (norme // C++ du build : la cle d'ABI du loader concorde avec celle du test) et ADC_TEST_TMPDIR. #include // CompositeModel, Euler, NoSource, BackgroundDensity -#include +#include #include -#include +#include #include #include @@ -118,8 +118,8 @@ std::string loader_source() { // emitted source verbatim. // clang-format off return R"CPP( -#include -#include +#include +#include #include #include namespace adc_generated { diff --git a/tests/test_assembler_driver.cpp b/tests/test_assembler_driver.cpp index e81337b8f..5963d9c5f 100644 --- a/tests/test_assembler_driver.cpp +++ b/tests/test_assembler_driver.cpp @@ -4,7 +4,7 @@ #include #include -#include // SystemAssembler, SystemDriver, SystemCoupler +#include // SystemAssembler, SystemDriver, SystemCoupler #include #include #include diff --git a/tests/test_aux_runtime_bz.cpp b/tests/test_aux_runtime_bz.cpp index fb0f2c68d..cfadbc231 100644 --- a/tests/test_aux_runtime_bz.cpp +++ b/tests/test_aux_runtime_bz.cpp @@ -8,7 +8,7 @@ #include #include // ExBVelocity -#include // add_compiled_model +#include // add_compiled_model #include #include diff --git a/tests/test_aux_system_bz.cpp b/tests/test_aux_system_bz.cpp index 0157505a9..a9ded42d1 100644 --- a/tests/test_aux_system_bz.cpp +++ b/tests/test_aux_system_bz.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tests/test_aux_te.cpp b/tests/test_aux_te.cpp index 7572900cb..b868aaa90 100644 --- a/tests/test_aux_te.cpp +++ b/tests/test_aux_te.cpp @@ -8,7 +8,7 @@ #include // Euler (bloc fluide source de T_e) #include // ExBVelocity #include // NoSource -#include // add_compiled_model +#include // add_compiled_model #include #include diff --git a/tests/test_block_builder.cpp b/tests/test_block_builder.cpp index 95cfc5db0..8a52458c3 100644 --- a/tests/test_block_builder.cpp +++ b/tests/test_block_builder.cpp @@ -9,7 +9,7 @@ // l'avance SSPRK2 conserve la masse. Si ca compile et passe, un .so genere peut faire de meme. #include // CompositeModel, NoSource, GravityForce, GravityCoupling #include // Euler (brique hyperbolique compressible) -#include +#include #include #include diff --git a/tests/test_cfl_dt.cpp b/tests/test_cfl_dt.cpp index 0fc272880..e04a09263 100644 --- a/tests/test_cfl_dt.cpp +++ b/tests/test_cfl_dt.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/test_compiled_model_parity.cpp b/tests/test_compiled_model_parity.cpp index ce512d327..75a9c67bc 100644 --- a/tests/test_compiled_model_parity.cpp +++ b/tests/test_compiled_model_parity.cpp @@ -6,8 +6,8 @@ // du bloc natif (les deux passent par le meme make_block / install_block / fill_boundary). #include // CompositeModel, GravityForce, GravityCoupling #include // Euler (= CompressibleFlux) -#include -#include +#include +#include #include #include diff --git a/tests/test_condensed_schur_source_stepper.cpp b/tests/test_condensed_schur_source_stepper.cpp index 44e98fe93..3dfd68d13 100644 --- a/tests/test_condensed_schur_source_stepper.cpp +++ b/tests/test_condensed_schur_source_stepper.cpp @@ -30,7 +30,7 @@ // les rangs, y compris vides) : iterations et resultat invariants au nombre de rangs. Les verifs // (ecarts MAX, normes) sont reduites par all_reduce_max : un FAIL sur un rang -> FAIL partout. -#include +#include #include #include diff --git a/tests/test_config_model_validation.cpp b/tests/test_config_model_validation.cpp index d6d09c1c7..cb2aaac38 100644 --- a/tests/test_config_model_validation.cpp +++ b/tests/test_config_model_validation.cpp @@ -18,8 +18,8 @@ // python/system.cpp et python/amr_system.cpp (objets runtime splices, cf. tests/CMakeLists.txt). #include -#include // detail::validate_model_spec (contrat de completude) -#include +#include // detail::validate_model_spec (contrat de completude) +#include #include #include "test_harness.hpp" // adc::test::Checker (style verbose) + raises partages diff --git a/tests/test_coupled_source.cpp b/tests/test_coupled_source.cpp index 5eb3442b1..793b02308 100644 --- a/tests/test_coupled_source.cpp +++ b/tests/test_coupled_source.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tests/test_disc_domain_mask.cpp b/tests/test_disc_domain_mask.cpp index 71ef3e090..3e1115917 100644 --- a/tests/test_disc_domain_mask.cpp +++ b/tests/test_disc_domain_mask.cpp @@ -32,7 +32,7 @@ #include #include #include -#include // detail::DiscDomain (descripteur source-unique) +#include // detail::DiscDomain (descripteur source-unique) #include #include diff --git a/tests/test_dispatch_tags.cpp b/tests/test_dispatch_tags.cpp index 0b135e3f0..ee33f8c89 100644 --- a/tests/test_dispatch_tags.cpp +++ b/tests/test_dispatch_tags.cpp @@ -9,7 +9,7 @@ // Aucune capabilite modele n'est testee ici (hll/hllc/roe sur un transport sans onde / sans pression) // : ces gardes sont des `if constexpr` PAR MODELE au call-site, hors perimetre du registry. -#include +#include #include #include diff --git a/tests/test_dynamic_model.cpp b/tests/test_dynamic_model.cpp index d8e4483d3..52bedd422 100644 --- a/tests/test_dynamic_model.cpp +++ b/tests/test_dynamic_model.cpp @@ -3,7 +3,7 @@ // meme vitesse d'onde que l'appel direct. C'est le mecanisme qui permet d'utiliser, a l'execution, // une brique generee/JIT dont le type n'est pas connu a la compilation (cf. dynamic_model.hpp). #include -#include +#include #include #include diff --git a/tests/test_eb_transport.cpp b/tests/test_eb_transport.cpp index 679b2a6fc..28ef9d4fe 100644 --- a/tests/test_eb_transport.cpp +++ b/tests/test_eb_transport.cpp @@ -42,7 +42,7 @@ #include #include #include -#include // detail::DiscDomain (level set source-unique) +#include // detail::DiscDomain (level set source-unique) #include #include diff --git a/tests/test_elliptic_composite_rhs.cpp b/tests/test_elliptic_composite_rhs.cpp index 67e22593d..f4d0acadc 100644 --- a/tests/test_elliptic_composite_rhs.cpp +++ b/tests/test_elliptic_composite_rhs.cpp @@ -14,7 +14,7 @@ #include #include -#include // make_poisson_rhs +#include // make_poisson_rhs #include #include diff --git a/tests/test_facade_routing.cpp b/tests/test_facade_routing.cpp index 6766fe17d..1c5aa1c38 100644 --- a/tests/test_facade_routing.cpp +++ b/tests/test_facade_routing.cpp @@ -20,7 +20,7 @@ // transport DIOCOTRON de production. La vitesse derive de grad phi (Poisson sur la densite) : champ a // divergence nulle -> la masse est conservee par les schemas masque / EB. Compile python/system.cpp. -#include +#include #include #include diff --git a/tests/test_imex_partial.cpp b/tests/test_imex_partial.cpp index 045cfe2bb..710120ee3 100644 --- a/tests/test_imex_partial.cpp +++ b/tests/test_imex_partial.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/test_imex_transport.cpp b/tests/test_imex_transport.cpp index 70091fddc..f1748590d 100644 --- a/tests/test_imex_transport.cpp +++ b/tests/test_imex_transport.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/test_model_registry.cpp b/tests/test_model_registry.cpp index a413eec81..bd6570355 100644 --- a/tests/test_model_registry.cpp +++ b/tests/test_model_registry.cpp @@ -15,7 +15,7 @@ // Le routage effectif (chaque tag builtin atteint bien une branche du dispatch) est verifie cote // test_config_model_validation.cpp, qui lie la machinerie de dispatch. -#include +#include #include #include diff --git a/tests/test_mpi_amr_compiled_parity.cpp b/tests/test_mpi_amr_compiled_parity.cpp index 1d6eb4870..32c5b15c9 100644 --- a/tests/test_mpi_amr_compiled_parity.cpp +++ b/tests/test_mpi_amr_compiled_parity.cpp @@ -26,7 +26,7 @@ // lecture hote ici est sure. On insere malgre tout un Kokkos::fence() de ceinture avant les diffs. #include // CompositeModel, GravityForce, GravityCoupling #include // Euler (transport compressible) -#include // add_compiled_model(AmrSystem, ...) +#include // add_compiled_model(AmrSystem, ...) #include #include // comm_init, my_rank, n_ranks, all_reduce_* diff --git a/tests/test_mpi_amr_distributed_coarse.cpp b/tests/test_mpi_amr_distributed_coarse.cpp index 87adc57f4..a947aeeb4 100644 --- a/tests/test_mpi_amr_distributed_coarse.cpp +++ b/tests/test_mpi_amr_distributed_coarse.cpp @@ -25,7 +25,7 @@ // binaire en np=1/2/4 et diff cmax (bit-identique attendu). #include // CompositeModel, GravityForce, GravityCoupling #include // Euler -#include // add_compiled_model(AmrSystem, ...) +#include // add_compiled_model(AmrSystem, ...) #include #include diff --git a/tests/test_mpi_amr_twoblock_parity.cpp b/tests/test_mpi_amr_twoblock_parity.cpp index 3ad06d8dd..4fd7282ff 100644 --- a/tests/test_mpi_amr_twoblock_parity.cpp +++ b/tests/test_mpi_amr_twoblock_parity.cpp @@ -12,7 +12,7 @@ // central multi-patch + le Poisson somme co-localise distribues. Independant du backend (Kokkos // Serial CI, Kokkos Cuda GH200). #include -#include +#include #include // comm_init, my_rank, n_ranks, all_reduce_* #include diff --git a/tests/test_mpi_coupled_source.cpp b/tests/test_mpi_coupled_source.cpp index 74019409d..1b4806c8b 100644 --- a/tests/test_mpi_coupled_source.cpp +++ b/tests/test_mpi_coupled_source.cpp @@ -17,7 +17,7 @@ #include #include // ExBVelocity (scalaire 1 var, role Density) #include // NoSource -#include // add_compiled_model +#include // add_compiled_model #include #include // CsOp (opcodes, miroir Python) diff --git a/tests/test_mpi_hybrid_mbox_parity.cpp b/tests/test_mpi_hybrid_mbox_parity.cpp index ea2c2c8ce..32e08f5d7 100644 --- a/tests/test_mpi_hybrid_mbox_parity.cpp +++ b/tests/test_mpi_hybrid_mbox_parity.cpp @@ -18,7 +18,7 @@ #include // CompositeModel, GravityCoupling #include // Euler (transport compressible natif) -#include +#include #include #include diff --git a/tests/test_mpi_mbox_parity.cpp b/tests/test_mpi_mbox_parity.cpp index 5e867b7b2..c04e4ca73 100644 --- a/tests/test_mpi_mbox_parity.cpp +++ b/tests/test_mpi_mbox_parity.cpp @@ -17,7 +17,7 @@ #include #include // CompositeModel, GravityForce, GravityCoupling #include // Euler (transport compressible) -#include +#include #include #include diff --git a/tests/test_mpi_system_fft.cpp b/tests/test_mpi_system_fft.cpp index 4f217094e..7b4336e84 100644 --- a/tests/test_mpi_system_fft.cpp +++ b/tests/test_mpi_system_fft.cpp @@ -26,7 +26,7 @@ #include #include // ExBVelocity #include // NoSource -#include // add_compiled_model +#include // add_compiled_model #include #include diff --git a/tests/test_mpi_system_gather_scatter.cpp b/tests/test_mpi_system_gather_scatter.cpp index 943879e51..6dfc3fc3f 100644 --- a/tests/test_mpi_system_gather_scatter.cpp +++ b/tests/test_mpi_system_gather_scatter.cpp @@ -26,7 +26,7 @@ #include #include // ExBVelocity (scalaire 1 var) #include // NoSource -#include // add_compiled_model +#include // add_compiled_model #include #include diff --git a/tests/test_mpi_system_io_gather.cpp b/tests/test_mpi_system_io_gather.cpp index d58c6066b..008e2aaae 100644 --- a/tests/test_mpi_system_io_gather.cpp +++ b/tests/test_mpi_system_io_gather.cpp @@ -44,7 +44,7 @@ #include #include // Euler (bloc fluide a 4 composantes, etat conservatif riche) #include // NoSource -#include // add_compiled_model +#include // add_compiled_model #include #include diff --git a/tests/test_mpi_system_solve_fields.cpp b/tests/test_mpi_system_solve_fields.cpp index caf94d5b5..e9c43b68f 100644 --- a/tests/test_mpi_system_solve_fields.cpp +++ b/tests/test_mpi_system_solve_fields.cpp @@ -17,7 +17,7 @@ #include // Euler (bloc fluide source de T_e) #include // ExBVelocity #include // NoSource -#include // add_compiled_model +#include // add_compiled_model #include #include diff --git a/tests/test_multirate_stride.cpp b/tests/test_multirate_stride.cpp index b667e9914..88a03fc68 100644 --- a/tests/test_multirate_stride.cpp +++ b/tests/test_multirate_stride.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/test_native_aux_named.cpp b/tests/test_native_aux_named.cpp index 53be4bd22..77850cb01 100644 --- a/tests/test_native_aux_named.cpp +++ b/tests/test_native_aux_named.cpp @@ -5,8 +5,8 @@ // the host path read 0 SILENTLY (#51-class gap, but for named fields). This pins the marshaling. #include -#include -#include +#include +#include #include #include diff --git a/tests/test_polar_condensed_schur_source_stepper.cpp b/tests/test_polar_condensed_schur_source_stepper.cpp index edd9c94a3..22f667538 100644 --- a/tests/test_polar_condensed_schur_source_stepper.cpp +++ b/tests/test_polar_condensed_schur_source_stepper.cpp @@ -27,7 +27,7 @@ // // Host / Serial-safe : UNE box, n_ranks()==1 (PolarTensorKrylovSolver / PolarPoissonSolver mono-rang). -#include +#include #include #include diff --git a/tests/test_polar_system_step.cpp b/tests/test_polar_system_step.cpp index bd818df6d..951469471 100644 --- a/tests/test_polar_system_step.cpp +++ b/tests/test_polar_system_step.cpp @@ -36,7 +36,7 @@ #include #include #include // ExBVelocityPolar, CompositeModel, NoSource, ChargeDensity -#include // derive_aux_polar : MEME derivation aux que System::solve_fields_polar +#include // derive_aux_polar : MEME derivation aux que System::solve_fields_polar #include #include diff --git a/tests/test_positivity_floor.cpp b/tests/test_positivity_floor.cpp index b01758374..fa4d185d2 100644 --- a/tests/test_positivity_floor.cpp +++ b/tests/test_positivity_floor.cpp @@ -18,7 +18,7 @@ // runtime_error explicite (jamais un scaling muet d'une composante arbitraire). #include #include -#include +#include #include #include diff --git a/tests/test_schur_condensation.cpp b/tests/test_schur_condensation.cpp index 3313df180..e1b328bc7 100644 --- a/tests/test_schur_condensation.cpp +++ b/tests/test_schur_condensation.cpp @@ -17,7 +17,7 @@ // Poisson canonique, et le RHS (sans terme de flux) = -Lap phi^n BIT-IDENTIQUE au Laplacien // canonique apply_laplacian (negue). Garde-fou de non-regression. -#include +#include #include #include diff --git a/tests/test_strang_splitting.cpp b/tests/test_strang_splitting.cpp index 3ccd0f67a..92e2a3877 100644 --- a/tests/test_strang_splitting.cpp +++ b/tests/test_strang_splitting.cpp @@ -30,8 +30,8 @@ // dans des branches MORTES ici (s.schur / s.schur_polar restent nullptr ; on passe par source_step). // Le member-access ->step(...) exige neanmoins le type COMPLET a l'instanciation -> on inclut les deux // en-tetes Schur (comme python/system.cpp). On n'en CONSTRUIT aucun objet : le test reste leger. -#include -#include +#include +#include #include #include diff --git a/tests/test_system_coupler.cpp b/tests/test_system_coupler.cpp index 1cf62ea17..92812a81d 100644 --- a/tests/test_system_coupler.cpp +++ b/tests/test_system_coupler.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/test_system_hardening.cpp b/tests/test_system_hardening.cpp index 965056f89..dd5bf95fd 100644 --- a/tests/test_system_hardening.cpp +++ b/tests/test_system_hardening.cpp @@ -5,8 +5,8 @@ #include #include -#include -#include +#include +#include #include // AmrLevelMP #include #include diff --git a/tests/test_system_two_explicit.cpp b/tests/test_system_two_explicit.cpp index 3f8dbc410..057d0c977 100644 --- a/tests/test_system_two_explicit.cpp +++ b/tests/test_system_two_explicit.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/test_two_species_minimal.cpp b/tests/test_two_species_minimal.cpp index d389fc8fc..740a830ea 100644 --- a/tests/test_two_species_minimal.cpp +++ b/tests/test_two_species_minimal.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/test_user_time_integrator.cpp b/tests/test_user_time_integrator.cpp index a1b9e7f69..ab6dc790e 100644 --- a/tests/test_user_time_integrator.cpp +++ b/tests/test_user_time_integrator.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/test_wave_speed_cache_engagement.cpp b/tests/test_wave_speed_cache_engagement.cpp index 13a1cd53d..89b44a473 100644 --- a/tests/test_wave_speed_cache_engagement.cpp +++ b/tests/test_wave_speed_cache_engagement.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include // Kokkos::View / atomic_add / deep_copy (compteur d'appels device-accessible) diff --git a/tests/test_weno5_compiled_model.cpp b/tests/test_weno5_compiled_model.cpp index 270db5b8f..1e0d344c5 100644 --- a/tests/test_weno5_compiled_model.cpp +++ b/tests/test_weno5_compiled_model.cpp @@ -12,8 +12,8 @@ // l'allocation et le resultat sont inchanges vs avant ce chantier. #include // CompositeModel, GravityForce, GravityCoupling #include // Euler (= CompressibleFlux) -#include -#include +#include +#include #include #include diff --git a/tests/test_weno5_ssprk3.cpp b/tests/test_weno5_ssprk3.cpp index 715be2d3f..3e4dbdf28 100644 --- a/tests/test_weno5_ssprk3.cpp +++ b/tests/test_weno5_ssprk3.cpp @@ -14,7 +14,7 @@ // WENO5+SSPRK3 a une erreur < Minmod+SSPRK2 a meme resolution, et une pente de convergence > 2 // (au-dela de l'ordre 2 du MUSCL). Test court (n <= 64), CI-friendly. #include // adc::validation::AdvectionDiffusion : transport scalaire (nu=0 = advection pure) -#include +#include #include #include