Developer Guide¶
Developing a New Physics Module¶
Developers have two workflows for creating new physics modules:
Creating a new multi-physics module from existing physics modules.
Creating a new single physics PDE simulation module.
In the first case, construct the new physics module by including existing physics modules by composition. See the Thermal solid mechanics module for an example.
For the second case, starting with an existing physics module and re-writing it as necessary is a good practice. The following steps describe creation of a new physics module:
Create a new class derived from BasePhysics.
In the constructor, create new
std::shared_ptrs
to FiniteElementStates corresponding to each state variable in your PDE.Link these states to the state pointer array in the
BasePhysics
class.Create methods for defining problem parameters (e.g. material properties and sources).
Create methods for defining boundary conditions. These should be stored as BoundaryConditions and managed in the
BasePhysics
's BoundaryConditionManager.Override the virtual
completeSetup()
method. This should include construction of all of the data structures needed for advancing the timestep of the PDE.Override the virtual
advanceTimestep()
method. This should solve the discretized PDE based on the chosen time integration method. This often requires definingmfem::Operators
to use MFEM-based nonlinear and time integration methods.
Important Data Structures¶
BasePhysics: Interface class for a generic PDE simulation module.
BoundaryCondition: Class for storage of boundary condition-related data.
BoundaryConditionManager: Storage class for related boundary conditions.
EquationSolver: Class for solving nonlinear and linear systems of equations.
FiniteElementState: Data structure describing a solution field and its underlying finite element discretization.
Source Code Documentation¶
Doxygen documentation for the Serac source code is located in the Doxygen directory.