https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DomainIntegralTopologicalQFunction.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
13
16{
19 "Determines if a node is within the ring of the crack front defintion; this object is "
20 "normally created by the DomainIntegralAction.");
21 params.addRequiredParam<unsigned int>("ring_index",
22 "The ring of elements that defines the integration domain");
23 params.addRequiredParam<UserObjectName>("crack_front_definition",
24 "The CrackFrontDefinition user object name");
25 params.addParam<unsigned int>(
26 "crack_front_point_index",
27 "The index of the point on the crack front corresponding to this q function");
28 params.set<bool>("use_displaced_mesh") = false;
29 return params;
30}
31
33 const InputParameters & parameters)
34 : AuxKernel(parameters),
35 _ring_number(getParam<unsigned int>("ring_index")),
36 _crack_front_definition(&getUserObject<CrackFrontDefinition>("crack_front_definition")),
37 _has_crack_front_point_index(isParamValid("crack_front_point_index")),
38 _crack_front_point_index(
39 _has_crack_front_point_index ? getParam<unsigned int>("crack_front_point_index") : 0),
40 _treat_as_2d(false)
41{
42}
43
44void
46{
48
49 if (_treat_as_2d)
50 {
52 {
54 "crack_front_point_index ignored because CrackFrontDefinition is set to treat as 2D");
55 }
56 }
57 else
58 {
60 {
61 mooseError("crack_front_point_index must be specified in DomainIntegralTopologicalQFunction");
62 }
63 }
64}
65
66Real
68{
69
70 Real q = 0;
71 bool is_node_in_ring = _crack_front_definition->isNodeInRing(
73 if (is_node_in_ring)
74 q = 1;
75
76 return q;
77}
registerMooseObject("SolidMechanicsApp", DomainIntegralTopologicalQFunction)
void ErrorVector unsigned int
const Node *const & _current_node
static InputParameters validParams()
Class used in fracture integrals to define geometric characteristics of the crack front.
bool treatAs2D() const
Whether the fracture computations are treated as 2D for the model.
bool isNodeInRing(const std::size_t ring_index, const dof_id_type connected_node_id, const std::size_t node_index) const
Determine whether a node is contained within a specified volume integral element ring for a given nod...
DomainIntegralTopologicalQFunction(const InputParameters &parameters)
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
const CrackFrontDefinition *const _crack_front_definition
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)
T & set(const std::string &name, bool quiet_mode=false)
void mooseError(Args &&... args) const
void mooseWarning(Args &&... args) const