https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
11#include "RankTwoScalarTools.h"
12#include "RankTwoTensor.h"
13#include "AuxiliarySystem.h"
14
16
19{
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
49void
50NodalRankTwoScalarPD::gatherWeightedValue(unsigned int id, dof_id_type dof, Real dg_vol_frac)
51{
52 Point curr_point = *_current_elem->node_ptr(id);
53 Real scalar_value = RankTwoScalarTools::getQuantity(
55
56 _aux.solution().add(dof, scalar_value * dg_vol_frac);
57}
registerMooseObject("PeridynamicsApp", NodalRankTwoScalarPD)
AuxiliarySystem & _aux
Reference to auxiliary system.
const Elem *const & _current_elem
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Userobject class to compute the equivalent scalar values for rank two tensor at individual material p...
MooseEnum _scalar_type
Determines the information to be extracted from the tensor by using the RankTwoScalarTools namespace,...
Point _input_direction
Direction vector used to calculate some material tensor quantities.
static InputParameters validParams()
NodalRankTwoScalarPD(const InputParameters &parameters)
const Point _point2
End point for axis used to calculate some cylinderical material tensor quantities.
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 _point1
Start point for axis used to calculate some cylinderical material tensor quantities.
Base userobject class for rank two tensor at individual material point.
const MaterialProperty< RankTwoTensor > & _tensor
Material properties tensor.
NumericVector< Number > & solution()
virtual void add(const numeric_index_type i, const T value)=0
MooseEnum scalarOptions()
This enum is left for legacy calls.
T getQuantity(const RankTwoTensorTempl< T > &tensor, const MooseEnum &scalar_type, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)