https://mooseframework.inl.gov
Loading...
Searching...
No Matches
EnrichmentFunctionCalculation.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 const CrackFrontDefinition * crack_front_definition)
14 : _crack_front_definition(*crack_front_definition)
15{
16}
17
18unsigned int
20 std::vector<Real> & B)
21{
22 unsigned int crack_front_point_index =
24
25 if (MooseUtils::absoluteFuzzyEqual(_r, 0.0))
26 mooseError("EnrichmentFunctionCalculation: the distance between a point and the crack "
27 "tip/front is zero.");
28
29 Real st = std::sin(_theta);
30 Real st2 = std::sin(_theta / 2.0);
31 Real ct2 = std::cos(_theta / 2.0);
32 Real sr = std::sqrt(_r);
33
34 B[0] = sr * st2;
35 B[1] = sr * ct2;
36 B[2] = sr * st2 * st;
37 B[3] = sr * ct2 * st;
38
39 return crack_front_point_index;
40}
41
42unsigned int
44 const Point & point, std::vector<RealVectorValue> & dB)
45{
46 unsigned int crack_front_point_index =
48
49 if (MooseUtils::absoluteFuzzyEqual(_r, 0.0))
50 mooseError("EnrichmentFunctionCalculation: the distance between a point and the crack "
51 "tip/front is zero.");
52
53 Real st = std::sin(_theta);
54 Real ct = std::cos(_theta);
55 Real st2 = std::sin(_theta / 2.0);
56 Real ct2 = std::cos(_theta / 2.0);
57 Real st15 = std::sin(1.5 * _theta);
58 Real ct15 = std::cos(1.5 * _theta);
59 Real sr = std::sqrt(_r);
60
61 dB[0](0) = -0.5 / sr * st2;
62 dB[0](1) = 0.5 / sr * ct2;
63 dB[0](2) = 0.0;
64 dB[1](0) = 0.5 / sr * ct2;
65 dB[1](1) = 0.5 / sr * st2;
66 dB[1](2) = 0.0;
67 dB[2](0) = -0.5 / sr * st15 * st;
68 dB[2](1) = 0.5 / sr * (st2 + st15 * ct);
69 dB[2](2) = 0.0;
70 dB[3](0) = -0.5 / sr * ct15 * st;
71 dB[3](1) = 0.5 / sr * (ct2 + ct15 * ct);
72 dB[3](2) = 0.0;
73
74 return crack_front_point_index;
75}
76
77void
79 RealVectorValue & rotated_vector,
80 const unsigned int point_index)
81{
82 rotated_vector = _crack_front_definition.rotateFromCrackFrontCoordsToGlobal(vector, point_index);
83}
void mooseError(Args &&... args)
Class used in fracture integrals to define geometric characteristics of the crack front.
void calculateRThetaToCrackFront(const Point qp, const std::size_t point_index, Real &r, Real &theta) const
Calculate r and theta of a point in the crack front polar coordinates for a given crack point index.
RealVectorValue rotateFromCrackFrontCoordsToGlobal(const RealVectorValue vector, const std::size_t point_index) const
Rotate a vector from crack front cartesian coordinate to global cartesian coordinate.
virtual unsigned int crackTipEnrichementFunctionAtPoint(const Point &point, std::vector< Real > &B)
calculate the enrichment function values at point
void rotateFromCrackFrontCoordsToGlobal(const RealVectorValue &vector, RealVectorValue &rotated_vector, const unsigned int point_index)
rotate a vector from crack front coordinate to global cooridate
virtual unsigned int crackTipEnrichementFunctionDerivativeAtPoint(const Point &point, std::vector< RealVectorValue > &dB)
calculate the enrichment function derivatives at point
EnrichmentFunctionCalculation(const CrackFrontDefinition *crack_front_definition)
const CrackFrontDefinition & _crack_front_definition