https://mooseframework.inl.gov
MechanicsBPD.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "MechanicsBPD.h"
11 
12 registerMooseObject("PeridynamicsApp", MechanicsBPD);
13 
16 {
18  params.addClassDescription("Class for calculating the residual and Jacobian for the bond-based "
19  "peridynamic mechanics formulation");
20 
21  params.addRequiredParam<unsigned int>(
22  "component",
23  "An integer corresponding to the variable this kernel acts on (0 for x, 1 for y, 2 for z)");
24 
25  return params;
26 }
27 
29  : MechanicsBasePD(parameters),
30  _bond_local_force(getMaterialProperty<Real>("bond_local_force")),
31  _bond_local_dfdU(getMaterialProperty<Real>("bond_dfdU")),
32  _bond_local_dfdT(getMaterialProperty<Real>("bond_dfdT")),
33  _component(getParam<unsigned int>("component"))
34 {
35 }
36 
37 void
39 {
40  _local_re(0) = -_bond_local_force[0] * _current_unit_vec(_component) * _bond_status;
41  _local_re(1) = -_local_re(0);
42 }
43 
44 void
46 {
51 
52  for (unsigned int i = 0; i < _nnodes; ++i)
53  for (unsigned int j = 0; j < _nnodes; ++j)
54  _local_ke(i, j) += (i == j ? 1 : -1) * diag * _bond_status;
55 }
56 
57 void
58 MechanicsBPD::computeLocalOffDiagJacobian(unsigned int jvar_num, unsigned int coupled_component)
59 {
60  if (_temp_coupled && jvar_num == _temp_var->number())
61  {
62  for (unsigned int i = 0; i < _nnodes; ++i)
63  for (unsigned int j = 0; j < _nnodes; ++j)
64  _local_ke(i, j) +=
65  (i == 1 ? 1 : -1) * _current_unit_vec(_component) * _bond_local_dfdT[j] * _bond_status;
66  }
67  else
68  {
69  Real val =
72  _current_unit_vec(coupled_component) / _current_vec.norm();
73  for (unsigned int i = 0; i < _nnodes; ++i)
74  for (unsigned int j = 0; j < _nnodes; ++j)
75  _local_ke(i, j) += (i == j ? 1 : -1) * val * _bond_status;
76  }
77 }
const bool _temp_coupled
Temperature variable.
const MaterialProperty< Real > & _bond_local_dfdT
Definition: MechanicsBPD.h:32
Base kernel class for peridynamic solid mechanics models.
MechanicsBPD(const InputParameters &parameters)
Definition: MechanicsBPD.C:28
auto norm() const -> decltype(std::norm(Real()))
unsigned int number() const
virtual void computeLocalOffDiagJacobian(unsigned int jvar_num, unsigned int jvar) override
Function to compute local contribution to the off-diagonal Jacobian at the current nodes...
Definition: MechanicsBPD.C:58
static InputParameters validParams()
const unsigned int _component
The index of displcement component.
Definition: MechanicsBPD.h:36
RealGradient _current_unit_vec
Unit vector of bond in current configuration.
Kernel class for bond based peridynamic solid mechanics models.
Definition: MechanicsBPD.h:17
const MaterialProperty< Real > & _bond_local_force
Bond based material properties.
Definition: MechanicsBPD.h:30
virtual void computeLocalJacobian() override
Definition: MechanicsBPD.C:45
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual void computeLocalResidual() override
Definition: MechanicsBPD.C:38
static InputParameters validParams()
Definition: MechanicsBPD.C:15
RealGradient _current_vec
Vector of bond in current configuration.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< Real > & _bond_local_dfdU
Definition: MechanicsBPD.h:31
registerMooseObject("PeridynamicsApp", MechanicsBPD)
void addClassDescription(const std::string &doc_string)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
MooseVariable * _temp_var
void ErrorVector unsigned int