60 mVertices(iBasicGeometry.mVertices)
70 for(
size_t i =
mVertices.size()-1; i > 0; i--) {
82 for(
size_t i = 0; i <
mVertices.size(); i++) {
101 const double c1 = (1.0e-14)*LengthP*LengthP;
102 const double c2 = (1.0e-14)*LengthQ*LengthQ;
104 const size_t minIter = 2;
105 const size_t maxIter = 5;
106 const double absTol = 1.0e-12;
108 double xi = 0.0, eta = 0.0;
119 bool lockXi =
false, lockEta =
false;
121 for(
size_t iter = 0; iter < maxIter; iter++) {
158 if(res < absTol && iter >= minIter) {
171 K(0,1) = K(1,0) = 0.0;
175 K(0,1) = K(1,0) = 0.0;
236 double a = pointA.
at(2) - pointB.
at(2);
237 double b = pointB.
at(1) - pointA.
at(1);
238 double c = pointA.
at(1) * pointB.
at(2) - pointB.
at(1) * pointA.
at(2);
240 return ( a * point->
at(1) + b * point->
at(2) + c ) / l;
270 const double relTol = 1.0e-3;
276 for (
int edgeIndex = 1; edgeIndex <= numEdges; edgeIndex++ ) {
280 const int nsLoc = bNodes.
at(1);
281 const int neLoc = bNodes.
at( bNodes.
giveSize() );
303 if ( i < element->giveNumberOfDofManagers() ) {
313 if ( lsn1 * lsn2 <= 0 && lst1 <= 0 && lst2 <= 0 ) {
314 double r = lsn1 / ( lsn1 - lsn2 );
315 if ( i <= element->giveNumberOfDofManagers() ) {
317 for (
int j = 1; j <= answer.
giveSize(); j++ ) {
322 oIntersectionPoints.push_back(answer);
332 double y = pointB.
at(2) - pointA.
at(2);
333 double x = pointB.
at(1) - pointA.
at(1);
341 answer.
at(1, 1) = cos(alpha);
342 answer.
at(1, 2) = sin(alpha);
343 answer.
at(2, 1) = -sin(alpha);
344 answer.
at(2, 2) = cos(alpha);
357 answer.
at(2) = atan2( xp.
at(2), xp.
at(1) );
372 double maxX, minX, maxY, minY;
389 if ( point->
at(1) >= minX && point->
at(1) <= maxX &&
390 point->
at(2) >= minY && point->
at(2) <= maxY ) {
406 return ( count != 0 );
442 answer.
at(1) = aPow * ( -aPow + bPow + cPow );
443 answer.
at(2) = bPow * ( aPow - bPow + cPow );
444 answer.
at(3) = cPow * ( aPow + bPow - cPow );
451 double sum = bar.
at(1) + bar.
at(2) + bar.
at(3);
454 for (
int i = 1; i <= answer.
giveSize(); i++ ) {
461 printf(
"Triangle: ");
462 for (
size_t i = 0; i <
mVertices.size(); i++ ) {
472 for (
int i = 1; i <= 3; i++ ) {
473 for (
int j = 1; j <= 2; j++ ) {
495 const double tol2 = 1.0e-18;
552 a1 = {-t1[1], t1[0]};
553 a2 = {-t2[1], t2[0]};
554 a3 = {-t3[1], t3[0]};
652 oRefinedTri.push_back(
Triangle(p1, q1, q3) );
653 oRefinedTri.push_back(
Triangle(q1, q2, q3) );
654 oRefinedTri.push_back(
Triangle(q1, p2, q2) );
655 oRefinedTri.push_back(
Triangle(q3, q2, p3) );
673 double angle = 2.0*
M_PI*iArcPos;
696 if ( dist > this->
radius ) {
714 if ( dist < this->
radius ) {
739 std :: vector< FloatArray >oneLineIntersects;
751 for (
int j = 1; j <= int ( oneLineIntersects.size() ); j++ ) {
752 oIntersectionPoints.push_back(oneLineIntersects [ j - 1 ]);
766 double distX = x2 - x1;
767 double distY = y2 - y1;
768 double a = 0., b = 0., A, B, C;
769 if ( distX != 0.0 ) {
773 B = 2 * ( ( -1 ) * c1 + b * a - a * c2 );
774 C = c1 * c1 + b * b - 2 * c2 * b + c2 * c2 -
radius *
radius;
778 C = x1 * x1 - 2 * x1 * c1 + c1 * c1 + c2 * c2 -
radius *
radius;
781 double D = B * B - 4 * A * C;
785 }
else if ( D == 0 ) {
791 for (
int i = 1; i <= sz; i++ ) {
797 fn = ( -1 ) * sqrt(D);
800 if ( distX != 0.0 ) {
801 point.
at(1) = ( ( -1 ) * B + fn ) / ( 2 * A );
802 point.
at(2) = a * point.
at(1) + b;
805 point.
at(2) = ( ( -1 ) * B + fn ) / ( 2 * A );
809 oIntersectionPoints.push_back(point);
817 std :: vector< FloatArray >intersecPoints;
820 return intersecPoints.size();
841 printf(
"Circle: radius = %e, center = ", this->
radius);
856 #ifdef __BOOST_MODULE 876 for (
int segId = 1; segId <= numSeg; segId++ ) {
893 double s =
dot(u, t);
900 FloatArray q = ( 1.0 - xi ) * crackP1 + xi * crackP2;
909 }
else if ( segId == numSeg ) {
919 double s =
dot(u, t);
926 FloatArray q = ( 1.0 - xi ) * crackP1 + xi * crackP2;
936 double arcPos = -1.0, dummy;
940 if ( dist2 < oDist*oDist ) {
961 double xi = 0.0, xiUnbounded = 0.0;
975 point.
distance(crackP1, crackP2, xi, xiUnbounded);
977 if( xiUnbounded < 0.0 ) {
978 oDist = xiUnbounded*crackP1.
distance(crackP2);
983 if( xiUnbounded > 1.0 ) {
984 oDist = -(xiUnbounded-1.0)*crackP1.
distance(crackP2);
990 double distToStart = xi*L;
992 oDist =
std::min(distToStart, (L - distToStart) );
993 oMinArcDist = distToStart/L;
997 bool isBeforeStart =
false, isAfterEnd =
false;
998 double distBeforeStart = 0.0, distAfterEnd = 0.0;
1006 const double distSeg_start = point.
distance(crackP1_start, crackP2_start, xi, xiUnbounded);
1008 if( xiUnbounded < 0.0 ) {
1009 isBeforeStart =
true;
1010 distBeforeStart = xiUnbounded*crackP1_start.
distance(crackP2_start);
1013 double arcPosPassed = crackP1_start.
distance(crackP2_start);
1014 double distToStart = xi*crackP1_start.
distance(crackP2_start);
1016 double minGeomDist = distSeg_start;
1023 for (
int segId = 2; segId <= numSeg-1; segId++ ) {
1029 const double distSeg = point.
distance(crackP1, crackP2, xi, xiUnbounded);
1031 if(distSeg < minGeomDist) {
1032 isBeforeStart =
false;
1033 minGeomDist = distSeg;
1034 distToStart = arcPosPassed + xi*crackP1.
distance(crackP2);
1037 arcPosPassed += crackP1.
distance(crackP2);
1049 const double distSeg_end = point.
distance(crackP1_end, crackP2_end, xi, xiUnbounded);
1052 if( xiUnbounded > 1.0 ) {
1053 arcPosPassed += xiUnbounded*crackP1_end.
distance(crackP2_end);
1056 arcPosPassed += xi*crackP1_end.
distance(crackP2_end);
1060 if(distSeg_end < minGeomDist) {
1061 isBeforeStart =
false;
1063 if( xiUnbounded > 1.0 ) {
1065 distAfterEnd = -(xiUnbounded-1.0)*crackP1_end.
distance(crackP2_end);
1068 distToStart = arcPosPassed;
1075 oDist = distBeforeStart;
1081 oDist = distAfterEnd;
1088 oDist =
std::min(distToStart, (L - distToStart) );
1089 oMinArcDist = distToStart/L;
1109 for (
size_t i = 0; i < numSeg; i++ ) {
1119 double xSegStart = 0.0, xSegEnd = 0.0;
1120 double xiSegStart = 0.0, xiSegEnd = 0.0;
1122 const double xiTol = 1.0e-9;
1123 if ( iXiStart < xiTol ) {
1128 for (
size_t i = 0; i < numSeg; i++ ) {
1131 xiSegStart = xSegStart / L;
1132 xiSegEnd = xSegEnd / L;
1134 if ( iXiStart > xiSegStart-xiTol && iXiStart < xiSegEnd+xiTol ) {
1137 double elXi = ( iXiStart - xiSegStart ) / ( xiSegEnd - xiSegStart );
1140 oPoints.push_back(p);
1144 if ( iXiEnd > xiSegStart && iXiEnd < xiSegEnd ) {
1147 double elXi = ( iXiEnd - xiSegStart ) / ( xiSegEnd - xiSegStart );
1150 oPoints.push_back(p);
1153 if ( xiSegEnd > iXiStart && xiSegEnd < iXiEnd + xiTol ) {
1158 xSegStart = xSegEnd;
1165 double xSegStart = 0.0, xSegEnd = 0.0;
1166 double xiSegStart = 0.0, xiSegEnd = 0.0;
1168 const double xiTol = 1.0e-9;
1169 if ( iArcPos < xiTol ) {
1174 for (
size_t i = 0; i < numSeg; i++ ) {
1177 xiSegStart = xSegStart / L;
1178 xiSegEnd = xSegEnd / L;
1180 if ( iArcPos > xiSegStart-xiTol && iArcPos < xiSegEnd+xiTol ) {
1183 double elXi = ( iArcPos - xiSegStart ) / ( xiSegEnd - xiSegStart );
1196 double xSegStart = 0.0, xSegEnd = 0.0;
1197 double xiSegStart = 0.0, xiSegEnd = 0.0;
1199 const double xiTol = 1.0e-9;
1201 for (
size_t i = 0; i < numSeg; i++ ) {
1204 xiSegStart = xSegStart / L;
1205 xiSegEnd = xSegEnd / L;
1207 if ( iArcPosition > xiSegStart-xiTol && iArcPosition < xiSegEnd+xiTol ) {
1213 FloatArray t = {p2(0) - p1(0), p2(1) - p1(1)};
1231 double xSegStart = 0.0, xSegEnd = 0.0;
1232 double xiSegStart = 0.0, xiSegEnd = 0.0;
1234 const double xiTol = 1.0e-9;
1236 for (
size_t i = 0; i < numSeg; i++ ) {
1239 xiSegStart = xSegStart / L;
1240 xiSegEnd = xSegEnd / L;
1242 if ( iArcPosition > xiSegStart-xiTol && iArcPosition < xiSegEnd+xiTol ) {
1248 oTangent = {p2(0) - p1(0), p2(1) - p1(1)};
1268 int numPoints = points.
giveSize() / 2;
1270 for (
int i = 1; i <= numPoints; i++ ) {
1271 mVertices.push_back({points.
at(2 * ( i - 1 ) + 1), points.
at( 2 * ( i ) )});
1275 #ifdef __BOOST_MODULE 1277 calcBoundingBox(LC, UC);
1289 points.
resize(nVert * 2);
1291 for (
int i = 0; i < nVert; i++ ) {
1299 #ifdef __BOOST_MODULE 1300 bool PolygonLine :: boundingBoxIntersects(
Element *element)
1311 for (
int i = 2; i <= numNodes; i++ ) {
1324 if ( !bOverlap(eLC, eUC, LC, UC) ) {
1337 printf(
"Warning: entering PolygonLine :: intersects(Element *element).\n");
1339 #ifdef __BOOST_MODULE 1340 if ( !boundingBoxIntersects(element) ) {
1344 double distTol = 1.0e-9;
1351 for (
int segId = 1; segId <= numSeg; segId++ ) {
1355 bPoint2 crackP2( this->
giveVertex ( segId + 1 )->at(1), this->
giveVertex ( segId + 1 )->at(2) );
1356 bSeg2 crackSeg(crackP1, crackP2);
1364 bSeg2 edge1(x1, x2);
1365 bSeg2 edge2(x2, x3);
1366 bSeg2 edge3(x3, x1);
1368 double d1 = bDist(crackSeg, edge1);
1369 if ( d1 < distTol ) {
1373 double d2 = bDist(crackSeg, edge2);
1374 if ( d2 < distTol ) {
1378 double d3 = bDist(crackSeg, edge3);
1379 if ( d3 < distTol ) {
1406 #ifdef __BOOST_MODULE 1407 void PolygonLine :: calcBoundingBox(bPoint2 &oLC, bPoint2 &oUC)
1409 oLC.x( vertices->at(1)->at(1) );
1410 oLC.y( vertices->at(1)->at(2) );
1412 oUC.x( vertices->at(1)->at(1) );
1413 oUC.y( vertices->at(1)->at(2) );
1415 int numPoints = vertices->giveSize();
1416 for (
int i = 2; i <= numPoints; i++ ) {
1417 oLC.x(
min( oLC.x(), vertices->at(i)->at(1) ) );
1418 oLC.y(
min( oLC.y(), vertices->at(i)->at(2) ) );
1420 oUC.x(
max( oUC.x(), vertices->at(i)->at(1) ) );
1421 oUC.y(
max( oUC.y(), vertices->at(i)->at(2) ) );
1431 std :: vector< FloatArray > oneLineIntersects;
1444 for (
FloatArray &interSect: oneLineIntersects ) {
1450 double distTol = 1.0e-9;
1452 bool alreadyFound =
false;
1456 for (
FloatArray &pInterSect: oIntersectionPoints ) {
1459 if ( pOld.
distance(pNew) < distTol ) {
1460 alreadyFound =
true;
1465 if ( !alreadyFound ) {
1466 oIntersectionPoints.
push_back(interSect);
1474 printf(
"Warning: entering PolygonLine :: computeIntersectionPoints(Element *element, std::vector< FloatArray > &oIntersectionPoints).\n");
1475 #ifdef __BOOST_MODULE 1477 if ( !boundingBoxIntersects(element) ) {
1483 std :: vector< FloatArray >oneLineIntersects;
1496 for (
FloatArray &interSect: oneLineIntersects ) {
1502 double distTol = 1.0e-9;
1504 bool alreadyFound =
false;
1506 bPoint2 pNew( interSect.at(1), interSect.at(2) );
1508 for (
FloatArray &pInterSect: oIntersectionPoints ) {
1509 bPoint2 pOld( pInterSect.at(1), pInterSect.at(2) );
1511 if ( bDist(pOld, pNew) < distTol ) {
1512 alreadyFound =
true;
1517 if ( !alreadyFound ) {
1518 oIntersectionPoints.push_back(interSect);
1529 printf(
"Warning: entering PolygonLine :: computeIntersectionPoints(Line *l, std::vector< FloatArray > &oIntersectionPoints).\n");
1531 #ifdef __BOOST_MODULE 1540 bSeg2 lineSeg(lineP1, lineP2);
1543 double distTol = 1.0e-9;
1545 bool foundOverlap =
false;
1549 for (
int segId = 1; segId <= numSeg; segId++ ) {
1552 bPoint2 crackP2( this->
giveVertex ( segId + 1 )->at(1), this->
giveVertex ( segId + 1 )->at(2) );
1553 bSeg2 crackSeg(crackP1, crackP2);
1555 bPoint2 intersectionPoint(0.0, 0.0);
1556 double d = bDist(crackSeg, lineSeg, & intersectionPoint);
1557 if ( d < distTol ) {
1558 if ( !foundOverlap ) {
1559 foundOverlap =
true;
1560 oIntersectionPoints.emplace_back({intersectionPoint.x(), intersectionPoint.y()});
1571 for(
int segIndex = 1; segIndex <= numSeg; segIndex++) {
1582 const double detTol = 1.0e-15;
1585 for(
int segIndex = 1; segIndex <= numSeg; segIndex++) {
1590 const FloatArray t1 = {xEnd(0) - xStart(0), xEnd(1) - xStart(1)};
1591 const FloatArray t2 = {iXEnd(0) - iXStart(0), iXEnd(1) - iXStart(1)};
1593 double xi1 = 0.0, xi2 = 0.0;
1596 for(
int iter = 0; iter < maxIter; iter++) {
1597 FloatArray temp = {iXStart(0) + xi2*t2(0) - xStart(0) - xi1*t1(0), iXStart(1) + xi2*t2(1) - xStart(1) - xi1*t1(1)};
1627 if(xi1 >= 0.0 && xi1 <= 1.0 && xi2 >= 0.0 && xi2 <= 1.0) {
1630 oIntersectionPoints.push_back(pos);
1640 std :: vector< FloatArray >intersecPoints;
1642 return intersecPoints.size();
1652 printf(
"PolygonLine:\n");
1666 std :: string vtkFileName;
1667 vtkFileName.append(
"crack");
1668 char lineIdNumberString [ 100 ];
1669 sprintf(lineIdNumberString,
"%d", iLineIndex);
1670 vtkFileName.append(lineIdNumberString);
1672 vtkFileName.append(
"Step");
1673 char stepString [ 100 ];
1675 sprintf(stepString,
"%d", iTStepIndex);
1676 vtkFileName.append(stepString);
1678 vtkFileName.append(
".vtk");
1684 std :: ofstream file;
1685 file.open( vtkFileName.data() );
1688 file <<
"# vtk DataFile Version 2.0\n";
1689 file <<
"Geometry of a PolygonLine\n";
1692 file <<
"DATASET UNSTRUCTURED_GRID\n";
1696 file <<
"POINTS " << numPoints <<
"double\n";
1698 for (
int i = 1; i <= numPoints; i++ ) {
1704 int numSeg = numPoints - 1;
1705 file <<
"CELLS " << numSeg <<
" " << numSeg * 3 <<
"\n";
1707 int numPointsPerSeg = 2;
1708 for (
int i = 0; i < numSeg; i++ ) {
1709 file << numPointsPerSeg <<
" " << i <<
" " << i + 1 <<
"\n";
1714 file <<
"CELL_TYPES " << numSeg <<
"\n";
1715 int vtkCellType = 3;
1716 for (
int i = 0; i < numSeg; i++ ) {
1717 file << vtkCellType <<
"\n";
1748 oStartTipInfo = info1;
1770 oEndTipInfo = info2;
1787 for (
int i = 1; i <= nVert; i++ ) {
1791 oCenter.
times( 1.0 /
double( nVert ) );
1793 for (
int i = 1; i <= nVert; i++ ) {
1802 std::vector<FloatArray> points;
1806 const double tol2 = 1.0e-18;
1818 for (
int i = 1; i <= idList.
giveSize(); i++ ) {
1819 this->idList.push_back( idList.
at(i) );
double giveDeterminant() const
Returns the trace (sum of diagonal components) of the receiver.
const FloatArray & giveVertex(int n) const
virtual void printYourself()
virtual void computeTangentialSignDist(double &oDist, const FloatArray &iPoint, double &oMinDistArcPos) const
void removeDuplicatePoints(const double &iTolSquare)
virtual double computeDistanceTo(const FloatArray *point)
Computes normal signed distance between this object and a point.
virtual void printYourself()
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Computes vector product (or cross product) of vectors given as parameters, , and stores the result in...
static void refineTriangle(std::vector< Triangle > &oRefinedTri, const Triangle &iTri)
Split a triangle in four.
double computeTangentialDistanceToEnd(FloatArray *point)
virtual IRResultType initializeFrom(InputRecord *ir)
Computes the normal distance to the surface not to the center.
void transformIntoPolar(FloatArray *point, FloatArray &answer)
#define _IFT_Circle_center
int giveNrVertices() const
Returns number of Geometry vertices.
void insertVertexBack(const FloatArray &iP)
double & at(int i)
Coefficient access function.
int max(int i, int j)
Returns bigger value form two given decimals.
virtual void giveInputRecord(DynamicInputRecord &input)
double sgn(double i)
Returns the signum of given value (if value is < 0 returns -1, otherwise returns 1) ...
TipInfo gathers useful information about a crack tip, like its position and tangent direction...
virtual bool isOutside(BasicGeometry *bg)
virtual FloatArray * giveCoordinates()
virtual bool isInside(Element *element)
void giveNormal(FloatArray &oNormal, const double &iArcPosition) const
Abstract base class for all finite elements.
virtual void giveBoundingSphere(FloatArray &oCenter, double &oRadius)
virtual double giveCoordinate(int i)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
Abstract representation of Geometry.
virtual bool intersects(Element *element)
Checks whether an element is interacted, Element reference will be later replaced by Geometry...
virtual int giveNumberOfDofManagers() const
virtual FEInterpolation * giveInterpolation() const
virtual bool isOutside(BasicGeometry *bg)
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
virtual int giveNumberOfNodes() const
Returns number of nodes of receiver.
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
double computeLength() const
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
virtual bool isOutside(BasicGeometry *bg)
virtual void printVTK(int iTStepIndex, int iLineIndex)
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
bool pointIsInTriangle(const FloatArray &iP) const
Checks if the projection of the the point iP onto the triangle plane is inside the triangle...
std::vector< FloatArray > mVertices
List of geometry vertices.
void setVertices(const std::vector< FloatArray > &iVertices)
double computeSquaredNorm() const
Computes the square of the norm.
void changeToAnticlockwise()
void computeProjection(FloatArray &answer)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes the Geometry from the InputRecord.
virtual void computeIntersectionPoints(Element *element, std::vector< FloatArray > &oIntersectionPoints)
Gives intersection points between this Geometry and Element.
virtual int computeNumberOfIntersectionPoints(Element *element)
Gives number of intersection points of Geometry entity with an element, Element reference will be lat...
virtual void giveBoundingSphere(FloatArray &oCenter, double &oRadius)
static double giveCharacteristicElementLength()
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
virtual void computeTangentialSignDist(double &oDist, const FloatArray &iPoint, double &oMinDistArcPos) const
void resizeWithValues(int s, int allocChunk=0)
Checks size of receiver towards requested bounds.
virtual void giveGlobalCoordinates(FloatArray &oGlobalCoord, const double &iArcPos) const
double at(int i, int j) const
Coefficient access function.
double distance_square(const FloatArray &iP1, const FloatArray &iP2, double &oXi, double &oXiUnbounded) const
virtual void giveSubPolygon(std::vector< FloatArray > &oPoints, const double &iXiStart, const double &iXiEnd) const
virtual int computeNumberOfIntersectionPoints(Element *element)
Gives number of intersection points of Geometry entity with an element, Element reference will be lat...
#define _IFT_PointSwarm_nodeID
virtual bool giveTips(TipInfo &oStartTipInfo, TipInfo &oEndTipInfo) const
Returns start and end tip of the geometry, if applicable.
virtual void computeLocalCoordinates(FloatArray &oLocCoord, const FloatArray &iPoint) const
Computes arc length coordinate in the range [0,1].
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes the Geometry from the InputRecord.
virtual int giveNumberOfBoundarySides()
virtual void boundaryGiveNodes(IntArray &answer, int boundary)=0
Gives the boundary nodes for requested boundary number.
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
void computeBarycentrCoor(FloatArray &answer) const
#define _IFT_Circle_radius
bool isOrientedAnticlockwise()
IRResultType
Type defining the return values of InputRecord reading operations.
virtual bool isInside(Element *element)
double computeNorm() const
Computes the norm (or length) of the vector.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual int computeNumberOfIntersectionPoints(Element *element)
Gives number of intersection points of Geometry entity with an element, Element reference will be lat...
virtual int computeNumberOfIntersectionPoints(Element *element)
Gives number of intersection points of Geometry entity with an element, Element reference will be lat...
bool isPointInside(FloatArray *point)
virtual bool intersects(Element *element)
Checks whether an element is interacted, Element reference will be later replaced by Geometry...
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes the Geometry from the InputRecord.
void times(double s)
Multiplies receiver with scalar.
virtual int giveNumberOfEdges() const
Returns number of edges.
virtual FloatArray * giveCoordinates()
int min(int i, int j)
Returns smaller value from two given decimals.
Triangle(const FloatArray &iP1, const FloatArray &iP2, const FloatArray &iP3)
void push_back(const double &iVal)
Add one element.
#define _IFT_PolygonLine_points
virtual void computeNormalSignDist(double &oDist, const FloatArray &iPoint) const
Functions for computing signed distance in normal and tangential direction.
virtual bool intersects(Element *element)
Checks whether an element is interacted, Element reference will be later replaced by Geometry...
double getRadiusOfCircumCircle()
void cropPolygon(const double &iArcPosStart, const double &iArcPosEnd)
Keep only a part of the underlying geometry, characterized by iArcPosStart and iArcPosEnd.
void translate(const FloatArray &iTrans)
int giveSize() const
Returns the size of receiver.
virtual Element_Geometry_Type giveGeometryType() const
Returns the element geometry type.
virtual double giveCoordinate(int i)
virtual void computeIntersectionPoints(Element *element, std::vector< FloatArray > &oIntersectionPoints)
Gives intersection points between this Geometry and Element.
BasicGeometry()
Constructor.
virtual void computeIntersectionPoints(Element *element, std::vector< FloatArray > &oIntersectionPoints)
Gives intersection points between this Geometry and Element.
the oofem namespace is to define a context or scope in which all oofem names are defined.
DofManager * giveDofManager(int i) const
static double computeLineDistance(const FloatArray &iP1, const FloatArray &iP2, const FloatArray &iQ1, const FloatArray &iQ2)
Computes the distance between two lines.
virtual void printYourself()
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
double normalize()
Normalizes receiver.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
double giveLength() const
double computeInclinationAngle()
void computeTransformationMatrix(FloatMatrix &answer)
void add(const FloatArray &src)
Adds array src to receiver.
virtual void computeNormalSignDist(double &oDist, const FloatArray &iPoint) const
Functions for computing signed distance in normal and tangential direction.
double dot(const FloatArray &x, const FloatArray &y)
virtual void giveTangent(FloatArray &oTangent, const double &iArcPosition) const
Computes tangential direction at given local coordinate (arcPos)
void resize(int s)
Resizes receiver towards requested size.
virtual ~BasicGeometry()
Destructor.
virtual void giveGlobalCoordinates(FloatArray &oGlobalCoord, const double &iArcPos) const
void computeCenterOfCircumCircle(FloatArray &answer) const