47 answer.
at(1) = lcoords.
at(1);
48 answer.
at(2) = lcoords.
at(2);
49 answer.
at(3) = lcoords.
at(3);
50 answer.
at(4) = 1. - lcoords.
at(1) - lcoords.
at(2) - lcoords.
at(3);
56 double x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4, detJ;
74 detJ = ( ( x4 - x1 ) * ( y2 - y1 ) * ( z3 - z1 ) - ( x4 - x1 ) * ( y3 - y1 ) * ( z2 - z1 ) +
75 ( x3 - x1 ) * ( y4 - y1 ) * ( z2 - z1 ) - ( x2 - x1 ) * ( y4 - y1 ) * ( z3 - z1 ) +
76 ( x2 - x1 ) * ( y3 - y1 ) * ( z4 - z1 ) - ( x3 - x1 ) * ( y2 - y1 ) * ( z4 - z1 ) );
82 answer.
at(1, 1) = -( ( y3 - y2 ) * ( z4 - z2 ) - ( y4 - y2 ) * ( z3 - z2 ) );
83 answer.
at(2, 1) = ( y4 - y3 ) * ( z1 - z3 ) - ( y1 - y3 ) * ( z4 - z3 );
84 answer.
at(3, 1) = -( ( y1 - y4 ) * ( z2 - z4 ) - ( y2 - y4 ) * ( z1 - z4 ) );
85 answer.
at(4, 1) = ( y2 - y1 ) * ( z3 - z1 ) - ( y3 - y1 ) * ( z2 - z1 );
87 answer.
at(1, 2) = -( ( x4 - x2 ) * ( z3 - z2 ) - ( x3 - x2 ) * ( z4 - z2 ) );
88 answer.
at(2, 2) = ( x1 - x3 ) * ( z4 - z3 ) - ( x4 - x3 ) * ( z1 - z3 );
89 answer.
at(3, 2) = -( ( x2 - x4 ) * ( z1 - z4 ) - ( x1 - x4 ) * ( z2 - z4 ) );
90 answer.
at(4, 2) = ( x3 - x1 ) * ( z2 - z1 ) - ( x2 - x1 ) * ( z3 - z1 );
92 answer.
at(1, 3) = -( ( x3 - x2 ) * ( y4 - y2 ) - ( x4 - x2 ) * ( y3 - y2 ) );
93 answer.
at(2, 3) = ( x4 - x3 ) * ( y1 - y3 ) - ( x1 - x3 ) * ( y4 - y3 );
94 answer.
at(3, 3) = -( ( x1 - x4 ) * ( y2 - y4 ) - ( x2 - x4 ) * ( y1 - y4 ) );
95 answer.
at(4, 3) = ( x2 - x1 ) * ( y3 - y1 ) - ( x3 - x1 ) * ( y2 - y1 );
97 answer.
times(1. / detJ);
106 this->
evalN(n, lcoords, cellgeo);
109 for (
int i = 1; i <= 4; i++ ) {
114 #define POINT_TOL 1.e-3 119 double x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4, xp, yp, zp, volume;
141 volume = ( ( x4 - x1 ) * ( y2 - y1 ) * ( z3 - z1 ) - ( x4 - x1 ) * ( y3 - y1 ) * ( z2 - z1 ) +
142 ( x3 - x1 ) * ( y4 - y1 ) * ( z2 - z1 ) - ( x2 - x1 ) * ( y4 - y1 ) * ( z3 - z1 ) +
143 ( x2 - x1 ) * ( y3 - y1 ) * ( z4 - z1 ) - ( x3 - x1 ) * ( y2 - y1 ) * ( z4 - z1 ) ) / 6.;
147 answer.
at(1) = ( ( x3 - x2 ) * ( yp - y2 ) * ( z4 - z2 ) - ( xp - x2 ) * ( y3 - y2 ) * ( z4 - z2 ) +
148 ( x4 - x2 ) * ( y3 - y2 ) * ( zp - z2 ) - ( x4 - x2 ) * ( yp - y2 ) * ( z3 - z2 ) +
149 ( xp - x2 ) * ( y4 - y2 ) * ( z3 - z2 ) - ( x3 - x2 ) * ( y4 - y2 ) * ( zp - z2 ) ) / 6. / volume;
151 answer.
at(2) = ( ( x4 - x1 ) * ( yp - y1 ) * ( z3 - z1 ) - ( xp - x1 ) * ( y4 - y1 ) * ( z3 - z1 ) +
152 ( x3 - x1 ) * ( y4 - y1 ) * ( zp - z1 ) - ( x3 - x1 ) * ( yp - y1 ) * ( z4 - z1 ) +
153 ( xp - x1 ) * ( y3 - y1 ) * ( z4 - z1 ) - ( x4 - x1 ) * ( y3 - y1 ) * ( zp - z1 ) ) / 6. / volume;
155 answer.
at(3) = ( ( x2 - x1 ) * ( yp - y1 ) * ( z4 - z1 ) - ( xp - x1 ) * ( y2 - y1 ) * ( z4 - z1 ) +
156 ( x4 - x1 ) * ( y2 - y1 ) * ( zp - z1 ) - ( x4 - x1 ) * ( yp - y1 ) * ( z2 - z1 ) +
157 ( xp - x1 ) * ( y4 - y1 ) * ( z2 - z1 ) - ( x2 - x1 ) * ( y4 - y1 ) * ( zp - z1 ) ) / 6. / volume;
161 for (
int i = 1; i <= 3; i++ ) {
171 answer.
at(4) = 1.0 - answer.
at(1) - answer.
at(2) - answer.
at(3);
180 double detJ, x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4;
197 detJ = ( ( x4 - x1 ) * ( y2 - y1 ) * ( z3 - z1 ) - ( x4 - x1 ) * ( y3 - y1 ) * ( z2 - z1 ) +
198 ( x3 - x1 ) * ( y4 - y1 ) * ( z2 - z1 ) - ( x2 - x1 ) * ( y4 - y1 ) * ( z3 - z1 ) +
199 ( x2 - x1 ) * ( y3 - y1 ) * ( z4 - z1 ) - ( x3 - x1 ) * ( y2 - y1 ) * ( z4 - z1 ) );
208 double ksi = lcoords.
at(1);
211 answer.
at(1) = ( 1. - ksi ) * 0.5;
212 answer.
at(2) = ( 1. + ksi ) * 0.5;
219 double coeff, l, x1, x2, y1, y2, z1, z2;
233 answer.
at(1, 1) = ( x1 - x2 ) * coeff;
234 answer.
at(1, 2) = ( y1 - y2 ) * coeff;
235 answer.
at(1, 3) = ( z1 - z2 ) * coeff;
237 answer.
at(2, 1) = ( x2 - x1 ) * coeff;
238 answer.
at(2, 2) = ( y2 - y1 ) * coeff;
239 answer.
at(2, 3) = ( z2 - z1 ) * coeff;
249 this->
edgeEvalN(n, iedge, lcoords, cellgeo);
273 int aNode = 0, bNode = 0;
279 }
else if ( iedge == 2 ) {
282 }
else if ( iedge == 3 ) {
285 }
else if ( iedge == 4 ) {
288 }
else if ( iedge == 5 ) {
291 }
else if ( iedge == 6 ) {
298 edgeNodes.
at(1) = ( aNode );
299 edgeNodes.
at(2) = ( bNode );
313 answer.
at(1) = lcoords.
at(1);
314 answer.
at(2) = lcoords.
at(2);
315 answer.
at(3) = 1. - lcoords.
at(1) - lcoords.
at(2);
351 lcoords_tet.
at(snodes.
at(1)) = lcoords.
at(1);
352 lcoords_tet.
at(snodes.
at(2)) = lcoords.
at(2);
353 lcoords_tet.
at(snodes.
at(3)) = 1. - lcoords.
at(1) - lcoords.
at(2);
356 this->
evaldNdx(fullB, lcoords_tet, cellgeo);
358 for (
int i = 1; i <= snodes.
giveSize(); ++i ) {
359 for (
int j = 1; j <= 3; ++j ) {
360 answer.
at(i, j) = fullB.
at(snodes.
at(i), j);
390 int aNode = 0, bNode = 0, cNode = 0;
397 }
else if ( isurf == 2 ) {
401 }
else if ( isurf == 3 ) {
405 }
else if ( isurf == 4 ) {
413 surfNodes.
at(1) = ( aNode );
414 surfNodes.
at(2) = ( bNode );
415 surfNodes.
at(3) = ( cNode );
428 return ( ( c2.
at(1) * c3.
at(2) - c3.
at(1) * c2.
at(2) ) * c1.
at(3) +
429 ( c3.
at(1) * c1.
at(2) - c1.
at(1) * c3.
at(2) ) * c2.
at(3) +
430 ( c1.
at(1) * c2.
at(2) - c2.
at(1) * c1.
at(2) ) * c3.
at(3) ) * 0.5;
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Computes vector product (or cross product) of vectors given as parameters, , and stores the result in...
double edgeComputeLength(IntArray &edgeNodes, const FEICellGeometry &cellgeo)
virtual int global2local(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates local coordinates from given global ones.
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 int SetUpPointsOnTetrahedra(int, MaterialMode mode)
Sets up receiver's integration points on tetrahedra (volume coords) integration domain.
virtual IntegrationRule * giveBoundaryIntegrationRule(int order, int boundary)
Sets up a suitable integration rule for integrating over the requested boundary.
virtual void surfaceLocal2global(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates edge global coordinates from given local ones.
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 void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of interpolation functions (shape functions) at given point.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation.
Abstract base class representing integration rule.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
virtual double evalNXIntegral(int iEdge, const FEICellGeometry &cellgeo)
Computes the integral .
virtual double surfaceEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the normal out of the surface at given point.
virtual void computeLocalEdgeMapping(IntArray &edgeNodes, int iedge)
void times(double f)
Multiplies receiver by factor f.
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 double surfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge jacobian of transformation between local and global coordinates.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
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.
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
virtual void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates global coordinates from given local ones.
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.
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 resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
Abstract service.
virtual void edgeLocal2global(FloatArray &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates edge global coordinates from given local ones.
virtual int SetUpPointsOnTriangle(int, MaterialMode mode)
Sets up receiver's integration points on triangular (area coords) integration domain.
virtual IntegrationRule * giveIntegrationRule(int order)
Sets up a suitable integration rule for numerical integrating over volume.
the oofem namespace is to define a context or scope in which all oofem names are defined.
double normalize()
Normalizes receiver.
virtual void computeLocalSurfaceMapping(IntArray &edgeNodes, int iedge)
virtual double edgeGiveTransformationJacobian(int iedge, 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.
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.