20 "Class for calculating the residual and Jacobian for the force-stabilized peridynamic " 21 "correspondence model under small strain assumptions");
25 "An integer corresponding to the variable this kernel acts on (0 for x, 1 for y, 2 for z)");
33 _sf_coeff(getMaterialProperty<
Real>(
"stabilization_force_coeff")),
34 _component(getParam<unsigned
int>(
"component"))
52 for (
unsigned int nd = 0; nd < _nnodes; ++nd)
53 for (
unsigned int i = 0; i < _nnodes; ++i)
54 _local_re(i) += (i == 0 ? -1 : 1) *
_multi[nd] *
59 _local_re(0) += -sforce;
60 _local_re(1) += sforce;
67 for (
unsigned int i = 0; i < _nnodes; ++i)
68 for (
unsigned int j = 0;
j < _nnodes; ++
j)
69 _local_ke(i,
j) += (i == 0 ? -1 : 1) *
_multi[
j] *
71 _origin_vec * _bond_status;
75 for (
unsigned int i = 0; i < _nnodes; ++i)
76 for (
unsigned int j = 0;
j < _nnodes; ++
j)
77 _local_ke(i,
j) += (i ==
j ? 1 : -1) * diag * _bond_status;
84 for (
unsigned int nd = 0; nd < _nnodes; ++nd)
87 std::vector<dof_id_type> ivardofs(_nnodes);
88 ivardofs[0] = _current_elem->node_ptr(nd)->dof_number(_sys.number(), _var.number(), 0);
89 std::vector<dof_id_type> neighbors = _pdmesh.getNeighbors(_current_elem->node_id(nd));
90 std::vector<dof_id_type> bonds = _pdmesh.getBonds(_current_elem->node_id(nd));
96 for (
unsigned int nb = 0; nb < neighbors.size(); ++nb)
97 if (_bond_status_var->getElementalValue(_pdmesh.elemPtr(bonds[nb])) > 0.5)
99 Node * neighbor_nb = _pdmesh.nodePtr(neighbors[nb]);
100 ivardofs[1] = neighbor_nb->dof_number(_sys.number(), _var.number(), 0);
101 vol_nb = _pdmesh.getNodeVolume(neighbors[nb]);
104 origin_vec_nb = _pdmesh.getNodeCoord(neighbor_nb->id()) -
105 _pdmesh.getNodeCoord(_current_elem->node_id(nd));
108 for (
unsigned int i = 0; i < _dim; ++i)
110 vol_nb * _horizon_radius[nd] / origin_vec_nb.
norm() * origin_vec_nb(i);
112 dFdUk *=
_shape2[nd].inverse();
116 for (
unsigned int i = 0; i < _nnodes; ++i)
117 for (
unsigned int j = 0;
j < _nnodes; ++
j)
118 _local_ke(i,
j) = (i == 0 ? -1 : 1) * (
j == 0 ? 0 : 1) *
_multi[nd] *
122 addJacobian(_assembly, _local_ke,
_ivardofs, ivardofs, _var.scalingFactor());
124 if (_has_diag_save_in)
126 unsigned int rows = _nnodes;
127 DenseVector<Real> diag(rows);
128 for (
unsigned int i = 0; i < rows; ++i)
129 diag(i) = _local_ke(i, i);
131 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
132 for (
unsigned int i = 0; i < _diag_save_in.size(); ++i)
133 _diag_save_in[i]->sys().solution().add_vector(diag, _diag_save_in[i]->dofIndices());
141 unsigned int jvar_num,
unsigned int coupled_component)
146 std::vector<RankTwoTensor> dSdT(_nnodes);
147 for (
unsigned int nd = 0; nd < _nnodes; ++nd)
151 for (
unsigned int i = 0; i < _nnodes; ++i)
152 for (
unsigned int j = 0;
j < _nnodes; ++
j)
153 _local_ke(i,
j) += (i == 0 ? -1 : 1) *
_multi[
j] *
159 for (
unsigned int i = 0; i < _nnodes; ++i)
160 for (
unsigned int j = 0;
j < _nnodes; ++
j)
162 (i == 0 ? -1 : 1) *
_multi[
j] *
164 _origin_vec * _bond_status;
170 unsigned int jvar_num,
unsigned int coupled_component)
178 for (
unsigned int nd = 0; nd < _nnodes; ++nd)
181 std::vector<dof_id_type> jvardofs(_nnodes);
182 jvardofs[0] = _current_elem->node_ptr(nd)->dof_number(_sys.number(), jvar_num, 0);
183 std::vector<dof_id_type> neighbors = _pdmesh.getNeighbors(_current_elem->node_id(nd));
184 std::vector<dof_id_type> bonds = _pdmesh.getBonds(_current_elem->node_id(nd));
190 for (
unsigned int nb = 0; nb < neighbors.size(); ++nb)
191 if (_bond_status_var->getElementalValue(_pdmesh.elemPtr(bonds[nb])) > 0.5)
194 Node * neighbor_nb = _pdmesh.nodePtr(neighbors[nb]);
195 jvardofs[1] = neighbor_nb->dof_number(_sys.number(), jvar_num, 0);
196 vol_nb = _pdmesh.getNodeVolume(neighbors[nb]);
199 origin_vec_nb = _pdmesh.getNodeCoord(neighbor_nb->id()) -
200 _pdmesh.getNodeCoord(_current_elem->node_id(nd));
203 for (
unsigned int i = 0; i < _dim; ++i)
204 dFdUk(coupled_component, i) =
205 _horizon_radius[nd] / origin_vec_nb.
norm() * origin_vec_nb(i) * vol_nb;
207 dFdUk *=
_shape2[nd].inverse();
211 for (
unsigned int i = 0; i < _nnodes; ++i)
212 for (
unsigned int j = 0;
j < _nnodes; ++
j)
213 _local_ke(i,
j) = (i == 0 ? -1 : 1) * (
j == 0 ? 0 : 1) *
_multi[nd] *
217 addJacobian(_assembly, _local_ke,
_ivardofs, jvardofs, _var.scalingFactor());
void computePDNonlocalOffDiagJacobian(unsigned int jvar_num, unsigned int coupled_component) override
Function to compute nonlocal contribution to the off-diagonal Jacobian at the current nodes...
const bool _temp_coupled
Temperature variable.
registerMooseObject("PeridynamicsApp", ForceStabilizedSmallStrainMechanicsNOSPD)
virtual RankTwoTensor computeDSDU(unsigned int component, unsigned int nd)
Function to compute derivative of stress with respect to displacements for small strain problems...
auto norm() const -> decltype(std::norm(Real()))
const MaterialProperty< RankFourTensor > & _Jacobian_mult
unsigned int number() const
void computeLocalOffDiagJacobian(unsigned int jvar_num, unsigned int coupled_component) override
Function to compute local contribution to the off-diagonal Jacobian at the current nodes...
const MaterialProperty< RankTwoTensor > & _stress
Kernel class for fictitious force stabilized peridynamic correspondence material model for small stra...
std::vector< const MaterialProperty< RankTwoTensor > * > _deigenstrain_dT
virtual void computeLocalJacobian() override
std::vector< MooseVariable * > _disp_var
displacement variables
static InputParameters validParams()
const unsigned int _component
The index of displacement component.
std::vector< dof_id_type > _ivardofs
Current variable dof numbers for nodes i and j.
const MaterialProperty< RankTwoTensor > & _shape2
const MaterialProperty< Real > & _multi
Material point based material properties.
virtual void computeNonlocalJacobian() override
RankTwoTensorTempl< Real > transpose() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
const MaterialProperty< Real > & _sf_coeff
Bond based material property for fictitious stabilization force.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
virtual void computeLocalResidual() override
MooseVariable * _temp_var
void ErrorVector unsigned int
Base kernel class for bond-associated correspondence material models.
ForceStabilizedSmallStrainMechanicsNOSPD(const InputParameters ¶meters)