![]() |
MFEM v4.10.0
Finite element discretization library
|
Abstract class for PETSc's ODE solvers. More...
#include <petsc.hpp>
Public Types | |
| enum | Type { ODE_SOLVER_LINEAR , ODE_SOLVER_GENERAL } |
Public Member Functions | |
| PetscODESolver (MPI_Comm comm, const std::string &prefix=std::string()) | |
| virtual | ~PetscODESolver () |
| virtual void | Init (TimeDependentOperator &f_, enum PetscODESolver::Type type) |
| Initialize the ODE solver. | |
| virtual void | Init (TimeDependentOperator &f_) |
| Associate a TimeDependentOperator with the ODE solver. | |
| void | SetType (PetscODESolver::Type) |
| PetscODESolver::Type | GetType () const |
| void | SetJacobianType (Operator::Type type) |
| virtual void | Step (Vector &x, real_t &t, real_t &dt) |
| Perform a time step from time t [in] to time t [out] based on the requested step size dt [in]. | |
| virtual void | Run (Vector &x, real_t &t, real_t &dt, real_t t_final) |
| Perform time integration from time t [in] to time tf [in]. | |
| operator petsc::TS () const | |
| Conversion function to PETSc's TS type. | |
Public Member Functions inherited from mfem::PetscSolver | |
| PetscSolver () | |
| Construct an empty PetscSolver. Initialize protected objects to NULL. | |
| virtual | ~PetscSolver () |
| Destroy the PetscParVectors allocated (if any). | |
| void | Customize (bool customize=true) const |
| Customize object with options set. | |
| int | GetConverged () |
| int | GetNumIterations () |
| real_t | GetFinalNorm () |
| void | SetMonitor (PetscSolverMonitor *ctx) |
| Sets user-defined monitoring routine. | |
| void | SetBCHandler (PetscBCHandler *bch) |
| Sets the object to handle essential boundary conditions. | |
| void | SetPreconditionerFactory (PetscPreconditionerFactory *factory) |
| Sets the object for the creation of the preconditioner. | |
| operator PetscObject () const | |
| Conversion function to PetscObject. | |
| MPI_Comm | GetComm () const |
| Get the associated MPI communicator. | |
| void | SetTol (real_t tol) |
| void | SetRelTol (real_t tol) |
| void | SetAbsTol (real_t tol) |
| void | SetMaxIter (int max_iter) |
| void | SetPrintLevel (int plev) |
Public Member Functions inherited from mfem::ODESolver | |
| ODESolver () | |
| virtual int | GetStateSize () |
| Returns how many State vectors the ODE requires. | |
| virtual bool | SupportsImplicitVariableType (ImplicitVariableType var) const |
| Returns true if the ODESolver supports the given ImplicitVariableType, var, and returns false otherwise. Default implementation returns true if var is ImplicitVariableType::SLOPE and false otherwise. | |
| void | SetImplicitVariableType (const ImplicitVariableType variable_type) |
| Sets the ImplicitVariableType for the TimeDependentOperator, if supported. | |
| virtual void | ComputeSlopeFromState (const real_t dt, const Vector &u, Vector &k) |
| Compute the finite-difference slope, \(\frac{du}{dt} \approx \frac{u(t+dt)-u(t)}{dt}\), and store it in k. | |
| virtual | ~ODESolver () |
Additional Inherited Members | |
Static Public Member Functions inherited from mfem::ODESolver | |
| static MFEM_EXPORT std::unique_ptr< ODESolver > | Select (const int ode_solver_type) |
| static MFEM_EXPORT std::unique_ptr< ODESolver > | SelectExplicit (const int ode_solver_type) |
| static MFEM_EXPORT std::unique_ptr< ODESolver > | SelectImplicit (const int ode_solver_type) |
| static MFEM_EXPORT std::unique_ptr< ODESolver > | SelectIMEX (const int ode_solver_type) |
Static Public Attributes inherited from mfem::ODESolver | |
| static MFEM_EXPORT std::string | ExplicitTypes |
| static MFEM_EXPORT std::string | ImplicitTypes |
| static MFEM_EXPORT std::string | IMEXTypes |
| static MFEM_EXPORT std::string | Types |
Protected Types inherited from mfem::ODESolver | |
| using | ImplicitVariableType = TimeDependentOperator::ImplicitVariableType |
Protected Member Functions inherited from mfem::PetscSolver | |
| void | CreatePrivateContext () |
| void | FreePrivateContext () |
Protected Attributes inherited from mfem::PetscSolver | |
| bool | clcustom |
| Boolean to handle SetFromOptions calls. | |
| PetscObject | obj |
| The actual PETSc object (KSP, PC, SNES or TS). | |
| PetscClassId | cid |
| The class id of the actual PETSc object. | |
| PetscParVector * | B |
| Right-hand side and solution vector. | |
| PetscParVector * | X |
| PetscBCHandler * | bchandler |
| Handler for boundary conditions. | |
| void * | private_ctx |
| Private context for solver. | |
| bool | operatorset |
| Boolean to handle SetOperator calls. | |
Protected Attributes inherited from mfem::ODESolver | |
| TimeDependentOperator * | f |
| Pointer to the associated TimeDependentOperator. | |
| MemoryType | mem_type |
| mfem::PetscODESolver::PetscODESolver | ( | MPI_Comm | comm, |
| const std::string & | prefix = std::string() ) |
| PetscODESolver::Type mfem::PetscODESolver::GetType | ( | ) | const |
|
inlinevirtual |
Associate a TimeDependentOperator with the ODE solver.
This method has to be called:
Reimplemented from mfem::ODESolver.
|
virtual |
|
inline |
|
virtual |
Perform time integration from time t [in] to time tf [in].
| [in,out] | x | Approximate solution. |
| [in,out] | t | Time associated with the approximate solution x. |
| [in,out] | dt | Time step size. |
| [in] | tf | Requested final time. |
The default implementation makes consecutive calls to Step() until reaching tf. The following rules describe the common behavior of the method:
Reimplemented from mfem::ODESolver.
| void mfem::PetscODESolver::SetJacobianType | ( | Operator::Type | type | ) |
Specifies the desired format of the Jacobian in case a PetscParMatrix is not returned by the GetGradient methods
| void mfem::PetscODESolver::SetType | ( | PetscODESolver::Type | type | ) |
Perform a time step from time t [in] to time t [out] based on the requested step size dt [in].
| [in,out] | x | Approximate solution. |
| [in,out] | t | Time associated with the approximate solution x. |
| [in,out] | dt | Time step size. |
The following rules describe the common behavior of the method:
Implements mfem::ODESolver.