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

Abstract WeakForm class. More...

#include <weak_form.hpp>

Public Member Functions

 WeakForm (std::string name)
 base constructor takes the name of the physics More...
 
virtual ~WeakForm ()
 destructor
 
virtual mfem::Vector residual (double time, double dt, ConstFieldPtr shape_disp, const std::vector< ConstFieldPtr > &fields, const std::vector< ConstQuadratureFieldPtr > &quad_fields={}, int block_row=0) const =0
 Virtual interface for computing the residual vector of a weak form. More...
 
virtual std::unique_ptr< mfem::HypreParMatrix > jacobian (double time, double dt, ConstFieldPtr shape_disp, const std::vector< ConstFieldPtr > &fields, const std::vector< double > &field_argument_tangents, const std::vector< ConstQuadratureFieldPtr > &quad_fields={}, int block_row=0) const =0
 Derivative of the residual with respect to specified field arguments: sum_j d{r}_i/d{fields}_j * argument_tangents[j], i is row, j are input fields (columns) More...
 
virtual void jvp (double time, double dt, ConstFieldPtr shape_disp, const std::vector< ConstFieldPtr > &fields, const std::vector< ConstQuadratureFieldPtr > &quad_fields, ConstFieldPtr v_shape_disp, const std::vector< ConstFieldPtr > &v_fields, const std::vector< ConstQuadratureFieldPtr > &v_quad_fields, const std::vector< DualFieldPtr > &jvp_reactions) const =0
 Jacobian-vector product, will overwrite any existing values in jvp_reactions. More...
 
virtual void vjp (double time, double dt, ConstFieldPtr shape_disp, const std::vector< ConstFieldPtr > &fields, const std::vector< ConstQuadratureFieldPtr > &quad_fields, const std::vector< ConstFieldPtr > &v_fields, DualFieldPtr vjp_shape_disp_sensitivity, const std::vector< DualFieldPtr > &vjp_sensitivities, const std::vector< QuadratureFieldPtr > &vjp_quadrature_sensivities) const =0
 Vector-Jacobian product, will += into existing values in vjpFields. More...
 
std::string name () const
 name
 

Detailed Description

Abstract WeakForm class.

Definition at line 36 of file weak_form.hpp.

Constructor & Destructor Documentation

◆ WeakForm()

smith::WeakForm::WeakForm ( std::string  name)
inline

base constructor takes the name of the physics

Parameters
nameprovide a name corresponding to the physics

Definition at line 41 of file weak_form.hpp.

Member Function Documentation

◆ jacobian()

virtual std::unique_ptr<mfem::HypreParMatrix> smith::WeakForm::jacobian ( double  time,
double  dt,
ConstFieldPtr  shape_disp,
const std::vector< ConstFieldPtr > &  fields,
const std::vector< double > &  field_argument_tangents,
const std::vector< ConstQuadratureFieldPtr > &  quad_fields = {},
int  block_row = 0 
) const
pure virtual

Derivative of the residual with respect to specified field arguments: sum_j d{r}_i/d{fields}_j * argument_tangents[j], i is row, j are input fields (columns)

Parameters
timetime
dttime step
shape_dispsmith::FiniteElementState*, change in model coordinates relative to the initially read in mesh
fieldsvector of smith::FiniteElementState*
field_argument_tangentsspecifies the weighting of the residual derivative with respect to each field
quad_fieldsvector of ConstQuadratureFieldPtr
block_rowspecifies which block row of the residual to compute the jacobian for the call will error if a non-zero argument_tangent weight is provided for two input fields with different sizes
Returns
std::unique_ptr<mfem::HypreParMatrix> returns sum_j d{r}_i/d{fields}_j * argument_tangents[j], where {fields}_j is the jth field, {r}_i is the ith residual block row

◆ jvp()

virtual void smith::WeakForm::jvp ( double  time,
double  dt,
ConstFieldPtr  shape_disp,
const std::vector< ConstFieldPtr > &  fields,
const std::vector< ConstQuadratureFieldPtr > &  quad_fields,
ConstFieldPtr  v_shape_disp,
const std::vector< ConstFieldPtr > &  v_fields,
const std::vector< ConstQuadratureFieldPtr > &  v_quad_fields,
const std::vector< DualFieldPtr > &  jvp_reactions 
) const
pure virtual

Jacobian-vector product, will overwrite any existing values in jvp_reactions.

Parameters
timetime
dttime step
shape_dispsmith::FiniteElementState*, change in model coordinates relative to the initially read in mesh
fieldsvector of smith::FiniteElementState*
quad_fieldsvector of ConstQuadratureFieldPtr
v_shape_dispshape_displacement tangent
v_fieldsfield tangents, right hand side 'v' fields
v_quad_fieldsquadrature_field_tangents
jvp_reactionsoutput jvps, 1 per row of a block system: d{r}_i / d{fields}_j * fieldsV[j] nullptr fieldsV are assumed to be all zero to avoid extra calculations

◆ residual()

virtual mfem::Vector smith::WeakForm::residual ( double  time,
double  dt,
ConstFieldPtr  shape_disp,
const std::vector< ConstFieldPtr > &  fields,
const std::vector< ConstQuadratureFieldPtr > &  quad_fields = {},
int  block_row = 0 
) const
pure virtual

Virtual interface for computing the residual vector of a weak form.

Parameters
timetime
dttime step
shape_dispsmith::FiniteElementState*, change in model coordinates relative to the initially read in mesh
fieldsvector of smith::FiniteElementState*
quad_fieldsvector of ConstQuadratureFieldPtr
block_rowinteger which specifies which row of a block system to get the residual for, defaults to 0
Returns
mfem::Vector

◆ vjp()

virtual void smith::WeakForm::vjp ( double  time,
double  dt,
ConstFieldPtr  shape_disp,
const std::vector< ConstFieldPtr > &  fields,
const std::vector< ConstQuadratureFieldPtr > &  quad_fields,
const std::vector< ConstFieldPtr > &  v_fields,
DualFieldPtr  vjp_shape_disp_sensitivity,
const std::vector< DualFieldPtr > &  vjp_sensitivities,
const std::vector< QuadratureFieldPtr > &  vjp_quadrature_sensivities 
) const
pure virtual

Vector-Jacobian product, will += into existing values in vjpFields.

Parameters
timetime
dttime step
shape_dispsmith::FiniteElementState*, change in model coordinates relative to the initially read in mesh
fieldsvector of smith::FiniteElementState*
quad_fieldsvector of ConstQuadratureFieldPtr
v_fieldsleft hand side 'v' fields
vjp_shape_disp_sensitivityvjp for shape_displacement: v_fields[i] * d{r}_i / d{shape_disp}
vjp_sensitivitiesoutput vjps, 1 per input field: v_fields[i] * d{r}_i / d{fields}_j
vjp_quadrature_sensivitiesoutput vjps, 1 per input quadrature field: v_fields[i] * d{r}_i / d{quadrature_field}_j

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