https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private 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.
 
virtual void computePDNonlocalOffDiagJacobian (unsigned int, unsigned int)
 Function to compute nonlocal contribution to the off-diagonal Jacobian at the current nodes.
 
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
 
unsigned int _ndisp
 number of displacement components
 
const std::vector< RealGradient > * _orientation
 Vector of bond in current configuration.
 
std::vector< dof_id_type > _ivardofs
 Current variable dof numbers for nodes i and j.
 
std::vector< Real > _weights
 weights used for the current element to obtain the nodal stress
 
RealGradient _current_vec
 Vector of bond in current configuration.
 
RealGradient _current_unit_vec
 Unit vector of bond in current configuration.
 
const bool _temp_coupled
 Temperature variable.
 
MooseVariable_temp_var
 
const bool _out_of_plane_strain_coupled
 Parameters for out-of-plane strain in weak plane stress formulation.
 
MooseVariable_out_of_plane_strain_var
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 

Private Attributes

FEProblemBase_dmi_fe_problem
 

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}
void mooseError(Args &&... args)
unsigned int _ndisp
number of displacement components
const bool _out_of_plane_strain_coupled
Parameters for out-of-plane strain in weak plane stress formulation.
MooseVariable * _temp_var
const std::vector< RealGradient > * _orientation
Vector of bond in current configuration.
MooseVariable * _out_of_plane_strain_var
const bool _temp_coupled
Temperature variable.
std::vector< MooseVariable * > _disp_var
displacement variables

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 ForceStabilizedSmallStrainMechanicsNOSPD, HorizonStabilizedFormIFiniteStrainMechanicsNOSPD, HorizonStabilizedFormIIFiniteStrainMechanicsNOSPD, HorizonStabilizedFormISmallStrainMechanicsNOSPD, WeakPlaneStressNOSPD, MechanicsBPD, HorizonStabilizedFormIISmallStrainMechanicsNOSPD, and MechanicsOSPD.

Definition at line 31 of file MechanicsBasePD.h.

33 {
34 }

Referenced by computeOffDiagJacobian().

◆ 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}
virtual void prepare() override
virtual void computePDNonlocalOffDiagJacobian(unsigned int, unsigned int)
Function to compute nonlocal contribution to the off-diagonal Jacobian at the current nodes.
virtual void computeLocalOffDiagJacobian(unsigned int, unsigned int)
Function to compute local contribution to the off-diagonal Jacobian at the current nodes.
unsigned int number() const

◆ 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 ForceStabilizedSmallStrainMechanicsNOSPD, HorizonStabilizedFormIFiniteStrainMechanicsNOSPD, HorizonStabilizedFormIIFiniteStrainMechanicsNOSPD, HorizonStabilizedFormIISmallStrainMechanicsNOSPD, HorizonStabilizedFormISmallStrainMechanicsNOSPD, MechanicsOSPD, and WeakPlaneStressNOSPD.

Definition at line 41 of file MechanicsBasePD.h.

43 {
44 }

Referenced by computeOffDiagJacobian().

◆ initialSetup()

void MechanicsBasePD::initialSetup ( )
overridevirtual

Definition at line 45 of file MechanicsBasePD.C.

46{
47 _orientation = &_assembly.getFE(FEType(), 1)->get_dxyzdxi();
48}

◆ prepare()

void MechanicsBasePD::prepare ( )
overridevirtual

Definition at line 51 of file MechanicsBasePD.C.

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}
RealGradient _current_unit_vec
Unit vector of bond in current configuration.
RealGradient _current_vec
Vector of bond in current configuration.
std::vector< dof_id_type > _ivardofs
Current variable dof numbers for nodes i and j.
std::vector< Real > _weights
weights used for the current element to obtain the nodal stress
virtual void prepare()
Function to precalculate data which will be used in the derived classes.

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

◆ validParams()

InputParameters MechanicsBasePD::validParams ( )
static

Definition at line 13 of file MechanicsBasePD.C.

14{
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}
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()

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

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 59 of file MechanicsBasePD.h.

Referenced by MechanicsBasePD().

◆ _orientation

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

Vector of bond in current configuration.

Definition at line 67 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: