24 namespace smith::mfem_ext {
113 void Mult(
const mfem::Vector& u,
const mfem::Vector& du_dt, mfem::Vector& d2u_dt2)
const override
115 Solve(t, 0.0, 0.0, u, du_dt, d2u_dt2);
127 void ImplicitSolve(
const double c0,
const double c1,
const mfem::Vector& u,
const mfem::Vector& du_dt,
128 mfem::Vector& d2u_dt2)
override
130 Solve(t, c0, c1, u, du_dt, d2u_dt2);
136 void ImplicitSolve(
const double dt,
const mfem::Vector& u, mfem::Vector& du_dt)
override;
161 void Step(mfem::Vector& x, mfem::Vector& dxdt,
double& time,
double& dt);
187 void Solve(
const double time,
const double c0,
const double c1,
const mfem::Vector& u,
const mfem::Vector& du_dt,
188 mfem::Vector& d2u_dt2)
const;
205 std::unique_ptr<mfem::SecondOrderODESolver> second_order_ode_solver_;
210 std::unique_ptr<mfem::ODESolver> first_order_system_ode_solver_;
221 mutable mfem::Vector U_minus_;
222 mutable mfem::Vector U_;
223 mutable mfem::Vector U_plus_;
224 mutable mfem::Vector dU_dt_;
225 mutable mfem::Vector d2U_dt2_;
310 void Mult(
const mfem::Vector& u, mfem::Vector& du_dt)
const { Solve(t, 0.0, u, du_dt); }
319 void ImplicitSolve(
const double dt,
const mfem::Vector& u, mfem::Vector& du_dt) { Solve(t, dt, u, du_dt); }
343 void Step(mfem::Vector& x,
double& time,
double& dt)
346 ode_solver_->Step(x, time, dt);
348 SLIC_ERROR(
"ode_solver_ unspecified");
367 virtual void Solve(
const double time,
const double dt,
const mfem::Vector& u, mfem::Vector& du_dt)
const;
385 std::unique_ptr<mfem::ODESolver> ode_solver_;
395 mutable mfem::Vector U_minus_;
396 mutable mfem::Vector U_;
397 mutable mfem::Vector U_plus_;
398 mutable mfem::Vector dU_dt_;
This file contains the declaration of the boundary condition manager class.
A container for the boundary condition information relating to a specific physics module.
This class manages the objects typically required to solve a nonlinear set of equations arising from ...
FirstOrderODE is a class wrapping mfem::TimeDependentOperator so that the user can use std::function ...
FirstOrderODE(int n, FirstOrderODE::State &&state, const EquationSolver &solver, const BoundaryConditionManager &bcs)
Constructor defining the size and specific system of ordinary differential equations to be solved.
static constexpr double epsilon
a small number used to compute finite difference approximations to time derivatives of boundary condi...
void ImplicitSolve(const double dt, const mfem::Vector &u, mfem::Vector &du_dt)
Solves the equation du_dt = f(u + dt * du_dt, t)
void SetEnforcementMethod(const DirichletEnforcementMethod method)
Configures the Dirichlet enforcement method to use.
void Mult(const mfem::Vector &u, mfem::Vector &du_dt) const
Solves the equation du_dt = f(u, t)
void Step(mfem::Vector &x, double &time, double &dt)
Performs a time step.
TimestepMethod GetTimestepper()
Query the timestep method for the ode solver.
void SetTimestepper(const smith::TimestepMethod timestepper)
Set the time integration method.
SecondOrderODE is a class wrapping mfem::SecondOrderTimeDependentOperator so that the user can use st...
void ImplicitSolve(const double c0, const double c1, const mfem::Vector &u, const mfem::Vector &du_dt, mfem::Vector &d2u_dt2) override
Solves the equation d2u_dt2 = f(u + c0 * d2u_dt2, du_dt + c1 * d2u_dt2, t)
SecondOrderODE(int n, State &&state, const EquationSolver &solver, const BoundaryConditionManager &bcs)
Constructor defining the size and specific system of ordinary differential equations to be solved.
void SetTimestepper(const smith::TimestepMethod timestepper)
Set the time integration method.
TimestepMethod GetTimestepper()
Query the timestep method for the ode solver.
void Step(mfem::Vector &x, mfem::Vector &dxdt, double &time, double &dt)
Performs a time step.
static constexpr double epsilon
a small number used to compute finite difference approximations to time derivatives of boundary condi...
void SetEnforcementMethod(const DirichletEnforcementMethod method)
Configures the Dirichlet enforcement method to use.
const State & GetState()
Get a reference to the current state.
void Mult(const mfem::Vector &u, const mfem::Vector &du_dt, mfem::Vector &d2u_dt2) const override
Solves the equation d2u_dt2 = f(u, du_dt, t)
This file contains the declaration of an equation solver wrapper.
TimestepMethod
Timestep method of a solver.
DirichletEnforcementMethod
this enum describes which way to enforce the time-varying constraint u(t) == U(t)
This file contains enumerations and record types for physics solver configuration.
A set of references to physics-module-owned variables used by the residual operator.
double & previous_dt
Previous value of dt.
mfem::Vector & u
Predicted true DOFs.
double & time
Time value at which the ODE solver wants to compute a residual.
mfem::Vector & du_dt
Previous value of du_dt.
double & dt
Current time step.
A set of references to physics-module-owned variables used by the residual operator.
double & c0
coefficient used to calculate updated displacement: u_{n + 1} := u + c0 * d2u_dt2
mfem::Vector & du_dt
Predicted du_dt.
mfem::Vector & u
Predicted true DOFs.
mfem::Vector & d2u_dt2
Previous value of d^2u_dt^2.
double & c1
coefficient used to calculate updated velocity: du_dt_{n+1} := du_dt + c1 * d2u_dt2
double & time
Time value at which the ODE solver wants to compute a residual.