https://mooseframework.inl.gov
NodalRankTwoScalarPD.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 "NodalRankTwoScalarPD.h"
11 #include "RankTwoScalarTools.h"
12 #include "RankTwoTensor.h"
13 #include "AuxiliarySystem.h"
14 
15 registerMooseObject("PeridynamicsApp", NodalRankTwoScalarPD);
16 
19 {
21  params.addClassDescription(
22  "Class for calculating scalar quantities of nodal rank-two stress and strain tensors "
23  "from material properties (stress and strain) for edge elements (i.e., bonds) "
24  "connected at that node. NOTE: This UserObject only applies to the NOSPD model.");
25 
27  "scalar_type", RankTwoScalarTools::scalarOptions(), "Type of scalar output");
28  params.addParam<Point>(
29  "point1",
30  Point(0, 0, 0),
31  "Start point for axis used to calculate some cylindrical material tensor quantities");
32  params.addParam<Point>("point2",
33  Point(0, 1, 0),
34  "End point for axis used to calculate some material tensor quantities");
35  params.addParam<Point>("direction", Point(0, 0, 1), "Direction vector");
36 
37  return params;
38 }
39 
41  : NodalRankTwoUserObjectBasePD(parameters),
42  _scalar_type(getParam<MooseEnum>("scalar_type")),
43  _point1(parameters.get<Point>("point1")),
44  _point2(parameters.get<Point>("point2")),
45  _input_direction(parameters.get<Point>("direction") / parameters.get<Point>("direction").norm())
46 {
47 }
48 
49 void
50 NodalRankTwoScalarPD::gatherWeightedValue(unsigned int id, dof_id_type dof, Real dg_vol_frac)
51 {
52  Point curr_point = *_current_elem->node_ptr(id);
55 
56  _aux.solution().add(dof, scalar_value * dg_vol_frac);
57 }
T getQuantity(const RankTwoTensorTempl< T > &tensor, const MooseEnum &scalar_type, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
MooseEnum _scalar_type
Determines the information to be extracted from the tensor by using the RankTwoScalarTools namespace...
virtual void gatherWeightedValue(unsigned int id, dof_id_type dof, Real dg_vol_frac) override
Function to gather bond-associated quantities to each material point.
const Point _point2
End point for axis used to calculate some cylinderical material tensor quantities.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
NumericVector< Number > & solution()
const MaterialProperty< RankTwoTensor > & _tensor
Material properties tensor.
Base userobject class for rank two tensor at individual material point.
Point _input_direction
Direction vector used to calculate some material tensor quantities.
const Point _point1
Start point for axis used to calculate some cylinderical material tensor quantities.
MooseEnum scalarOptions()
This enum is left for legacy calls.
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
auto norm(const T &a) -> decltype(std::abs(a))
NodalRankTwoScalarPD(const InputParameters &parameters)
Userobject class to compute the equivalent scalar values for rank two tensor at individual material p...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Elem *const & _current_elem
registerMooseObject("PeridynamicsApp", NodalRankTwoScalarPD)
void addClassDescription(const std::string &doc_string)
AuxiliarySystem & _aux
Reference to auxiliary system.
virtual void add(const numeric_index_type i, const Number value)=0
const Elem & get(const ElemType type_in)
uint8_t dof_id_type