https://mooseframework.inl.gov
GeneralizedPlaneStrainUserObjectNOSPD.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 
11 #include "RankTwoTensor.h"
12 #include "RankFourTensor.h"
13 #include "Function.h"
14 
16 
19 {
21  params.addClassDescription("Class for calculating the scalar residual and diagonal Jacobian "
22  "entry of generalized plane strain in the H1NOSPD formulation");
23 
24  return params;
25 }
26 
28  const InputParameters & parameters)
30  _stress(getMaterialProperty<RankTwoTensor>("stress"))
31 {
32 }
33 
34 void
36 {
37  // dof_id_type for node i and j
38  dof_id_type node_i = _current_elem->node_id(0);
39  dof_id_type node_j = _current_elem->node_id(1);
40 
41  // coordinates for node i and j
42  Point coord_i = _pdmesh.getNodeCoord(node_i);
43  Point coord_j = _pdmesh.getNodeCoord(node_j);
44 
45  // nodal area for node i and j
46  Real nv_i = _pdmesh.getNodeVolume(node_i);
47  Real nv_j = _pdmesh.getNodeVolume(node_j);
48 
49  // sum of volumes of material points used in bond-associated deformation gradient calculation
50  dof_id_type id_j_in_i = _pdmesh.getNeighborIndex(node_i, node_j);
51  dof_id_type id_i_in_j = _pdmesh.getNeighborIndex(node_j, node_i);
52 
53  Real dg_vol_frac_i = _pdmesh.getHorizonSubsetVolumeFraction(node_i, id_j_in_i);
54  Real dg_vol_frac_j = _pdmesh.getHorizonSubsetVolumeFraction(node_j, id_i_in_j);
55 
57 
58  // residual
59  _residual += (_stress[0](2, 2) - _pressure.value(_t, coord_i) * _factor) * nv_i * dg_vol_frac_i *
60  bond_status;
61  _residual += (_stress[1](2, 2) - _pressure.value(_t, coord_j) * _factor) * nv_j * dg_vol_frac_j *
62  bond_status;
63 
64  // diagonal jacobian
65  _jacobian += (_Cijkl[0](2, 2, 2, 2) * nv_i * dg_vol_frac_i +
66  _Cijkl[1](2, 2, 2, 2) * nv_j * dg_vol_frac_j) *
67  bond_status;
68 }
const Function & _pressure
Applied out-of-plane force parameters.
const MaterialProperty< RankFourTensor > & _Cijkl
Elasticity tensor.
PeridynamicsMesh & _pdmesh
Reference to Peridynamic mesh.
GeneralizedPlaneStrainUserObjectNOSPD(const InputParameters &parameters)
dof_id_type getNeighborIndex(dof_id_type node_i, dof_id_type node_j)
Function to return the local neighbor index of node_j from node_i&#39;s neighbor list.
OutputData getElementalValue(const Elem *elem, unsigned int idx=0) const
UserObject class to compute the residual and diagonal Jacobian components for scalar out-of-plane str...
const MaterialProperty< RankTwoTensor > & _stress
Materials property stress.
MooseVariable * _bond_status_var
Bond status aux variable.
Real getHorizonSubsetVolumeFraction(dof_id_type node_id, dof_id_type neighbor_id)
Function to return the volume fraction of a horizon subset used for bond-associated deformation gradi...
Real getNodeVolume(dof_id_type node_id)
Function to return nodal volume for node node_id.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Point getNodeCoord(dof_id_type node_id)
Function to return coordinates for node node_id.
const Elem *const & _current_elem
registerMooseObject("PeridynamicsApp", GeneralizedPlaneStrainUserObjectNOSPD)
void addClassDescription(const std::string &doc_string)
virtual Real value(Real t, const Point &p) const
uint8_t dof_id_type
Base userObject class to compute the residual and diagonal Jacobian components for scalar out-of-plan...