38 const GmpFemPhysicsCommonMaterialFactory* matFactory,
const GmLogCategory& logger)
39 : T(pluginType, simulation,
id, description, matFactory, logger)
47 assert(e); Q_UNUSED(MX); Q_UNUSED(N);
48 int cNodes, inNode, nv;
51 int d = GmpFemPhysicsCommon::nodeDim();
53 auto eType = e->
type();
56 n = n - pow(2, d - 1);
64 inNode = (n - 3.0 * (d - 1)) / 2.0;
68 inNode = (n - pow(2.0, d)) / 2.0;
71 cNodes = 0.5 * n - inNode;
77 double detScale = 1.0;
83 assert(Bu.n_rows == d && Bu.n_cols == n*d);
92 R(0, 0) = J(0, 0) / detJ;
93 R(0, 1) = J(0, 1) / detJ;
100 double J1 = 0.0, J2 = 0.0, J3 = 0.0;
102 J1 = J(0, 1)*J(1, 2) - J(1, 1)*J(0, 2);
103 J2 = J(1, 0)*J(0, 2) - J(0, 0)*J(1, 2);
104 J3 = J(0, 0)*J(1, 1) - J(1, 0)*J(0, 1);
107 detJ2 = sqrt(J1 * J1 + J2 * J2 + J3 * J3);
110 detJ = detJ2 * detScale;
119 detJ1 = sqrt(J(0, 0)*J(0, 0) + J(0, 1)*J(0, 1) + J(0, 2)*J(0, 2));
120 R(0, 0) = J(0, 0) / detJ1;
121 R(0, 1) = J(0, 1) / detJ1;
122 R(0, 2) = J(0, 2) / detJ1;
124 R(2, 0) = J1 / detJ2;
125 R(2, 1) = J2 / detJ2;
126 R(2, 2) = J3 / detJ2;
128 R(1, 0) = R(2, 1)*R(0, 2) - R(0, 1)*R(2, 2);
129 R(1, 1) = R(0, 0)*R(2, 2) - R(2, 0)*R(0, 2);
130 R(1, 2) = R(2, 0)*R(0, 1) - R(0, 0)*R(2, 1);
134 double dipdir, dip2, dip, strike;
141 dipdir =angleAtanD (N2(0),N2(1));
145 dip2 = 90.0 - angleAtanD(abs(N2(2)), sqrt(N2(0)*N2(0) + N2(1)*N2(1)));
149 dip2 = 90.00 + angleAtanD(abs(N2(2)),sqrt(N2(0)*N2(0)+N2(1)*N2(1)));
152 dip = -M_PI*(180 + dip2) / 180.0;
153 strike = M_PI*(90+dipdir)/180;
155 R(0, 0) = sin(strike); R(0, 1) = cos(strike); R(0, 2) = 0;
156 R(1, 0) = cos(dip)*cos(strike); R(1, 1) = -cos(dip)*sin(strike); R(1, 2) = -sin(dip);
157 R(2, 0) = -sin(dip)*cos(strike); R(2, 1) = sin(dip)*sin(strike); R(2, 2) = -cos(dip);
161 double easting, northing, dip, strike;
172 easting = (N2(2) < 0) ? N2(1) : -N2(1);
174 northing = (N2(2) > 0) ? N2(0) : -N2(0);
176 dip = abs(asin(sqrt(N2(0)*N2(0) + N2(1)*N2(1))));
178 strike = acos(northing / sqrt(easting*easting + northing*northing));
180 strike = (easting>= 0.0)? strike : (2 * M_PI - strike);
182 R(0, 0) = sin(strike); R(0, 1) = cos(strike); R(0, 2) = 0;
183 R(1, 0) = cos(dip)*cos(strike); R(1, 1) = -cos(dip)*sin(strike); R(1, 2) = -sin(dip);
184 R(2, 0) = -sin(dip)*cos(strike); R(2, 1) = sin(dip)*sin(strike); R(2, 2) = -cos(dip);
190 gmErrorMsg(logger(),
QObject::tr(
"gmpInterface: Unsupported condition in fillStrainDisplacementMatrix"));
198 for (
int i = 0; i < d; ++i)
200 for (
int j = 0; j < cNodes; ++j)
205 Bu(i, j * 2 + i) = -H(j);
207 Bu(i, (j + 2) * 2 + i) = H(1 - j);
212 Bu(i, j * 3 + i) = -H(j);
215 Bu(i, (j + cNodes) * 3 + i) = H(j);
219 gmErrorMsg(logger(),
QObject::tr(
"GmpStdCohesive: Unsupported condition to fill B matrix."));
223 for (
int j = 0; j < inNode; ++j)
228 Bu(i, (j + 4) * 2 + i) = -H(j + 2);
230 Bu(i, (j + 4 + inNode) * 2 + i) = H(1 + inNode - j);
235 Bu(i, (nv + j) * 3 + i) = -H(cNodes + j);
237 Bu(i, (nv + inNode + j) * 3 + i) = H(cNodes + j);
241 gmErrorMsg(logger(),
QObject::tr(
"GmpInterface: Unsupported condition to fill B matrix."));
323 const GmpFemPhysicsCommonMaterialFactory* matFactory,
const GmLogCategory& logger)
324 : T(pluginType, simulation,
id, description, matFactory, logger)
330 assert(e); Q_UNUSED(MX); Q_UNUSED(N);
331 int cNodes, inNode, nv;
334 int d = GmpFemPhysicsCommon::nodeDim();
338 n = n - pow(2, d - 1);
341 inNode = (n - pow(2.0, d)) / 2.0;
342 cNodes = 0.5 * n - inNode;
348 assert(Bu.n_rows == d && Bu.n_cols == n * d);
357 R(0, 0) = J(0, 0) / detJ;
358 R(0, 1) = J(0, 1) / detJ;
365 gmErrorMsg(logger(),
QObject::tr(
"gmpInterface: Axisymmetric interface element must be 2D model"));
373 for (
int i = 0; i < d; ++i)
375 for (
int j = 0; j < cNodes; ++j)
380 Bu(i, j * 2 + i) = -H(j);
382 Bu(i, (j + 2) * 2 + i) = H(1 - j);
386 gmErrorMsg(logger(),
QObject::tr(
"GmpStdCohesive: Unsupported condition to fill B matrix."));
390 for (
int j = 0; j < inNode; ++j)
395 Bu(i, (j + 4) * 2 + i) = -H(j + 2);
397 Bu(i, (j + 4 + inNode) * 2 + i) = H(1 + inNode - j);
401 gmErrorMsg(logger(),
QObject::tr(
"GmpInterface: Unsupported condition to fill B matrix."));
422 int d = GmpFemPhysicsCommon::nodeDim();
426 n = n - pow(2, d - 1);
428 assert(MX.n_rows == n / 2 && MX.n_cols == d);
431 for (
int j = 0; j < n/2; ++j)
432 rGauss += N(j)*MX(j, 0);
434 return 2 * arma::datum::pi * rGauss;