KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
triangle_2d_3.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Riccardo Rossi
11 // Janosch Stascheit
12 // Felix Nagel
13 // contributors: Hoang Giang Bui
14 // Josep Maria Carbonell
15 //
16 
17 #if !defined(KRATOS_TRIANGLE_2D_3_H_INCLUDED )
18 #define KRATOS_TRIANGLE_2D_3_H_INCLUDED
19 
20 
21 // System includes
22 
23 // External includes
24 
25 // Project includes
26 #include "geometries/line_2d_2.h"
30 
31 namespace Kratos
32 {
35 
39 
43 
47 
51 
72 template<class TPointType> class Triangle2D3
73  : public Geometry<TPointType>
74 {
75 public:
79 
84 
89 
94 
99 
105 
109  typedef TPointType PointType;
110 
117  typedef typename BaseType::IndexType IndexType;
118 
124  typedef typename BaseType::SizeType SizeType;
125 
131 
136 
142 
151 
158 
164 
170 
177 
184 
192 
200 
205 
209 
210 // Triangle2D3( const PointType& FirstPoint,
211 // const PointType& SecondPoint,
212 // const PointType& ThirdPoint )
213 // : BaseType( PointsArrayType(), &msGeometryData )
214 // {
215 // this->Points().push_back( typename PointType::Pointer( new PointType( FirstPoint ) ) );
216 // this->Points().push_back( typename PointType::Pointer( new PointType( SecondPoint ) ) );
217 // this->Points().push_back( typename PointType::Pointer( new PointType( ThirdPoint ) ) );
218 // }
219 
220  Triangle2D3( typename PointType::Pointer pFirstPoint,
221  typename PointType::Pointer pSecondPoint,
222  typename PointType::Pointer pThirdPoint )
223  : BaseType( PointsArrayType(), &msGeometryData )
224  {
225  this->Points().push_back( pFirstPoint );
226  this->Points().push_back( pSecondPoint );
227  this->Points().push_back( pThirdPoint );
228  }
229 
230  explicit Triangle2D3( const PointsArrayType& ThisPoints )
231  : BaseType( ThisPoints, &msGeometryData )
232  {
233  if ( this->PointsNumber() != 3 )
234  KRATOS_ERROR << "Invalid points number. Expected 3, given " << this->PointsNumber() << std::endl;
235  }
236 
238  explicit Triangle2D3(
239  const IndexType GeometryId,
240  const PointsArrayType& rThisPoints
241  ) : BaseType(GeometryId, rThisPoints, &msGeometryData)
242  {
243  KRATOS_ERROR_IF( this->PointsNumber() != 3 ) << "Invalid points number. Expected 3, given " << this->PointsNumber() << std::endl;
244  }
245 
247  explicit Triangle2D3(
248  const std::string& rGeometryName,
249  const PointsArrayType& rThisPoints
250  ) : BaseType(rGeometryName, rThisPoints, &msGeometryData)
251  {
252  KRATOS_ERROR_IF(this->PointsNumber() != 3) << "Invalid points number. Expected 3, given " << this->PointsNumber() << std::endl;
253  }
254 
264  Triangle2D3( Triangle2D3 const& rOther )
265  : BaseType( rOther )
266  {
267  }
268 
281  template<class TOtherPointType> explicit Triangle2D3( Triangle2D3<TOtherPointType> const& rOther )
282  : BaseType( rOther )
283  {
284  }
285 
289  ~Triangle2D3() override {}
290 
292  {
294  }
295 
297  {
299  }
300 
304 
317  {
318  BaseType::operator=( rOther );
319  return *this;
320  }
321 
333  template<class TOtherPointType>
335  {
336  BaseType::operator=( rOther );
337  return *this;
338  }
339 
343 
349  typename BaseType::Pointer Create(
350  PointsArrayType const& rThisPoints
351  ) const override
352  {
353  return typename BaseType::Pointer( new Triangle2D3( rThisPoints ) );
354  }
355 
362  typename BaseType::Pointer Create(
363  const IndexType NewGeometryId,
364  PointsArrayType const& rThisPoints
365  ) const override
366  {
367  return typename BaseType::Pointer( new Triangle2D3( NewGeometryId, rThisPoints ) );
368  }
369 
375  typename BaseType::Pointer Create(
376  const BaseType& rGeometry
377  ) const override
378  {
379  auto p_geometry = typename BaseType::Pointer( new Triangle2D3( rGeometry.Points() ) );
380  p_geometry->SetData(rGeometry.GetData());
381  return p_geometry;
382  }
383 
390  typename BaseType::Pointer Create(
391  const IndexType NewGeometryId,
392  const BaseType& rGeometry
393  ) const override
394  {
395  auto p_geometry = typename BaseType::Pointer( new Triangle2D3( NewGeometryId, rGeometry.Points() ) );
396  p_geometry->SetData(rGeometry.GetData());
397  return p_geometry;
398  }
399 
405  Matrix& PointsLocalCoordinates( Matrix& rResult ) const override
406  {
407  rResult = ZeroMatrix( 3, 2 );
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;
414  return rResult;
415  }
416 
426  Vector& rResult,
427  const typename BaseType::LumpingMethods LumpingMethod = BaseType::LumpingMethods::ROW_SUM
428  ) const override
429  {
430  if(rResult.size() != 3)
431  rResult.resize( 3, false );
432  std::fill( rResult.begin(), rResult.end(), 1.00 / 3.00 );
433  return rResult;
434  }
435 
439 
459  double Length() const override
460  {
461  //return sqrt(fabs( DeterminantOfJacobian(PointType()))*0.5);
462  double length = 0.000;
463  length = 1.1283791670955 * sqrt( fabs( Area() ) ); // (4xA/Pi)^(1/2)
464  return length;
465  }
466 
467 
483  double Area() const override {
484  const PointType& p0 = this->operator [](0);
485  const PointType& p1 = this->operator [](1);
486  const PointType& p2 = this->operator [](2);
487 
488  double x10 = p1.X() - p0.X();
489  double y10 = p1.Y() - p0.Y();
490 
491  double x20 = p2.X() - p0.X();
492  double y20 = p2.Y() - p0.Y();
493 
494  double detJ = x10 * y20-y10 * x20;
495  return 0.5*detJ;
496  }
497 
498  // TODO: Code activated in June 2023
499  // /**
500  // * @brief This method calculates and returns the volume of this geometry.
501  // * @return Error, the volume of a 2D geometry is not defined
502  // * @see Length()
503  // * @see Area()
504  // * @see Volume()
505  // */
506  // double Volume() const override
507  // {
508  // KRATOS_ERROR << "Triangle2D3:: Method not well defined. Replace with DomainSize() instead" << std::endl;
509  // return 0.0;
510  // }
511 
518  bool HasIntersection( const BaseType& rThisGeometry ) const override
519  {
520  if (rThisGeometry.LocalSpaceDimension() < this->LocalSpaceDimension()) {
522  *this, rThisGeometry[0], rThisGeometry[1]);
523  } // Both geometries are 2D
524  const BaseType& geom_1 = *this;
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]);
527  }
528 
540  bool HasIntersection( const Point& rLowPoint, const Point& rHighPoint ) const override
541  {
542  Point box_center;
543  Point box_half_size;
544 
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;
548 
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;
552 
553  return TriBoxOverlap(box_center, box_half_size);
554  }
555 
570  double DomainSize() const override {
571  return this->Area();
572  }
574 
579  virtual double Semiperimeter() const {
580  return CalculateSemiperimeter(
581  MathUtils<double>::Norm3(this->GetPoint(0)-this->GetPoint(1)),
582  MathUtils<double>::Norm3(this->GetPoint(1)-this->GetPoint(2)),
583  MathUtils<double>::Norm3(this->GetPoint(2)-this->GetPoint(0))
584  );
585  }
586 
595  double MinEdgeLength() const override {
596  auto a = this->GetPoint(0) - this->GetPoint(1);
597  auto b = this->GetPoint(1) - this->GetPoint(2);
598  auto c = this->GetPoint(2) - this->GetPoint(0);
599 
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]);
603 
604  return CalculateMinEdgeLength(sa, sb, sc);
605  }
606 
615  double MaxEdgeLength() const override {
616  auto a = this->GetPoint(0) - this->GetPoint(1);
617  auto b = this->GetPoint(1) - this->GetPoint(2);
618  auto c = this->GetPoint(2) - this->GetPoint(0);
619 
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]);
623 
624  return CalculateMaxEdgeLength(sa, sb, sc);
625  }
626 
635  double AverageEdgeLength() const override {
636  return CalculateAvgEdgeLength(
637  MathUtils<double>::Norm3(this->GetPoint(0)-this->GetPoint(1)),
638  MathUtils<double>::Norm3(this->GetPoint(1)-this->GetPoint(2)),
639  MathUtils<double>::Norm3(this->GetPoint(2)-this->GetPoint(0))
640  );
641  }
642 
650  double Circumradius() const override {
651  return CalculateCircumradius(
652  MathUtils<double>::Norm3(this->GetPoint(0)-this->GetPoint(1)),
653  MathUtils<double>::Norm3(this->GetPoint(1)-this->GetPoint(2)),
654  MathUtils<double>::Norm3(this->GetPoint(2)-this->GetPoint(0))
655  );
656  }
657 
665  double Inradius() const override {
666  return CalculateInradius(
667  MathUtils<double>::Norm3(this->GetPoint(0)-this->GetPoint(1)),
668  MathUtils<double>::Norm3(this->GetPoint(1)-this->GetPoint(2)),
669  MathUtils<double>::Norm3(this->GetPoint(2)-this->GetPoint(0))
670  );
671  }
672 
674 
685  double InradiusToCircumradiusQuality() const override {
686  constexpr double normFactor = 1.0;
687 
688  double a = MathUtils<double>::Norm3(this->GetPoint(0)-this->GetPoint(1));
689  double b = MathUtils<double>::Norm3(this->GetPoint(1)-this->GetPoint(2));
690  double c = MathUtils<double>::Norm3(this->GetPoint(2)-this->GetPoint(0));
691 
692  return normFactor * CalculateInradius(a,b,c) / CalculateCircumradius(a,b,c);
693  };
694 
705  double InradiusToLongestEdgeQuality() const override {
706  constexpr double normFactor = 1.0; // TODO: This normalization coeficient is not correct.
707 
708  auto a = this->GetPoint(0) - this->GetPoint(1);
709  auto b = this->GetPoint(1) - this->GetPoint(2);
710  auto c = this->GetPoint(2) - this->GetPoint(0);
711 
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]);
715 
716  return normFactor * CalculateInradius(std::sqrt(sa),std::sqrt(sb),std::sqrt(sc)) / CalculateMaxEdgeLength(sa,sb,sc);
717  }
718 
729  double AreaToEdgeLengthRatio() const override {
730  constexpr double normFactor = 1.0;
731 
732  auto a = this->GetPoint(0) - this->GetPoint(1);
733  auto b = this->GetPoint(1) - this->GetPoint(2);
734  auto c = this->GetPoint(2) - this->GetPoint(0);
735 
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]);
739 
740  return normFactor * Area() / (sa+sb+sc);
741  }
742 
754  double ShortestAltitudeToEdgeLengthRatio() const override {
755  constexpr double normFactor = 1.0;
756 
757  auto a = this->GetPoint(0) - this->GetPoint(1);
758  auto b = this->GetPoint(1) - this->GetPoint(2);
759  auto c = this->GetPoint(2) - this->GetPoint(0);
760 
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]);
764 
765  // Shortest altitude is the one intersecting the largest base.
766  double base = CalculateMaxEdgeLength(sa,sb,sc);
767 
768  return normFactor * (Area() * 2 / base ) / std::sqrt(sa+sb+sc);
769  }
770 
776  array_1d<double, 3> Normal(const CoordinatesArrayType& rPointLocalCoordinates) const override
777  {
778  const array_1d<double, 3> tangent_xi = this->GetPoint(1) - this->GetPoint(0);
779  const array_1d<double, 3> tangent_eta = this->GetPoint(2) - this->GetPoint(0);
780 
781  array_1d<double, 3> normal;
782  MathUtils<double>::CrossProduct(normal, tangent_xi, tangent_eta);
783 
784  return 0.5 * normal;
785  }
786 
795  bool IsInside(
796  const CoordinatesArrayType& rPoint,
797  CoordinatesArrayType& rResult,
798  const double Tolerance = std::numeric_limits<double>::epsilon()
799  ) const override
800  {
801  this->PointLocalCoordinates( rResult, rPoint );
802 
803  if ( (rResult[0] >= (0.0-Tolerance)) && (rResult[0] <= (1.0+Tolerance)) )
804  {
805  if ( (rResult[1] >= (0.0-Tolerance)) && (rResult[1] <= (1.0+Tolerance)) )
806  {
807  if ( (rResult[0] + rResult[1]) <= (1.0+Tolerance) )
808  {
809  return true;
810  }
811  }
812  }
813 
814  return false;
815  }
816 
828  CoordinatesArrayType& rResult,
829  const CoordinatesArrayType& rPoint
830  ) const override {
831 
832  rResult = ZeroVector(3);
833 
834  const TPointType& point_0 = this->GetPoint(0);
835 
836  // Compute the Jacobian matrix and its determinant
838  J(0,0) = this->GetPoint(1).X() - this->GetPoint(0).X();
839  J(0,1) = this->GetPoint(2).X() - this->GetPoint(0).X();
840  J(1,0) = this->GetPoint(1).Y() - this->GetPoint(0).Y();
841  J(1,1) = this->GetPoint(2).Y() - this->GetPoint(0).Y();
842  const double det_J = J(0,0)*J(1,1) - J(0,1)*J(1,0);
843 
844  // Compute eta and xi
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;
849 
850  rResult(0) = xi;
851  rResult(1) = eta;
852  rResult(2) = 0.0;
853 
854  return rResult;
855  }
856 
860 
872  SizeType EdgesNumber() const override
873  {
874  return 3;
875  }
876 
886  {
888  edges.push_back( Kratos::make_shared<EdgeType>( this->pGetPoint( 1 ), this->pGetPoint( 2 ) ) );
889  edges.push_back( Kratos::make_shared<EdgeType>( this->pGetPoint( 2 ), this->pGetPoint( 0 ) ) );
890  edges.push_back( Kratos::make_shared<EdgeType>( this->pGetPoint( 0 ), this->pGetPoint( 1 ) ) );
891  return edges;
892  }
893 
894  SizeType FacesNumber() const override
895  {
896  return 3;
897  }
898 
899  //Connectivities of faces required
901  {
902  if(NumberNodesInFaces.size() != 3 )
903  NumberNodesInFaces.resize(3,false);
904  // Linear Triangles have elements of 2 nodes as faces
905  NumberNodesInFaces[0]=2;
906  NumberNodesInFaces[1]=2;
907  NumberNodesInFaces[2]=2;
908 
909  }
910 
912  {
913  // faces in columns
914  if(NodesInFaces.size1() != 3 || NodesInFaces.size2() != 3)
915  NodesInFaces.resize(3,3,false);
916 
917  //face 1
918  NodesInFaces(0,0)=0;//contrary node to the face
919  NodesInFaces(1,0)=1;
920  NodesInFaces(2,0)=2;
921  //face 2
922  NodesInFaces(0,1)=1;//contrary node to the face
923  NodesInFaces(1,1)=2;
924  NodesInFaces(2,1)=0;
925  //face 3
926  NodesInFaces(0,2)=2;//contrary node to the face
927  NodesInFaces(1,2)=0;
928  NodesInFaces(2,2)=1;
929 
930  }
931 
932 
933 
937 
947  double ShapeFunctionValue( IndexType ShapeFunctionIndex,
948  const CoordinatesArrayType& rPoint ) const override
949  {
950  switch ( ShapeFunctionIndex )
951  {
952  case 0:
953  return( 1.0 -rPoint[0] - rPoint[1] );
954  case 1:
955  return( rPoint[0] );
956  case 2:
957  return( rPoint[1] );
958  default:
959  KRATOS_ERROR << "Wrong index of shape function!" << *this << std::endl;
960  }
961 
962  return 0;
963  }
964 
979  Vector& ShapeFunctionsValues (Vector &rResult, const CoordinatesArrayType& rCoordinates) const override
980  {
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] ;
985 
986  return rResult;
987  }
988 
989 
1003  ShapeFunctionsGradientsType& rResult,
1004  IntegrationMethod ThisMethod ) const override
1005  {
1006  const unsigned int integration_points_number =
1007  msGeometryData.IntegrationPointsNumber( ThisMethod );
1008 
1010  double x10 = this->Points()[1].X() - this->Points()[0].X();
1011  double y10 = this->Points()[1].Y() - this->Points()[0].Y();
1012 
1013  double x20 = this->Points()[2].X() - this->Points()[0].X();
1014  double y20 = this->Points()[2].Y() - this->Points()[0].Y();
1015 
1016  //Jacobian is calculated:
1017  // |dx/dxi dx/deta| |x1-x0 x2-x0|
1018  //J=| |= | |
1019  // |dy/dxi dy/deta| |y1-y0 y2-y0|
1020 
1021 
1022  double detJ = x10 * y20-y10 * x20;
1023 
1024  DN_DX(0,0) = -y20 + y10;
1025  DN_DX(0,1) = x20 - x10;
1026  DN_DX(1,0) = y20;
1027  DN_DX(1,1) = -x20;
1028  DN_DX(2,0) = -y10;
1029  DN_DX(2,1) = x10;
1030 
1031  DN_DX /= detJ;
1032 
1033  //workaround by riccardo
1034  if(rResult.size() != integration_points_number)
1035  {
1036  rResult.resize(integration_points_number,false);
1037  }
1038  for(unsigned int i=0; i<integration_points_number; i++)
1039  rResult[i] = DN_DX;
1040  }
1041 
1043  ShapeFunctionsGradientsType& rResult,
1044  Vector& determinants_of_jacobian,
1045  IntegrationMethod ThisMethod ) const override
1046  {
1047  const unsigned int integration_points_number =
1048  msGeometryData.IntegrationPointsNumber( ThisMethod );
1049 
1051  double x10 = this->Points()[1].X() - this->Points()[0].X();
1052  double y10 = this->Points()[1].Y() - this->Points()[0].Y();
1053 
1054  double x20 = this->Points()[2].X() - this->Points()[0].X();
1055  double y20 = this->Points()[2].Y() - this->Points()[0].Y();
1056 
1057  //Jacobian is calculated:
1058  // |dx/dxi dx/deta| |x1-x0 x2-x0|
1059  //J=| |= | |
1060  // |dy/dxi dy/deta| |y1-y0 y2-y0|
1061 
1062 
1063  double detJ = x10 * y20-y10 * x20;
1064 
1065  DN_DX(0,0) = -y20 + y10;
1066  DN_DX(0,1) = x20 - x10;
1067  DN_DX(1,0) = y20;
1068  DN_DX(1,1) = -x20;
1069  DN_DX(2,0) = -y10;
1070  DN_DX(2,1) = x10;
1071 
1072  DN_DX /= detJ;
1073 
1074  //workaround by riccardo
1075  if(rResult.size() != integration_points_number)
1076  {
1077  rResult.resize(integration_points_number,false);
1078  }
1079  for(unsigned int i=0; i<integration_points_number; i++)
1080  rResult[i] = DN_DX;
1081 
1082  if(determinants_of_jacobian.size() != integration_points_number )
1083  determinants_of_jacobian.resize(integration_points_number,false);
1084 
1085  for(unsigned int i=0; i<integration_points_number; i++)
1086  determinants_of_jacobian[i] = detJ;
1087  }
1088 
1102  IntegrationMethod ThisMethod ) const override
1103  {
1104  const unsigned int integration_points_number = msGeometryData.IntegrationPointsNumber( ThisMethod );
1105  if(rResult.size() != integration_points_number)
1106  {
1107  rResult.resize(integration_points_number,false);
1108  }
1109 
1110  const double detJ = 2.0*(this->Area());
1111 
1112  for ( unsigned int pnt = 0; pnt < integration_points_number; pnt++ )
1113  {
1114  rResult[pnt] = detJ;
1115  }
1116  return rResult;
1117  }
1118 
1138  double DeterminantOfJacobian( IndexType IntegrationPointIndex,
1139  IntegrationMethod ThisMethod ) const override
1140  {
1141  return 2.0*(this->Area());
1142  }
1143 
1158  double DeterminantOfJacobian( const CoordinatesArrayType& rPoint ) const override
1159  {
1160  return 2.0*(this->Area());
1161  }
1162 
1163 
1167 
1175  std::string Info() const override
1176  {
1177  return "2 dimensional triangle with three nodes in 2D space";
1178  }
1179 
1186  void PrintInfo( std::ostream& rOStream ) const override
1187  {
1188  rOStream << "2 dimensional triangle with three nodes in 2D space";
1189  }
1190 
1205  void PrintData( std::ostream& rOStream ) const override
1206  {
1207  // Base Geometry class PrintData call
1208  BaseType::PrintData( rOStream );
1209  std::cout << std::endl;
1210 
1211  // If the geometry has valid points, calculate and output its data
1212  if (this->AllPointsAreValid()) {
1213  Matrix jacobian;
1214  this->Jacobian( jacobian, PointType() );
1215  rOStream << " Jacobian in the origin\t : " << jacobian;
1216  }
1217  }
1218 
1224  IntegrationMethod ThisMethod )
1225  {
1226  ShapeFunctionsGradientsType localGradients
1227  = CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
1228  const int integration_points_number
1229  = msGeometryData.IntegrationPointsNumber( ThisMethod );
1230  ShapeFunctionsGradientsType Result( integration_points_number );
1231 
1232  for ( int pnt = 0; pnt < integration_points_number; pnt++ )
1233  {
1234  Result[pnt] = localGradients[pnt];
1235  }
1236 
1237  return Result;
1238  }
1239 
1245  {
1246  IntegrationMethod ThisMethod = msGeometryData.DefaultIntegrationMethod();
1247  ShapeFunctionsGradientsType localGradients
1248  = CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
1249  const int integration_points_number
1250  = msGeometryData.IntegrationPointsNumber( ThisMethod );
1251  ShapeFunctionsGradientsType Result( integration_points_number );
1252 
1253  for ( int pnt = 0; pnt < integration_points_number; pnt++ )
1254  {
1255  Result[pnt] = localGradients[pnt];
1256  }
1257 
1258  return Result;
1259  }
1260 
1271  const CoordinatesArrayType& rPoint ) const override
1272  {
1273  rResult = ZeroMatrix( 3, 2 );
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;
1280  return rResult;
1281  }
1282 
1283 
1284 
1294  virtual Matrix& ShapeFunctionsGradients( Matrix& rResult, PointType& rPoint )
1295  {
1296  rResult = ZeroMatrix( 3, 2 );
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;
1303  return rResult;
1304  }
1305 
1313  {
1314  if ( rResult.size() != this->PointsNumber() )
1315  {
1316  // KLUDGE: While there is a bug in
1317  // ublas vector resize, I have to put this beside resizing!!
1319  rResult.swap( temp );
1320  }
1321 
1322  if(rResult[0].size1() != 2 || rResult[0].size2() != 2 )
1323  rResult[0].resize( 2, 2,false );
1324 
1325  if(rResult[1].size1() != 2 || rResult[1].size2() != 2 )
1326  rResult[1].resize( 2, 2,false );
1327 
1328  if(rResult[2].size1() != 2 || rResult[2].size2() != 2 )
1329  rResult[2].resize( 2, 2,false );
1330 
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;
1343  return rResult;
1344  }
1345 
1353  {
1354  if ( rResult.size() != this->PointsNumber() )
1355  {
1356  // KLUDGE: While there is a bug in
1357  // ublas vector resize, I have to put this beside resizing!!
1358 // ShapeFunctionsGradientsType
1360  rResult.swap( temp );
1361  }
1362 
1363  for ( IndexType i = 0; i < rResult.size(); i++ )
1364  {
1366  rResult[i].swap( temp );
1367  }
1368 
1369  rResult[0][0].resize( 2, 2,false );
1370 
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 );
1376 
1377  for ( int i = 0; i < 3; i++ )
1378  {
1379 
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;
1388  }
1389 
1390  return rResult;
1391  }
1392 
1396 
1398 
1399 protected:
1404 private:
1407 
1408  static const GeometryData msGeometryData;
1409 
1410  static const GeometryDimension msGeometryDimension;
1411 
1415 
1416  friend class Serializer;
1417 
1418  void save( Serializer& rSerializer ) const override
1419  {
1421  }
1422 
1423  void load( Serializer& rSerializer ) override
1424  {
1426  }
1427 
1428  Triangle2D3():BaseType( PointsArrayType(), &msGeometryData ) {}
1429 
1433 
1434 
1438 
1439 
1443 
1451  static Matrix CalculateShapeFunctionsIntegrationPointsValues(
1452  typename BaseType::IntegrationMethod ThisMethod )
1453  {
1454  IntegrationPointsContainerType all_integration_points =
1455  AllIntegrationPoints();
1456  IntegrationPointsArrayType integration_points = all_integration_points[static_cast<int>(ThisMethod)];
1457  //number of integration points
1458  const int integration_points_number = integration_points.size();
1459  //number of nodes in current geometry
1460  const int points_number = 3;
1461  //setting up return matrix
1462  Matrix shape_function_values( integration_points_number, points_number );
1463  //loop over all integration points
1464 
1465  for ( int pnt = 0; pnt < integration_points_number; pnt++ )
1466  {
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();
1472  }
1473 
1474  return shape_function_values;
1475  }
1476 
1487  CalculateShapeFunctionsIntegrationPointsLocalGradients(
1488  typename BaseType::IntegrationMethod ThisMethod )
1489  {
1490  IntegrationPointsContainerType all_integration_points =
1491  AllIntegrationPoints();
1492  IntegrationPointsArrayType integration_points = all_integration_points[static_cast<int>(ThisMethod)];
1493  //number of integration points
1494  const int integration_points_number = integration_points.size();
1495  ShapeFunctionsGradientsType d_shape_f_values( integration_points_number );
1496  //initialising container
1497  //std::fill(d_shape_f_values.begin(), d_shape_f_values.end(), Matrix(4,2));
1498  //loop over all integration points
1499 
1500  for ( int pnt = 0; pnt < integration_points_number; pnt++ )
1501  {
1502  Matrix result( 3, 2 );
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;
1510  }
1511 
1512  return d_shape_f_values;
1513  }
1514 
1518  static const IntegrationPointsContainerType AllIntegrationPoints()
1519  {
1520  IntegrationPointsContainerType integration_points =
1521  {
1522  {
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()
1533  }
1534  };
1535  return integration_points;
1536  }
1537 
1541  static const ShapeFunctionsValuesContainerType AllShapeFunctionsValues()
1542  {
1543  ShapeFunctionsValuesContainerType shape_functions_values =
1544  {
1545  {
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(
1566  }
1567  };
1568  return shape_functions_values;
1569  }
1570 
1575  AllShapeFunctionsLocalGradients()
1576  {
1577  ShapeFunctionsLocalGradientsContainerType shape_functions_local_gradients =
1578  {
1579  {
1580  Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_1 ),
1581  Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_2 ),
1582  Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_3 ),
1583  Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_4 ),
1584  Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_5 ),
1585  Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_1 ),
1586  Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_2 ),
1587  Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_3 ),
1588  Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_4 ),
1589  Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 ),
1590  }
1591  };
1592  return shape_functions_local_gradients;
1593  }
1594 
1595 
1596 //*************************************************************************************
1597 //*************************************************************************************
1598 
1599  /* Triangle/triangle intersection test routine,
1600  * by Tomas Moller, 1997.
1601  * See article "A Fast Triangle-Triangle Intersection Test",
1602  * Journal of Graphics Tools, 2(2), 1997
1603  *
1604  * Updated June 1999: removed the divisions -- a little faster now!
1605  * Updated October 1999: added {} to CROSS and SUB macros
1606  *
1607  * int NoDivTriTriIsect(float V0[3],float V1[3],float V2[3],
1608  * float U0[3],float U1[3],float U2[3])
1609  *
1610  * parameters: vertices of triangle 1: V0,V1,V2
1611  * vertices of triangle 2: U0,U1,U2
1612  * result : returns 1 if the triangles intersect, otherwise 0
1613  *
1614  */
1615 
1616  bool NoDivTriTriIsect( const Point& V0,
1617  const Point& V1,
1618  const Point& V2,
1619  const Point& U0,
1620  const Point& U1,
1621  const Point& U2) const
1622  {
1623  short index;
1624  double d1,d2;
1625  double du0,du1,du2,dv0,dv1,dv2;
1626  double du0du1,du0du2,dv0dv1,dv0dv2;
1627  double vp0,vp1,vp2;
1628  double up0,up1,up2;
1629  double bb,cc,max;
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;
1634 
1635 
1636  const double epsilon = 1E-6;
1637 
1638 // compute plane equation of triangle(V0,V1,V2) //
1639  noalias(E1) = V1-V0;
1640  noalias(E2) = V2-V0;
1641  MathUtils<double>::CrossProduct(N1, E1, E2);
1642  d1=-inner_prod(N1,V0);
1643 // plane equation 1: N1.X+d1=0 //
1644 
1645 // put U0,U1,U2 into plane equation 1 to compute signed distances to the plane//
1646  du0=inner_prod(N1,U0)+d1;
1647  du1=inner_prod(N1,U1)+d1;
1648  du2=inner_prod(N1,U2)+d1;
1649 
1650 // coplanarity robustness check //
1651  if(fabs(du0)<epsilon) du0=0.0;
1652  if(fabs(du1)<epsilon) du1=0.0;
1653  if(fabs(du2)<epsilon) du2=0.0;
1654 
1655  du0du1=du0*du1;
1656  du0du2=du0*du2;
1657 
1658  if(du0du1>0.00 && du0du2>0.00)// same sign on all of them + not equal 0 ? //
1659  return false; // no intersection occurs //
1660 
1661 // compute plane of triangle (U0,U1,U2) //
1662  noalias(E1) = U1 - U0;
1663  noalias(E2) = U2 - U0;
1664  MathUtils<double>::CrossProduct(N2, E1, E2);
1665  d2=-inner_prod(N2,U0);
1666 // plane equation 2: N2.X+d2=0 //
1667 
1668 // put V0,V1,V2 into plane equation 2 //
1669  dv0=inner_prod(N2,V0)+d2;
1670  dv1=inner_prod(N2,V1)+d2;
1671  dv2=inner_prod(N2,V2)+d2;
1672 
1673  if(fabs(dv0)<epsilon) dv0=0.0;
1674  if(fabs(dv1)<epsilon) dv1=0.0;
1675  if(fabs(dv2)<epsilon) dv2=0.0;
1676 
1677  dv0dv1=dv0*dv1;
1678  dv0dv2=dv0*dv2;
1679 
1680  if(dv0dv1>0.00 && dv0dv2>0.00)// same sign on all of them + not equal 0 ? //
1681  return false; // no intersection occurs //
1682 
1683 // compute direction of intersection line //
1685 
1686 // compute and index to the largest component of D //
1687  max=(double)fabs(D[0]);
1688  index=0;
1689  bb=(double)fabs(D[1]);
1690  cc=(double)fabs(D[2]);
1691  if(bb>max)
1692  {
1693  max=bb,index=1;
1694  }
1695  if(cc>max)
1696  {
1697  max=cc,index=2;
1698  }
1699 
1700 // this is the simplified projection onto L//
1701  vp0=V0[index];
1702  vp1=V1[index];
1703  vp2=V2[index];
1704 
1705  up0=U0[index];
1706  up1=U1[index];
1707  up2=U2[index];
1708 
1709 
1710 // compute interval for triangle 1 //
1711  double a,b,c,x0,x1;
1712  if( New_Compute_Intervals(vp0,vp1,vp2,dv0, dv1,dv2,dv0dv1,dv0dv2, a,b,c,x0,x1)==true )
1713  {
1714  return coplanar_tri_tri(N1,V0,V1,V2,U0,U1,U2);
1715  }
1716 
1717 // compute interval for triangle 2 //
1718  double d,e,f,y0,y1;
1719  if( New_Compute_Intervals(up0, up1, up2, du0, du1, du2, du0du1, du0du2, d, e, f, y0, y1)==true )
1720  {
1721  return coplanar_tri_tri(N1,V0,V1,V2,U0,U1,U2);
1722  }
1723 
1724 
1725  double xx,yy,xxyy,tmp;
1726  xx=x0*x1;
1727  yy=y0*y1;
1728  xxyy=xx*yy;
1729 
1730  tmp=a*xxyy;
1731  isect1[0]=tmp+b*x1*yy;
1732  isect1[1]=tmp+c*x0*yy;
1733 
1734  tmp=d*xxyy;
1735  isect2[0]=tmp+e*xx*y1;
1736  isect2[1]=tmp+f*xx*y0;
1737 
1738 
1739  Sort(isect1[0],isect1[1]);
1740  Sort(isect2[0],isect2[1]);
1741 
1742  if(isect1[1]<isect2[0] || isect2[1]<isect1[0]) return false;
1743  return true;
1744  }
1745 
1746 
1747 //*************************************************************************************
1748 //*************************************************************************************
1749 
1750 
1751 // sort so that a<=b //
1752  void Sort(double& a, double& b) const
1753  {
1754  if(a>b)
1755  {
1756  double c;
1757  c=a;
1758  a=b;
1759  b=c;
1760  }
1761  }
1762 
1763 //*************************************************************************************
1764 //*************************************************************************************
1765 
1766  bool New_Compute_Intervals( double& VV0,
1767  double& VV1,
1768  double& VV2,
1769  double& D0,
1770  double& D1,
1771  double& D2,
1772  double& D0D1,
1773  double& D0D2,
1774  double& A,
1775  double& B,
1776  double& C,
1777  double& X0,
1778  double& X1
1779  ) const
1780  {
1781  if(D0D1>0.00)
1782  {
1783  // here we know that D0D2<=0.0 //
1784  // that is D0, D1 are on the same side, D2 on the other or on the plane //
1785  A=VV2;
1786  B=(VV0-VV2)*D2;
1787  C=(VV1-VV2)*D2;
1788  X0=D2-D0;
1789  X1=D2-D1;
1790  }
1791  else if(D0D2>0.00)
1792  {
1793  // here we know that d0d1<=0.0 //
1794  A=VV1;
1795  B=(VV0-VV1)*D1;
1796  C=(VV2-VV1)*D1;
1797  X0=D1-D0;
1798  X1=D1-D2;
1799  }
1800  else if(D1*D2>0.00 || D0!=0.00)
1801  {
1802  // here we know that d0d1<=0.0 or that D0!=0.0 //
1803  A=VV0;
1804  B=(VV1-VV0)*D0;
1805  C=(VV2-VV0)*D0;
1806  X0=D0-D1;
1807  X1=D0-D2;
1808  }
1809  else if(D1!=0.00)
1810  {
1811  A=VV1;
1812  B=(VV0-VV1)*D1;
1813  C=(VV2-VV1)*D1;
1814  X0=D1-D0;
1815  X1=D1-D2;
1816  }
1817  else if(D2!=0.00)
1818  {
1819  A=VV2;
1820  B=(VV0-VV2)*D2;
1821  C=(VV1-VV2)*D2;
1822  X0=D2-D0;
1823  X1=D2-D1;
1824  }
1825  else
1826  {
1828  return true;
1829  }
1830 
1831  return false;
1832 
1833  }
1834 
1835 //*************************************************************************************
1836 //*************************************************************************************
1837 
1838  bool coplanar_tri_tri( const array_1d<double, 3>& N,
1839  const Point& V0,
1840  const Point& V1,
1841  const Point& V2,
1842  const Point& U0,
1843  const Point& U1,
1844  const Point& U2) const
1845  {
1846  array_1d<double, 3 > A;
1847  short i0,i1;
1848 
1849  // first project onto an axis-aligned plane, that maximizes the area //
1850  // of the triangles, compute indices: i0,i1. //
1851  A[0]=fabs(N[0]);
1852  A[1]=fabs(N[1]);
1853  A[2]=fabs(N[2]);
1854  if(A[0]>A[1])
1855  {
1856  if(A[0]>A[2])
1857  {
1858  i0=1; // A[0] is greatest //
1859  i1=2;
1860  }
1861  else
1862  {
1863  i0=0; // A[2] is greatest //
1864  i1=1;
1865  }
1866  }
1867  else // A[0]<=A[1] //
1868  {
1869  if(A[2]>A[1])
1870  {
1871  i0=0; // A[2] is greatest //
1872  i1=1;
1873  }
1874  else
1875  {
1876  i0=0; // A[1] is greatest //
1877  i1=2;
1878  }
1879  }
1880 
1881  // test all edges of triangle 1 against the edges of triangle 2 //
1882  //std::cout<< "Proof One " << std::endl;
1883  if ( Edge_Against_Tri_Edges(i0, i1, V0,V1,U0,U1,U2)==true) return true;
1884 
1885  //std::cout<< "Proof Two " << std::endl;
1886  if ( Edge_Against_Tri_Edges(i0, i1, V1,V2,U0,U1,U2)==true) return true;
1887 
1888  //std::cout<< "Proof Three " << std::endl;
1889  if ( Edge_Against_Tri_Edges(i0, i1, V2,V0,U0,U1,U2)==true) return true;
1890 
1891  // finally, test if tri1 is totally contained in tri2 or vice versa //
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;
1894 
1895  return false;
1896  }
1897 
1898 //*************************************************************************************
1899 //*************************************************************************************
1900 
1901  bool Edge_Against_Tri_Edges(const short& i0,
1902  const short& i1,
1903  const Point& V0,
1904  const Point& V1,
1905  const Point&U0,
1906  const Point&U1,
1907  const Point&U2) const
1908  {
1909 
1910  double Ax,Ay,Bx,By,Cx,Cy,e,d,f;
1911  Ax=V1[i0]-V0[i0];
1912  Ay=V1[i1]-V0[i1];
1913  // test edge U0,U1 against V0,V1 //
1914 
1915  //std::cout<< "Proof One B " << std::endl;
1916  if(Edge_Edge_Test(Ax, Ay, Bx, By, Cx, Cy, e, d, f, i0, i1, V0, U0, U1)==true) return true;
1917  // test edge U1,U2 against V0,V1 //
1918  //std::cout<< "Proof Two B " << std::endl;
1919  if(Edge_Edge_Test(Ax, Ay, Bx, By, Cx, Cy, e, d, f, i0, i1, V0, U1, U2)==true) return true;
1920  // test edge U2,U1 against V0,V1 //
1921  if(Edge_Edge_Test(Ax, Ay, Bx, By, Cx, Cy, e, d, f, i0, i1, V0, U2, U0)==true) return true;
1922 
1923  return false;
1924  }
1925 
1926 
1927 //*************************************************************************************
1928 //*************************************************************************************
1929 
1930 // this edge to edge test is based on Franlin Antonio's gem:
1931 // "Faster Line Segment Intersection", in Graphics Gems III,
1932 // pp. 199-202
1933  bool Edge_Edge_Test(const double& Ax,
1934  const double& Ay,
1935  double& Bx,
1936  double& By,
1937  double& Cx,
1938  double& Cy,
1939  double& e,
1940  double& d,
1941  double& f,
1942  const short& i0,
1943  const short& i1,
1944  const Point&V0,
1945  const Point&U0,
1946  const Point&U1) const
1947  {
1948  Bx=U0[i0]-U1[i0];
1949  By=U0[i1]-U1[i1];
1950  Cx=V0[i0]-U0[i0];
1951  Cy=V0[i1]-U0[i1];
1952  f=Ay*Bx-Ax*By;
1953  d=By*Cx-Bx*Cy;
1954 
1955  if(std::fabs(f)<1E-10) f = 0.00;
1956  if(std::fabs(d)<1E-10) d = 0.00;
1957 
1958 
1959  if((f>0.00 && d>=0.00 && d<=f) || (f<0.00 && d<=0.00 && d>=f))
1960  {
1961  e=Ax*Cy-Ay*Cx;
1962  //std::cout<< "e = "<< e << std::endl;
1963  if(f>0.00)
1964  {
1965  if(e>=0.00 && e<=f) return true;
1966  }
1967  else
1968  {
1969  if(e<=0.00 && e>=f) return true;
1970  }
1971  }
1972  return false;
1973  }
1974 
1975 //*************************************************************************************
1976 //*************************************************************************************
1977 
1978 
1979  bool Point_In_Tri(const short& i0,
1980  const short& i1,
1981  const Point& V0,
1982  const Point& U0,
1983  const Point& U1,
1984  const Point& U2) const
1985  {
1986  double a,b,c,d0,d1,d2;
1987  // is T1 completly inside T2? //
1988  // check if V0 is inside tri(U0,U1,U2) //
1989  a=U1[i1]-U0[i1];
1990  b=-(U1[i0]-U0[i0]);
1991  c=-a*U0[i0]-b*U0[i1];
1992  d0=a*V0[i0]+b*V0[i1]+c;
1993 
1994  a=U2[i1]-U1[i1];
1995  b=-(U2[i0]-U1[i0]);
1996  c=-a*U1[i0]-b*U1[i1];
1997  d1=a*V0[i0]+b*V0[i1]+c;
1998 
1999  a=U0[i1]-U2[i1];
2000  b=-(U0[i0]-U2[i0]);
2001  c=-a*U2[i0]-b*U2[i1];
2002  d2=a*V0[i0]+b*V0[i1]+c;
2003  if(d0*d1>0.0)
2004  {
2005  if(d0*d2>0.0) return true;
2006  }
2007 
2008  return false;
2009  }
2010 
2011 
2020  inline bool TriBoxOverlap(Point& rBoxCenter, Point& rBoxHalfSize) const
2021  {
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;
2026 
2027  // move everything so that the boxcenter is in (0,0,0)
2028  noalias(vert0) = this->GetPoint(0) - rBoxCenter;
2029  noalias(vert1) = this->GetPoint(1) - rBoxCenter;
2030  noalias(vert2) = this->GetPoint(2) - rBoxCenter;
2031 
2032  // compute triangle edges
2033  noalias(edge0) = vert1 - vert0;
2034  noalias(edge1) = vert2 - vert1;
2035  noalias(edge2) = vert0 - vert2;
2036 
2037  // Bullet 3:
2038  // test the 9 tests first (this was faster)
2039  // We are only interested on z-axis test, which defines the {x,y} plane
2040  // Note that projections onto crossproduct tri-{x,y} are always 0:
2041  // that means there is no separating axis on X,Y-axis tests
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;
2045 
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;
2049 
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;
2053 
2054  // Bullet 1:
2055  // first test overlap in the {x,y,(z)}-directions
2056  // find min, max of the triangle each direction, and test for overlap in
2057  // that direction -- this is equivalent to testing a minimal AABB around
2058  // the triangle against the AABB
2059 
2060  // test in X-direction
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;
2063 
2064  // test in Y-direction
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;
2067 
2068  // test in Z-direction
2069  // we do not consider rBoxHalfSize[2] since we are working in 2D
2070 
2071  // Bullet 2:
2072  // test if the box intersects the plane of the triangle
2073  // compute plane equation of triangle: normal*x+d=0
2074  // Triangle and box are on the {x-y} plane, so this test won't return false
2075 
2076  return true; // box and triangle overlaps
2077  }
2078 
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
2094  {
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);
2099 
2100  rad = rAbsEdgeY*rBoxHalfSize[0] + rAbsEdgeX*rBoxHalfSize[1];
2101 
2102  if(min_max.first>rad || min_max.second<-rad) return true;
2103  else return false;
2104  }
2105 
2115  inline double CalculateSemiperimeter(const double a, const double b, const double c) const {
2116  return 0.5 * (a+b+c);
2117  }
2118 
2128  inline double CalculateMinEdgeLength(const double sa, const double sb, const double sc) const {
2129  return std::sqrt(std::min({sa, sb, sc}));
2130  }
2131 
2141  inline double CalculateMaxEdgeLength(const double sa, const double sb, const double sc) const {
2142  return std::sqrt(std::max({sa, sb, sc}));
2143  }
2144 
2154  inline double CalculateAvgEdgeLength(const double a, const double b, const double c) const {
2155  return 1.0 / 3.0 * (a+b+c);
2156  }
2157 
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));
2169  }
2170 
2180  inline double CalculateCircumradius(const double a, const double b, const double c) const {
2181  return (a*b*c) / std::sqrt((a+b+c) * (b+c-a) * (c+a-b) * (a+b-c));
2182  }
2183 
2187 
2188 
2192 
2193 
2197 
2198  template<class TOtherPointType> friend class Triangle2D3;
2199 
2203 
2204 
2206 }; // Class Geometry
2207 
2211 
2212 
2216 
2219 template<class TPointType> inline std::istream& operator >> (
2220  std::istream& rIStream,
2221  Triangle2D3<TPointType>& rThis );
2225 template<class TPointType> inline std::ostream& operator << (
2226  std::ostream& rOStream,
2227  const Triangle2D3<TPointType>& rThis )
2228 {
2229  rThis.PrintInfo( rOStream );
2230  rOStream << std::endl;
2231  rThis.PrintData( rOStream );
2232  return rOStream;
2233 }
2234 
2236 
2237 template<class TPointType> const
2238 GeometryData Triangle2D3<TPointType>::msGeometryData(
2241  Triangle2D3<TPointType>::AllIntegrationPoints(),
2242  Triangle2D3<TPointType>::AllShapeFunctionsValues(),
2243  AllShapeFunctionsLocalGradients()
2244 );
2245 
2246 template<class TPointType> const
2247 GeometryDimension Triangle2D3<TPointType>::msGeometryDimension(2, 2);
2248 
2249 }// namespace Kratos.
2250 
2251 #endif // KRATOS_TRIANGLE_2D_3_H_INCLUDED defined
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