74 #define POINT_TOL 1.e-3 79 double detJ, x1, x2, x3, y1, y2, y3;
89 detJ = ( x2 * y3 + x1 * y2 + y1 * x3 - x2 * y1 - x3 * y2 - x1 * y3 );
92 answer.
at(1) = ( ( x2 * y3 - x3 * y2 ) + ( y2 - y3 ) * coords.
at(
xind) + ( x3 - x2 ) * coords.
at(
yind) ) / detJ;
93 answer.
at(2) = ( ( x3 * y1 - x1 * y3 ) + ( y3 - y1 ) * coords.
at(
xind) + ( x1 - x3 ) * coords.
at(
yind) ) / detJ;
98 for (
int i = 1; i <= 2; i++ ) {
107 answer.
at(3) = 1. - answer.
at(1) - answer.
at(2);
116 double x1, x2, x3, y1, y2, y3;
126 return x1 * ( y2 - y3 ) + x2 * ( -y1 + y3 ) + x3 * ( y1 - y2 );
140 OOFEM_ERROR(
"Not applicable to constant interpolation");
156 FloatArray n = { ( 1 - lcoords(0) ) * 0.5, ( 1 + lcoords(0) ) * 0.5 };
169 int aNode = 0, bNode = 0;
175 }
else if ( iedge == 2 ) {
178 }
else if ( iedge == 3 ) {
185 edgeNodes.
at(1) = aNode;
186 edgeNodes.
at(2) = bNode;
195 nodeA = edgeNodes.
at(1);
196 nodeB = edgeNodes.
at(2);
200 return sqrt(dx * dx + dy * dy);
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.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
Abstract base class representing integration rule.
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 int global2local(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Default implementation using Newton's method to find the local coordinates.
virtual void computeLocalEdgeMapping(IntArray &edgeNodes, int iedge)
double edgeComputeLength(IntArray &edgeNodes, const FEICellGeometry &cellgeo)
void resize(int n)
Checks size of receiver towards requested bounds.
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of 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 bool inside(const FloatArray &lcoords) const
virtual int SetUpPointsOnTriangle(int, MaterialMode mode)
Sets up receiver's integration points on triangular (area coords) integration domain.
void zero()
Zeroes all coefficient of receiver.
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.
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 giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation.
Class representing Gaussian-quadrature integration rule.
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...
void resize(int s)
Resizes receiver towards requested size.