https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NodalRankTwoUserObjectBasePD.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 "AuxiliarySystem.h"
13
16{
19 "Base class for calculating components and scalar type quantities of nodal rank-two stress "
20 "and strain tensors from material properties (stress and strain) for edge elements "
21 "(i.e., bonds) connected at that node. NOTE: This UserObject only applies to the NOSPD "
22 "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
38void
39NodalRankTwoUserObjectBasePD::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 weight = _pdmesh.getNeighborWeight(_current_elem->node_id(id), id_j_in_i);
44
45 // gather volume weighted contribution only if the bond is active
47 gatherWeightedValue(id, dof, weight);
48}
const ExecFlagType EXEC_TIMESTEP_END
PeridynamicsMesh & _pdmesh
Reference to Peridynamic mesh.
MooseVariable * _bond_status_var
Bond status aux variable.
const Elem *const & _current_elem
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
DofValue getElementalValue(const Elem *elem, unsigned int idx=0) const
UserObject base class to compute nodal quantities stored as AuxVariable at a material point based on ...
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.
virtual void computeValue(unsigned int id, dof_id_type dof) override
Function to assemble elemental quantities to nodal AuxVariable at a material point.
NodalRankTwoUserObjectBasePD(const InputParameters &parameters)
Real getNeighborWeight(dof_id_type node_id, dof_id_type neighbor_id)
Function to return normalized weight for neighbor neighbor_id of node node_id based on predefined wei...
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.