48 1. - lcoords.
at(1) - lcoords.
at(2)
55 double x1, x2, x3, y1, y2, y3, detJ;
65 detJ = x1 * ( y2 - y3 ) + x2 * ( -y1 + y3 ) + x3 * ( y1 - y2 );
68 answer.
at(1, 1) = ( y2 - y3 ) / detJ;
69 answer.
at(1, 2) = ( x3 - x2 ) / detJ;
71 answer.
at(2, 1) = ( y3 - y1 ) / detJ;
72 answer.
at(2, 2) = ( x1 - x3 ) / detJ;
74 answer.
at(3, 1) = ( y1 - y2 ) / detJ;
75 answer.
at(3, 2) = ( x2 - x1 ) / detJ;
100 #define POINT_TOL 1.e-3 105 double detJ, x1, x2, x3, y1, y2, y3;
115 detJ = x1 * ( y2 - y3 ) + x2 * ( -y1 + y3 ) + x3 * ( y1 - y2 );
118 answer.
at(1) = ( ( x2 * y3 - x3 * y2 ) + ( y2 - y3 ) * coords.
at(
xind) + ( x3 - x2 ) * coords.
at(
yind) ) / detJ;
119 answer.
at(2) = ( ( x3 * y1 - x1 * y3 ) + ( y3 - y1 ) * coords.
at(
xind) + ( x1 - x3 ) * coords.
at(
yind) ) / detJ;
123 for (
int i = 1; i <= 2; i++ ) {
133 if( ( answer.
at(1) + answer.
at(2)) > 1.0 ) {
134 const double temp = 0.5*( answer.
at(1) + answer.
at(2) - 1.);
135 answer.
at(1) -= temp;
136 answer.
at(2) -= temp;
140 answer.
at(3) = 1. - answer.
at(1) - answer.
at(2);
149 double x1, x2, x3, y1, y2, y3;
159 return ( x1 * ( y2 - y3 ) + x2 * ( -y1 + y3 ) + x3 * ( y1 - y2 ) );
164 const double point_tol = 1.0e-3;
166 for (
int i = 1; i <= 2; i++ ) {
167 if ( lcoords.
at(i) < - point_tol ) {
169 }
else if ( lcoords.
at(i) > ( 1. + point_tol ) ) {
174 if ( 1. - lcoords.
at(1) - lcoords.
at(2) < - point_tol ) {
176 }
else if ( 1. - lcoords.
at(1) - lcoords.
at(2) > ( 1. + point_tol ) ) {
186 double ksi = lcoords.
at(1);
187 answer = { ( 1. - ksi ) * 0.5, ( 1. + ksi ) * 0.5 };
198 answer = { -1.0 / l, 1.0 / l };
219 this->
edgeEvalN(n, iedge, lcoords, cellgeo);
232 int aNode = 0, bNode = 0;
238 }
else if ( iedge == 2 ) {
241 }
else if ( iedge == 3 ) {
248 edgeNodes.
at(1) = aNode;
249 edgeNodes.
at(2) = bNode;
258 nodeA = edgeNodes.
at(1);
259 nodeB = edgeNodes.
at(2);
263 return sqrt(dx * dx + dy * dy);
270 double x1, x2, x3, y1, y2, y3;
282 return fabs( 0.5 * ( x1 * ( y2 - y3 ) + x2 * ( -y1 + y3 ) + x3 * ( y1 - y2 ) ) );
290 double x1, x2, y1, y2;
302 return -( x2 * y1 - x1 * y2 );
325 this->
evalN( N, lcoords, cellgeo);
328 for (
int i = 1; i <= 3; i++ ) {
343 this->
edgeEvalN(n, iedge, lcoords, cellgeo);
virtual void edgeLocal2global(FloatArray &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates edge global coordinates from given local ones.
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 boundaryEdgeGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation Jacobian on the requested boundary.
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.
virtual void computeLocalEdgeMapping(IntArray &edgeNodes, int iedge)
double & at(int i)
Coefficient access function.
virtual const FloatArray * giveVertexCoordinates(int i) const =0
Class representing a general abstraction for cell geometry.
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.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
Abstract base class representing integration rule.
virtual double giveArea(const FEICellGeometry &cellgeo) const
Computes the exact area.
virtual double edgeEvalNormal(FloatArray &normal, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the normal on the given edge.
virtual double evalNXIntegral(int iEdge, const FEICellGeometry &cellgeo)
Computes the integral .
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 global2local(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Default implementation using Newton's method to find the local coordinates.
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.
Implementation of matrix containing floating point numbers.
double edgeComputeLength(IntArray &edgeNodes, const FEICellGeometry &cellgeo)
virtual void local2global(FloatArray &answer, const FloatArray &gcoords, const FEICellGeometry &cellgeo)
Evaluates global coordinates from given local ones.
virtual double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
Abstract service.
virtual double edgeGiveTransformationJacobian(int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge Jacobian of transformation between local and global coordinates.
void zero()
Zeroes all coefficients of receiver.
virtual int SetUpPointsOnTriangle(int, MaterialMode mode)
Sets up receiver's integration points on triangular (area coords) integration domain.
virtual double boundaryGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation Jacobian on the requested boundary.
virtual bool inside(const FloatArray &lcoords) const
the oofem namespace is to define a context or scope in which all oofem names are defined.
double normalize()
Normalizes receiver.
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.