EnrichmentFunctionCalculation.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7
9
11  const CrackFrontDefinition * crack_front_definition)
12 {
13  _crack_front_definition = crack_front_definition;
14 }
15
16 unsigned int
18  std::vector<Real> & B)
19 {
20  unsigned int crack_front_point_index =
22
23  if (MooseUtils::absoluteFuzzyEqual(_r, 0.0))
24  mooseError("EnrichmentFunctionCalculation: the distance between a point and the crack "
25  "tip/front is zero.");
26
27  Real st = std::sin(_theta);
28  Real st2 = std::sin(_theta / 2.0);
29  Real ct2 = std::cos(_theta / 2.0);
30  Real sr = std::sqrt(_r);
31
32  B[0] = sr * st2;
33  B[1] = sr * ct2;
34  B[2] = sr * st2 * st;
35  B[3] = sr * ct2 * st;
36
37  return crack_front_point_index;
38 }
39
40 unsigned int
42  const Point & point, std::vector<RealVectorValue> & dB)
43 {
44  unsigned int crack_front_point_index =
46
47  if (MooseUtils::absoluteFuzzyEqual(_r, 0.0))
48  mooseError("EnrichmentFunctionCalculation: the distance between a point and the crack "
49  "tip/front is zero.");
50
51  Real st = std::sin(_theta);
52  Real ct = std::cos(_theta);
53  Real st2 = std::sin(_theta / 2.0);
54  Real ct2 = std::cos(_theta / 2.0);
55  Real st15 = std::sin(1.5 * _theta);
56  Real ct15 = std::cos(1.5 * _theta);
57  Real sr = std::sqrt(_r);
58
59  dB[0](0) = -0.5 / sr * st2;
60  dB[0](1) = 0.5 / sr * ct2;
61  dB[0](2) = 0.0;
62  dB[1](0) = 0.5 / sr * ct2;
63  dB[1](1) = 0.5 / sr * st2;
64  dB[1](2) = 0.0;
65  dB[2](0) = -0.5 / sr * st15 * st;
66  dB[2](1) = 0.5 / sr * (st2 + st15 * ct);
67  dB[2](2) = 0.0;
68  dB[3](0) = -0.5 / sr * ct15 * st;
69  dB[3](1) = 0.5 / sr * (ct2 + ct15 * ct);
70  dB[3](2) = 0.0;
71
72  return crack_front_point_index;
73 }
74
75 void
77  RealVectorValue & rotated_vector,
78  const unsigned int point_index)
79 {
80  rotated_vector = _crack_front_definition->rotateFromCrackFrontCoordsToGlobal(vector, point_index);
81 }
void calculateRThetaToCrackFront(const Point qp, const unsigned int point_index, Real &r, Real &theta) const
calculate r and theta in the crack front polar cooridnate
const CrackFrontDefinition * _crack_front_definition
RealVectorValue rotateFromCrackFrontCoordsToGlobal(const RealVectorValue vector, const unsigned int point_index) const
rotate a vector from crack front cartesian coordinate to global cartesian coordinate ...
EnrichmentFunctionCalculation(const CrackFrontDefinition *crack_front_definition)
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
Works on top of NodalNormalsPreprocessor.
virtual unsigned int crackTipEnrichementFunctionDerivativeAtPoint(const Point &point, std::vector< RealVectorValue > &dB)
calculate the enrichment function derivatives at point