zoomy_foam.symsolver#
Foam driver of the symbolic solvers: prints the C++ solver, builds it with wmake in the OpenFOAM
apptainer (inside the image: directly, zoomy_foam._pipeline.in_image), runs the case. Sits at the end of Model -> SystemModel -> NumericalSystemModel -> C++
template -> foam runtime (symsolver/rt.H).
Module Contents#
Classes#
decomposePar’s method for an MPI run. |
|
Foam runtime of a C++ solver backend ( |
|
The explicit hyperbolic template on foam: |
|
The Chorin projection template on foam, run with |
Functions#
The CPU hypre install symFoam links ( |
|
The restart state |
Data#
API#
- zoomy_foam.symsolver.APP#
None
- zoomy_foam.symsolver.SCHEMES = <Multiline-String>#
- zoomy_foam.symsolver.PRECICE#
‘Path(…)’
- zoomy_foam.symsolver.HYPRE_VERSION#
‘3.2.0’
- zoomy_foam.symsolver.HYPRE_CACHE#
‘Path(…)’
- zoomy_foam.symsolver.HYPRE_SCRIPT#
None
- class zoomy_foam.symsolver.Decomposition#
Bases:
zoomy_core.misc.options.OptiondecomposePar’s method for an MPI run.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- scotch#
‘scotch’
- simple#
‘simple’
- class zoomy_foam.symsolver.FoamDriver(**params)#
Bases:
param.ParameterizedFoam runtime of a C++ solver backend (
zoomy_core.symsolver.backend_cxx): build tree, case, launch, read-back.References
Weller et al. 1998, https://doi.org/10.1063/1.168744
Initialization
- nprocs#
‘Integer(…)’
- decomposition#
‘OptionParam(…)’
- build(nsm, dimension, topo=None)#
Print the solver, write the build tree and wmake it (cached by a hash of the sources).
Args
nsm: the NumericalSystemModel (or the tuple of systems of a split template)dimension: spatial dimension of the casetopo: mesh topology whose boundary-closure classes the kernels carry; None (precompile): none
Returns
Path of the
symFoambinary.
- run(mesh, model, Q0, workdir)#
Write the case (mesh, fields, stencils), launch
symFoam(mpirun -parallelfornprocs > 1) and read the result back.Args
mesh: zoomy_core meshQ0: initial state(n_state, n_cells)in the mesh orderworkdir: case directory (recreated)
Returns
(time, Q)with Q in the mesh order; the written snapshots are kept inself.snapshots.
- class zoomy_foam.symsolver.SymbolicHyperbolicSolverFoam(**params)#
Bases:
zoomy_foam.symsolver.FoamDriver,zoomy_core.symsolver.backend_cxx.CxxBackendThe explicit hyperbolic template on foam:
time, Q = solver.run(mesh, nsm, Q0, workdir).Initialization
- class zoomy_foam.symsolver.SymbolicChorinSolverFoam(**params)#
Bases:
zoomy_foam.symsolver.FoamDriver,zoomy_core.symsolver.backend_cxx.CxxChorinBackendThe Chorin projection template on foam, run with
(pred, press, corr)in place ofnsm.predis the predictor NSM on the full state,press/corrthe pressure and corrector systems of the model’s split.References
Chorin 1968, https://doi.org/10.1090/S0025-5718-1968-0242392-2
Initialization
- linear_solver#
‘OptionParam(…)’
- zoomy_foam.symsolver.hypre_prefix()#
The CPU hypre install symFoam links (
~/.cache/zoomy/hypre-cpu-3.2.0, orZOOMY_HYPRE_DIR), built first bycontainers/zoomy_amrex/build_hypre_cuda.sh cpuwhen missing.References
Falgout, Yang 2002, https://doi.org/10.1007/3-540-47789-6_66
- zoomy_foam.symsolver.restart_state(path, nprocs=1)#
The restart state
(base, name, time)atpath: a time directory ofio.save_state(<base>/[processor<k>/]<name>), or a case / checkpoint directory (its latest).