17 #if !defined(KRATOS_TRIANGLE_2D_3_H_INCLUDED )
18 #define KRATOS_TRIANGLE_2D_3_H_INCLUDED
221 typename PointType::Pointer pSecondPoint,
222 typename PointType::Pointer pThirdPoint )
231 :
BaseType( ThisPoints, &msGeometryData )
241 ) :
BaseType(GeometryId, rThisPoints, &msGeometryData)
248 const std::string& rGeometryName,
250 ) :
BaseType(rGeometryName, rThisPoints, &msGeometryData)
333 template<
class TOtherPo
intType>
353 return typename BaseType::Pointer(
new Triangle2D3( rThisPoints ) );
367 return typename BaseType::Pointer(
new Triangle2D3( NewGeometryId, rThisPoints ) );
379 auto p_geometry =
typename BaseType::Pointer(
new Triangle2D3( rGeometry.
Points() ) );
380 p_geometry->SetData(rGeometry.
GetData());
395 auto p_geometry =
typename BaseType::Pointer(
new Triangle2D3( NewGeometryId, rGeometry.
Points() ) );
396 p_geometry->SetData(rGeometry.
GetData());
408 rResult( 0, 0 ) = 0.0;
409 rResult( 0, 1 ) = 0.0;
410 rResult( 1, 0 ) = 1.0;
411 rResult( 1, 1 ) = 0.0;
412 rResult( 2, 0 ) = 0.0;
413 rResult( 2, 1 ) = 1.0;
430 if(rResult.size() != 3)
431 rResult.
resize( 3,
false );
432 std::fill( rResult.
begin(), rResult.
end(), 1.00 / 3.00 );
462 double length = 0.000;
463 length = 1.1283791670955 * sqrt( fabs(
Area() ) );
488 double x10 = p1.
X() - p0.
X();
489 double y10 = p1.
Y() - p0.
Y();
491 double x20 = p2.
X() - p0.
X();
492 double y20 = p2.
Y() - p0.
Y();
494 double detJ = x10 * y20-y10 * x20;
522 *
this, rThisGeometry[0], rThisGeometry[1]);
525 const BaseType& geom_2 = rThisGeometry;
526 return NoDivTriTriIsect(geom_1[0], geom_1[1], geom_1[2], geom_2[0], geom_2[1], geom_2[2]);
545 box_center[0] = 0.50 * (rLowPoint[0] + rHighPoint[0]);
546 box_center[1] = 0.50 * (rLowPoint[1] + rHighPoint[1]);
547 box_center[2] = 0.00;
549 box_half_size[0] = 0.50 * std::abs(rHighPoint[0] - rLowPoint[0]);
550 box_half_size[1] = 0.50 * std::abs(rHighPoint[1] - rLowPoint[1]);
551 box_half_size[2] = 0.00;
553 return TriBoxOverlap(box_center, box_half_size);
580 return CalculateSemiperimeter(
600 auto sa = (
a[0]*
a[0])+(
a[1]*
a[1])+(
a[2]*
a[2]);
601 auto sb = (
b[0]*
b[0])+(
b[1]*
b[1])+(
b[2]*
b[2]);
602 auto sc = (
c[0]*
c[0])+(
c[1]*
c[1])+(
c[2]*
c[2]);
604 return CalculateMinEdgeLength(sa, sb, sc);
620 auto sa = (
a[0]*
a[0])+(
a[1]*
a[1])+(
a[2]*
a[2]);
621 auto sb = (
b[0]*
b[0])+(
b[1]*
b[1])+(
b[2]*
b[2]);
622 auto sc = (
c[0]*
c[0])+(
c[1]*
c[1])+(
c[2]*
c[2]);
624 return CalculateMaxEdgeLength(sa, sb, sc);
636 return CalculateAvgEdgeLength(
651 return CalculateCircumradius(
666 return CalculateInradius(
686 constexpr
double normFactor = 1.0;
692 return normFactor * CalculateInradius(
a,
b,
c) / CalculateCircumradius(
a,
b,
c);
706 constexpr
double normFactor = 1.0;
712 double sa = (
a[0]*
a[0])+(
a[1]*
a[1])+(
a[2]*
a[2]);
713 double sb = (
b[0]*
b[0])+(
b[1]*
b[1])+(
b[2]*
b[2]);
714 double sc = (
c[0]*
c[0])+(
c[1]*
c[1])+(
c[2]*
c[2]);
716 return normFactor * CalculateInradius(std::sqrt(sa),std::sqrt(sb),std::sqrt(sc)) / CalculateMaxEdgeLength(sa,sb,sc);
730 constexpr
double normFactor = 1.0;
736 double sa = (
a[0]*
a[0])+(
a[1]*
a[1])+(
a[2]*
a[2]);
737 double sb = (
b[0]*
b[0])+(
b[1]*
b[1])+(
b[2]*
b[2]);
738 double sc = (
c[0]*
c[0])+(
c[1]*
c[1])+(
c[2]*
c[2]);
740 return normFactor *
Area() / (sa+sb+sc);
755 constexpr
double normFactor = 1.0;
761 double sa = (
a[0]*
a[0])+(
a[1]*
a[1])+(
a[2]*
a[2]);
762 double sb = (
b[0]*
b[0])+(
b[1]*
b[1])+(
b[2]*
b[2]);
763 double sc = (
c[0]*
c[0])+(
c[1]*
c[1])+(
c[2]*
c[2]);
766 double base = CalculateMaxEdgeLength(sa,sb,sc);
768 return normFactor * (
Area() * 2 / base ) / std::sqrt(sa+sb+sc);
798 const double Tolerance = std::numeric_limits<double>::epsilon()
803 if ( (rResult[0] >= (0.0-Tolerance)) && (rResult[0] <= (1.0+Tolerance)) )
805 if ( (rResult[1] >= (0.0-Tolerance)) && (rResult[1] <= (1.0+Tolerance)) )
807 if ( (rResult[0] + rResult[1]) <= (1.0+Tolerance) )
834 const TPointType& point_0 = this->
GetPoint(0);
842 const double det_J =
J(0,0)*
J(1,1) -
J(0,1)*
J(1,0);
845 const double eta = (
J(1,0)*(point_0.X() - rPoint(0)) +
846 J(0,0)*(rPoint(1) - point_0.Y())) /
det_J;
847 const double xi = (
J(1,1)*(rPoint(0) - point_0.X()) +
848 J(0,1)*(point_0.Y() - rPoint(1))) /
det_J;
950 switch ( ShapeFunctionIndex )
953 return( 1.0 -rPoint[0] - rPoint[1] );
959 KRATOS_ERROR <<
"Wrong index of shape function!" << *
this << std::endl;
981 if(rResult.size() != 3) rResult.
resize(3,
false);
982 rResult[0] = 1.0 -rCoordinates[0] - rCoordinates[1];
983 rResult[1] = rCoordinates[0] ;
984 rResult[2] = rCoordinates[1] ;
1006 const unsigned int integration_points_number =
1010 double x10 = this->
Points()[1].X() - this->
Points()[0].X();
1011 double y10 = this->
Points()[1].Y() - this->
Points()[0].Y();
1013 double x20 = this->
Points()[2].X() - this->
Points()[0].X();
1014 double y20 = this->
Points()[2].Y() - this->
Points()[0].Y();
1022 double detJ = x10 * y20-y10 * x20;
1024 DN_DX(0,0) = -y20 + y10;
1025 DN_DX(0,1) = x20 - x10;
1034 if(rResult.size() != integration_points_number)
1036 rResult.
resize(integration_points_number,
false);
1038 for(
unsigned int i=0;
i<integration_points_number;
i++)
1044 Vector& determinants_of_jacobian,
1047 const unsigned int integration_points_number =
1051 double x10 = this->
Points()[1].X() - this->
Points()[0].X();
1052 double y10 = this->
Points()[1].Y() - this->
Points()[0].Y();
1054 double x20 = this->
Points()[2].X() - this->
Points()[0].X();
1055 double y20 = this->
Points()[2].Y() - this->
Points()[0].Y();
1063 double detJ = x10 * y20-y10 * x20;
1065 DN_DX(0,0) = -y20 + y10;
1066 DN_DX(0,1) = x20 - x10;
1075 if(rResult.size() != integration_points_number)
1077 rResult.
resize(integration_points_number,
false);
1079 for(
unsigned int i=0;
i<integration_points_number;
i++)
1082 if(determinants_of_jacobian.size() != integration_points_number )
1083 determinants_of_jacobian.
resize(integration_points_number,
false);
1085 for(
unsigned int i=0;
i<integration_points_number;
i++)
1086 determinants_of_jacobian[
i] = detJ;
1105 if(rResult.size() != integration_points_number)
1107 rResult.
resize(integration_points_number,
false);
1110 const double detJ = 2.0*(this->
Area());
1112 for (
unsigned int pnt = 0; pnt < integration_points_number; pnt++ )
1114 rResult[pnt] = detJ;
1141 return 2.0*(this->
Area());
1160 return 2.0*(this->
Area());
1177 return "2 dimensional triangle with three nodes in 2D space";
1188 rOStream <<
"2 dimensional triangle with three nodes in 2D space";
1209 std::cout << std::endl;
1215 rOStream <<
" Jacobian in the origin\t : " << jacobian;
1227 = CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
1228 const int integration_points_number
1232 for (
int pnt = 0; pnt < integration_points_number; pnt++ )
1234 Result[pnt] = localGradients[pnt];
1248 = CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
1249 const int integration_points_number
1253 for (
int pnt = 0; pnt < integration_points_number; pnt++ )
1255 Result[pnt] = localGradients[pnt];
1274 rResult( 0, 0 ) = -1.0;
1275 rResult( 0, 1 ) = -1.0;
1276 rResult( 1, 0 ) = 1.0;
1277 rResult( 1, 1 ) = 0.0;
1278 rResult( 2, 0 ) = 0.0;
1279 rResult( 2, 1 ) = 1.0;
1297 rResult( 0, 0 ) = -1.0;
1298 rResult( 0, 1 ) = -1.0;
1299 rResult( 1, 0 ) = 1.0;
1300 rResult( 1, 1 ) = 0.0;
1301 rResult( 2, 0 ) = 0.0;
1302 rResult( 2, 1 ) = 1.0;
1314 if ( rResult.size() != this->PointsNumber() )
1322 if(rResult[0].size1() != 2 || rResult[0].size2() != 2 )
1323 rResult[0].
resize( 2, 2,
false );
1325 if(rResult[1].size1() != 2 || rResult[1].size2() != 2 )
1326 rResult[1].
resize( 2, 2,
false );
1328 if(rResult[2].size1() != 2 || rResult[2].size2() != 2 )
1329 rResult[2].
resize( 2, 2,
false );
1331 rResult[0]( 0, 0 ) = 0.0;
1332 rResult[0]( 0, 1 ) = 0.0;
1333 rResult[0]( 1, 0 ) = 0.0;
1334 rResult[0]( 1, 1 ) = 0.0;
1335 rResult[1]( 0, 0 ) = 0.0;
1336 rResult[1]( 0, 1 ) = 0.0;
1337 rResult[1]( 1, 0 ) = 0.0;
1338 rResult[1]( 1, 1 ) = 0.0;
1339 rResult[2]( 0, 0 ) = 0.0;
1340 rResult[2]( 0, 1 ) = 0.0;
1341 rResult[2]( 1, 0 ) = 0.0;
1342 rResult[2]( 1, 1 ) = 0.0;
1354 if ( rResult.size() != this->PointsNumber() )
1369 rResult[0][0].
resize( 2, 2,
false );
1371 rResult[0][1].
resize( 2, 2,
false );
1372 rResult[1][0].
resize( 2, 2,
false );
1373 rResult[1][1].
resize( 2, 2,
false );
1374 rResult[2][0].
resize( 2, 2,
false );
1375 rResult[2][1].
resize( 2, 2,
false );
1377 for (
int i = 0;
i < 3;
i++ )
1380 rResult[
i][0]( 0, 0 ) = 0.0;
1381 rResult[
i][0]( 0, 1 ) = 0.0;
1382 rResult[
i][0]( 1, 0 ) = 0.0;
1383 rResult[
i][0]( 1, 1 ) = 0.0;
1384 rResult[
i][1]( 0, 0 ) = 0.0;
1385 rResult[
i][1]( 0, 1 ) = 0.0;
1386 rResult[
i][1]( 1, 0 ) = 0.0;
1387 rResult[
i][1]( 1, 1 ) = 0.0;
1418 void save(
Serializer& rSerializer )
const override
1451 static Matrix CalculateShapeFunctionsIntegrationPointsValues(
1455 AllIntegrationPoints();
1458 const int integration_points_number = integration_points.size();
1460 const int points_number = 3;
1462 Matrix shape_function_values( integration_points_number, points_number );
1465 for (
int pnt = 0; pnt < integration_points_number; pnt++ )
1467 shape_function_values( pnt, 0 ) = 1.0
1468 - integration_points[pnt].X()
1469 - integration_points[pnt].Y();
1470 shape_function_values( pnt, 1 ) = integration_points[pnt].X();
1471 shape_function_values( pnt, 2 ) = integration_points[pnt].Y();
1474 return shape_function_values;
1487 CalculateShapeFunctionsIntegrationPointsLocalGradients(
1491 AllIntegrationPoints();
1494 const int integration_points_number = integration_points.size();
1500 for (
int pnt = 0; pnt < integration_points_number; pnt++ )
1503 result( 0, 0 ) = -1.0;
1504 result( 0, 1 ) = -1.0;
1505 result( 1, 0 ) = 1.0;
1506 result( 1, 1 ) = 0.0;
1507 result( 2, 0 ) = 0.0;
1508 result( 2, 1 ) = 1.0;
1509 d_shape_f_values[pnt] = result;
1512 return d_shape_f_values;
1523 Quadrature<TriangleGaussLegendreIntegrationPoints1, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1524 Quadrature<TriangleGaussLegendreIntegrationPoints2, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1525 Quadrature<TriangleGaussLegendreIntegrationPoints3, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1526 Quadrature<TriangleGaussLegendreIntegrationPoints4, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1527 Quadrature<TriangleGaussLegendreIntegrationPoints5, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1528 Quadrature<TriangleCollocationIntegrationPoints1, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1529 Quadrature<TriangleCollocationIntegrationPoints2, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1530 Quadrature<TriangleCollocationIntegrationPoints3, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1531 Quadrature<TriangleCollocationIntegrationPoints4, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1532 Quadrature<TriangleCollocationIntegrationPoints5, 2, IntegrationPoint<3> >::GenerateIntegrationPoints()
1535 return integration_points;
1546 Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1548 Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1550 Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1552 Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1554 Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1556 Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1558 Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1560 Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1562 Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1564 Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1568 return shape_functions_values;
1575 AllShapeFunctionsLocalGradients()
1592 return shape_functions_local_gradients;
1616 bool NoDivTriTriIsect(
const Point& V0,
1621 const Point& U2)
const
1625 double du0,du1,du2,dv0,dv1,dv2;
1626 double du0du1,du0du2,dv0dv1,dv0dv2;
1630 array_1d<double,2> isect1, isect2;
1631 array_1d<double,3> D;
1632 array_1d<double,3> E1,E2;
1633 array_1d<double,3> N1,N2;
1636 const double epsilon = 1
E-6;
1651 if(fabs(du0)<epsilon) du0=0.0;
1652 if(fabs(du1)<epsilon) du1=0.0;
1653 if(fabs(du2)<epsilon) du2=0.0;
1658 if(du0du1>0.00 && du0du2>0.00)
1673 if(fabs(dv0)<epsilon) dv0=0.0;
1674 if(fabs(dv1)<epsilon) dv1=0.0;
1675 if(fabs(dv2)<epsilon) dv2=0.0;
1680 if(dv0dv1>0.00 && dv0dv2>0.00)
1712 if( New_Compute_Intervals(vp0,vp1,vp2,dv0, dv1,dv2,dv0dv1,dv0dv2,
a,
b,
c,x0,
x1)==true )
1714 return coplanar_tri_tri(N1,V0,V1,V2,U0,U1,U2);
1719 if( New_Compute_Intervals(up0, up1, up2, du0, du1, du2, du0du1, du0du2,
d,
e,
f, y0, y1)==
true )
1721 return coplanar_tri_tri(N1,V0,V1,V2,U0,U1,U2);
1725 double xx,yy,xxyy,
tmp;
1732 isect1[1]=
tmp+
c*x0*yy;
1735 isect2[0]=
tmp+
e*xx*y1;
1736 isect2[1]=
tmp+
f*xx*y0;
1739 Sort(isect1[0],isect1[1]);
1740 Sort(isect2[0],isect2[1]);
1742 if(isect1[1]<isect2[0] || isect2[1]<isect1[0])
return false;
1752 void Sort(
double&
a,
double&
b)
const
1766 bool New_Compute_Intervals(
double& VV0,
1800 else if(D1*D2>0.00 || D0!=0.00)
1838 bool coplanar_tri_tri(
const array_1d<double, 3>&
N,
1844 const Point& U2)
const
1846 array_1d<double, 3 >
A;
1883 if ( Edge_Against_Tri_Edges(i0, i1, V0,V1,U0,U1,U2)==
true)
return true;
1886 if ( Edge_Against_Tri_Edges(i0, i1, V1,V2,U0,U1,U2)==
true)
return true;
1889 if ( Edge_Against_Tri_Edges(i0, i1, V2,V0,U0,U1,U2)==
true)
return true;
1892 if (Point_In_Tri( i0, i1, V0, U0, U1, U2)==
true)
return true;
1893 if (Point_In_Tri( i0, i1, U0, V0, V1, V2)==
true)
return true;
1901 bool Edge_Against_Tri_Edges(
const short& i0,
1907 const Point&U2)
const
1910 double Ax,Ay,Bx,By,Cx,Cy,
e,
d,
f;
1916 if(Edge_Edge_Test(Ax, Ay, Bx, By, Cx, Cy,
e,
d,
f, i0, i1, V0, U0, U1)==
true)
return true;
1919 if(Edge_Edge_Test(Ax, Ay, Bx, By, Cx, Cy,
e,
d,
f, i0, i1, V0, U1, U2)==
true)
return true;
1921 if(Edge_Edge_Test(Ax, Ay, Bx, By, Cx, Cy,
e,
d,
f, i0, i1, V0, U2, U0)==
true)
return true;
1933 bool Edge_Edge_Test(
const double& Ax,
1946 const Point&U1)
const
1955 if(std::fabs(
f)<1
E-10)
f = 0.00;
1956 if(std::fabs(
d)<1
E-10)
d = 0.00;
1959 if((
f>0.00 &&
d>=0.00 &&
d<=
f) || (
f<0.00 && d<=0.00 && d>=
f))
1965 if(
e>=0.00 &&
e<=
f)
return true;
1969 if(e<=0.00 && e>=
f)
return true;
1979 bool Point_In_Tri(
const short& i0,
1984 const Point& U2)
const
1986 double a,
b,
c,d0,
d1,d2;
1991 c=-
a*U0[i0]-
b*U0[i1];
1992 d0=
a*V0[i0]+
b*V0[i1]+
c;
1996 c=-
a*U1[i0]-
b*U1[i1];
1997 d1=
a*V0[i0]+
b*V0[i1]+
c;
2001 c=-
a*U2[i0]-
b*U2[i1];
2002 d2=
a*V0[i0]+
b*V0[i1]+
c;
2005 if(d0*d2>0.0)
return true;
2020 inline bool TriBoxOverlap(Point& rBoxCenter, Point& rBoxHalfSize)
const
2022 double abs_ex, abs_ey;
2023 array_1d<double,3 > vert0, vert1, vert2;
2024 array_1d<double,3 > edge0, edge1, edge2;
2025 std::pair<double, double> min_max;
2033 noalias(edge0) = vert1 - vert0;
2034 noalias(edge1) = vert2 - vert1;
2035 noalias(edge2) = vert0 - vert2;
2042 abs_ex = std::abs(edge0[0]);
2043 abs_ey = std::abs(edge0[1]);
2044 if (AxisTestZ(edge0[0],edge0[1],abs_ex,abs_ey,vert0,vert2,rBoxHalfSize))
return false;
2046 abs_ex = std::abs(edge1[0]);
2047 abs_ey = std::abs(edge1[1]);
2048 if (AxisTestZ(edge1[0],edge1[1],abs_ex,abs_ey,vert1,vert0,rBoxHalfSize))
return false;
2050 abs_ex = std::abs(edge2[0]);
2051 abs_ey = std::abs(edge2[1]);
2052 if (AxisTestZ(edge2[0],edge2[1],abs_ex,abs_ey,vert2,vert1,rBoxHalfSize))
return false;
2061 min_max = std::minmax({vert0[0],vert1[0],vert2[0]});
2062 if(min_max.first>rBoxHalfSize[0] || min_max.second<-rBoxHalfSize[0])
return false;
2065 min_max = std::minmax({vert0[1],vert1[1],vert2[1]});
2066 if(min_max.first>rBoxHalfSize[1] || min_max.second<-rBoxHalfSize[1])
return false;
2089 bool AxisTestZ(
double& rEdgeX,
double& rEdgeY,
2090 double& rAbsEdgeX,
double& rAbsEdgeY,
2091 array_1d<double,3>& rVertA,
2092 array_1d<double,3>& rVertC,
2093 Point& rBoxHalfSize)
const
2095 double proj_a, proj_c, rad;
2096 proj_a = rEdgeX*rVertA[1] - rEdgeY*rVertA[0];
2097 proj_c = rEdgeX*rVertC[1] - rEdgeY*rVertC[0];
2098 std::pair<double, double> min_max = std::minmax(proj_a, proj_c);
2100 rad = rAbsEdgeY*rBoxHalfSize[0] + rAbsEdgeX*rBoxHalfSize[1];
2102 if(min_max.first>rad || min_max.second<-rad)
return true;
2115 inline double CalculateSemiperimeter(
const double a,
const double b,
const double c)
const {
2116 return 0.5 * (
a+
b+
c);
2128 inline double CalculateMinEdgeLength(
const double sa,
const double sb,
const double sc)
const {
2129 return std::sqrt(
std::min({sa, sb, sc}));
2141 inline double CalculateMaxEdgeLength(
const double sa,
const double sb,
const double sc)
const {
2142 return std::sqrt(
std::max({sa, sb, sc}));
2154 inline double CalculateAvgEdgeLength(
const double a,
const double b,
const double c)
const {
2155 return 1.0 / 3.0 * (
a+
b+
c);
2167 inline double CalculateInradius(
const double a,
const double b,
const double c)
const {
2168 return 0.5 * std::sqrt((
b+
c-
a) * (
c+
a-
b) * (
a+
b-
c) / (
a+
b+
c));
2180 inline double CalculateCircumradius(
const double a,
const double b,
const double c)
const {
2220 std::istream& rIStream,
2226 std::ostream& rOStream,
2230 rOStream << std::endl;
2237 template<
class TPo
intType>
const
2238 GeometryData Triangle2D3<TPointType>::msGeometryData(
2241 Triangle2D3<TPointType>::AllIntegrationPoints(),
2242 Triangle2D3<TPointType>::AllShapeFunctionsValues(),
2243 AllShapeFunctionsLocalGradients()
2246 template<
class TPo
intType>
const
Definition: geometry_data.h:60
KratosGeometryType
Definition: geometry_data.h:110
SizeType IntegrationPointsNumber() const
Definition: geometry_data.h:430
IntegrationMethod
Definition: geometry_data.h:76
KratosGeometryFamily
Definition: geometry_data.h:91
IntegrationMethod DefaultIntegrationMethod() const
Definition: geometry_data.h:425
Definition: geometry_dimension.h:42
Geometry base class.
Definition: geometry.h:71
TPointType & operator[](const SizeType &i)
Definition: geometry.h:441
SizeType PointsNumber() const
Definition: geometry.h:528
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: geometry.h:3834
Geometry & operator=(const Geometry &rOther)
Definition: geometry.h:400
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
DataValueContainer & GetData()
Definition: geometry.h:591
SizeType LocalSpaceDimension() const
Definition: geometry.h:1300
std::size_t SizeType
Definition: geometry.h:144
const TPointType::Pointer pGetPoint(const int Index) const
Definition: geometry.h:1790
std::size_t IndexType
Definition: geometry.h:137
std::array< Matrix, static_cast< int >GeometryData::IntegrationMethod::NumberOfIntegrationMethods)> ShapeFunctionsValuesContainerType
Definition: geometry.h:172
const PointsArrayType & Points() const
Definition: geometry.h:1768
bool AllPointsAreValid() const
Checks if the geometry points are valid Checks if the geometry points are valid from the pointer valu...
Definition: geometry.h:4093
std::array< IntegrationPointsArrayType, static_cast< int >GeometryData::IntegrationMethod::NumberOfIntegrationMethods)> IntegrationPointsContainerType
Definition: geometry.h:167
LumpingMethods
This defines the different methods to compute the lumping methods.
Definition: geometry.h:109
JacobiansType & Jacobian(JacobiansType &rResult) const
Definition: geometry.h:2901
TPointType const & GetPoint(const int Index) const
Definition: geometry.h:1816
GeometryData::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: geometry.h:177
GeometryData::IntegrationMethod IntegrationMethod
Definition: geometry.h:122
Short class definition.
Definition: integration_point.h:52
Definition: amatrix_interface.h:41
void swap(Matrix &Other)
Definition: amatrix_interface.h:289
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
iterator end()
Definition: amatrix_interface.h:243
iterator begin()
Definition: amatrix_interface.h:241
static bool TriangleLineIntersection2D(const TGeometryType &rTriangle, const array_1d< double, 3 > &rPoint0, const array_1d< double, 3 > &rPoint1)
Definition: intersection_utilities.h:162
An two node 2D line geometry with linear shape functions.
Definition: line_2d_2.h:65
Various mathematical utilitiy functions.
Definition: math_utils.h:62
static double Norm3(const TVectorType &a)
Calculates the norm of vector "a" which is assumed to be of size 3.
Definition: math_utils.h:691
static T CrossProduct(const T &a, const T &b)
Performs the vector product of the two input vectors a,b.
Definition: math_utils.h:762
This class defines the node.
Definition: node.h:65
Point class.
Definition: point.h:59
double Y() const
Definition: point.h:187
double X() const
Definition: point.h:181
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
void push_back(const TPointerType &x)
Definition: pointer_vector.h:270
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
A three node 2D triangle geometry with linear shape functions.
Definition: triangle_2d_3.h:74
std::string Info() const override
Definition: triangle_2d_3.h:1175
ShapeFunctionsSecondDerivativesType & ShapeFunctionsSecondDerivatives(ShapeFunctionsSecondDerivativesType &rResult, const CoordinatesArrayType &rPoint) const override
Definition: triangle_2d_3.h:1312
BaseType::JacobiansType JacobiansType
Definition: triangle_2d_3.h:176
bool IsInside(const CoordinatesArrayType &rPoint, CoordinatesArrayType &rResult, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Definition: triangle_2d_3.h:795
BaseType::IntegrationPointsContainerType IntegrationPointsContainerType
Definition: triangle_2d_3.h:157
BaseType::Pointer Create(PointsArrayType const &rThisPoints) const override
Creates a new geometry pointer.
Definition: triangle_2d_3.h:349
void ShapeFunctionsIntegrationPointsGradients(ShapeFunctionsGradientsType &rResult, Vector &determinants_of_jacobian, IntegrationMethod ThisMethod) const override
Definition: triangle_2d_3.h:1042
void PrintInfo(std::ostream &rOStream) const override
Definition: triangle_2d_3.h:1186
SizeType FacesNumber() const override
Returns the number of faces of the current geometry.
Definition: triangle_2d_3.h:894
BaseType::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: triangle_2d_3.h:169
Vector & ShapeFunctionsValues(Vector &rResult, const CoordinatesArrayType &rCoordinates) const override
Definition: triangle_2d_3.h:979
bool HasIntersection(const BaseType &rThisGeometry) const override
Detect if this triangle is intersected with another geometry.
Definition: triangle_2d_3.h:518
TPointType PointType
Definition: triangle_2d_3.h:109
BaseType::IntegrationPointType IntegrationPointType
Definition: triangle_2d_3.h:141
Triangle2D3(typename PointType::Pointer pFirstPoint, typename PointType::Pointer pSecondPoint, typename PointType::Pointer pThirdPoint)
Definition: triangle_2d_3.h:220
BaseType::Pointer Create(const BaseType &rGeometry) const override
Creates a new geometry pointer.
Definition: triangle_2d_3.h:375
virtual ShapeFunctionsGradientsType ShapeFunctionsLocalGradients(IntegrationMethod ThisMethod)
Definition: triangle_2d_3.h:1223
BaseType::NormalType NormalType
Definition: triangle_2d_3.h:204
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: triangle_2d_3.h:150
double MaxEdgeLength() const override
Definition: triangle_2d_3.h:615
GeometriesArrayType GenerateEdges() const override
This method gives you all edges of this geometry.
Definition: triangle_2d_3.h:885
BaseType::SizeType SizeType
Definition: triangle_2d_3.h:124
Triangle2D3 & operator=(Triangle2D3< TOtherPointType > const &rOther)
Definition: triangle_2d_3.h:334
Vector & LumpingFactors(Vector &rResult, const typename BaseType::LumpingMethods LumpingMethod=BaseType::LumpingMethods::ROW_SUM) const override
Lumping factors for the calculation of the lumped mass matrix.
Definition: triangle_2d_3.h:425
double InradiusToLongestEdgeQuality() const override
Definition: triangle_2d_3.h:705
double AverageEdgeLength() const override
Definition: triangle_2d_3.h:635
double ShortestAltitudeToEdgeLengthRatio() const override
Definition: triangle_2d_3.h:754
double InradiusToCircumradiusQuality() const override
Quality functions.
Definition: triangle_2d_3.h:685
double DomainSize() const override
Definition: triangle_2d_3.h:570
BaseType::GeometriesArrayType GeometriesArrayType
Definition: triangle_2d_3.h:104
BaseType::PointsArrayType PointsArrayType
Definition: triangle_2d_3.h:130
CoordinatesArrayType & PointLocalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rPoint) const override
Definition: triangle_2d_3.h:827
double MinEdgeLength() const override
Definition: triangle_2d_3.h:595
BaseType::Pointer Create(const IndexType NewGeometryId, PointsArrayType const &rThisPoints) const override
Creates a new geometry pointer.
Definition: triangle_2d_3.h:362
BaseType::ShapeFunctionsThirdDerivativesType ShapeFunctionsThirdDerivativesType
Definition: triangle_2d_3.h:199
double DeterminantOfJacobian(IndexType IntegrationPointIndex, IntegrationMethod ThisMethod) const override
Definition: triangle_2d_3.h:1138
void PrintData(std::ostream &rOStream) const override
Definition: triangle_2d_3.h:1205
~Triangle2D3() override
Definition: triangle_2d_3.h:289
SizeType EdgesNumber() const override
This method gives you number of all edges of this geometry.
Definition: triangle_2d_3.h:872
virtual Matrix & ShapeFunctionsGradients(Matrix &rResult, PointType &rPoint)
Definition: triangle_2d_3.h:1294
double Area() const override
Definition: triangle_2d_3.h:483
Triangle2D3(Triangle2D3 const &rOther)
Definition: triangle_2d_3.h:264
virtual ShapeFunctionsGradientsType ShapeFunctionsLocalGradients()
Definition: triangle_2d_3.h:1244
void ShapeFunctionsIntegrationPointsGradients(ShapeFunctionsGradientsType &rResult, IntegrationMethod ThisMethod) const override
Definition: triangle_2d_3.h:1002
Vector & DeterminantOfJacobian(Vector &rResult, IntegrationMethod ThisMethod) const override
Definition: triangle_2d_3.h:1101
void NumberNodesInFaces(DenseVector< unsigned int > &NumberNodesInFaces) const override
Definition: triangle_2d_3.h:900
Triangle2D3(const IndexType GeometryId, const PointsArrayType &rThisPoints)
Constructor with Geometry Id.
Definition: triangle_2d_3.h:238
double DeterminantOfJacobian(const CoordinatesArrayType &rPoint) const override
Definition: triangle_2d_3.h:1158
ShapeFunctionsThirdDerivativesType & ShapeFunctionsThirdDerivatives(ShapeFunctionsThirdDerivativesType &rResult, const CoordinatesArrayType &rPoint) const override
Definition: triangle_2d_3.h:1352
friend class Triangle2D3
Definition: triangle_2d_3.h:2198
void NodesInFaces(DenseMatrix< unsigned int > &NodesInFaces) const override
Definition: triangle_2d_3.h:911
KRATOS_CLASS_POINTER_DEFINITION(Triangle2D3)
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: triangle_2d_3.h:135
virtual double Semiperimeter() const
Class Interface.
Definition: triangle_2d_3.h:579
BaseType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: triangle_2d_3.h:183
BaseType::IndexType IndexType
Definition: triangle_2d_3.h:117
double ShapeFunctionValue(IndexType ShapeFunctionIndex, const CoordinatesArrayType &rPoint) const override
Definition: triangle_2d_3.h:947
double Circumradius() const override
Definition: triangle_2d_3.h:650
Triangle2D3(const std::string &rGeometryName, const PointsArrayType &rThisPoints)
Constructor with Geometry Name.
Definition: triangle_2d_3.h:247
BaseType::ShapeFunctionsValuesContainerType ShapeFunctionsValuesContainerType
Definition: triangle_2d_3.h:163
Matrix & ShapeFunctionsLocalGradients(Matrix &rResult, const CoordinatesArrayType &rPoint) const override
Definition: triangle_2d_3.h:1270
double Length() const override
Definition: triangle_2d_3.h:459
Triangle2D3(Triangle2D3< TOtherPointType > const &rOther)
Definition: triangle_2d_3.h:281
Geometry< TPointType > BaseType
Definition: triangle_2d_3.h:83
BaseType::Pointer Create(const IndexType NewGeometryId, const BaseType &rGeometry) const override
Creates a new geometry pointer.
Definition: triangle_2d_3.h:390
GeometryData::KratosGeometryType GetGeometryType() const override
Definition: triangle_2d_3.h:296
array_1d< double, 3 > Normal(const CoordinatesArrayType &rPointLocalCoordinates) const override
It returns a vector that is normal to its corresponding geometry in the given local point.
Definition: triangle_2d_3.h:776
Matrix & PointsLocalCoordinates(Matrix &rResult) const override
Definition: triangle_2d_3.h:405
bool HasIntersection(const Point &rLowPoint, const Point &rHighPoint) const override
Definition: triangle_2d_3.h:540
Triangle2D3(const PointsArrayType &ThisPoints)
Definition: triangle_2d_3.h:230
double AreaToEdgeLengthRatio() const override
Definition: triangle_2d_3.h:729
Triangle2D3 & operator=(const Triangle2D3 &rOther)
Definition: triangle_2d_3.h:316
double Inradius() const override
Definition: triangle_2d_3.h:665
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: triangle_2d_3.h:291
GeometryData::IntegrationMethod IntegrationMethod
Definition: triangle_2d_3.h:98
BaseType::ShapeFunctionsSecondDerivativesType ShapeFunctionsSecondDerivativesType
Definition: triangle_2d_3.h:191
Line2D2< TPointType > EdgeType
Definition: triangle_2d_3.h:88
Short class definition.
Definition: array_1d.h:61
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
static double max(double a, double b)
Definition: GeometryFunctions.h:79
static double min(double a, double b)
Definition: GeometryFunctions.h:71
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
const GeometryData Triangle2D3< TPointType >::msGeometryData & msGeometryDimension(), Triangle2D3< TPointType >::AllShapeFunctionsValues(), AllShapeFunctionsLocalGradients()
Definition: brep_curve.h:483
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
const GeometryData BrepCurve< TContainerPointType, TContainerPointEmbeddedType >::msGeometryData & msGeometryDimension
Definition: brep_curve.h:483
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
f
Definition: generate_convection_diffusion_explicit_element.py:112
x1
Definition: generate_frictional_mortar_condition.py:121
X1
Definition: generate_frictional_mortar_condition.py:119
E
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:26
int C
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:27
a
Definition: generate_stokes_twofluid_element.py:77
tuple tmp
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:98
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
def load(f)
Definition: ode_solve.py:307
int d
Definition: ode_solve.py:397
float temp
Definition: rotating_cone.py:85
J
Definition: sensitivityMatrix.py:58
A
Definition: sensitivityMatrix.py:70
N
Definition: sensitivityMatrix.py:29
det_J
Definition: sensitivityMatrix.py:67
B
Definition: sensitivityMatrix.py:76
integer i
Definition: TensorModule.f:17
subroutine d1(DSTRAN, D, dtime, NDI, NSHR, NTENS)
Definition: TensorModule.f:594
e
Definition: run_cpp_mpi_tests.py:31