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.
tetrahedra_3d_4.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 #pragma once
18 
19 // System includes
20 
21 // External includes
22 
23 // Project includes
26 #include "geometries/plane.h"
27 #include "utilities/geometry_utilities.h"
28 
29 namespace Kratos
30 {
58 template<class TPointType> class Tetrahedra3D4 : public Geometry<TPointType>
59 {
60 public:
69 
75 
80 
85 
91 
95  typedef TPointType PointType;
96 
102  typedef typename BaseType::IndexType IndexType;
103 
104 
110  typedef typename BaseType::SizeType SizeType;
111 
117 
124 
132 
139 
146 
153 
160 
167 
175 
180 
185 
190 
194  Tetrahedra3D4( typename PointType::Pointer pPoint1,
195  typename PointType::Pointer pPoint2,
196  typename PointType::Pointer pPoint3,
197  typename PointType::Pointer pPoint4 )
198  : BaseType(PointsArrayType(), &msGeometryData)
199  {
200  this->Points().reserve(4);
201  this->Points().push_back(pPoint1);
202  this->Points().push_back(pPoint2);
203  this->Points().push_back(pPoint3);
204  this->Points().push_back(pPoint4);
205  }
206 
207  explicit Tetrahedra3D4( const PointsArrayType& ThisPoints)
208  : BaseType(ThisPoints, &msGeometryData)
209  {
210  KRATOS_ERROR_IF( this->PointsNumber() != 4 ) << "Invalid points number. Expected 4, given " << this->PointsNumber() << std::endl;
211  }
212 
214  explicit Tetrahedra3D4(
215  const IndexType GeometryId,
216  const PointsArrayType& rThisPoints
217  ) : BaseType(GeometryId, rThisPoints, &msGeometryData)
218  {
219  KRATOS_ERROR_IF( this->PointsNumber() != 4 ) << "Invalid points number. Expected 4, given " << this->PointsNumber() << std::endl;
220  }
221 
223  explicit Tetrahedra3D4(
224  const std::string& rGeometryName,
225  const PointsArrayType& rThisPoints
226  ) : BaseType( rGeometryName, rThisPoints, &msGeometryData )
227  {
228  KRATOS_ERROR_IF(this->PointsNumber() != 4) << "Invalid points number. Expected 4, given " << this->PointsNumber() << std::endl;
229  }
230 
241  : BaseType(rOther)
242  {
243  }
244 
257  template<class TOtherPointType> explicit Tetrahedra3D4(Tetrahedra3D4<TOtherPointType> const& rOther)
258  : BaseType(rOther)
259  {
260  }
261 
263  ~Tetrahedra3D4() override {}
264 
266  {
268  }
270  {
272  }
273 
290  {
291  BaseType::operator=(rOther);
292  return *this;
293  }
294 
306  template<class TOtherPointType>
308  {
309  BaseType::operator=(rOther);
310 
311  return *this;
312  }
313 
317 
323  typename BaseType::Pointer Create(
324  PointsArrayType const& rThisPoints
325  ) const override
326  {
327  return typename BaseType::Pointer(new Tetrahedra3D4(rThisPoints));
328  }
329 
336  typename BaseType::Pointer Create(
337  const IndexType NewGeometryId,
338  PointsArrayType const& rThisPoints
339  ) const override
340  {
341  return typename BaseType::Pointer( new Tetrahedra3D4( NewGeometryId, rThisPoints ) );
342  }
343 
349  typename BaseType::Pointer Create(
350  const BaseType& rGeometry
351  ) const override
352  {
353  auto p_geometry = typename BaseType::Pointer( new Tetrahedra3D4( rGeometry.Points() ) );
354  p_geometry->SetData(rGeometry.GetData());
355  return p_geometry;
356  }
357 
364  typename BaseType::Pointer Create(
365  const IndexType NewGeometryId,
366  const BaseType& rGeometry
367  ) const override
368  {
369  auto p_geometry = typename BaseType::Pointer( new Tetrahedra3D4( NewGeometryId, rGeometry.Points() ) );
370  p_geometry->SetData(rGeometry.GetData());
371  return p_geometry;
372  }
373 
383  Vector& rResult,
384  const typename BaseType::LumpingMethods LumpingMethod = BaseType::LumpingMethods::ROW_SUM
385  ) const override
386  {
387  if(rResult.size() != 4)
388  rResult.resize(4, false);
389  std::fill(rResult.begin(), rResult.end(), 1.00 / 4.00);
390  return rResult;
391  }
392 
412  double Length() const override
413  {
414  constexpr double factor = 2.0396489026555; // (12/sqrt(2)) ^ 1/3);
415  return factor * std::cbrt(std::fabs(Volume())); // sqrt(fabs( DeterminantOfJacobian(PointType())));
416  }
417 
432  double Area() const override
433  {
434  return this->Volume();
435  }
436 
450  double Volume() const override {
451  //Closed formula for the linear tetrahedra
452  const double onesixth = 1.0/6.0;
453 
454  const CoordinatesArrayType& rP0 = this->Points()[0].Coordinates();
455  const CoordinatesArrayType& rP1 = this->Points()[1].Coordinates();
456  const CoordinatesArrayType& rP2 = this->Points()[2].Coordinates();
457  const CoordinatesArrayType& rP3 = this->Points()[3].Coordinates();
458 
459  const double x10 = rP1[0] - rP0[0];
460  const double y10 = rP1[1] - rP0[1];
461  const double z10 = rP1[2] - rP0[2];
462 
463  const double x20 = rP2[0] - rP0[0];
464  const double y20 = rP2[1] - rP0[1];
465  const double z20 = rP2[2] - rP0[2];
466 
467  const double x30 = rP3[0] - rP0[0];
468  const double y30 = rP3[1] - rP0[1];
469  const double z30 = rP3[2] - rP0[2];
470 
471  const double detJ = x10 * y20 * z30 - x10 * y30 * z20 + y10 * z20 * x30 - y10 * x20 * z30 + z10 * x20 * y30 - z10 * y20 * x30;
472  return detJ*onesixth;
473  }
474 
475  double DomainSize() const override {
476  return Volume();
477  }
478 
486  double MinEdgeLength() const override {
487  const auto a = this->GetPoint(0) - this->GetPoint(1);
488  const auto b = this->GetPoint(1) - this->GetPoint(2);
489  const auto c = this->GetPoint(2) - this->GetPoint(0);
490  const auto d = this->GetPoint(3) - this->GetPoint(0);
491  const auto e = this->GetPoint(3) - this->GetPoint(1);
492  const auto f = this->GetPoint(3) - this->GetPoint(2);
493 
494  const double sa = (a[0]*a[0])+(a[1]*a[1])+(a[2]*a[2]);
495  const double sb = (b[0]*b[0])+(b[1]*b[1])+(b[2]*b[2]);
496  const double sc = (c[0]*c[0])+(c[1]*c[1])+(c[2]*c[2]);
497  const double sd = (d[0]*d[0])+(d[1]*d[1])+(d[2]*d[2]);
498  const double se = (e[0]*e[0])+(e[1]*e[1])+(e[2]*e[2]);
499  const double sf = (f[0]*f[0])+(f[1]*f[1])+(f[2]*f[2]);
500 
501  return CalculateMinEdgeLength(sa, sb, sc, sd, se, sf);
502  }
503 
512  double MaxEdgeLength() const override {
513  const auto a = this->GetPoint(0) - this->GetPoint(1);
514  const auto b = this->GetPoint(1) - this->GetPoint(2);
515  const auto c = this->GetPoint(2) - this->GetPoint(0);
516  const auto d = this->GetPoint(3) - this->GetPoint(0);
517  const auto e = this->GetPoint(3) - this->GetPoint(1);
518  const auto f = this->GetPoint(3) - this->GetPoint(2);
519 
520  const double sa = (a[0]*a[0])+(a[1]*a[1])+(a[2]*a[2]);
521  const double sb = (b[0]*b[0])+(b[1]*b[1])+(b[2]*b[2]);
522  const double sc = (c[0]*c[0])+(c[1]*c[1])+(c[2]*c[2]);
523  const double sd = (d[0]*d[0])+(d[1]*d[1])+(d[2]*d[2]);
524  const double se = (e[0]*e[0])+(e[1]*e[1])+(e[2]*e[2]);
525  const double sf = (f[0]*f[0])+(f[1]*f[1])+(f[2]*f[2]);
526 
527  return CalculateMaxEdgeLength(sa, sb, sc, sd, se, sf);
528  }
529 
537  double AverageEdgeLength() const override {
538  return CalculateAvgEdgeLength(
539  MathUtils<double>::Norm3(this->GetPoint(0)-this->GetPoint(1)),
540  MathUtils<double>::Norm3(this->GetPoint(1)-this->GetPoint(2)),
541  MathUtils<double>::Norm3(this->GetPoint(2)-this->GetPoint(0)),
542  MathUtils<double>::Norm3(this->GetPoint(3)-this->GetPoint(0)),
543  MathUtils<double>::Norm3(this->GetPoint(3)-this->GetPoint(1)),
544  MathUtils<double>::Norm3(this->GetPoint(3)-this->GetPoint(2))
545  );
546  }
547 
552  double Circumradius() const override {
553  // | s10 y10 z10 | | s10 x10 z10 | | s10 x10 y10 | | x10 y10 z10 |
554  // MX | s20 y20 z20 | MY | s20 x20 z20 | MZ | s20 x20 y20 | AL | x20 y20 z20 |
555  // | s30 y30 z30 | | s30 x30 z30 | | s30 x30 y30 | | x30 y30 z30 |
556 
557  const CoordinatesArrayType& rP0 = this->Points()[0].Coordinates();
558  const CoordinatesArrayType& rP1 = this->Points()[1].Coordinates();
559  const CoordinatesArrayType& rP2 = this->Points()[2].Coordinates();
560  const CoordinatesArrayType& rP3 = this->Points()[3].Coordinates();
561 
562  const double aDot = rP0[0] * rP0[0] + rP0[1] * rP0[1] + rP0[2] * rP0[2];
563  const double bDot = rP1[0] * rP1[0] + rP1[1] * rP1[1] + rP1[2] * rP1[2];
564  const double cDot = rP2[0] * rP2[0] + rP2[1] * rP2[1] + rP2[2] * rP2[2];
565  const double dDot = rP3[0] * rP3[0] + rP3[1] * rP3[1] + rP3[2] * rP3[2];
566 
567  // Build the simplified matrices
568  const double s10 = aDot - dDot;
569  const double x10 = rP0[0] - rP3[0];
570  const double y10 = rP0[1] - rP3[1];
571  const double z10 = rP0[2] - rP3[2];
572 
573  const double s20 = bDot - dDot;
574  const double x20 = rP1[0] - rP3[0];
575  const double y20 = rP1[1] - rP3[1];
576  const double z20 = rP1[2] - rP3[2];
577 
578  const double s30 = cDot - dDot;
579  const double x30 = rP2[0] - rP3[0];
580  const double y30 = rP2[1] - rP3[1];
581  const double z30 = rP2[2] - rP3[2];
582 
583  const double detJMX = s10 * y20 * z30 + y10 * z20 * s30 + z10 * s20 * y30 - s30 * y20 * z10 - y30 * z20 * s10 - z30 * s20 * y10;
584  const double detJMY = s10 * x20 * z30 + x10 * z20 * s30 + z10 * s20 * x30 - s30 * x20 * z10 - x30 * z20 * s10 - z30 * s20 * x10;
585  const double detJMZ = s10 * x20 * y30 + x10 * y20 * s30 + y10 * s20 * x30 - s30 * x20 * y10 - x30 * y20 * s10 - y30 * s20 * x10;
586  const double detJAL = x10 * y20 * z30 + y10 * z20 * x30 + z10 * x20 * y30 - x30 * y20 * z10 - y30 * z20 * x10 - z30 * x20 * y10;
587 
588  return std::sqrt( (detJMX*detJMX + detJMY*detJMY + detJMZ*detJMZ)) / (2*std::abs(detJAL));
589  }
590 
596  double Inradius() const override {
597  // | x10 y10 z10 |
598  // AL | x20 y20 z20 |
599  // | x30 y30 z30 |
600 
601  const CoordinatesArrayType& rP0 = this->Points()[0].Coordinates();
602  const CoordinatesArrayType& rP1 = this->Points()[1].Coordinates();
603  const CoordinatesArrayType& rP2 = this->Points()[2].Coordinates();
604  const CoordinatesArrayType& rP3 = this->Points()[3].Coordinates();
605 
606  array_1d<double, 3> c012, c013, c023, c123;
607 
608  MathUtils<double>::CrossProduct(c012, rP2-rP0, rP1-rP0);
609  MathUtils<double>::CrossProduct(c013, rP3-rP0, rP1-rP0);
610  MathUtils<double>::CrossProduct(c023, rP3-rP0, rP2-rP0);
611  MathUtils<double>::CrossProduct(c123, rP3-rP1, rP2-rP1);
612 
613  const double n012 = std::sqrt(c012[0]*c012[0] + c012[1]*c012[1] + c012[2]*c012[2]);
614  const double n013 = std::sqrt(c013[0]*c013[0] + c013[1]*c013[1] + c013[2]*c013[2]);
615  const double n023 = std::sqrt(c023[0]*c023[0] + c023[1]*c023[1] + c023[2]*c023[2]);
616  const double n123 = std::sqrt(c123[0]*c123[0] + c123[1]*c123[1] + c123[2]*c123[2]);
617 
618  // Build the simplified matrices
619  const double x10 = rP0[0] - rP3[0];
620  const double y10 = rP0[1] - rP3[1];
621  const double z10 = rP0[2] - rP3[2];
622 
623  const double x20 = rP1[0] - rP3[0];
624  const double y20 = rP1[1] - rP3[1];
625  const double z20 = rP1[2] - rP3[2];
626 
627  const double x30 = rP2[0] - rP3[0];
628  const double y30 = rP2[1] - rP3[1];
629  const double z30 = rP2[2] - rP3[2];
630 
631  const double detJAL = x10 * y20 * z30 + y10 * z20 * x30 + z10 * x20 * y30 - x30 * y20 * z10 - y30 * z20 * x10 - z30 * x20 * y10;
632 
633  return std::abs(detJAL) / (n012 + n013 + n023 + n123);
634  }
635 
637 
648  double InradiusToCircumradiusQuality() const override {
649  constexpr double normFactor = 3.0;
650 
651  return normFactor * Inradius() / Circumradius();
652  };
653 
664  double InradiusToLongestEdgeQuality() const override {
665  constexpr double normFactor = 4.89897982161;
666 
667  const auto a = this->GetPoint(0) - this->GetPoint(1);
668  const auto b = this->GetPoint(1) - this->GetPoint(2);
669  const auto c = this->GetPoint(2) - this->GetPoint(0);
670  const auto d = this->GetPoint(3) - this->GetPoint(0);
671  const auto e = this->GetPoint(3) - this->GetPoint(1);
672  const auto f = this->GetPoint(3) - this->GetPoint(2);
673 
674  const double sa = (a[0]*a[0])+(a[1]*a[1])+(a[2]*a[2]);
675  const double sb = (b[0]*b[0])+(b[1]*b[1])+(b[2]*b[2]);
676  const double sc = (c[0]*c[0])+(c[1]*c[1])+(c[2]*c[2]);
677  const double sd = (d[0]*d[0])+(d[1]*d[1])+(d[2]*d[2]);
678  const double se = (e[0]*e[0])+(e[1]*e[1])+(e[2]*e[2]);
679  const double sf = (f[0]*f[0])+(f[1]*f[1])+(f[2]*f[2]);
680 
681  return normFactor * Inradius() / CalculateMaxEdgeLength(sa,sb,sc,sd,se,sf);
682  }
683 
694  double ShortestToLongestEdgeQuality() const override {
695  const auto a = this->GetPoint(0) - this->GetPoint(1);
696  const auto b = this->GetPoint(1) - this->GetPoint(2);
697  const auto c = this->GetPoint(2) - this->GetPoint(0);
698  const auto d = this->GetPoint(3) - this->GetPoint(0);
699  const auto e = this->GetPoint(3) - this->GetPoint(1);
700  const auto f = this->GetPoint(3) - this->GetPoint(2);
701 
702  const double sa = (a[0]*a[0])+(a[1]*a[1])+(a[2]*a[2]);
703  const double sb = (b[0]*b[0])+(b[1]*b[1])+(b[2]*b[2]);
704  const double sc = (c[0]*c[0])+(c[1]*c[1])+(c[2]*c[2]);
705  const double sd = (d[0]*d[0])+(d[1]*d[1])+(d[2]*d[2]);
706  const double se = (e[0]*e[0])+(e[1]*e[1])+(e[2]*e[2]);
707  const double sf = (f[0]*f[0])+(f[1]*f[1])+(f[2]*f[2]);
708 
709  return CalculateMinEdgeLength(sa,sb,sc,sd,se,sf) / CalculateMaxEdgeLength(sa,sb,sc,sd,se,sf);
710  }
711 
721  double RegularityQuality() const override {
722  KRATOS_ERROR << "Method 'RegularityQuality' is not yet implemented for Tetrahedra3D4" << std::endl;
723  return 0.0;
724  }
725 
735  double VolumeToSurfaceAreaQuality() const override {
736  KRATOS_ERROR << "Method 'VolumeToSurfaceAreaQuality' is not yet implemented for Tetrahedra3D4" << std::endl;
737  return 0.0;
738  }
739 
749  double VolumeToEdgeLengthQuality() const override {
750  constexpr double normFactor = 12.0;
751 
752  const auto a = this->GetPoint(0) - this->GetPoint(1);
753  const auto b = this->GetPoint(1) - this->GetPoint(2);
754  const auto c = this->GetPoint(2) - this->GetPoint(0);
755  const auto d = this->GetPoint(3) - this->GetPoint(0);
756  const auto e = this->GetPoint(3) - this->GetPoint(1);
757  const auto f = this->GetPoint(3) - this->GetPoint(2);
758 
759  const double sa = (a[0]*a[0]) + (a[1]*a[1]) + (a[2]*a[2]);
760  const double sb = (b[0]*b[0]) + (b[1]*b[1]) + (b[2]*b[2]);
761  const double sc = (c[0]*c[0]) + (c[1]*c[1]) + (c[2]*c[2]);
762  const double sd = (d[0]*d[0]) + (d[1]*d[1]) + (d[2]*d[2]);
763  const double se = (e[0]*e[0]) + (e[1]*e[1]) + (e[2]*e[2]);
764  const double sf = (f[0]*f[0]) + (f[1]*f[1]) + (f[2]*f[2]);
765 
766  const double vol = Volume();
767 
768  return std::abs(normFactor * std::pow(9 * vol * vol, 1.0 / 3.0) / (sa + sb + sc + sd + se + sf)) * (vol < 0 ? -1 : 1);
769  }
770 
780  double VolumeToAverageEdgeLength() const override {
781  constexpr double normFactor = 6.0 * 1.41421356237309504880;
782 
783  return normFactor * Volume() / std::pow(AverageEdgeLength(), 3);
784  }
785 
797  double VolumeToRMSEdgeLength() const override {
798  constexpr double normFactor = 6.0 * 1.41421356237309504880;
799 
800  const auto a = this->GetPoint(0) - this->GetPoint(1);
801  const auto b = this->GetPoint(1) - this->GetPoint(2);
802  const auto c = this->GetPoint(2) - this->GetPoint(0);
803  const auto d = this->GetPoint(3) - this->GetPoint(0);
804  const auto e = this->GetPoint(3) - this->GetPoint(1);
805  const auto f = this->GetPoint(3) - this->GetPoint(2);
806 
807  const double sa = (a[0]*a[0])+(a[1]*a[1])+(a[2]*a[2]);
808  const double sb = (b[0]*b[0])+(b[1]*b[1])+(b[2]*b[2]);
809  const double sc = (c[0]*c[0])+(c[1]*c[1])+(c[2]*c[2]);
810  const double sd = (d[0]*d[0])+(d[1]*d[1])+(d[2]*d[2]);
811  const double se = (e[0]*e[0])+(e[1]*e[1])+(e[2]*e[2]);
812  const double sf = (f[0]*f[0])+(f[1]*f[1])+(f[2]*f[2]);
813 
814  return normFactor * Volume() / std::pow(std::sqrt(1.0/6.0 * (sa + sb + sc + sd + se + sf)), 3.0);
815  }
816 
817 
824  double MinDihedralAngle() const override {
825  Vector dihedral_angles(6);
826  ComputeDihedralAngles(dihedral_angles);
827  double min_dihedral_angle = 1000.0;
828  for (unsigned int i = 0; i < 6; i++) {
829  if (dihedral_angles[i]<min_dihedral_angle) min_dihedral_angle=dihedral_angles[i];
830  }
831  return min_dihedral_angle;
832  }
833 
840  double MaxDihedralAngle() const override {
841  Vector dihedral_angles(6);
842  ComputeDihedralAngles(dihedral_angles);
843  double max_dihedral_angle = -1000.0;
844  for (unsigned int i = 0; i < 6; i++) {
845  if (dihedral_angles[i] > max_dihedral_angle) max_dihedral_angle = dihedral_angles[i];
846  }
847  return max_dihedral_angle;
848  }
849 
850 
851 
858  double MinSolidAngle() const override {
859  Vector solid_angles(4);
860  ComputeSolidAngles(solid_angles);
861  double min_solid_angle = 1000.0;
862  for (unsigned int i = 0; i < 4; i++) {
863  if (solid_angles[i]<min_solid_angle) min_solid_angle = solid_angles[i];
864  }
865  return min_solid_angle;
866 
867  }
868 
869 
875  inline void ComputeSolidAngles(Vector& rSolidAngles) const override
876  {
877  if(rSolidAngles.size() != 4)
878  rSolidAngles.resize(4, false);
879 
880  Vector dihedral_angles(6);
881  ComputeDihedralAngles(dihedral_angles);
882 
883  rSolidAngles[0] = dihedral_angles[0] + dihedral_angles[1] + dihedral_angles[2] - Globals::Pi;
884  rSolidAngles[1] = dihedral_angles[0] + dihedral_angles[3] + dihedral_angles[4] - Globals::Pi;
885  rSolidAngles[2] = dihedral_angles[2] + dihedral_angles[4] + dihedral_angles[5] - Globals::Pi;
886  rSolidAngles[3] = dihedral_angles[1] + dihedral_angles[3] + dihedral_angles[5] - Globals::Pi;
887  }
888 
889 
895  inline void ComputeDihedralAngles(Vector& rDihedralAngles) const override
896  {
897  if(rDihedralAngles.size() != 6)
898  rDihedralAngles.resize(6, false);
899 
901  for (unsigned int i = 0; i < 4; i++) {
902  const array_1d<double, 3 > & xyz = this->GetPoint(i);
903  for (unsigned int j = 0; j < 3; j++)
904  coords(i, j) = xyz[j];
905  }
906  //we have to check 6 different angles (one per edge)
907  //to get an easy-to-read algorithm, we find the angles by creating the normal planes to each face and then find the angles between them
908  //to do so, we create a list of 3 nodes per angle. face1 is defined with nodes 0,1,2a , and face2 is defined with nodes 0,1,2b
909  const int node0[] = {0, 0, 0, 1, 1, 2};
910  const int node1[] = {1, 3, 2, 3, 2, 3};
911  const int node2a[] = {2, 1, 1, 0, 0, 0};
912  const int node2b[] = {3, 2, 3, 2, 3, 1};
913 
914  array_1d<double,3> edge1,edge2a,edge2b,normal1,normal2;
915 
916  //now we only loop through the six edges to see which one has the lowest angle
917  for (unsigned int i = 0; i < 6; i++) {
918  //first we find the edges
919  for (unsigned int j = 0; j < 3; ++j) {
920  edge1[j] = coords(node1[i],j) - coords(node0[i],j) ;
921  edge2a[j] = coords(node2a[i],j) - coords(node0[i],j) ;
922  edge2b[j] = coords(node2b[i],j) - coords(node0[i],j) ;
923  }
924  //now we find the normals to the planes
925  MathUtils<double>::CrossProduct(normal1,edge1,edge2a);
926  MathUtils<double>::CrossProduct(normal2,edge1,edge2b);
927  normal1 /= std::sqrt(normal1[0]*normal1[0] + normal1[1]*normal1[1] + normal1[2]*normal1[2]);
928  normal2 /= std::sqrt(normal2[0]*normal2[0] + normal2[1]*normal2[1] + normal2[2]*normal2[2]);
929 
930  //and finally the cos of the angle:
931  const double angle_cos = ( normal1[0]*normal2[0] + normal1[1]*normal2[1] + normal1[2]*normal2[2] );
932  rDihedralAngles[i] = std::acos(angle_cos);
933  }
934  }
935 
941  Matrix& PointsLocalCoordinates( Matrix& rResult ) const override
942  {
943  if(rResult.size1()!= 4 || rResult.size2()!= 3)
944  rResult.resize(4, 3, false);
945 
946  rResult(0,0)=0.0;
947  rResult(0,1)=0.0;
948  rResult(0,2)=0.0;
949  rResult(1,0)=1.0;
950  rResult(1,1)=0.0;
951  rResult(1,2)=0.0;
952  rResult(2,0)=0.0;
953  rResult(2,1)=1.0;
954  rResult(2,2)=0.0;
955  rResult(3,0)=0.0;
956  rResult(3,1)=0.0;
957  rResult(3,2)=1.0;
958 
959  return rResult;
960  }
961 
969  CoordinatesArrayType& rResult,
970  const CoordinatesArrayType& rPoint
971  ) const override
972  {
973  return GeometryUtils::PointLocalCoordinatesPlanarFaceTetrahedra(*this, rResult, rPoint);
974  }
975 
984  bool IsInside(
985  const CoordinatesArrayType& rPoint,
986  CoordinatesArrayType& rResult,
987  const double Tolerance = std::numeric_limits<double>::epsilon()
988  ) const override
989  {
990  this->PointLocalCoordinates( rResult, rPoint );
991 
992  if( rResult[0] >= 0.0-Tolerance ) {
993  if( rResult[1] >= 0.0-Tolerance ) {
994  if( rResult[2] >= 0.0-Tolerance ) {
995  if( (rResult[0] + rResult[1] + rResult[2]) <= (1.0+Tolerance)) {
996  return true;
997  }
998  }
999  }
1000  }
1001 
1002  return false;
1003  }
1004 
1008 
1020  SizeType EdgesNumber() const override
1021  {
1022  return 6;
1023  }
1024 
1034  {
1036  typedef typename Geometry<TPointType>::Pointer EdgePointerType;
1037  edges.push_back( EdgePointerType(new EdgeType(
1038  this->pGetPoint(0),
1039  this->pGetPoint(1))) );
1040  edges.push_back( EdgePointerType(new EdgeType(
1041  this->pGetPoint(1),
1042  this->pGetPoint(2))) );
1043  edges.push_back( EdgePointerType(new EdgeType(
1044  this->pGetPoint(2),
1045  this->pGetPoint(0))) );
1046  edges.push_back( EdgePointerType(new EdgeType(
1047  this->pGetPoint(0),
1048  this->pGetPoint(3))) );
1049  edges.push_back( EdgePointerType(new EdgeType(
1050  this->pGetPoint(1),
1051  this->pGetPoint(3))) );
1052  edges.push_back( EdgePointerType(new EdgeType(
1053  this->pGetPoint(2),
1054  this->pGetPoint(3))) );
1055 
1056  return edges;
1057  }
1058 
1062 
1070  SizeType FacesNumber() const override
1071  {
1072  return 4;
1073  }
1074 
1084  {
1086  typedef typename Geometry<TPointType>::Pointer FacePointerType;
1087  faces.push_back( FacePointerType(new FaceType(
1088  this->pGetPoint(2),
1089  this->pGetPoint(3),
1090  this->pGetPoint(1))) );
1091  faces.push_back( FacePointerType(new FaceType(
1092  this->pGetPoint(0),
1093  this->pGetPoint(3),
1094  this->pGetPoint(2))) );
1095  faces.push_back( FacePointerType(new FaceType(
1096  this->pGetPoint(0),
1097  this->pGetPoint(1),
1098  this->pGetPoint(3))) );
1099  faces.push_back( FacePointerType(new FaceType(
1100  this->pGetPoint(0),
1101  this->pGetPoint(2),
1102  this->pGetPoint(1))) );
1103  return faces;
1104  }
1105 
1106  //Connectivities of faces required
1108  {
1109  NumberNodesInFaces.resize(4, false);
1110  // Linear Tetrahedra have elements of 3 nodes as faces
1111  NumberNodesInFaces[0]=3;
1112  NumberNodesInFaces[1]=3;
1113  NumberNodesInFaces[2]=3;
1114  NumberNodesInFaces[3]=3;
1115 
1116  }
1117 
1118 
1120  {
1121  // faces in columns
1122  if(NodesInFaces.size1() != 4 || NodesInFaces.size2() != 4)
1123  NodesInFaces.resize(4, 4, false);
1124 
1125  //face 1
1126  NodesInFaces(0,0)=0;//contrary node to the face
1127  NodesInFaces(1,0)=1;
1128  NodesInFaces(2,0)=2;
1129  NodesInFaces(3,0)=3;
1130  //face 2
1131  NodesInFaces(0,1)=1;//contrary node to the face
1132  NodesInFaces(1,1)=2;
1133  NodesInFaces(2,1)=0;
1134  NodesInFaces(3,1)=3;
1135  //face 3
1136  NodesInFaces(0,2)=2;//contrary node to the face
1137  NodesInFaces(1,2)=0;
1138  NodesInFaces(2,2)=1;
1139  NodesInFaces(3,2)=3;
1140  //face 4
1141  NodesInFaces(0,3)=3;//contrary node to the face
1142  NodesInFaces(1,3)=0;
1143  NodesInFaces(2,3)=2;
1144  NodesInFaces(3,3)=1;
1145 
1146  }
1147 
1161  double ShapeFunctionValue( IndexType ShapeFunctionIndex,
1162  const CoordinatesArrayType& rPoint) const override
1163  {
1164  switch( ShapeFunctionIndex )
1165  {
1166  case 0:
1167  return( 1.0-(rPoint[0]+rPoint[1]+rPoint[2]) );
1168  case 1:
1169  return( rPoint[0] );
1170  case 2:
1171  return( rPoint[1] );
1172  case 3:
1173  return( rPoint[2] );
1174  default:
1175  KRATOS_ERROR << "Wrong index of shape function!" << *this << std::endl;
1176  }
1177  return 0;
1178  }
1179 
1193  Vector& ShapeFunctionsValues (Vector &rResult, const CoordinatesArrayType& rCoordinates) const override
1194  {
1195  if(rResult.size() != 4) rResult.resize(4,false);
1196  rResult[0] = 1.0-(rCoordinates[0]+rCoordinates[1]+rCoordinates[2]);
1197  rResult[1] = rCoordinates[0] ;
1198  rResult[2] = rCoordinates[1] ;
1199  rResult[3] = rCoordinates[2] ;
1200 
1201  return rResult;
1202  }
1203 
1212  Matrix& ShapeFunctionsLocalGradients( Matrix& rResult, const CoordinatesArrayType& rPoint ) const override
1213  {
1214  if(rResult.size1() != this->PointsNumber() || rResult.size2() != this->LocalSpaceDimension())
1215  rResult.resize(this->PointsNumber(),this->LocalSpaceDimension(),false);
1216 
1217  CalculateShapeFunctionsLocalGradients(rResult, rPoint);
1218 
1219  return rResult;
1220  }
1221 
1238  ShapeFunctionsGradientsType& rResult,
1239  IntegrationMethod ThisMethod) const override
1240  {
1241  const unsigned int integration_points_number =
1242  msGeometryData.IntegrationPointsNumber(ThisMethod);
1243  KRATOS_ERROR_IF(integration_points_number == 0) << "This integration method is not supported" << *this << std::endl;
1244 
1246  const double x10 = this->Points()[1].X() - this->Points()[0].X();
1247  const double y10 = this->Points()[1].Y() - this->Points()[0].Y();
1248  const double z10 = this->Points()[1].Z() - this->Points()[0].Z();
1249 
1250  const double x20 = this->Points()[2].X() - this->Points()[0].X();
1251  const double y20 = this->Points()[2].Y() - this->Points()[0].Y();
1252  const double z20 = this->Points()[2].Z() - this->Points()[0].Z();
1253 
1254  const double x30 = this->Points()[3].X() - this->Points()[0].X();
1255  const double y30 = this->Points()[3].Y() - this->Points()[0].Y();
1256  const double z30 = this->Points()[3].Z() - this->Points()[0].Z();
1257 
1258  const double detJ = x10 * y20 * z30 - x10 * y30 * z20 + y10 * z20 * x30 - y10 * x20 * z30 + z10 * x20 * y30 - z10 * y20 * x30;
1259 
1260  DN_DX(0,0) = -y20 * z30 + y30 * z20 + y10 * z30 - z10 * y30 - y10 * z20 + z10 * y20;
1261  DN_DX(0,1) = -z20 * x30 + x20 * z30 - x10 * z30 + z10 * x30 + x10 * z20 - z10 * x20;
1262  DN_DX(0,2) = -x20 * y30 + y20 * x30 + x10 * y30 - y10 * x30 - x10 * y20 + y10 * x20;
1263  DN_DX(1,0) = y20 * z30 - y30 * z20;
1264  DN_DX(1,1) = z20 * x30 - x20 * z30;
1265  DN_DX(1,2) = x20 * y30 - y20 * x30;
1266  DN_DX(2,0) = -y10 * z30 + z10 * y30;
1267  DN_DX(2,1) = x10 * z30 - z10 * x30;
1268  DN_DX(2,2) = -x10 * y30 + y10 * x30;
1269  DN_DX(3,0) = y10 * z20 - z10 * y20;
1270  DN_DX(3,1) = -x10 * z20 + z10 * x20;
1271  DN_DX(3,2) = x10 * y20 - y10 * x20;
1272 
1273  DN_DX /= detJ;
1274  if(rResult.size() != integration_points_number) {
1275  rResult.resize(integration_points_number,false);
1276  }
1277 
1278  for(unsigned int i=0; i<integration_points_number; i++)
1279  rResult[i] = DN_DX;
1280  }
1281 
1282 
1285  , Vector& determinants_of_jacobian
1286  , IntegrationMethod ThisMethod) const override
1287  {
1288  const unsigned int integration_points_number =
1289  msGeometryData.IntegrationPointsNumber(ThisMethod);
1290  KRATOS_ERROR_IF(integration_points_number == 0) << "This integration method is not supported" << *this << std::endl;
1291 
1293  const double x10 = this->Points()[1].X() - this->Points()[0].X();
1294  const double y10 = this->Points()[1].Y() - this->Points()[0].Y();
1295  const double z10 = this->Points()[1].Z() - this->Points()[0].Z();
1296 
1297  const double x20 = this->Points()[2].X() - this->Points()[0].X();
1298  const double y20 = this->Points()[2].Y() - this->Points()[0].Y();
1299  const double z20 = this->Points()[2].Z() - this->Points()[0].Z();
1300 
1301  const double x30 = this->Points()[3].X() - this->Points()[0].X();
1302  const double y30 = this->Points()[3].Y() - this->Points()[0].Y();
1303  const double z30 = this->Points()[3].Z() - this->Points()[0].Z();
1304 
1305  const double detJ = x10 * y20 * z30 - x10 * y30 * z20 + y10 * z20 * x30 - y10 * x20 * z30 + z10 * x20 * y30 - z10 * y20 * x30;
1306 
1307  DN_DX(0,0) = -y20 * z30 + y30 * z20 + y10 * z30 - z10 * y30 - y10 * z20 + z10 * y20;
1308  DN_DX(0,1) = -z20 * x30 + x20 * z30 - x10 * z30 + z10 * x30 + x10 * z20 - z10 * x20;
1309  DN_DX(0,2) = -x20 * y30 + y20 * x30 + x10 * y30 - y10 * x30 - x10 * y20 + y10 * x20;
1310  DN_DX(1,0) = y20 * z30 - y30 * z20;
1311  DN_DX(1,1) = z20 * x30 - x20 * z30;
1312  DN_DX(1,2) = x20 * y30 - y20 * x30;
1313  DN_DX(2,0) = -y10 * z30 + z10 * y30;
1314  DN_DX(2,1) = x10 * z30 - z10 * x30;
1315  DN_DX(2,2) = -x10 * y30 + y10 * x30;
1316  DN_DX(3,0) = y10 * z20 - z10 * y20;
1317  DN_DX(3,1) = -x10 * z20 + z10 * x20;
1318  DN_DX(3,2) = x10 * y20 - y10 * x20;
1319 
1320  DN_DX /= detJ;
1321 
1322  if(determinants_of_jacobian.size() != integration_points_number )
1323  determinants_of_jacobian.resize(integration_points_number,false);
1324 
1325  for(unsigned int i=0; i<integration_points_number; i++)
1326  determinants_of_jacobian[i] = detJ;
1327 
1328  // Volume = detJ*0.1666666666666666666667;
1329 
1330  // Workaround by riccardo
1331  if(rResult.size() != integration_points_number) {
1332  rResult.resize(integration_points_number,false);
1333  }
1334  for(unsigned int i=0; i<integration_points_number; i++)
1335  rResult[i] = DN_DX;
1336  }
1337 
1345  {
1346  if ( rResult.size() != this->PointsNumber() )
1347  {
1348  // KLUDGE: While there is a bug in ublas vector resize, I have to put this beside resizing!!
1350  rResult.swap( temp );
1351  }
1352 
1353  for ( unsigned int i = 0; i < this->PointsNumber(); i++ )
1354  {
1355  rResult[i] = ZeroMatrix(3,3);
1356  }
1357 
1358  return rResult;
1359  }
1360 
1367  bool HasIntersection( const BaseType& rThisGeometry) const override
1368  {
1369  if (rThisGeometry.LocalSpaceDimension() < this->LocalSpaceDimension()) {
1370  // Check the intersection of each face against the intersecting object
1371  const auto faces = this->GenerateFaces();
1372  for (auto& face : faces) {
1373  if (face.HasIntersection(rThisGeometry)) {
1374  return true;
1375  }
1376  }
1377  // Let check the second geometry is inside.
1378  // Considering there are no intersection, if one point is inside all of it is inside.
1379  array_1d<double, 3> local_point;
1380  return this->IsInside(rThisGeometry.GetPoint(0), local_point);
1381  }
1382  // Both geometries are 3D
1383  array_1d<Plane, 4> plane;
1384  std::vector<BaseType> intersections;
1385 
1386  GetPlanes(plane);
1387  intersections.push_back(rThisGeometry);
1388  for (unsigned int i = 0; i < 4; ++i) {
1389  std::vector<BaseType> inside;
1390  for (unsigned int j = 0; j < intersections.size(); ++j) {
1391  SplitAndDecompose(intersections[j], plane[i], inside);
1392  }
1393  intersections = inside;
1394  }
1395  return bool (intersections.size() > 0);
1396  }
1397 
1398 
1399  bool HasIntersection(const Point& rLowPoint, const Point& rHighPoint) const override
1400  {
1401  using Triangle3D3Type = Triangle3D3<TPointType>;
1402  // Check if faces have intersection
1403  if(Triangle3D3Type(this->pGetPoint(0),this->pGetPoint(2), this->pGetPoint(1)).HasIntersection(rLowPoint, rHighPoint))
1404  return true;
1405  if(Triangle3D3Type(this->pGetPoint(0),this->pGetPoint(3), this->pGetPoint(2)).HasIntersection(rLowPoint, rHighPoint))
1406  return true;
1407  if(Triangle3D3Type(this->pGetPoint(0),this->pGetPoint(1), this->pGetPoint(3)).HasIntersection(rLowPoint, rHighPoint))
1408  return true;
1409  if(Triangle3D3Type(this->pGetPoint(2),this->pGetPoint(3), this->pGetPoint(1)).HasIntersection(rLowPoint, rHighPoint))
1410  return true;
1411 
1412  // if there are no faces intersecting the box then or the box is inside the tetrahedron or it does not have intersection
1413  CoordinatesArrayType local_coordinates;
1414  return IsInside(rLowPoint,local_coordinates);
1415  }
1416 
1417 
1419  const BaseType& tetra, Plane& plane,
1420  std::vector<BaseType>& inside) const
1421  {
1422 
1423  // Determine on which side of the plane the points of the tetrahedron lie.
1424  int i = 0;
1425  int positive = 0, negative = 0, zero = 0;
1427  array_1d<int,4> pos, neg, zer;
1428 
1429  noalias(C) = ZeroVector(4);
1430 
1431  pos[0] = 0;
1432  neg[0] = 0;
1433  zer[0] = 0;
1434  pos[1] = 0;
1435  neg[1] = 0;
1436  zer[1] = 0;
1437  pos[2] = 0;
1438  neg[2] = 0;
1439  zer[2] = 0;
1440  pos[3] = 0;
1441  neg[3] = 0;
1442  zer[3] = 0;
1443 
1444  for (i = 0; i < 4; ++i) {
1445  const array_1d<double,3>& p = tetra[i].Coordinates();
1446  C[i] = plane.DistanceTo(p);
1447  if (C[i] > 0.00)
1448  pos[positive++] = i;
1449  else if (C[i] < 0.00)
1450  neg[negative++] = i;
1451  else
1452  zer[zero++] = i;
1453  }
1454 
1455  // For a split to occur, one of the c_i must be positive and one must
1456  // be negative.
1457  if (negative == 0) {
1458  // Tetrahedron is completely on the positive side of plane, full clip.
1459  return;
1460  }
1461 
1462  if (positive == 0) {
1463  // Tetrahedron is completely on the negative side of plane.
1464  inside.push_back(tetra);
1465  return;
1466  }
1467 
1468  double w0, w1, invCDiff;
1471 
1472  if (positive == 3) {
1473  // +++-
1474  for (i = 0; i < positive; ++i) {
1475  invCDiff = 1.00/(C[pos[i]] - C[neg[0]]);
1476  w0 = -C[neg[0]]*invCDiff;
1477  w1 = +C[pos[i]]*invCDiff;
1478  V[pos[i]] = w0*tetra[pos[i]].Coordinates() + w1*tetra[neg[0]].Coordinates();
1479  }
1480  inside.push_back(tetra);
1481  } else if (positive == 2) {
1482  if (negative == 2) {
1483  // ++--
1484  for (i = 0; i < positive; ++i) {
1485  invCDiff = (1.00)/(C[pos[i]] - C[neg[0]]);
1486  w0 = -C[neg[0]]*invCDiff;
1487  w1 = +C[pos[i]]*invCDiff;
1488  intp[i] = w0*tetra[pos[i]].Coordinates() + w1*tetra[neg[0]].Coordinates();
1489  }
1490  for (i = 0; i < negative; ++i) {
1491  invCDiff = (1.00)/(C[pos[i]] - C[neg[1]]);
1492  w0 = -C[neg[1]]*invCDiff;
1493  w1 = +C[pos[i]]*invCDiff;
1494  intp[i+2] = w0*tetra[pos[i]].Coordinates() + w1*tetra[neg[1]].Coordinates();
1495  }
1496 
1497  V[pos[0]] = intp[2];
1498  V[pos[1]] = intp[1];
1499  inside.push_back(tetra);
1500  } else {
1501  // ++-0
1502  for (i = 0; i < positive; ++i) {
1503  invCDiff = (1.00)/(C[pos[i]] - C[neg[0]]);
1504  w0 = -C[neg[0]]*invCDiff;
1505  w1 = +C[pos[i]]*invCDiff;
1506  V[pos[i]] = w0*tetra[pos[i]].Coordinates() + w1*tetra[neg[0]].Coordinates();
1507  }
1508  inside.push_back(tetra);
1509  }
1510  } else if (positive == 1) {
1511  if (negative == 3) {
1512  // +---
1513  for (i = 0; i < negative; ++i) {
1514  invCDiff = (1.00)/(C[pos[0]] - C[neg[i]]);
1515  w0 = -C[neg[i]]*invCDiff;
1516  w1 = +C[pos[0]]*invCDiff;
1517  intp[i] = w0*tetra[pos[0]] + w1*tetra[neg[i]];
1518  }
1519 
1520  V[pos[0]] = intp[0];
1521  inside.push_back(tetra);
1522  } else if (negative == 2) {
1523  // +--0
1524  for (i = 0; i < negative; ++i) {
1525  invCDiff = (1.00)/(C[pos[0]] - C[neg[i]]);
1526  w0 = -C[neg[i]]*invCDiff;
1527  w1 = +C[pos[0]]*invCDiff;
1528  intp[i] = w0*tetra[pos[0]] + w1*tetra[neg[i]];
1529  }
1530 
1531  V[pos[0]] = intp[0];
1532  inside.push_back(tetra);
1533  } else {
1534  // +-00
1535  invCDiff = (1.00)/(C[pos[0]] - C[neg[0]]);
1536  w0 = -C[neg[0]]*invCDiff;
1537  w1 = +C[pos[0]]*invCDiff;
1538  V[pos[0]] = w0*tetra[pos[0]] + w1*tetra[neg[0]];
1539  inside.push_back(tetra);
1540  }
1541  }
1542  }
1543 
1544 
1545  void GetPlanes(array_1d<Plane, 4>& plane) const
1546  {
1547  const BaseType& geom_1 = *this;
1548  const array_1d<double, 3> edge10 = geom_1[1].Coordinates() - geom_1[0].Coordinates();
1549  const array_1d<double, 3> edge20 = geom_1[2].Coordinates() - geom_1[0].Coordinates();
1550  const array_1d<double, 3> edge30 = geom_1[3].Coordinates() - geom_1[0].Coordinates();
1551  const array_1d<double, 3> edge21 = geom_1[2].Coordinates() - geom_1[1].Coordinates();
1552  const array_1d<double, 3> edge31 = geom_1[3].Coordinates() - geom_1[1].Coordinates();
1553 
1554  MathUtils<double>::UnitCrossProduct(plane[0].mNormal, edge10, edge20); // <v0,v2,v1>
1555  MathUtils<double>::UnitCrossProduct(plane[1].mNormal, edge30, edge10); // <v0,v1,v3>
1556  MathUtils<double>::UnitCrossProduct(plane[2].mNormal, edge20, edge30); // <v0,v3,v2>
1557  MathUtils<double>::UnitCrossProduct(plane[3].mNormal, edge31, edge21); // <v1,v2,v3>
1558 
1559  const double det = inner_prod(edge10, plane[3].mNormal);
1560  if (det < 0.00) {
1561  // The normals are inner pointing, reverse their directions.
1562  for (unsigned int i = 0; i < 4; ++i) {
1563  plane[i].mNormal = -plane[i].mNormal;
1564  }
1565  }
1566 
1567  for (unsigned int i = 0; i < 4; ++i) {
1568  plane[i].mConstant = inner_prod(geom_1[i].Coordinates(), plane[i].mNormal);
1569  }
1570  }
1571 
1575 
1589  const CoordinatesArrayType& rPointGlobalCoordinates,
1590  const double Tolerance = std::numeric_limits<double>::epsilon()
1591  ) const override
1592  {
1593  // Point to compute distance to
1594  const Point point(rPointGlobalCoordinates);
1595 
1596  // Check if point is inside
1597  CoordinatesArrayType aux_coordinates;
1598  if (this->IsInside(rPointGlobalCoordinates, aux_coordinates, Tolerance)) {
1599  return 0.0;
1600  }
1601 
1602  // Compute distance to faces
1603  std::array<double, 4> distances;
1604  distances[0] = GeometryUtils::PointDistanceToTriangle3D(this->GetPoint(2), this->GetPoint(3), this->GetPoint(1), point);
1605  distances[1] = GeometryUtils::PointDistanceToTriangle3D(this->GetPoint(0), this->GetPoint(3), this->GetPoint(2), point);
1606  distances[2] = GeometryUtils::PointDistanceToTriangle3D(this->GetPoint(0), this->GetPoint(1), this->GetPoint(3), point);
1607  distances[3] = GeometryUtils::PointDistanceToTriangle3D(this->GetPoint(0), this->GetPoint(2), this->GetPoint(1), point);
1608  const auto min = std::min_element(distances.begin(), distances.end());
1609  return *min;
1610  }
1611 
1615 
1623  std::string Info() const override
1624  {
1625  return "3 dimensional tetrahedra with four nodes in 3D space";
1626  }
1627 
1635  void PrintInfo(std::ostream& rOStream) const override
1636  {
1637  rOStream << "3 dimensional tetrahedra with four nodes in 3D space";
1638  }
1639 
1649  void PrintData( std::ostream& rOStream ) const override
1650  {
1651  // Base Geometry class PrintData call
1652  BaseType::PrintData( rOStream );
1653  std::cout << std::endl;
1654 
1655  // If the geometry has valid points, calculate and output its data
1656  if (this->AllPointsAreValid()) {
1657  Matrix jacobian;
1658  this->Jacobian( jacobian, PointType() );
1659  rOStream << " Jacobian in the origin\t : " << jacobian;
1660  }
1661  }
1662 
1663 protected:
1664 
1669 private:
1672 
1673  static const GeometryData msGeometryData;
1674 
1675  static const GeometryDimension msGeometryDimension;
1676 
1677 
1681 
1682  friend class Serializer;
1683 
1684  void save(Serializer& rSerializer) const override
1685  {
1687  }
1688 
1689  void load(Serializer& rSerializer) override
1690  {
1692  }
1693 
1694  // serialization needs the default constructor
1695  Tetrahedra3D4(): BaseType(PointsArrayType(), &msGeometryData) {}
1696 
1710  static Matrix& CalculateShapeFunctionsLocalGradients( Matrix& rResult, const CoordinatesArrayType& rPoint )
1711  {
1712  rResult(0,0) = -1.0;
1713  rResult(0,1) = -1.0;
1714  rResult(0,2) = -1.0;
1715  rResult(1,0) = 1.0;
1716  rResult(1,1) = 0.0;
1717  rResult(1,2) = 0.0;
1718  rResult(2,0) = 0.0;
1719  rResult(2,1) = 1.0;
1720  rResult(2,2) = 0.0;
1721  rResult(3,0) = 0.0;
1722  rResult(3,1) = 0.0;
1723  rResult(3,2) = 1.0;
1724  return rResult;
1725  }
1726 
1735  static Matrix CalculateShapeFunctionsIntegrationPointsValues(
1736  typename BaseType::IntegrationMethod ThisMethod)
1737  {
1738  IntegrationPointsContainerType all_integration_points =
1739  AllIntegrationPoints();
1740  IntegrationPointsArrayType integration_points = all_integration_points[static_cast<int>(ThisMethod)];
1741  //number of integration points
1742  const int integration_points_number = integration_points.size();
1743  //number of nodes in current geometry
1744  const int points_number = 4;
1745  //setting up return matrix
1746  Matrix shape_function_values(integration_points_number, points_number );
1747  //loop over all integration points
1748  for(int pnt = 0; pnt < integration_points_number; pnt++)
1749  {
1750  shape_function_values(pnt,0) = ( 1.0
1751  -integration_points[pnt].X()
1752  -integration_points[pnt].Y()
1753  -integration_points[pnt].Z() );
1754  shape_function_values(pnt,1) = integration_points[pnt].X();
1755  shape_function_values(pnt,2) = integration_points[pnt].Y();
1756  shape_function_values(pnt,3) = integration_points[pnt].Z();
1757  }
1758  return shape_function_values;
1759  }
1760 
1771  CalculateShapeFunctionsIntegrationPointsLocalGradients(
1772  typename BaseType::IntegrationMethod ThisMethod)
1773  {
1774  IntegrationPointsContainerType all_integration_points =
1775  AllIntegrationPoints();
1776  IntegrationPointsArrayType integration_points = all_integration_points[static_cast<int>(ThisMethod)];
1777  //number of integration points
1778  const int integration_points_number = integration_points.size();
1779  ShapeFunctionsGradientsType d_shape_f_values(integration_points_number);
1780  //initialising container
1781  //loop over all integration points
1782  for( int pnt=0; pnt<integration_points_number; pnt++ )
1783  {
1784  Matrix result = ZeroMatrix(4,3);
1785  result(0,0) = -1.0;
1786  result(0,1) = -1.0;
1787  result(0,2) = -1.0;
1788  result(1,0) = 1.0;
1789  result(1,1) = 0.0;
1790  result(1,2) = 0.0;
1791  result(2,0) = 0.0;
1792  result(2,1) = 1.0;
1793  result(2,2) = 0.0;
1794  result(3,0) = 0.0;
1795  result(3,1) = 0.0;
1796  result(3,2) = 1.0;
1797  d_shape_f_values[pnt] = result;
1798  }
1799  return d_shape_f_values;
1800  }
1801 
1802  static const IntegrationPointsContainerType AllIntegrationPoints()
1803  {
1804  IntegrationPointsContainerType integration_points =
1805  {
1806  {
1807  Quadrature<TetrahedronGaussLegendreIntegrationPoints1,
1808  3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1809  Quadrature<TetrahedronGaussLegendreIntegrationPoints2,
1810  3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1811  Quadrature<TetrahedronGaussLegendreIntegrationPoints3,
1812  3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1813  Quadrature<TetrahedronGaussLegendreIntegrationPoints4,
1814  3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1815  Quadrature<TetrahedronGaussLegendreIntegrationPoints5,
1816  3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1817  }
1818  };
1819  return integration_points;
1820  }
1821 
1822  static const ShapeFunctionsValuesContainerType AllShapeFunctionsValues()
1823  {
1824  ShapeFunctionsValuesContainerType shape_functions_values =
1825  {
1826  {
1827  Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1829  Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1831  Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1833  Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1835  Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
1837  }
1838  };
1839  return shape_functions_values;
1840  }
1841 
1843  AllShapeFunctionsLocalGradients()
1844  {
1845  ShapeFunctionsLocalGradientsContainerType shape_functions_local_gradients =
1846  {
1847  {
1848  Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients(
1850  Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients(
1852  Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients(
1854  Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients(
1856  Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients(
1858  }
1859  };
1860  return shape_functions_local_gradients;
1861  }
1862 
1875  inline double CalculateMinEdgeLength(double sa, double sb, double sc, double sd, double se, double sf) const {
1876  return std::sqrt(std::min({sa, sb, sc, sd, se, sf}));
1877  }
1878 
1891  inline double CalculateMaxEdgeLength(double sa, double sb, double sc, double sd, double se, double sf) const {
1892  return std::sqrt(std::max({sa, sb, sc, sd, se, sf}));
1893  }
1894 
1907  inline double CalculateAvgEdgeLength(double a, double b, double c, double d, double e, double f) const {
1908  return (a + b + c + d + e + f) * 1.0/6.0;
1909  }
1910 
1923  inline double CalculateCircumradius(double a, double b, double c, double d, double e, double f) const {
1924  KRATOS_ERROR << "Circumradius function hasn't been implemented yet" << std::endl;
1925  return 0.0;
1926  }
1927 
1940  inline double CalculateInradius(double a, double b, double c, double d, double e, double f) const {
1941  KRATOS_ERROR << "Inradius function hasn't been implemented yet" << std::endl;
1942  return 0.0;
1943  }
1944 
1945 
1950  template<class TOtherPointType> friend class Tetrahedra3D4;
1951 
1952 
1958 };// Class Tetrahedra3D4
1959 
1960 
1968 template<class TPointType> inline std::istream& operator >> (
1969  std::istream& rIStream, Tetrahedra3D4<TPointType>& rThis);
1970 
1974 template<class TPointType> inline std::ostream& operator << (
1975  std::ostream& rOStream, const Tetrahedra3D4<TPointType>& rThis)
1976 {
1977  rThis.PrintInfo(rOStream);
1978  rOStream << std::endl;
1979  rThis.PrintData(rOStream);
1980 
1981  return rOStream;
1982 }
1983 
1984 
1985 template<class TPointType> const
1986 GeometryData Tetrahedra3D4<TPointType>::msGeometryData(
1989  Tetrahedra3D4<TPointType>::AllIntegrationPoints(),
1990  Tetrahedra3D4<TPointType>::AllShapeFunctionsValues(),
1991  AllShapeFunctionsLocalGradients()
1992 );
1993 
1994 template<class TPointType>
1995 const GeometryDimension Tetrahedra3D4<TPointType>::msGeometryDimension(3, 3);
1996 
1997 }// namespace Kratos.
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
Definition: geometry_dimension.h:42
Geometry base class.
Definition: geometry.h:71
SizeType PointsNumber() const
Definition: geometry.h:528
void push_back(PointPointerType x)
Definition: geometry.h:548
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
static TGeometryType::CoordinatesArrayType & PointLocalCoordinatesPlanarFaceTetrahedra(const TGeometryType &rGeometry, typename TGeometryType::CoordinatesArrayType &rResult, const typename TGeometryType::CoordinatesArrayType &rPoint)
Returns the local coordinates of a given arbitrary point for a given linear tetrahedra.
Definition: geometry_utilities.h:67
static double PointDistanceToTriangle3D(const Point &rTrianglePoint1, const Point &rTrianglePoint2, const Point &rTrianglePoint3, const Point &rPoint)
This function calculates the distance of a 3D point to a 3D triangle.
Definition: geometry_utilities.cpp:172
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
An two node 3D line geometry with linear shape functions.
Definition: line_3d_2.h:64
Various mathematical utilitiy functions.
Definition: math_utils.h:62
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
static void UnitCrossProduct(T1 &c, const T2 &a, const T3 &b)
Performs the unitary cross product of the two input vectors a,b.
Definition: math_utils.h:831
Definition: plane.h:30
double DistanceTo(const array_1d< double, 3 > &p)
Calcula la distancia del punto al plano.
Definition: plane.h:81
Point class.
Definition: point.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
void reserve(size_type dim)
Definition: pointer_vector.h:319
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 four node tetrahedra geometry with linear shape functions.
Definition: tetrahedra_3d_4.h:59
Tetrahedra3D4 & operator=(const Tetrahedra3D4 &rOther)
Definition: tetrahedra_3d_4.h:289
double ShapeFunctionValue(IndexType ShapeFunctionIndex, const CoordinatesArrayType &rPoint) const override
Definition: tetrahedra_3d_4.h:1161
double AverageEdgeLength() const override
Definition: tetrahedra_3d_4.h:537
GeometriesArrayType GenerateEdges() const override
This method gives you all edges of this geometry.
Definition: tetrahedra_3d_4.h:1033
BaseType::Pointer Create(const BaseType &rGeometry) const override
Creates a new geometry pointer.
Definition: tetrahedra_3d_4.h:349
Geometry< TPointType > BaseType
Definition: tetrahedra_3d_4.h:68
GeometryData::KratosGeometryType GetGeometryType() const override
Definition: tetrahedra_3d_4.h:269
ShapeFunctionsSecondDerivativesType & ShapeFunctionsSecondDerivatives(ShapeFunctionsSecondDerivativesType &rResult, const CoordinatesArrayType &rPoint) const override
Definition: tetrahedra_3d_4.h:1344
SizeType EdgesNumber() const override
This method gives you number of all edges of this geometry.
Definition: tetrahedra_3d_4.h:1020
void ShapeFunctionsIntegrationPointsGradients(ShapeFunctionsGradientsType &rResult, Vector &determinants_of_jacobian, IntegrationMethod ThisMethod) const override
Definition: tetrahedra_3d_4.h:1283
double MinSolidAngle() const override
Definition: tetrahedra_3d_4.h:858
double Inradius() const override
Definition: tetrahedra_3d_4.h:596
BaseType::Pointer Create(const IndexType NewGeometryId, const BaseType &rGeometry) const override
Creates a new geometry pointer.
Definition: tetrahedra_3d_4.h:364
BaseType::Pointer Create(PointsArrayType const &rThisPoints) const override
Creates a new geometry pointer.
Definition: tetrahedra_3d_4.h:323
KRATOS_CLASS_POINTER_DEFINITION(Tetrahedra3D4)
Triangle3D3< TPointType > FaceType
Definition: tetrahedra_3d_4.h:74
double MinDihedralAngle() const override
Definition: tetrahedra_3d_4.h:824
Tetrahedra3D4(const IndexType GeometryId, const PointsArrayType &rThisPoints)
Constructor with Geometry Id.
Definition: tetrahedra_3d_4.h:214
double MaxEdgeLength() const override
Definition: tetrahedra_3d_4.h:512
double MinEdgeLength() const override
Definition: tetrahedra_3d_4.h:486
GeometryData::IntegrationMethod IntegrationMethod
Definition: tetrahedra_3d_4.h:84
double CalculateDistance(const CoordinatesArrayType &rPointGlobalCoordinates, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Computes the distance between an point in global coordinates and the closest point of this geometry....
Definition: tetrahedra_3d_4.h:1588
void NumberNodesInFaces(DenseVector< unsigned int > &NumberNodesInFaces) const override
Definition: tetrahedra_3d_4.h:1107
void SplitAndDecompose(const BaseType &tetra, Plane &plane, std::vector< BaseType > &inside) const
Definition: tetrahedra_3d_4.h:1418
double VolumeToSurfaceAreaQuality() const override
Definition: tetrahedra_3d_4.h:735
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: tetrahedra_3d_4.h:131
BaseType::ShapeFunctionsValuesContainerType ShapeFunctionsValuesContainerType
Definition: tetrahedra_3d_4.h:145
double VolumeToEdgeLengthQuality() const override
Definition: tetrahedra_3d_4.h:749
double Length() const override
Definition: tetrahedra_3d_4.h:412
double InradiusToLongestEdgeQuality() const override
Definition: tetrahedra_3d_4.h:664
double MaxDihedralAngle() const override
Definition: tetrahedra_3d_4.h:840
double Area() const override
Definition: tetrahedra_3d_4.h:432
TPointType PointType
Definition: tetrahedra_3d_4.h:95
Tetrahedra3D4(Tetrahedra3D4 const &rOther)
Definition: tetrahedra_3d_4.h:240
Tetrahedra3D4(const std::string &rGeometryName, const PointsArrayType &rThisPoints)
Constructor with Geometry Name.
Definition: tetrahedra_3d_4.h:223
BaseType::IndexType IndexType
Definition: tetrahedra_3d_4.h:102
BaseType::GeometriesArrayType GeometriesArrayType
Definition: tetrahedra_3d_4.h:90
void ComputeSolidAngles(Vector &rSolidAngles) const override
Definition: tetrahedra_3d_4.h:875
double VolumeToAverageEdgeLength() const override
Definition: tetrahedra_3d_4.h:780
BaseType::IntegrationPointType IntegrationPointType
Definition: tetrahedra_3d_4.h:123
BaseType::JacobiansType JacobiansType
Definition: tetrahedra_3d_4.h:159
~Tetrahedra3D4() override
Destructor. Does nothing!!!
Definition: tetrahedra_3d_4.h:263
double RegularityQuality() const override
Definition: tetrahedra_3d_4.h:721
double Volume() const override
Definition: tetrahedra_3d_4.h:450
BaseType::Pointer Create(const IndexType NewGeometryId, PointsArrayType const &rThisPoints) const override
It creates a new geometry pointer.
Definition: tetrahedra_3d_4.h:336
void ComputeDihedralAngles(Vector &rDihedralAngles) const override
Definition: tetrahedra_3d_4.h:895
Tetrahedra3D4(Tetrahedra3D4< TOtherPointType > const &rOther)
Definition: tetrahedra_3d_4.h:257
void PrintData(std::ostream &rOStream) const override
Definition: tetrahedra_3d_4.h:1649
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: tetrahedra_3d_4.h:184
double InradiusToCircumradiusQuality() const override
Quality functions.
Definition: tetrahedra_3d_4.h:648
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: tetrahedra_3d_4.h:265
BaseType::ShapeFunctionsSecondDerivativesType ShapeFunctionsSecondDerivativesType
Definition: tetrahedra_3d_4.h:174
Matrix MatrixType
Definition: tetrahedra_3d_4.h:189
void NodesInFaces(DenseMatrix< unsigned int > &NodesInFaces) const override
Definition: tetrahedra_3d_4.h:1119
BaseType::PointsArrayType PointsArrayType
Definition: tetrahedra_3d_4.h:116
BaseType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: tetrahedra_3d_4.h:166
BaseType::SizeType SizeType
Definition: tetrahedra_3d_4.h:110
double VolumeToRMSEdgeLength() const override
Definition: tetrahedra_3d_4.h:797
void PrintInfo(std::ostream &rOStream) const override
Definition: tetrahedra_3d_4.h:1635
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: tetrahedra_3d_4.h:382
Matrix & PointsLocalCoordinates(Matrix &rResult) const override
Definition: tetrahedra_3d_4.h:941
friend class Tetrahedra3D4
Definition: tetrahedra_3d_4.h:1950
Vector & ShapeFunctionsValues(Vector &rResult, const CoordinatesArrayType &rCoordinates) const override
Definition: tetrahedra_3d_4.h:1193
bool HasIntersection(const Point &rLowPoint, const Point &rHighPoint) const override
Definition: tetrahedra_3d_4.h:1399
BaseType::IntegrationPointsContainerType IntegrationPointsContainerType
Definition: tetrahedra_3d_4.h:138
Matrix & ShapeFunctionsLocalGradients(Matrix &rResult, const CoordinatesArrayType &rPoint) const override
Definition: tetrahedra_3d_4.h:1212
std::string Info() const override
Definition: tetrahedra_3d_4.h:1623
void ShapeFunctionsIntegrationPointsGradients(ShapeFunctionsGradientsType &rResult, IntegrationMethod ThisMethod) const override
Definition: tetrahedra_3d_4.h:1237
double ShortestToLongestEdgeQuality() const override
Definition: tetrahedra_3d_4.h:694
SizeType FacesNumber() const override
Returns the number of faces of the current geometry.
Definition: tetrahedra_3d_4.h:1070
void GetPlanes(array_1d< Plane, 4 > &plane) const
Definition: tetrahedra_3d_4.h:1545
CoordinatesArrayType & PointLocalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rPoint) const override
Returns the local coordinates of a given arbitrary point.
Definition: tetrahedra_3d_4.h:968
BaseType::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: tetrahedra_3d_4.h:152
GeometriesArrayType GenerateFaces() const override
Returns all faces of the current geometry.
Definition: tetrahedra_3d_4.h:1083
double Circumradius() const override
Definition: tetrahedra_3d_4.h:552
double DomainSize() const override
This method calculate and return length, area or volume of this geometry depending to it's dimension.
Definition: tetrahedra_3d_4.h:475
Line3D2< TPointType > EdgeType
Definition: tetrahedra_3d_4.h:73
Tetrahedra3D4(const PointsArrayType &ThisPoints)
Definition: tetrahedra_3d_4.h:207
bool HasIntersection(const BaseType &rThisGeometry) const override
Test if this geometry intersects with other geometry.
Definition: tetrahedra_3d_4.h:1367
Tetrahedra3D4 & operator=(Tetrahedra3D4< TOtherPointType > const &rOther)
Definition: tetrahedra_3d_4.h:307
bool IsInside(const CoordinatesArrayType &rPoint, CoordinatesArrayType &rResult, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Definition: tetrahedra_3d_4.h:984
Tetrahedra3D4(typename PointType::Pointer pPoint1, typename PointType::Pointer pPoint2, typename PointType::Pointer pPoint3, typename PointType::Pointer pPoint4)
Definition: tetrahedra_3d_4.h:194
BaseType::NormalType NormalType
Definition: tetrahedra_3d_4.h:179
A three node 3D triangle geometry with linear shape functions.
Definition: triangle_3d_3.h:77
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
sd
Definition: GenerateWind.py:148
static double max(double a, double b)
Definition: GeometryFunctions.h:79
static double min(double a, double b)
Definition: GeometryFunctions.h:71
constexpr double Pi
Definition: global_variables.h:25
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
REACTION_CHECK_STIFFNESS_FACTOR INNER_LOOP_ITERATION DISTANCE_THRESHOLD ACTIVE_CHECK_FACTOR AUXILIAR_COORDINATES NORMAL_GAP WEIGHTED_GAP WEIGHTED_SCALAR_RESIDUAL bool
Definition: contact_structural_mechanics_application_variables.h:93
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
const GeometryData Tetrahedra3D4< TPointType >::msGeometryData & msGeometryDimension(), Tetrahedra3D4< TPointType >::AllShapeFunctionsValues(), AllShapeFunctionsLocalGradients()
Definition: brep_curve.h:483
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
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
V
Definition: generate_droplet_dynamics.py:256
w1
Definition: generate_frictional_mortar_condition.py:94
int C
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:27
a
Definition: generate_stokes_twofluid_element.py:77
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
int j
Definition: quadrature.py:648
float temp
Definition: rotating_cone.py:85
p
Definition: sensitivityMatrix.py:52
integer i
Definition: TensorModule.f:17
zero
Definition: test_pureconvectionsolver_benchmarking.py:94
e
Definition: run_cpp_mpi_tests.py:31
float factor
for node in (self.combined_model_part).Nodes: pold = node.GetSolutionStepValue(PRESSURE,...
Definition: ulf_PGLASS.py:254