https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
37void
39{
40 _local_re(0) = -_bond_local_force[0] * _current_unit_vec(_component) * _bond_status;
41 _local_re(1) = -_local_re(0);
42}
43
44void
46{
50 _current_vec.norm();
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
57void
58MechanicsBPD::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}
registerMooseObject("PeridynamicsApp", MechanicsBPD)
void ErrorVector unsigned int
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Kernel class for bond based peridynamic solid mechanics models.
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.
const MaterialProperty< Real > & _bond_local_dfdU
MechanicsBPD(const InputParameters &parameters)
virtual void computeLocalJacobian() override
virtual void computeLocalResidual() override
const unsigned int _component
The index of displcement component.
static InputParameters validParams()
const MaterialProperty< Real > & _bond_local_dfdT
const MaterialProperty< Real > & _bond_local_force
Bond based material properties.
Base kernel class for peridynamic solid mechanics models.
static InputParameters validParams()
MooseVariable * _temp_var
RealGradient _current_unit_vec
Unit vector of bond in current configuration.
RealGradient _current_vec
Vector of bond in current configuration.
const bool _temp_coupled
Temperature variable.
unsigned int number() const