Serac can be used either by providing input files to the main executable or through a C++ API. Example lua input files are located in the data directory and examples of how to use the C++ API are located in the tests directory.
Physics Module C++ Interface¶
A fundamental data structure in Serac is BasePhysics. Classes derived from
BasePhysics are expected to encapsulate a specific partial differential equation and all of the state data and parameters associated with it. Currently, Serac contains the following physics modules:
If you would like to include Serac's simulation capabilities in your software project, these are the classes to include. To set up and use a physics module:
- Construct the appropriate physics module class using a
mfem::ParMeshand a polynomial order of approximation.
- Set the material properties via
- Set the boundary conditions via a
std::setof boundary attributes and a
- Set the right hand side source terms (e.g. body forces).
- Set the time integration scheme (e.g. quasi-static or backward Euler). Note that not all time integrators are available for all physics modules.
- Complete the setup of the physics module by calling
completeSetup(). This allocates and builds all of the underlying linear algebra data structures.
- Advance the timestep by calling
- Output the state variables in VisIt, and optionally ParaView, format by calling
outputState(). You can also access the underlying state data via the generic
getState()or physics-specific calls (e.g.