www.mooseframework.org
NodalRankTwoUserObjectBasePD.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "AuxiliarySystem.h"
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<NodalAuxVariableUserObjectBasePD>();
19  params.addClassDescription(
20  "Base class for calculating components and scalar type quantities of nodal rank-two stress "
21  "and strain tensors from material properties (stress and strain) for edge elements "
22  "(i.e., bonds) connected at that node. NOTE: This UserObject only applies to SNOSPD model.");
23 
24  params.addRequiredParam<MaterialPropertyName>(
25  "rank_two_tensor", "Name of the nodal rank two tensors (stress/strains)");
26 
27  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
28 
29  return params;
30 }
31 
34  _tensor(getMaterialProperty<RankTwoTensor>("rank_two_tensor"))
35 {
36 }
37 
38 void
39 NodalRankTwoUserObjectBasePD::computeValue(unsigned int id, dof_id_type dof)
40 {
41  dof_id_type id_j_in_i =
42  _pdmesh.getNeighborIndex(_current_elem->node_id(id), _current_elem->node_id(1 - id));
43  Real dg_vol_frac = _pdmesh.getDefGradVolFraction(_current_elem->node_id(id), id_j_in_i);
44 
45  // gather volume weighted contribution only if the bond is active
46  if (_bond_status_var->getElementalValue(_current_elem) > 0.5)
47  gatherWeightedValue(id, dof, dg_vol_frac);
48 }
validParams< NodalRankTwoUserObjectBasePD >
InputParameters validParams< NodalRankTwoUserObjectBasePD >()
Definition: NodalRankTwoUserObjectBasePD.C:16
NodalAuxVariableUserObjectBasePD
UserObject base class to compute nodal quantities stored as AuxVariable at a material point based on ...
Definition: NodalAuxVariableUserObjectBasePD.h:23
NodalRankTwoUserObjectBasePD.h
NodalRankTwoUserObjectBasePD::computeValue
virtual void computeValue(unsigned int id, dof_id_type dof) override
Function to assemble elemental quantities to nodal AuxVariable at a material point.
Definition: NodalRankTwoUserObjectBasePD.C:39
validParams< NodalAuxVariableUserObjectBasePD >
InputParameters validParams< NodalAuxVariableUserObjectBasePD >()
Definition: NodalAuxVariableUserObjectBasePD.C:17
PeridynamicsMesh::getNeighborIndex
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's neighbor list.
Definition: PeridynamicsMesh.C:368
NodalRankTwoUserObjectBasePD::gatherWeightedValue
virtual void gatherWeightedValue(unsigned int id, dof_id_type dof, Real dg_vol_frac)=0
Function to gather bond-associated quantities to each material point.
NodalRankTwoUserObjectBasePD::NodalRankTwoUserObjectBasePD
NodalRankTwoUserObjectBasePD(const InputParameters &parameters)
Definition: NodalRankTwoUserObjectBasePD.C:32
ElementUserObjectBasePD::_bond_status_var
MooseVariable * _bond_status_var
Bond status aux variable.
Definition: ElementUserObjectBasePD.h:30
RankTwoTensorTempl< Real >
ElementUserObjectBasePD::_pdmesh
PeridynamicsMesh & _pdmesh
Reference to Peridynamic mesh.
Definition: ElementUserObjectBasePD.h:39
PeridynamicsMesh::getDefGradVolFraction
Real getDefGradVolFraction(dof_id_type node_id, dof_id_type neighbor_id)
Function to return summation of volumes of bond-associated neighbors used in the deformation gradient...
Definition: PeridynamicsMesh.C:453