24 #ifndef _GEMA_PLUGIN_MECHANICAL_PHYSICS_INTERFACE_H_ 25 #define _GEMA_PLUGIN_MECHANICAL_PHYSICS_INTERFACE_H_ 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();
54 n = n - pow(2, d - 1);
62 inNode = (n - 3.0 * (d - 1)) / 2.0;
66 inNode = (n - pow(2.0, d)) / 2.0;
69 cNodes = 0.5 * n - inNode;
75 assert(Bu.n_rows == d && Bu.n_cols == n*d);
84 R(0, 0) = J(0, 0) / detJ;
85 R(0, 1) = J(0, 1) / detJ;
92 double J1 = 0.0, J2 = 0.0, J3 = 0.0;
94 J1 = J(0, 1)*J(1, 2) - J(1, 1)*J(0, 2);
95 J2 = J(1, 0)*J(0, 2) - J(0, 0)*J(1, 2);
96 J3 = J(0, 0)*J(1, 1) - J(1, 0)*J(0, 1);
99 detJ = sqrt(J1*J1 + J2*J2 + J3*J3);
109 detJ1 = sqrt(J(0, 0)*J(0, 0) + J(0, 1)*J(0, 1) + J(0, 2)*J(0, 2));
110 R(0, 0) = J(0, 0) / detJ1;
111 R(0, 1) = J(0, 1) / detJ1;
112 R(0, 2) = J(0, 2) / detJ1;
114 detJ2 = sqrt(J1*J1 + J2* J2 + J3* J3);
115 R(2, 0) = J1 / detJ2;
116 R(2, 1) = J2 / detJ2;
117 R(2, 2) = J3 / detJ2;
119 R(1, 0) = R(2, 1)*R(0, 2) - R(0, 1)*R(2, 2);
120 R(1, 1) = R(0, 0)*R(2, 2) - R(2, 0)*R(0, 2);
121 R(1, 2) = R(2, 0)*R(0, 1) - R(0, 0)*R(2, 1);
125 double dipdir, dip2, dip, strike;
132 dipdir =angleAtanD (N2(0),N2(1));
136 dip2 = 90.0 - angleAtanD(abs(N2(2)), sqrt(N2(0)*N2(0) + N2(1)*N2(1)));
140 dip2 = 90.00 + angleAtanD(abs(N2(2)),sqrt(N2(0)*N2(0)+N2(1)*N2(1)));
143 dip = -M_PI*(180 + dip2) / 180.0;
144 strike = M_PI*(90+dipdir)/180;
146 R(0, 0) = sin(strike); R(0, 1) = cos(strike); R(0, 2) = 0;
147 R(1, 0) = cos(dip)*cos(strike); R(1, 1) = -cos(dip)*sin(strike); R(1, 2) = -sin(dip);
148 R(2, 0) = -sin(dip)*cos(strike); R(2, 1) = sin(dip)*sin(strike); R(2, 2) = -cos(dip);
152 double easting, northing, dip, strike;
163 easting = (N2(2) < 0) ? N2(1) : -N2(1);
165 northing = (N2(2) > 0) ? N2(0) : -N2(0);
167 dip = abs(asin(sqrt(N2(0)*N2(0) + N2(1)*N2(1))));
169 strike = acos(northing / sqrt(easting*easting + northing*northing));
171 strike = (easting>= 0.0)? strike : (2 * M_PI - strike);
173 R(0, 0) = sin(strike); R(0, 1) = cos(strike); R(0, 2) = 0;
174 R(1, 0) = cos(dip)*cos(strike); R(1, 1) = -cos(dip)*sin(strike); R(1, 2) = -sin(dip);
175 R(2, 0) = -sin(dip)*cos(strike); R(2, 1) = sin(dip)*sin(strike); R(2, 2) = -cos(dip);
181 gmErrorMsg(logger(),
QObject::tr(
"gmpInterface: Unsupported condition in fillStrainDisplacementMatrix"));
189 for (
int i = 0; i < d; ++i)
191 for (
int j = 0; j < cNodes; ++j)
196 Bu(i, j * 2 + i) = -H(j);
198 Bu(i, (j + 2) * 2 + i) = H(1 - j);
203 Bu(i, j * 3 + i) = -H(j);
206 Bu(i, (j + cNodes) * 3 + i) = H(j);
210 gmErrorMsg(logger(),
QObject::tr(
"GmpStdCohesive: Unsupported condition to fill B matrix."));
214 for (
int j = 0; j < inNode; ++j)
219 Bu(i, (j + 4) * 2 + i) = -H(j + 2);
221 Bu(i, (j + 4 + inNode) * 2 + i) = H(1 + inNode - j);
226 Bu(i, (nv + j) * 3 + i) = -H(cNodes + j);
228 Bu(i, (nv + inNode + j) * 3 + i) = H(cNodes + j);
232 gmErrorMsg(logger(),
QObject::tr(
"GmpInterface: Unsupported condition to fill B matrix."));
246 double angleAtanD(
double y,
double x)
248 double PI, GRAUS, angle;
275 angle = atan(y / x)*GRAUS;
280 angle = atan(y / x)*GRAUS;
293 angle = 180.00 - abs(atan(y / x)*GRAUS);
298 angle = abs(atan(y / x)*GRAUS) - 180.00;
314 const GmpFemPhysicsCommonMaterialFactory* matFactory,
const GmLogCategory& logger)
315 : T(pluginType, simulation,
id, description, matFactory, logger)
321 assert(e); Q_UNUSED(MX); Q_UNUSED(N);
322 int cNodes, inNode, nv;
325 int d = GmpFemPhysicsCommon::nodeDim();
329 n = n - pow(2, d - 1);
332 inNode = (n - pow(2.0, d)) / 2.0;
333 cNodes = 0.5 * n - inNode;
339 assert(Bu.n_rows == d && Bu.n_cols == n * d);
348 R(0, 0) = J(0, 0) / detJ;
349 R(0, 1) = J(0, 1) / detJ;
356 gmErrorMsg(logger(),
QObject::tr(
"gmpInterface: Axisymmetric interface element must be 2D model"));
364 for (
int i = 0; i < d; ++i)
366 for (
int j = 0; j < cNodes; ++j)
371 Bu(i, j * 2 + i) = -H(j);
373 Bu(i, (j + 2) * 2 + i) = H(1 - j);
377 gmErrorMsg(logger(),
QObject::tr(
"GmpStdCohesive: Unsupported condition to fill B matrix."));
381 for (
int j = 0; j < inNode; ++j)
386 Bu(i, (j + 4) * 2 + i) = -H(j + 2);
388 Bu(i, (j + 4 + inNode) * 2 + i) = H(1 + inNode - j);
392 gmErrorMsg(logger(),
QObject::tr(
"GmpInterface: Unsupported condition to fill B matrix."));
413 int d = GmpFemPhysicsCommon::nodeDim();
417 n = n - pow(2, d - 1);
419 assert(MX.n_rows == n / 2 && MX.n_cols == d);
422 for (
int j = 0; j < n/2; ++j)
423 rGauss += N(j)*MX(j, 0);
425 return 2 * arma::datum::pi * rGauss;
Declaration of the GmpMechanicalInterface classes.
QString tr(const char *sourceText, const char *disambiguation, int n)
virtual void shapeValues(const GmVector &ncoord, GmVector &N) const=0
Zero-Thickness interface element 2D & 3D for Int2dl4 and Int2dl6, Int3dl8 and CZE3D8P "Linear interfa...
Definition: gmpInterface.h:34
virtual double scaledJacobianDet(const GmMatrix &J) const=0
Definition: gmpInterface.h:310
virtual bool isAxisymmetric()
Returns TRUE only for axisymmetric models.
Definition: gmpInterface.h:429
virtual GmCellType type() const=0
virtual int numNodes() const=0