55 return fabs( 0.5 * ( x13 * y24 - x24 * y13 ) );
67 ( 1. + ksi ) * ( 1. + eta ) * 0.25,
68 ( 1. - ksi ) * ( 1. + eta ) * 0.25,
69 ( 1. - ksi ) * ( 1. - eta ) * 0.25,
70 ( 1. + ksi ) * ( 1. - eta ) * 0.25
84 jacobianMatrix.at(1, 1) += dn.
at(i, 1) * x;
85 jacobianMatrix.at(1, 2) += dn.
at(i, 1) * y;
86 jacobianMatrix.at(2, 1) += dn.
at(i, 2) * x;
87 jacobianMatrix.at(2, 2) += dn.
at(i, 2) * y;
92 return jacobianMatrix.giveDeterminant();
98 double ksi = lcoords.
at(1);
99 double eta = lcoords.
at(2);
101 double n1 = ( 1. + ksi ) * ( 1. + eta ) * 0.25;
102 double n2 = ( 1. - ksi ) * ( 1. + eta ) * 0.25;
103 double n3 = ( 1. - ksi ) * ( 1. - eta ) * 0.25;
104 double n4 = ( 1. + ksi ) * ( 1. - eta ) * 0.25;
117 #define POINT_TOL 1.e-6 122 double x1, x2, x3, x4, y1, y2, y3, y4, a1, a2, a3, a4, b1, b2, b3, b4;
123 double a, b, c, ksi1, ksi2, ksi3, eta1 = 0.0, eta2 = 0.0, denom;
138 a1 = x1 + x2 + x3 + x4;
139 a2 = x1 - x2 - x3 + x4;
140 a3 = x1 + x2 - x3 - x4;
141 a4 = x1 - x2 + x3 - x4;
143 b1 = y1 + y2 + y3 + y4;
144 b2 = y1 - y2 - y3 + y4;
145 b3 = y1 + y2 - y3 - y4;
146 b4 = y1 - y2 + y3 - y4;
148 a = a2 * b4 - b2 * a4;
149 b = a1 * b4 + a2 * b3 - a3 * b2 - b1 * a4 - b4 * 4.0 * coords.
at(
xind) + a4 * 4.0 * coords.
at(
yind);
150 c = a1 * b3 - a3 * b1 - 4.0 * coords.
at(
xind) * b3 + 4.0 * coords.
at(
yind) * a3;
153 cubic(0.0, a, b, c, & ksi1, & ksi2, & ksi3, & nroot);
161 denom = ( b3 + ksi1 * b4 );
162 if ( fabs(denom) <= 1.0e-10 ) {
163 eta1 = ( 4.0 * coords.
at(
xind) - a1 - ksi1 * a2 ) / ( a3 + ksi1 * a4 );
165 eta1 = ( 4.0 * coords.
at(
yind) - b1 - ksi1 * b2 ) / denom;
170 double diff_ksi1, diff_eta1, diff_ksi2, diff_eta2, diff1, diff2;
172 denom = b3 + ksi2 * b4;
173 if ( fabs(denom) <= 1.0e-10 ) {
174 eta2 = ( 4.0 * coords.
at(
xind) - a1 - ksi2 * a2 ) / ( a3 + ksi2 * a4 );
176 eta2 = ( 4.0 * coords.
at(
yind) - b1 - ksi2 * b2 ) / denom;
182 diff_ksi1 = ksi1 - 1.0;
186 diff_ksi1 = ksi1 + 1.0;
191 diff_eta1 = eta1 - 1.0;
195 diff_eta1 = eta1 + 1.0;
200 diff_ksi2 = ksi2 - 1.0;
204 diff_ksi2 = ksi2 + 1.0;
209 diff_eta2 = eta2 - 1.0;
213 diff_eta2 = eta2 + 1.0;
216 diff1 = diff_ksi1 * diff_ksi1 + diff_eta1 * diff_eta1;
217 diff2 = diff_ksi2 * diff_ksi2 + diff_eta2 * diff_eta2;
220 if ( diff1 > diff2 ) {
231 for (
int i = 1; i <= 2; i++ ) {
247 double ksi = lcoords.
at(1);
248 answer = { ( 1. - ksi ) * 0.5, ( 1. + ksi ) * 0.5 };
257 nodeA = edgeNodes.
at(1);
258 nodeB = edgeNodes.
at(2);
275 answer = { -1.0 / l, 1.0 / l };
285 this->
edgeEvalN(n, iedge, lcoords, cellgeo);
297 int aNode = 0, bNode = 0;
303 }
else if ( iedge == 2 ) {
306 }
else if ( iedge == 3 ) {
309 }
else if ( iedge == 4 ) {
316 edgeNodes.
at(1) = aNode;
317 edgeNodes.
at(2) = bNode;
326 nodeA = edgeNodes.
at(1);
327 nodeB = edgeNodes.
at(2);
331 return sqrt(dx * dx + dy * dy);
337 const double point_tol = 1.0e-3;
339 for (
int i = 1; i <= 2; i++ ) {
340 if ( lcoords.
at(i) < ( -1. - point_tol ) ) {
342 }
else if ( lcoords.
at(i) > ( 1. + point_tol ) ) {
352 const double &ksi = lcoords[0];
353 const double &eta = lcoords[1];
358 answer.
at(1, 1) = 0.25 * ( 1. + eta );
359 answer.
at(2, 1) = -0.25 * ( 1. + eta );
360 answer.
at(3, 1) = -0.25 * ( 1. - eta );
361 answer.
at(4, 1) = 0.25 * ( 1. - eta );
364 answer.
at(1, 2) = 0.25 * ( 1. + ksi );
365 answer.
at(2, 2) = 0.25 * ( 1. - ksi );
366 answer.
at(3, 2) = -0.25 * ( 1. - ksi );
367 answer.
at(4, 2) = -0.25 * ( 1. + ksi );
374 double x1, x2, y1, y2;
386 return -( x2 * y1 - x1 * y2 );
407 this->
evalN( N, lcoords, cellgeo);
410 for (
int i = 1; i <= 4; i++ ) {
425 this->
edgeEvalN(n, iedge, lcoords, cellgeo);
virtual int global2local(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Default implementation using Newton's method to find the local coordinates.
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 double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation.
virtual double edgeGiveTransformationJacobian(int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge Jacobian of transformation between local and global coordinates.
virtual void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates global coordinates from given local ones.
double & at(int i)
Coefficient access function.
virtual const FloatArray * giveVertexCoordinates(int i) const =0
virtual double edgeEvalNormal(FloatArray &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the normal on the given edge.
Class representing a general abstraction for cell geometry.
virtual double edgeGiveTransformationJacobian(int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge Jacobian of transformation between local and global coordinates.
virtual void edgeEvaldNds(FloatArray &answer, int iedge, 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.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
Abstract base class representing integration rule.
void cubic(double a, double b, double c, double d, double *r1, double *r2, double *r3, int *num)
Solves cubic equation for real roots.
virtual double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation.
virtual void computeLocalEdgeMapping(IntArray &edgeNodes, int iedge)
virtual double boundaryEdgeGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation Jacobian on the requested boundary.
virtual IntegrationRule * giveIntegrationRule(int order)
Sets up a suitable integration rule for numerical integrating over volume.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
Class representing vector of real numbers.
double edgeComputeLength(IntArray &edgeNodes, const FEICellGeometry &cellgeo)
Implementation of matrix containing floating point numbers.
virtual void edgeLocal2global(FloatArray &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates edge global coordinates from given local ones.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
Abstract service.
void zero()
Zeroes all coefficients of receiver.
virtual double evalNXIntegral(int iEdge, const FEICellGeometry &cellgeo)
Computes the integral .
void beProductTOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
virtual bool inside(const FloatArray &lcoords) const
virtual void evaldNdxi(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of interpolation functions (shape functions) 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 evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
int giveNumberOfRows() const
Returns number of rows of receiver.
virtual double giveArea(const FEICellGeometry &cellgeo) const
Computes the exact area.
virtual double boundaryGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation Jacobian on the requested boundary.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of interpolation functions (shape functions) at given point.
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.