44 double xi = lcoords(0);
46 answer(0) = 0.5 * ( xi - 1.0 ) * xi;
47 answer(1) = 0.5 * ( xi + 1.0 ) * xi;
48 answer(2) = 1.0 - xi * xi;
61 double xi = lcoords(0);
63 answer.
at(1, 1) = xi - 0.5;
64 answer.
at(2, 1) = xi + 0.5;
65 answer.
at(3, 1) = -2.0 * xi;
71 this->
evalN(n, lcoords, cellgeo);
83 double x1_x2, y1_y2, px_x3, py_y3, x3_x2_x1, y3_y2_y1;
84 double b0, b1, b2, b3;
93 b0 = 0.50 * ( x1_x2 * px_x3 + y1_y2 * py_y3 );
94 b1 = 0.25 * ( x1_x2 * x1_x2 + y1_y2 * y1_y2 ) + x3_x2_x1 * px_x3 + y3_y2_y1 * py_y3;
95 b2 = 0.75 * ( x1_x2 * x3_x2_x1 + y1_y2 * y3_y2_y1 );
96 b3 = 0.50 * ( x3_x2_x1 * x3_x2_x1 + y3_y2_y1 * y3_y2_y1 );
100 cubic(b3, b2, b1, b0, & r [ 0 ], & r [ 1 ], & r [ 2 ], & roots);
107 for (
int i = 0; i < roots; i++ ) {
108 if ( r [ i ] > -1.0 && r [ i ] < 1.0 ) {
112 r [ i ] -= ( b0 + b1 * r [ i ] + b2 * r [ i ] * r [ i ] + b3 * r [ i ] * r [ i ] * r [ i ] ) / ( b1 + 2 * b2 * r [ i ] + 3 * b3 * r [ i ] * r [ i ] );
113 p [ points ] = r [ i ];
118 double min_distance2 = 0.0, min_xi = 0, distance2;
122 for (
int i = 0; i < points; i++ ) {
126 if ( i == 0 || distance2 < min_distance2 ) {
127 min_distance2 = distance2;
132 answer(0) =
clamp(min_xi, -1., 1.);
139 edgeNodes = { 1, 2, 3};
144 this->
evalN(answer, lcoords, cellgeo);
150 double xi = lcoords(0);
152 answer(0) = -0.5 + xi;
153 answer(1) = 0.5 + xi;
154 answer(2) = -2.0 * xi;
164 double J = sqrt(es1 * es1 + es2 * es2);
171 double xi = lcoords(0);
172 double dN1dxi = -0.5 + xi;
173 double dN2dxi = 0.5 + xi;
174 double dN3dxi = -2.0 * xi;
197 double xi = lcoords(0);
198 double a1 = -0.5 + xi;
199 double a2 = 0.5 + xi;
200 double a3 = -2.0 * xi;
209 return sqrt(es1 * es1 + es2 * es2);
214 double xi = lcoords(0);
215 double dN1dxi = -0.5 + xi;
216 double dN2dxi = 0.5 + xi;
217 double dN3dxi = -2.0 * xi;
226 double J = sqrt(es1 * es1 + es2 * es2);
229 jacobianMatrix.
resize(2, 2);
230 jacobianMatrix(0, 0) = es1 / J;
231 jacobianMatrix(0, 1) = es2 / J;
232 jacobianMatrix(1, 0) = -es2 / J;
233 jacobianMatrix(1, 1) = es1 / J;
245 double x1, x2, x3, y1, y2, y3;
259 return ( x1 * y2 - x2 * y1 + 4 * ( x3 * ( y1 - y2 ) + y3 * ( x2 - x1 ) ) ) / 3.0;
virtual int global2local(FloatArray &answer, const FloatArray &gcoords, const FEICellGeometry &cellgeo)
Default implementation using Newton's method to find the local coordinates.
double & at(int i)
Coefficient access function.
virtual const FloatArray * giveVertexCoordinates(int i) const =0
Class representing a general abstraction for cell geometry.
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...
Class implementing an array of integers.
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 void evaldNdxi(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
virtual double evalNXIntegral(int iEdge, const FEICellGeometry &cellgeo)
Computes the integral .
virtual double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation.
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 evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of interpolation functions (shape functions) at given point.
double at(int i, int j) const
Coefficient access function.
double distance_square(const FloatArray &iP1, const FloatArray &iP2, double &oXi, double &oXiUnbounded) const
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
double clamp(int a, int lower, int upper)
Returns the clamped value of a between upper and lower.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
Abstract service.
virtual void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates global coordinates from given local ones.
virtual void edgeLocal2global(FloatArray &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates edge global coordinates from given local ones.
void giveJacobianMatrixAt(FloatMatrix &jacobianMatrix, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Gives the jacobian matrix at the local coordinates.
virtual int SetUpPointsOnLine(int, MaterialMode mode)
Sets up receiver's integration points on unit line integration domain.
virtual void computeLocalEdgeMapping(IntArray &edgeNodes, int iedge)
void times(double s)
Multiplies receiver with scalar.
virtual double edgeEvalNormal(FloatArray &normal, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the normal on the given edge.
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.
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
double edgeComputeLength(IntArray &edgeNodes, const FEICellGeometry &cellgeo)
double normalize()
Normalizes 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.
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.