www.mooseframework.org
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
DomainIntegralQFunction Class Reference

Coupled auxiliary value. More...

#include <DomainIntegralQFunction.h>

Inheritance diagram for DomainIntegralQFunction:
[legend]

Public Member Functions

 DomainIntegralQFunction (const InputParameters &parameters)
 Factory constructor, takes parameters so that all derived classes can be built using the same constructor. More...
 
virtual ~DomainIntegralQFunction ()
 

Protected Member Functions

virtual void initialSetup ()
 
virtual Real computeValue ()
 
void projectToFrontAtPoint (Real &dist_to_front, Real &dist_along_tangent)
 

Private Attributes

const Real _j_integral_radius_inner
 
const Real _j_integral_radius_outer
 
const CrackFrontDefinition *const _crack_front_definition
 
bool _has_crack_front_point_index
 
const unsigned int _crack_front_point_index
 
bool _treat_as_2d
 
bool _is_point_on_intersecting_boundary
 

Detailed Description

Coupled auxiliary value.

Definition at line 19 of file DomainIntegralQFunction.h.

Constructor & Destructor Documentation

◆ DomainIntegralQFunction()

DomainIntegralQFunction::DomainIntegralQFunction ( const InputParameters &  parameters)

Factory constructor, takes parameters so that all derived classes can be built using the same constructor.

Definition at line 31 of file DomainIntegralQFunction.C.

32  : AuxKernel(parameters),
33  _j_integral_radius_inner(getParam<Real>("j_integral_radius_inner")),
34  _j_integral_radius_outer(getParam<Real>("j_integral_radius_outer")),
35  _crack_front_definition(&getUserObject<CrackFrontDefinition>("crack_front_definition")),
36  _has_crack_front_point_index(isParamValid("crack_front_point_index")),
38  _has_crack_front_point_index ? getParam<unsigned int>("crack_front_point_index") : 0),
39  _treat_as_2d(false),
41 {
42 }
const CrackFrontDefinition *const _crack_front_definition
const unsigned int _crack_front_point_index

◆ ~DomainIntegralQFunction()

virtual DomainIntegralQFunction::~DomainIntegralQFunction ( )
inlinevirtual

Definition at line 28 of file DomainIntegralQFunction.h.

28 {}

Member Function Documentation

◆ computeValue()

Real DomainIntegralQFunction::computeValue ( )
protectedvirtual

Definition at line 69 of file DomainIntegralQFunction.C.

70 {
71  Real dist_to_crack_front;
72  Real dist_along_tangent;
73  projectToFrontAtPoint(dist_to_crack_front, dist_along_tangent);
74 
75  Real q = 1.0;
76  if (dist_to_crack_front > _j_integral_radius_inner &&
77  dist_to_crack_front < _j_integral_radius_outer)
78  q = (_j_integral_radius_outer - dist_to_crack_front) /
80  else if (dist_to_crack_front >= _j_integral_radius_outer)
81  q = 0.0;
82 
83  if (q > 0.0)
84  {
85  Real tangent_multiplier = 1.0;
86  if (!_treat_as_2d)
87  {
88  const Real forward_segment_length =
90  const Real backward_segment_length =
92 
93  if (dist_along_tangent >= 0.0)
94  {
95  if (forward_segment_length > 0.0)
96  tangent_multiplier = 1.0 - dist_along_tangent / forward_segment_length;
97  }
98  else
99  {
100  if (backward_segment_length > 0.0)
101  tangent_multiplier = 1.0 + dist_along_tangent / backward_segment_length;
102  }
103  }
104 
105  tangent_multiplier = std::max(tangent_multiplier, 0.0);
106  tangent_multiplier = std::min(tangent_multiplier, 1.0);
107 
108  // Set to zero if a node is on a designated free surface and its crack front node is not.
111  tangent_multiplier = 0.0;
112 
113  q *= tangent_multiplier;
114  }
115 
116  return q;
117 }
bool isNodeOnIntersectingBoundary(const Node *const node) const
Real getCrackFrontBackwardSegmentLength(const unsigned int point_index) const
void projectToFrontAtPoint(Real &dist_to_front, Real &dist_along_tangent)
Real getCrackFrontForwardSegmentLength(const unsigned int point_index) const
const CrackFrontDefinition *const _crack_front_definition
const unsigned int _crack_front_point_index

◆ initialSetup()

void DomainIntegralQFunction::initialSetup ( )
protectedvirtual

Definition at line 45 of file DomainIntegralQFunction.C.

46 {
48 
49  if (_treat_as_2d)
50  {
52  {
53  mooseWarning(
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 DomainIntegralQFunction");
62  }
63  }
66 }
bool isPointWithIndexOnIntersectingBoundary(const unsigned int point_index) const
const CrackFrontDefinition *const _crack_front_definition
const unsigned int _crack_front_point_index

◆ projectToFrontAtPoint()

void DomainIntegralQFunction::projectToFrontAtPoint ( Real &  dist_to_front,
Real &  dist_along_tangent 
)
protected

Definition at line 120 of file DomainIntegralQFunction.C.

Referenced by computeValue().

121 {
122  const Point * crack_front_point =
124 
125  Point p = *_current_node;
126  const RealVectorValue & crack_front_tangent =
128 
129  RealVectorValue crack_node_to_current_node = p - *crack_front_point;
130  dist_along_tangent = crack_node_to_current_node * crack_front_tangent;
131  RealVectorValue projection_point = *crack_front_point + dist_along_tangent * crack_front_tangent;
132  RealVectorValue axis_to_current_node = p - projection_point;
133  dist_to_front = axis_to_current_node.norm();
134 }
const RealVectorValue & getCrackFrontTangent(const unsigned int point_index) const
const CrackFrontDefinition *const _crack_front_definition
const unsigned int _crack_front_point_index
const Point * getCrackFrontPoint(const unsigned int point_index) const

Member Data Documentation

◆ _crack_front_definition

const CrackFrontDefinition* const DomainIntegralQFunction::_crack_front_definition
private

Definition at line 38 of file DomainIntegralQFunction.h.

Referenced by computeValue(), initialSetup(), and projectToFrontAtPoint().

◆ _crack_front_point_index

const unsigned int DomainIntegralQFunction::_crack_front_point_index
private

Definition at line 40 of file DomainIntegralQFunction.h.

Referenced by computeValue(), initialSetup(), and projectToFrontAtPoint().

◆ _has_crack_front_point_index

bool DomainIntegralQFunction::_has_crack_front_point_index
private

Definition at line 39 of file DomainIntegralQFunction.h.

Referenced by initialSetup().

◆ _is_point_on_intersecting_boundary

bool DomainIntegralQFunction::_is_point_on_intersecting_boundary
private

Definition at line 42 of file DomainIntegralQFunction.h.

Referenced by computeValue(), and initialSetup().

◆ _j_integral_radius_inner

const Real DomainIntegralQFunction::_j_integral_radius_inner
private

Definition at line 36 of file DomainIntegralQFunction.h.

Referenced by computeValue().

◆ _j_integral_radius_outer

const Real DomainIntegralQFunction::_j_integral_radius_outer
private

Definition at line 37 of file DomainIntegralQFunction.h.

Referenced by computeValue().

◆ _treat_as_2d

bool DomainIntegralQFunction::_treat_as_2d
private

Definition at line 41 of file DomainIntegralQFunction.h.

Referenced by computeValue(), and initialSetup().


The documentation for this class was generated from the following files: