Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
Public Member Functions | List of all members
smith::DifferentiableSolver Class Referenceabstract

Abstract interface to DifferentiableSolver interface. Each differentiable solve should provide both its forward solve and an adjoint solve. More...

#include <differentiable_solver.hpp>

Public Member Functions

virtual ~DifferentiableSolver ()
 destructor
 
virtual void completeSetup (const smith::FiniteElementState &u)=0
 Required for certain solvers/preconditioners, e.g. when multigrid algorithms want a near null-space For these cases, it should be called before solve.
 
virtual std::shared_ptr< smith::FiniteElementStatesolve (const smith::FiniteElementState &u_guess, std::function< mfem::Vector(const smith::FiniteElementState &)> equation, std::function< std::unique_ptr< mfem::HypreParMatrix >(const smith::FiniteElementState &)> jacobian) const =0
 Solve a set of equations with a FiniteElementState as unknown. More...
 
virtual std::shared_ptr< smith::FiniteElementStatesolveAdjoint (const smith::FiniteElementDual &u_bar, std::unique_ptr< mfem::HypreParMatrix > jacobian_transposed) const =0
 Solve the (linear) adjoint set of equations with a FiniteElementState as unknown. More...
 
virtual void clearMemory () const
 Interface option to clear memory between solves to avoid high-water mark memory usage.
 

Detailed Description

Abstract interface to DifferentiableSolver interface. Each differentiable solve should provide both its forward solve and an adjoint solve.

Definition at line 37 of file differentiable_solver.hpp.

Member Function Documentation

◆ solve()

virtual std::shared_ptr<smith::FiniteElementState> smith::DifferentiableSolver::solve ( const smith::FiniteElementState u_guess,
std::function< mfem::Vector(const smith::FiniteElementState &)>  equation,
std::function< std::unique_ptr< mfem::HypreParMatrix >(const smith::FiniteElementState &)>  jacobian 
) const
pure virtual

Solve a set of equations with a FiniteElementState as unknown.

Parameters
u_guessinitial guess for solver
equationstd::function for equation to be solved
jacobianstd::function for evaluating the linearized Jacobian about the current solution
Returns
The solution FiniteElementState

Implemented in smith::NonlinearDifferentiableSolver, and smith::LinearDifferentiableSolver.

◆ solveAdjoint()

virtual std::shared_ptr<smith::FiniteElementState> smith::DifferentiableSolver::solveAdjoint ( const smith::FiniteElementDual u_bar,
std::unique_ptr< mfem::HypreParMatrix >  jacobian_transposed 
) const
pure virtual

Solve the (linear) adjoint set of equations with a FiniteElementState as unknown.

Parameters
u_barrhs for the solve
jacobian_transposedthe evaluated linearized adjoint space matrix
Returns
The adjoint solution field

Implemented in smith::NonlinearDifferentiableSolver, and smith::LinearDifferentiableSolver.


The documentation for this class was generated from the following file: