24 PetscOptionsBegin(PETSC_COMM_WORLD,
"",
25 "Get analytical boundary conditions options",
"none");
27 ierr = PetscOptionsScalar(
"-analytical_alpha",
"crack angle",
"",
aLpha,
32 ierr = PetscOptionsScalar(
33 "-analytical_alpha_fraction_pi",
34 "crack angle given as fraction of Pi aLpha = M_PI/fraction",
"",
35 fraction, &fraction, &flg);
37 if (flg == PETSC_TRUE) {
38 aLpha = M_PI / fraction;
40 ierr = PetscOptionsEnd();
48 #ifndef __ANALITICAL_TRACTION__
49 #define __ANALITICAL_TRACTION__
65 const double x = coords[0];
66 const double y = coords[1];
67 const double z = coords[2];
68 double &fx = forces[0];
69 double &fy = forces[1];
70 double &fz = forces[2];
72 const double n0 = normal[0] / sqrt(pow(normal[0], 2) + pow(normal[1], 2) +
74 const double n1 = normal[1] / sqrt(pow(normal[0], 2) + pow(normal[1], 2) +
76 const double n2 = normal[2] / sqrt(pow(normal[0], 2) + pow(normal[1], 2) +
79 const double pi = M_PI;
80 const double alpha =
aLpha;
81 const double theta = atan2(z, x * sin(alpha) + y * cos(alpha));
84 sqrt(pow(x * sin(alpha) + y * cos(alpha), 2) + pow(z, 2));
85 const double sref1 = 1 / sqrt(2 *
pi * rxy) * cos(theta / 2.) *
86 (1. - sin(theta / 2.) * sin(3. * theta / 2.));
87 const double sref2 = 1 / sqrt(2 *
pi * rxy) * cos(theta / 2.) *
88 (1. + sin(theta / 2.) * sin(3. * theta / 2.));
89 const double sref3 = 1 / sqrt(2 *
pi * rxy) * sin(theta / 2.) *
90 cos(theta / 2.) * cos(3. * theta / 2.);
92 const double scal1 = sref1 * pow(sin(alpha), 2);
93 const double scal2 = sref1 * pow(cos(alpha), 2);
94 const double scal3 = sref2;
95 const double scal4 = sref1 * sin(alpha) * cos(alpha);
96 const double scal5 = sref3 * sin(alpha);
97 const double scal6 = sref3 * cos(alpha);
100 fx = scal1 * n0 + scal4 * n1 + scal5 * n2;
101 fy = scal4 * n0 + scal2 * n1 + scal6 * n2;
102 fz = scal5 * n0 + scal6 * n1 + scal3 * n2;
112 #endif //__ANALITICAL_TRACTION__
114 #ifndef __ANALITICAL_DISPLACEMENT__
115 #define __ANALITICAL_DISPLACEMENT__
121 virtual vector<VectorDouble> &
operator()(
const double X,
const double Y,
132 double &x =
dIsp[0][0];
133 double &y =
dIsp[0][1];
134 double &z =
dIsp[0][2];
138 const double E = 1.0e5;
140 const double pi = M_PI;
141 const double alpha =
aLpha;
143 const double theta = atan2(Z, X * sin(alpha) + Y * cos(alpha));
147 sqrt(sqrt(pow(X * sin(alpha) + Y * cos(alpha), 2) + pow(Z, 2)) /
149 cos(theta / 2.) * (3 - 4 * nu - cos(theta)) *
153 sqrt(sqrt(pow(X * sin(alpha) + Y * cos(alpha), 2) + pow(Z, 2)) /
155 cos(theta / 2.) * (3 - 4 * nu - cos(theta)) * cos(alpha);
158 sqrt(sqrt(pow(X * sin(alpha) + Y * cos(alpha), 2) + pow(Z, 2)) /
160 sin(theta / 2.) * (3 - 4 * nu - cos(theta));
238 #endif //__ANALITICAL_DISPLACEMENT__