Text2Code Applications¶
Text2Code lets users describe an Exasim PDE application with plain text files and generate the backend inputs and model kernels needed to run a solver. The two primary files are:
pdeapp.txt: application, mesh, discretization, solver, runtime, and output configuration.pdemodel.txt: symbolic PDE model definitions such as fluxes, source terms, boundary terms, initial conditions, visualization fields, and QoI integrands.
Use Text2Code when you want a frontend-free workflow, a reproducible text input deck, or a compact application description that can be moved to an HPC system without MATLAB, Python, or Julia.
Workflow¶
flowchart TD
A["pdeapp.txt and pdemodel.txt"] --> T["Text2Code"]
T --> F["Exasim model code and input files"]
F --> P["Preprocessing data"]
P --> G["Code generation"]
G --> C["Compilation"]
C --> E["Execution"]
E --> O["Postprocessing"]
In practice, /path/to/exasim-prefix/local/bin/text2code pdeapp.txt parses both
text files, builds mesh/master and decomposition data, optionally generates
model C++ kernels, and writes the binary datain/ bundle used by Exasim
applications.
When To Use Text2Code¶
Text2Code is useful when:
- you want all PDE and solver configuration in version-controlled text files;
- you want to run on a cluster without installing frontend languages;
- you want a reproducible app input deck for regression testing;
- you need to generate a built-in or external model from symbolic equations;
- you want parameter sweeps controlled by runtime input files.
Interactive MATLAB, Python, and Julia workflows remain the better choice when you need exploratory scripting, frontend mesh utilities, or rapid plotting.
Section Roadmap¶
- pdeapp.txt guide: how to configure applications, solvers, execution modes, sweeps, outputs, and HPC settings.
- pdemodel.txt guide: how to write symbolic PDE models, callbacks, variables, and generated outputs.
- Physics Models: how to choose
ModelC,ModelD, orModelW, and how auxiliary variables, EOS, AV, and coupling map to Text2Code functions. - PDE modeling guide: practical model-building examples.
- Application setup guide: steady, transient, MPI, GPU, parameter sweep, restart, and postprocessing configurations.
- Workflow and troubleshooting: how to run
text2code, inspect generated artifacts, and debug common failures. - Advanced topics: multiphysics, parameterized models, HPC workflows, coupling, and language extension guidance.
- Reference gateway: links to complete keyword and grammar references.
Minimal Example¶
From a source tree with Exasim installed under /path/to/exasim-prefix, a
complete Text2Code-generated app workflow is:
cd apps/navierstokes/naca0012steady
/path/to/exasim-prefix/local/bin/text2code pdeapp.txt
cmake -S . -B build -DExasim_DIR=/path/to/exasim-prefix
cmake --build build -j
build/exasimapp datain/ dataout/out
This sequence:
- reads
pdeapp.txtand discoverspdemodel.txt; - writes or updates
datain/; - generates model code when requested by the app file;
- configures and builds the standalone
exasimapp; - runs the app with
datain/as input anddataout/outas the output prefix.
For a smaller scalar example, use apps/poisson/poisson2d with the same command
pattern.
Relationship To Other Exasim Documentation¶
- Frontend preprocessing explains the related
frontend path from
pde,mesh, andpdemodelobjects to backend files. - pdemodel abstraction explains the host-language
equivalent of
pdemodel.txt. - pdeapp.txt fields is the complete keyword reference.
- pdemodel.txt syntax is the complete DSL reference.
- Parameter sweeps covers shared sweep output semantics.
- Postprocessing covers solve-time and standalone postprocessing.