https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
MechanicsBasePD Class Reference

Base kernel class for peridynamic solid mechanics models. More...

#include <MechanicsBasePD.h>

Inheritance diagram for MechanicsBasePD:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 MechanicsBasePD (const InputParameters &parameters)
 
virtual void computeOffDiagJacobian (unsigned int jvar) override
 
virtual void computeLocalOffDiagJacobian (unsigned int, unsigned int)
 Function to compute local contribution to the off-diagonal Jacobian at the current nodes. More...
 
virtual void computePDNonlocalOffDiagJacobian (unsigned int, unsigned int)
 Function to compute nonlocal contribution to the off-diagonal Jacobian at the current nodes. More...
 
virtual void initialSetup () override
 
virtual void prepare () override
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Attributes

std::vector< MooseVariable * > _disp_var
 displacement variables More...
 
unsigned int _ndisp
 number of displacement components More...
 
const std::vector< RealGradient > * _orientation
 Vector of bond in current configuration. More...
 
std::vector< dof_id_type_ivardofs
 Current variable dof numbers for nodes i and j. More...
 
std::vector< Real_weights
 weights used for the current element to obtain the nodal stress More...
 
RealGradient _current_vec
 Vector of bond in current configuration. More...
 
RealGradient _current_unit_vec
 Unit vector of bond in current configuration. More...
 
const bool _temp_coupled
 Temperature variable. More...
 
MooseVariable_temp_var
 
const bool _out_of_plane_strain_coupled
 Parameters for out-of-plane strain in weak plane stress formulation. More...
 
MooseVariable_out_of_plane_strain_var
 

Detailed Description

Base kernel class for peridynamic solid mechanics models.

Definition at line 18 of file MechanicsBasePD.h.

Constructor & Destructor Documentation

◆ MechanicsBasePD()

MechanicsBasePD::MechanicsBasePD ( const InputParameters parameters)

Definition at line 27 of file MechanicsBasePD.C.

29  _temp_coupled(isCoupled("temperature")),
30  _temp_var(_temp_coupled ? getVar("temperature", 0) : nullptr),
31  _ndisp(coupledComponents("displacements")),
32  _out_of_plane_strain_coupled(isCoupled("out_of_plane_strain")),
33  _out_of_plane_strain_var(_out_of_plane_strain_coupled ? getVar("out_of_plane_strain", 0)
34  : nullptr),
35  _orientation(nullptr)
36 {
37  if (_ndisp != _dim)
38  mooseError("Number of displacements should be consistent with mesh dimension!");
39 
40  for (unsigned int i = 0; i < _ndisp; ++i)
41  _disp_var.push_back(getVar("displacements", i));
42 }
const bool _temp_coupled
Temperature variable.
void mooseError(Args &&... args)
const bool _out_of_plane_strain_coupled
Parameters for out-of-plane strain in weak plane stress formulation.
unsigned int _ndisp
number of displacement components
std::vector< MooseVariable * > _disp_var
displacement variables
MooseVariable * _out_of_plane_strain_var
const std::vector< RealGradient > * _orientation
Vector of bond in current configuration.
MooseVariable * _temp_var

Member Function Documentation

◆ computeLocalOffDiagJacobian()

virtual void MechanicsBasePD::computeLocalOffDiagJacobian ( unsigned int  ,
unsigned int   
)
inlinevirtual

Function to compute local contribution to the off-diagonal Jacobian at the current nodes.

Parameters
coupled_componentThe coupled variable number

Reimplemented in HorizonStabilizedFormIIFiniteStrainMechanicsNOSPD, HorizonStabilizedFormIISmallStrainMechanicsNOSPD, HorizonStabilizedFormIFiniteStrainMechanicsNOSPD, HorizonStabilizedFormISmallStrainMechanicsNOSPD, MechanicsOSPD, ForceStabilizedSmallStrainMechanicsNOSPD, MechanicsBPD, and WeakPlaneStressNOSPD.

Definition at line 31 of file MechanicsBasePD.h.

Referenced by computeOffDiagJacobian().

32  {};

◆ computeOffDiagJacobian()

void MechanicsBasePD::computeOffDiagJacobian ( unsigned int  jvar)
overridevirtual

Definition at line 73 of file MechanicsBasePD.C.

74 {
75  prepare();
76 
77  if (jvar_num == _var.number())
78  computeJacobian();
79  else
80  {
81  unsigned int coupled_component = 0;
82  bool active = false;
83 
84  for (unsigned int i = 0; i < _dim; ++i)
85  if (jvar_num == _disp_var[i]->number())
86  {
87  coupled_component = i;
88  active = true;
89  }
90 
91  if (_temp_coupled && jvar_num == _temp_var->number())
92  active = true;
93 
95  active = true;
96 
97  if (active)
98  {
99  prepareMatrixTag(_assembly, _var.number(), jvar_num);
100  computeLocalOffDiagJacobian(jvar_num, coupled_component);
101  accumulateTaggedLocalMatrix();
102 
103  if (_use_full_jacobian)
104  computePDNonlocalOffDiagJacobian(jvar_num, coupled_component);
105  }
106  }
107 }
const bool _temp_coupled
Temperature variable.
unsigned int number() const
virtual void computeLocalOffDiagJacobian(unsigned int, unsigned int)
Function to compute local contribution to the off-diagonal Jacobian at the current nodes...
const bool _out_of_plane_strain_coupled
Parameters for out-of-plane strain in weak plane stress formulation.
std::vector< MooseVariable * > _disp_var
displacement variables
virtual void prepare() override
MooseVariable * _out_of_plane_strain_var
virtual void computePDNonlocalOffDiagJacobian(unsigned int, unsigned int)
Function to compute nonlocal contribution to the off-diagonal Jacobian at the current nodes...
MooseVariable * _temp_var

◆ computePDNonlocalOffDiagJacobian()

virtual void MechanicsBasePD::computePDNonlocalOffDiagJacobian ( unsigned int  ,
unsigned int   
)
inlinevirtual

Function to compute nonlocal contribution to the off-diagonal Jacobian at the current nodes.

Parameters
jvar_numThe number of the first coupled variable
coupled_componentThe component number of the second coupled variable

Reimplemented in HorizonStabilizedFormIIFiniteStrainMechanicsNOSPD, HorizonStabilizedFormIISmallStrainMechanicsNOSPD, HorizonStabilizedFormIFiniteStrainMechanicsNOSPD, HorizonStabilizedFormISmallStrainMechanicsNOSPD, MechanicsOSPD, ForceStabilizedSmallStrainMechanicsNOSPD, and WeakPlaneStressNOSPD.

Definition at line 39 of file MechanicsBasePD.h.

Referenced by computeOffDiagJacobian().

40  {};

◆ initialSetup()

void MechanicsBasePD::initialSetup ( )
overridevirtual

Definition at line 45 of file MechanicsBasePD.C.

46 {
47  _orientation = &_assembly.getFE(FEType(), 1)->get_dxyzdxi();
48 }
const std::vector< RealGradient > * _orientation
Vector of bond in current configuration.

◆ prepare()

void MechanicsBasePD::prepare ( )
overridevirtual

Definition at line 51 of file MechanicsBasePD.C.

Referenced by computeOffDiagJacobian(), GeneralizedPlaneStrainOffDiagNOSPD::computeOffDiagJacobianScalar(), and GeneralizedPlaneStrainOffDiagOSPD::computeOffDiagJacobianScalar().

52 {
54 
55  _ivardofs.resize(_nnodes);
56  _weights.resize(_nnodes);
57  for (unsigned int nd = 0; nd < _nnodes; ++nd)
58  {
59  _ivardofs[nd] = _current_elem->node_ptr(nd)->dof_number(_sys.number(), _var.number(), 0);
60  _weights[nd] = _pdmesh.getNeighborWeight(
61  _current_elem->node_id(nd),
62  _pdmesh.getNeighborIndex(_current_elem->node_id(nd), _current_elem->node_id(1 - nd)));
63  }
64 
65  for (unsigned int i = 0; i < _dim; ++i)
66  _current_vec(i) = _origin_vec(i) + _disp_var[i]->getNodalValue(*_current_elem->node_ptr(1)) -
67  _disp_var[i]->getNodalValue(*_current_elem->node_ptr(0));
68 
70 }
auto norm() const -> decltype(std::norm(Real()))
RealGradient _current_unit_vec
Unit vector of bond in current configuration.
std::vector< Real > _weights
weights used for the current element to obtain the nodal stress
std::vector< MooseVariable * > _disp_var
displacement variables
RealGradient _current_vec
Vector of bond in current configuration.
std::vector< dof_id_type > _ivardofs
Current variable dof numbers for nodes i and j.
virtual void prepare()
Function to precalculate data which will be used in the derived classes.

◆ validParams()

InputParameters MechanicsBasePD::validParams ( )
static

Definition at line 13 of file MechanicsBasePD.C.

Referenced by MechanicsBaseNOSPD::validParams(), MechanicsOSPD::validParams(), MechanicsBPD::validParams(), and GeneralizedPlaneStrainOffDiagOSPD::validParams().

14 {
16  params.addClassDescription(
17  "Base class for calculating the residual and Jacobian for the peridynamic mechanic kernels");
18 
19  params.addCoupledVar("temperature", "Nonlinear variable name for the temperature");
20  params.addCoupledVar("out_of_plane_strain",
21  "Nonlinear variable name for the out_of_plane strain for "
22  "plane stress analysis using NOSPD formulation");
23 
24  return params;
25 }
static InputParameters validParams()
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _current_unit_vec

RealGradient MechanicsBasePD::_current_unit_vec
protected

◆ _current_vec

RealGradient MechanicsBasePD::_current_vec
protected

◆ _disp_var

std::vector<MooseVariable *> MechanicsBasePD::_disp_var
protected

◆ _ivardofs

std::vector<dof_id_type> MechanicsBasePD::_ivardofs
protected

◆ _ndisp

unsigned int MechanicsBasePD::_ndisp
protected

number of displacement components

Definition at line 55 of file MechanicsBasePD.h.

Referenced by MechanicsBasePD().

◆ _orientation

const std::vector<RealGradient>* MechanicsBasePD::_orientation
protected

Vector of bond in current configuration.

Definition at line 63 of file MechanicsBasePD.h.

Referenced by initialSetup().

◆ _out_of_plane_strain_coupled

const bool MechanicsBasePD::_out_of_plane_strain_coupled
protected

◆ _out_of_plane_strain_var

MooseVariable* MechanicsBasePD::_out_of_plane_strain_var
protected

◆ _temp_coupled

const bool MechanicsBasePD::_temp_coupled
protected

◆ _temp_var

MooseVariable* MechanicsBasePD::_temp_var
protected

◆ _weights

std::vector<Real> MechanicsBasePD::_weights
protected

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