Application frontend¶
The frontend turns JSON or TOML settings into a simulation object graph. Read the application pipeline, the minimal custom application tutorial, and 0.1 → 0.2 migration before using these types directly.
pfc::ui::App and pfc::ui::SpectralSimulationSession are deleted. JSON
drivers use pfc::ui::make_simulation_session<Stack> or an app-owned ETD
session, then pfc::sim::run.
pfc::sim::stacks::SpectralCPUStack¶
-
class SpectralCPUStack
Programmatic spectral CPU stack: Domain + Decomposition + CPUFFT + Field sized to the FFT inbox.
Public Functions
-
inline explicit SpectralCPUStack(pfc::Domain domain, int rank, int nproc, MPI_Comm comm, const heffte::plan_options &options)
- Parameters:
domain – The global Cartesian simulation domain.
rank – Caller’s MPI rank on
comm.nproc – Total number of ranks on
comm(used bydecomposition::create).comm – MPI communicator passed to the FFT.
-
template<class G>
inline auto du() Build a compact-driver residual field for the spectral stack.
Returns a
pfc::sim::DuField<G, pfc::field::SpectralGradient<G>>bound tom_uand the cached FFT plan. There is no halo exchange to hide here, so the prepare callable is a no-op; the spectral evaluator’s ownprepare()runs the forward FFT plus one inverse FFT per declared derivative insideapply(...).Usage mirrors the FD stack:
Returned by value (move). Capturesauto& u = stack.u(); auto du = stack.du<MyGrads>(); du.apply([](const G& g) { ... }); u += dt * du;
thisonly indirectly through the evaluator’s reference tom_u.vec(); must not outlive the stack.- Template Parameters:
G – Model-owned per-point grads aggregate.
-
inline explicit SpectralCPUStack(pfc::Domain domain, int rank, int nproc, MPI_Comm comm, const heffte::plan_options &options)