17 "Base class for calculating the residual and Jacobian for the peridynamic mechanic kernels");
19 params.
addCoupledVar(
"temperature",
"Nonlinear variable name for the temperature");
21 "Nonlinear variable name for the out_of_plane strain for "
22 "plane stress analysis using NOSPD formulation");
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)
38 mooseError(
"Number of displacements should be consistent with mesh dimension!");
40 for (
unsigned int i = 0; i <
_ndisp; ++i)
41 _disp_var.push_back(getVar(
"displacements", i));
47 _orientation = &_assembly.getFE(FEType(), 1)->get_dxyzdxi();
57 for (
unsigned int nd = 0; nd < _nnodes; ++nd)
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)));
65 for (
unsigned int i = 0; i < _dim; ++i)
67 _disp_var[i]->getNodalValue(*_current_elem->node_ptr(0));
77 if (jvar_num == _var.number())
81 unsigned int coupled_component = 0;
84 for (
unsigned int i = 0; i < _dim; ++i)
87 coupled_component = i;
99 prepareMatrixTag(_assembly, _var.number(), jvar_num);
101 accumulateTaggedLocalMatrix();
103 if (_use_full_jacobian)
void mooseError(Args &&... args)
MechanicsBasePD(const InputParameters ¶meters)
unsigned int _ndisp
number of displacement components
static InputParameters validParams()
const bool _out_of_plane_strain_coupled
Parameters for out-of-plane strain in weak plane stress formulation.
virtual void prepare() override
virtual void computeOffDiagJacobian(unsigned int jvar) override
MooseVariable * _temp_var
virtual void computePDNonlocalOffDiagJacobian(unsigned int, unsigned int)
Function to compute nonlocal contribution to the off-diagonal Jacobian at the current nodes.
const std::vector< RealGradient > * _orientation
Vector of bond in current configuration.
RealGradient _current_unit_vec
Unit vector of bond in current configuration.
MooseVariable * _out_of_plane_strain_var
virtual void initialSetup() override
RealGradient _current_vec
Vector of bond in current configuration.
virtual void computeLocalOffDiagJacobian(unsigned int, unsigned int)
Function to compute local contribution to the off-diagonal Jacobian at the current nodes.
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
const bool _temp_coupled
Temperature variable.
std::vector< MooseVariable * > _disp_var
displacement variables
unsigned int number() const
Base kernel class for peridynamic models.
static InputParameters validParams()
virtual void prepare()
Function to precalculate data which will be used in the derived classes.