Files here are called during a live FlowSim simulation. Grouped by role in
the pipeline. All four subdirs are added to the MATLAB path by
flowsim_init.m via genpath.
🇧🇷 Versao em portugues:
runtime/LEIAME.md
runtime/
├── preproc/ mesh + method preprocessing (called once per run)
├── time/ time-stepping drivers (called once per timestep)
├── plug/ PLUG_* callbacks (called every substep — the "hot" plane)
└── util/ helpers reused across the pipeline
| File | Called by | Role |
|---|---|---|
preprocessormod.m |
main.m |
reads Start.dat, builds env.geometry from .msh |
preprocessmethod.m |
main.m |
per-pmethod premethod struct setup |
preRE.m |
hydraulic_RE |
Richards-specific preprocessing |
preSaturation.m |
IMPES |
saturation-specific preprocessing |
preconcentration.m |
IMPEC |
concentration-specific preprocessing |
| File | phasekey | Role |
|---|---|---|
setmethod.m |
(any) | dispatch to the phasekey-appropriate driver |
hydraulic.m |
4 | steady groundwater / hydraulic-head solver |
hydraulic_RE.m |
6 | Richards equation transient solver |
IMPES.m |
1 | Implicit Pressure Explicit Saturation |
IMPEC.m |
5 | Implicit Pressure Explicit Concentration |
IMHEC.m |
— | variant (hydraulic-head + concentration) |
These are the physics plugins — replace one to change the physics without
touching the time driver. All accept (env, parms, tempo) and return the
scalar / matrix the driver needs for the current substep.
| File | Callback for | Returns |
|---|---|---|
PLUG_kfunction.m |
permeability tensor | env.config.kmap for current h |
PLUG_bcfunction.m |
pressure BC | env.config.nflag, nflagface |
PLUG_bcfunction_con.m |
concentration BC | ditto (for tracers) |
PLUG_bcfunction_con_mpfa_o_fps.m |
MPFA-O concentration BC | ditto |
PLUG_sourcefunction.m |
source term (wells, injection) | element-wise source |
PLUG_dfunction.m |
dispersion / diffusion | tensor |
PLUG_Gfunction.m |
gravity | element-wise vector |
| File | Role |
|---|---|
solver.m |
linear-system solve wrapper (backslash + preconditioner options) |
solvePressure.m / solvePressure_TPFA.m |
pressure-eq wrapper |
solveSaturation.m |
saturation-eq wrapper |
addsource.m |
inserts wells/source terms into the assembled system |
postprocessor.m |
writes VTK / TecPlot / mat output |
plotandwrite.m / plotandwrite_pressfield.m |
plot + persist result fields |
soil_properties.m |
Richards dtheta/dt accumulation term |
thetafunction.m / theta_n.m |
Richards water-content models |
gravitation.m / calcnormk.m |
gravity + permeability norm helpers |
applyinicialcond.m / attribinitialcond.m / IC.m |
initial-condition setup |
setrestartinicond.m / getrestartdata.m |
restart-file handling |
defineWells.m |
well-source definition helper |
benchmark.m |
benchmark utility (bench identifier lookup) |
flowsim_init.m adds paths in this order (later = higher precedence):
+fs/— vectorized packages (highest precedence — shadow legacy)base/,solvers/,factories/,simulacoes/,benchmarks/— OOP contractruntime/**(this tree, viagenpath)legacy/**— legacy fallbacks (lowest precedence)
If a symbol exists both in +fs/… and in legacy/…, MATLAB resolves to the
+fs/ version because it comes earlier on the path.
Files here are the live copies used at runtime. Their vectorized twins
(where they exist) live in +fs/ and shadow them transparently. Files
that are shadowed and still called from here are:
preprocessmethod→ callsfs.lpew.v2.preLPEW2(transparent shadow offerncodes_Pre_LPEW_2_vect) when+fs/is on the path- Assembly calls hit
fs.assembly.<pmethod>.buildfirst; formpfadandtpfathese are fully vectorized, others delegate to legacy
../README.md— repository-level overview../docs/code-map.md— function-level "where does X live?" table../docs/vectorization-guide.md— recipe for extending+fs/../legacy/README.md— index of legacy clusters