52 answer.
at(1) = 0.125 * ( 1. - x ) * ( 1. - y ) * ( 1. + z );
53 answer.
at(2) = 0.125 * ( 1. - x ) * ( 1. + y ) * ( 1. + z );
54 answer.
at(3) = 0.125 * ( 1. + x ) * ( 1. + y ) * ( 1. + z );
55 answer.
at(4) = 0.125 * ( 1. + x ) * ( 1. - y ) * ( 1. + z );
56 answer.
at(5) = 0.125 * ( 1. - x ) * ( 1. - y ) * ( 1. - z );
57 answer.
at(6) = 0.125 * ( 1. - x ) * ( 1. + y ) * ( 1. - z );
58 answer.
at(7) = 0.125 * ( 1. + x ) * ( 1. + y ) * ( 1. - z );
59 answer.
at(8) = 0.125 * ( 1. + x ) * ( 1. - y ) * ( 1. - z );
69 for (
int i = 1; i <= 8; i++ ) {
83 this->
evalN(n, lcoords, cellgeo);
86 for (
int i = 1; i <= 8; i++ ) {
91 #define POINT_TOL 1.e-3 96 double x1, x2, x3, x4, x5, x6, x7, x8, a1, a2, a3, a4, a5, a6, a7, a8;
97 double y1, y2, y3, y4, y5, y6, y7, y8, b1, b2, b3, b4, b5, b6, b7, b8;
98 double z1, z2, z3, z4, z5, z6, z7, z8, c1, c2, c3, c4, c5, c6, c7, c8;
99 double xp, yp, zp, u, v, w;
135 a1 = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8;
136 a2 = -x1 - x2 + x3 + x4 - x5 - x6 + x7 + x8;
137 a3 = -x1 + x2 + x3 - x4 - x5 + x6 + x7 - x8;
138 a4 = x1 + x2 + x3 + x4 - x5 - x6 - x7 - x8;
139 a5 = x1 - x2 + x3 - x4 + x5 - x6 + x7 - x8;
140 a6 = -x1 - x2 + x3 + x4 + x5 + x6 - x7 - x8;
141 a7 = -x1 + x2 + x3 - x4 + x5 - x6 - x7 + x8;
142 a8 = x1 - x2 + x3 - x4 - x5 + x6 - x7 + x8;
144 b1 = y1 + y2 + y3 + y4 + y5 + y6 + y7 + y8;
145 b2 = -y1 - y2 + y3 + y4 - y5 - y6 + y7 + y8;
146 b3 = -y1 + y2 + y3 - y4 - y5 + y6 + y7 - y8;
147 b4 = y1 + y2 + y3 + y4 - y5 - y6 - y7 - y8;
148 b5 = y1 - y2 + y3 - y4 + y5 - y6 + y7 - y8;
149 b6 = -y1 - y2 + y3 + y4 + y5 + y6 - y7 - y8;
150 b7 = -y1 + y2 + y3 - y4 + y5 - y6 - y7 + y8;
151 b8 = y1 - y2 + y3 - y4 - y5 + y6 - y7 + y8;
153 c1 = z1 + z2 + z3 + z4 + z5 + z6 + z7 + z8;
154 c2 = -z1 - z2 + z3 + z4 - z5 - z6 + z7 + z8;
155 c3 = -z1 + z2 + z3 - z4 - z5 + z6 + z7 - z8;
156 c4 = z1 + z2 + z3 + z4 - z5 - z6 - z7 - z8;
157 c5 = z1 - z2 + z3 - z4 + z5 - z6 + z7 - z8;
158 c6 = -z1 - z2 + z3 + z4 + z5 + z6 - z7 - z8;
159 c7 = -z1 + z2 + z3 - z4 + z5 - z6 - z7 + z8;
160 c8 = z1 - z2 + z3 - z4 - z5 + z6 - z7 + z8;
168 if ( ( ++nite ) > 10 ) {
178 r.at(1) = a1 + u * a2 + v * a3 + w * a4 + u * v * a5 + u * w * a6 + v * w * a7 + u * v * w * a8 - 8.0 * xp;
179 r.at(2) = b1 + u * b2 + v * b3 + w * b4 + u * v * b5 + u * w * b6 + v * w * b7 + u * v * w * b8 - 8.0 * yp;
180 r.at(3) = c1 + u * c2 + v * c3 + w * c4 + u * v * c5 + u * w * c6 + v * w * c7 + u * v * w * c8 - 8.0 * zp;
183 if ( r.computeSquaredNorm() < 1.e-20 ) {
187 p.
at(1, 1) = a2 + v * a5 + w * a6 + v * w * a8;
188 p.
at(1, 2) = a3 + u * a5 + w * a7 + u * w * a8;
189 p.
at(1, 3) = a4 + u * a6 + v * a7 + u * v * a8;
191 p.
at(2, 1) = b2 + v * b5 + w * b6 + v * w * b8;
192 p.
at(2, 2) = b3 + u * b5 + w * b7 + u * w * b8;
193 p.
at(2, 3) = b4 + u * b6 + v * b7 + u * v * b8;
195 p.
at(3, 1) = c2 + v * c5 + w * c6 + v * w * c8;
196 p.
at(3, 2) = c3 + u * c5 + w * c7 + u * w * c8;
197 p.
at(3, 3) = c4 + u * c6 + v * c7 + u * v * c8;
208 for (
int i = 1; i <= 3; i++ ) {
224 double ksi = lcoords.
at(1);
227 answer.
at(1) = ( 1. - ksi ) * 0.5;
228 answer.
at(2) = ( 1. + ksi ) * 0.5;
241 answer.
at(1, 1) = -1.0 / l;
242 answer.
at(2, 1) = 1.0 / l;
262 this->
edgeEvalN(n, iedge, lcoords, cellgeo);
286 int aNode = 0, bNode = 0;
291 }
else if ( iedge == 2 ) {
294 }
else if ( iedge == 3 ) {
297 }
else if ( iedge == 4 ) {
300 }
else if ( iedge == 5 ) {
303 }
else if ( iedge == 6 ) {
306 }
else if ( iedge == 7 ) {
309 }
else if ( iedge == 8 ) {
312 }
else if ( iedge == 9 ) {
315 }
else if ( iedge == 10 ) {
318 }
else if ( iedge == 11 ) {
321 }
else if ( iedge == 12 ) {
328 edgeNodes = {aNode, bNode};
346 answer.
at(1) = ( 1. + ksi ) * ( 1. + eta ) * 0.25;
347 answer.
at(2) = ( 1. - ksi ) * ( 1. + eta ) * 0.25;
348 answer.
at(3) = ( 1. - ksi ) * ( 1. - eta ) * 0.25;
349 answer.
at(4) = ( 1. + ksi ) * ( 1. - eta ) * 0.25;
364 lcoords_hex = {-lcoords.
at(1), -lcoords.
at(2), 1};
365 }
else if ( isurf == 2 ) {
366 lcoords_hex = {-lcoords.
at(2), -lcoords.
at(1), -1};
367 }
else if ( isurf == 3 ) {
368 lcoords_hex = {-1, -lcoords.
at(1), lcoords.
at(2)};
369 }
else if ( isurf == 4 ) {
370 lcoords_hex = {-lcoords.
at(1), 1, lcoords.
at(2)};
371 }
else if ( isurf == 5 ) {
372 lcoords_hex = {1, lcoords.
at(1), lcoords.
at(2)};
373 }
else if ( isurf == 6 ) {
374 lcoords_hex = {lcoords.
at(1), -1, lcoords.
at(2)};
381 lcoords_hex = {-1, lcoords.
at(1), lcoords.
at(2)};
382 }
else if ( isurf == 2 ) {
383 lcoords_hex = {1, lcoords.
at(1), lcoords.
at(2)};
384 }
else if ( isurf == 3 ) {
385 lcoords_hex = {lcoords.
at(1), -1, lcoords.
at(2)};
386 }
else if ( isurf == 4 ) {
387 lcoords_hex = {lcoords.
at(1), 1, lcoords.
at(2)};
388 }
else if ( isurf == 5 ) {
389 lcoords_hex = {lcoords.
at(1), lcoords.
at(2), -1};
390 }
else if ( isurf == 6 ) {
391 lcoords_hex = {lcoords.
at(1), lcoords.
at(2), 1};
398 this->
evaldNdx(fullB, lcoords_hex, cellgeo);
400 for (
int i = 1; i <= snodes.
giveSize(); ++i ) {
401 for (
int j = 1; j <= 3; ++j ) {
402 answer.
at(i, j) = fullB.
at(snodes.
at(i), j);
439 dNdksi.at(1) = ( 1. + eta );
440 dNdksi.at(2) = -( 1. + eta );
441 dNdksi.at(3) = -( 1. - eta );
442 dNdksi.at(4) = ( 1. - eta );
444 dNdeta.
at(1) = ( 1. + ksi );
445 dNdeta.
at(2) = ( 1. - ksi );
446 dNdeta.
at(3) = -( 1. - ksi );
447 dNdeta.
at(4) = -( 1. + ksi );
449 for (
int i = 1; i <= 4; ++i ) {
470 surfNodes = {1, 4, 3, 2};
471 }
else if ( isurf == 2 ) {
472 surfNodes = {5, 6, 7, 8};
473 }
else if ( isurf == 3 ) {
474 surfNodes = {1, 2, 6, 5};
475 }
else if ( isurf == 4 ) {
476 surfNodes = {2, 3, 7, 6};
477 }
else if ( isurf == 5 ) {
478 surfNodes = {3, 4, 8, 7};
479 }
else if ( isurf == 6 ) {
480 surfNodes = {4, 1, 5, 8};
493 for (
int i = 1; i <= 8; i++ ) {
509 dN.
at(1, 1) = -0.125 * ( 1. - v ) * ( 1. + w );
510 dN.
at(2, 1) = -0.125 * ( 1. + v ) * ( 1. + w );
511 dN.
at(3, 1) = 0.125 * ( 1. + v ) * ( 1. + w );
512 dN.
at(4, 1) = 0.125 * ( 1. - v ) * ( 1. + w );
513 dN.
at(5, 1) = -0.125 * ( 1. - v ) * ( 1. - w );
514 dN.
at(6, 1) = -0.125 * ( 1. + v ) * ( 1. - w );
515 dN.
at(7, 1) = 0.125 * ( 1. + v ) * ( 1. - w );
516 dN.
at(8, 1) = 0.125 * ( 1. - v ) * ( 1. - w );
518 dN.
at(1, 2) = -0.125 * ( 1. - u ) * ( 1. + w );
519 dN.
at(2, 2) = 0.125 * ( 1. - u ) * ( 1. + w );
520 dN.
at(3, 2) = 0.125 * ( 1. + u ) * ( 1. + w );
521 dN.
at(4, 2) = -0.125 * ( 1. + u ) * ( 1. + w );
522 dN.
at(5, 2) = -0.125 * ( 1. - u ) * ( 1. - w );
523 dN.
at(6, 2) = 0.125 * ( 1. - u ) * ( 1. - w );
524 dN.
at(7, 2) = 0.125 * ( 1. + u ) * ( 1. - w );
525 dN.
at(8, 2) = -0.125 * ( 1. + u ) * ( 1. - w );
527 dN.
at(1, 3) = 0.125 * ( 1. - u ) * ( 1. - v );
528 dN.
at(2, 3) = 0.125 * ( 1. - u ) * ( 1. + v );
529 dN.
at(3, 3) = 0.125 * ( 1. + u ) * ( 1. + v );
530 dN.
at(4, 3) = 0.125 * ( 1. + u ) * ( 1. - v );
531 dN.
at(5, 3) = -0.125 * ( 1. - u ) * ( 1. - v );
532 dN.
at(6, 3) = -0.125 * ( 1. - u ) * ( 1. + v );
533 dN.
at(7, 3) = -0.125 * ( 1. + u ) * ( 1. + v );
534 dN.
at(8, 3) = -0.125 * ( 1. + u ) * ( 1. - v );
549 c4(2) * ( c1(1) * ( -c2(0) - c3(0) ) + c2(1) * ( c1(0) - c3(0) ) + c3(1) * ( c1(0) + c2(0) ) ) +
550 c3(2) * ( c1(1) * ( -c2(0) + c4(0) ) + c2(1) * ( c1(0) + c4(0) ) + c4(1) * ( -c1(0) - c2(0) ) ) +
551 c2(2) * ( c1(1) * ( c3(0) + c4(0) ) + c3(1) * ( -c1(0) - c4(0) ) + c4(1) * ( -c1(0) + c3(0) ) ) +
552 c1(2) * ( c2(1) * ( -c3(0) - c4(0) ) + c3(1) * ( c2(0) - c4(0) ) + c4(1) * ( c2(0) + c3(0) ) ) ) * 0.25;
double giveDeterminant() const
Returns the trace (sum of diagonal components) of the receiver.
virtual void computeLocalEdgeMapping(IntArray &edgeNodes, int iedge)
virtual void edgeEvaldNdx(FloatMatrix &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of edge interpolation functions (shape functions) at given point...
void subtract(const FloatArray &src)
Subtracts array src to receiver.
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Computes vector product (or cross product) of vectors given as parameters, , and stores the result in...
virtual int global2local(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates local coordinates from given global ones.
bool solveForRhs(const FloatArray &b, FloatArray &answer, bool transpose=false)
Solves the system of linear equations .
virtual void edgeLocal2global(FloatArray &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates edge global coordinates from given local ones.
virtual IntegrationRule * giveBoundaryIntegrationRule(int order, int boundary)
Sets up a suitable integration rule for integrating over the requested boundary.
virtual void surfaceEvalN(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of edge interpolation functions (shape functions) at given point.
double & at(int i)
Coefficient access function.
virtual const FloatArray * giveVertexCoordinates(int i) const =0
Class representing a general abstraction for cell geometry.
void clear()
Clears receiver (zero size).
virtual double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
virtual void surfaceEvaldNdx(FloatMatrix &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of edge interpolation functions (shape functions) at given point...
virtual int SetUpPointsOnSquare(int, MaterialMode mode)
Sets up receiver's integration points on unit square integration domain.
virtual double evalNXIntegral(int iEdge, const FEICellGeometry &cellgeo)
Computes the integral .
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates global coordinates from given local ones.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of interpolation functions (shape functions) at given point.
Abstract base class representing integration rule.
virtual void surfaceLocal2global(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates edge global coordinates from given local ones.
void giveLocalDerivative(FloatMatrix &dN, const FloatArray &lcoords)
virtual int SetUpPointsOnCube(int, MaterialMode mode)
Sets up receiver's integration points on unit cube integration domain.
double at(int i, int j) const
Coefficient access function.
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
virtual IntegrationRule * giveIntegrationRule(int order)
Sets up a suitable integration rule for numerical integrating over volume.
virtual double edgeGiveTransformationJacobian(int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge jacobian of transformation between local and global coordinates.
virtual void edgeEvaldNdxi(FloatArray &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of edge interpolation functions (shape functions) at given point...
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
Abstract service.
double edgeComputeLength(IntArray &edgeNodes, const FEICellGeometry &cellgeo)
void zero()
Zeroes all coefficients of receiver.
void setColumn(const FloatArray &src, int c)
Sets the values of the matrix in specified column.
virtual void computeLocalSurfaceMapping(IntArray &edgeNodes, int iedge)
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
virtual double surfaceEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the normal out of the surface at given point.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
double normalize()
Normalizes receiver.
virtual double surfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge jacobian of transformation between local and global coordinates.
void add(const FloatArray &src)
Adds array src to receiver.
virtual void edgeEvalN(FloatArray &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of edge interpolation functions (shape functions) at given point.
virtual void giveJacobianMatrixAt(FloatMatrix &jacobianMatrix, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Gives the jacobian matrix at the local coordinates.
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.