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.
line_3d_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 #pragma once
18 
19 // System includes
20 
21 // External includes
22 
23 // Project includes
24 #include "geometries/geometry.h"
25 #include "geometries/line_3d_2.h"
30 
31 namespace Kratos
32 {
33 
36 
40 
44 
48 
52 
63 template<class TPointType>
64 
65 class Line3D3 : public Geometry<TPointType>
66 {
67 public:
71 
74 
77 
81 
86 
89  typedef TPointType PointType;
90 
95  typedef typename BaseType::IndexType IndexType;
96 
97 
102  typedef typename BaseType::SizeType SizeType;
103 
108 
114 
121 
127 
132 
137 
143 
149 
153 
158 
162 
163  Line3D3( typename PointType::Pointer pFirstPoint, typename PointType::Pointer pSecondPoint,
164  typename PointType::Pointer pThirdPoint )
165  : BaseType( PointsArrayType(), &msGeometryData )
166  {
167  BaseType::Points().push_back( pFirstPoint );
168  BaseType::Points().push_back( pSecondPoint );
169  BaseType::Points().push_back( pThirdPoint );
170  }
171 
172  Line3D3( const PointsArrayType& ThisPoints )
173  : BaseType( ThisPoints, &msGeometryData )
174  {
175  if ( BaseType::PointsNumber() != 3 )
176  KRATOS_ERROR << "Invalid points number. Expected 3, given " << BaseType::PointsNumber() << std::endl;
177  }
178 
180  explicit Line3D3(
181  const IndexType GeometryId,
182  const PointsArrayType& rThisPoints
183  ) : BaseType(GeometryId, rThisPoints, &msGeometryData)
184  {
185  KRATOS_ERROR_IF( this->PointsNumber() != 3 ) << "Invalid points number. Expected 3, given " << this->PointsNumber() << std::endl;
186  }
187 
189  explicit Line3D3(
190  const std::string& rGeometryName,
191  const PointsArrayType& rThisPoints
192  ) : BaseType(rGeometryName, rThisPoints, &msGeometryData)
193  {
194  KRATOS_ERROR_IF(this->PointsNumber() != 3) << "Invalid points number. Expected 3, given " << this->PointsNumber() << std::endl;
195  }
196 
204  Line3D3( Line3D3 const& rOther )
205  : BaseType( rOther )
206  {
207  }
208 
219  template<class TOtherPointType> Line3D3( Line3D3<TOtherPointType> const& rOther )
220  : BaseType( rOther )
221  {
222  }
223 
225  ~Line3D3() override {}
226 
228  {
230  }
231 
233  {
235  }
236 
240 
251  Line3D3& operator=( const Line3D3& rOther )
252  {
253  BaseType::operator=( rOther );
254  return *this;
255  }
256 
265  template<class TOtherPointType>
267  {
268  BaseType::operator=( rOther );
269  return *this;
270  }
271 
275 
282  typename BaseType::Pointer Create(
283  const IndexType NewGeometryId,
284  PointsArrayType const& rThisPoints
285  ) const override
286  {
287  return typename BaseType::Pointer( new Line3D3(NewGeometryId, rThisPoints ) );
288  }
289 
296  typename BaseType::Pointer Create(
297  const IndexType NewGeometryId,
298  const BaseType& rGeometry
299  ) const override
300  {
301  auto p_geometry = typename BaseType::Pointer( new Line3D3( NewGeometryId, rGeometry.Points() ) );
302  p_geometry->SetData(rGeometry.GetData());
303  return p_geometry;
304  }
305 
315  Vector& rResult,
316  const typename BaseType::LumpingMethods LumpingMethod = BaseType::LumpingMethods::ROW_SUM
317  ) const override
318  {
319  if(rResult.size() != 3)
320  rResult.resize( 3, false );
321  rResult[0] = 1.0/6.0;
322  rResult[2] = 2.0/3.0;
323  rResult[1] = 1.0/6.0;
324  return rResult;
325  }
326 
330 
343  double Length() const override
344  {
346  return IntegrationUtilities::ComputeDomainSize(*this, integration_method);
347  }
348 
360  double Area() const override
361  {
362  return Length();
363  }
364 
365 
376  double DomainSize() const override
377  {
378  return Length();
379  }
380 
389  bool IsInside(
390  const CoordinatesArrayType& rPoint,
391  CoordinatesArrayType& rResult,
392  const double Tolerance = std::numeric_limits<double>::epsilon()
393  ) const override
394  {
395  this->PointLocalCoordinates( rResult, rPoint );
396 
397  if ( std::abs( rResult[0] ) <= (1.0 + Tolerance) )
398  return true;
399 
400  return false;
401  }
402 
410  Vector& DeterminantOfJacobian( Vector& rResult, IntegrationMethod ThisMethod ) const override
411  {
412  const std::size_t number_of_integration_points = this->IntegrationPointsNumber( ThisMethod );
413  if( rResult.size() != number_of_integration_points)
414  rResult.resize( number_of_integration_points, false );
415 
416  Matrix J(3, 1);
417  for (std::size_t pnt = 0; pnt < number_of_integration_points; ++pnt) {
418  this->Jacobian( J, pnt, ThisMethod);
419  rResult[pnt] = std::sqrt(std::pow(J(0,0), 2) + std::pow(J(1,0), 2) + std::pow(J(2,0), 2));
420  }
421  return rResult;
422  }
423 
433  IndexType IntegrationPointIndex,
434  IntegrationMethod ThisMethod ) const override
435  {
436  Matrix J(3, 1);
437  this->Jacobian( J, IntegrationPointIndex, ThisMethod);
438  return std::sqrt(std::pow(J(0,0), 2) + std::pow(J(1,0), 2) + std::pow(J(2,0), 2));
439  }
440 
448  double DeterminantOfJacobian( const CoordinatesArrayType& rPoint ) const override
449  {
450  Matrix J(3, 1);
451  this->Jacobian( J, rPoint);
452  return std::sqrt(std::pow(J(0,0), 2) + std::pow(J(1,0), 2) + std::pow(J(2,0), 2));
453  }
454 
458 
462  SizeType EdgesNumber() const override
463  {
464  return 2;
465  }
466 
467  SizeType FacesNumber() const override
468  {
469  return 0;
470  }
471 
475 
485  Vector& rResult,
486  const CoordinatesArrayType& rCoordinates
487  ) const override
488  {
489  if(rResult.size() != 3) {
490  rResult.resize(3, false);
491  }
492 
493  rResult[0] = 0.5 * (rCoordinates[0] - 1.0) * rCoordinates[0];
494  rResult[1] = 0.5 * (rCoordinates[0] + 1.0) * rCoordinates[0];
495  rResult[2] = 1.0 - rCoordinates[0] * rCoordinates[0];
496 
497  return rResult;
498  }
499 
509  double ShapeFunctionValue( IndexType ShapeFunctionIndex,
510  const CoordinatesArrayType& rPoint ) const override
511  {
512  switch ( ShapeFunctionIndex )
513  {
514  case 0:
515  return( 0.5*( rPoint[0] - 1.0 )*rPoint[0] );
516  case 1:
517  return( 0.5*( rPoint[0] + 1.0 )*rPoint[0] );
518  case 2:
519  return( 1.0 -rPoint[0]*rPoint[0] );
520 
521  default:
522  KRATOS_ERROR << "Wrong index of shape function!" << *this << std::endl;
523  }
524 
525  return 0;
526  }
527 
533  IntegrationMethod ThisMethod )
534  {
535  ShapeFunctionsGradientsType localGradients
536  = CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
537  const int integration_points_number
538  = msGeometryData.IntegrationPointsNumber( ThisMethod );
539  ShapeFunctionsGradientsType Result( integration_points_number );
540 
541  for ( int pnt = 0; pnt < integration_points_number; pnt++ )
542  {
543  Result[pnt] = localGradients[pnt];
544  }
545 
546  return Result;
547  }
548 
554  {
555  IntegrationMethod ThisMethod = msGeometryData.DefaultIntegrationMethod();
556  ShapeFunctionsGradientsType localGradients
557  = CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
558  const int integration_points_number
559  = msGeometryData.IntegrationPointsNumber( ThisMethod );
560  ShapeFunctionsGradientsType Result( integration_points_number );
561 
562  for ( int pnt = 0; pnt < integration_points_number; pnt++ )
563  {
564  Result[pnt] = localGradients[pnt];
565  }
566 
567  return Result;
568  }
569 
579  const CoordinatesArrayType& rPoint ) const override
580  {
581  // Setting up result matrix
582  if(rResult.size1() != 3 || rResult.size2() != 1) {
583  rResult.resize( 3, 1, false );
584  }
585 
586  noalias( rResult ) = ZeroMatrix( 3, 1 );
587  rResult( 0, 0 ) = rPoint[0] - 0.5;
588  rResult( 1, 0 ) = rPoint[0] + 0.5;
589  rResult( 2, 0 ) = -rPoint[0] * 2.0;
590  return( rResult );
591  }
592 
598  Matrix& PointsLocalCoordinates( Matrix& rResult ) const override
599  {
600  if(rResult.size1() != 3 || rResult.size2() != 1) {
601  rResult.resize( 3, 1, false );
602  }
603  noalias( rResult ) = ZeroMatrix( 3, 1 );
604  rResult( 0, 0 ) = -1.0;
605  rResult( 1, 0 ) = 1.0;
606  rResult( 2, 0 ) = 0.0;
607  return rResult;
608  }
609 
617  CoordinatesArrayType& rResult,
618  const CoordinatesArrayType& rPoint
619  ) const override
620  {
621  // Define distance_objective as the gradient of ||point - global_coordinate(xi)||**2,
622  // that is (point - local_coordinate(xi))*coordinate_derivative(xi) (times -2, which we ignore)
623  // The zeros of the distance_objective are local extremes of the distance between point and line
624  // We will get the zeros contained in the interval [-1, 1] (if any). If, for any of these zeros,
625  // the point is on the line, the local coordinate is our result.
626  rResult.clear();
627 
628  constexpr double TOLERANCE = 1e-12;
629 
630  const auto& r_p0 = this->GetPoint(0);
631  const auto& r_p1 = this->GetPoint(1);
632  const auto& r_p2 = this->GetPoint(2);
633 
634  // The method is prone to numerical instability close to the ends of the search interval
635  // exit early in that case
636  const array_1d<double,3> d0 = r_p0 - rPoint;
637  if (MathUtils<double>::Dot3(d0, d0) < TOLERANCE) {
638  rResult[0] = -1.0;
639  return rResult;
640  }
641  const array_1d<double,3> d1 = r_p1 - rPoint;
642  if (MathUtils<double>::Dot3(d1, d1) < TOLERANCE) {
643  rResult[0] = 1.0;
644  return rResult;
645  }
646 
647  array_1d<double, 3> c1 = r_p0 + r_p1 - 2*r_p2;
648  array_1d<double, 3> c2 = r_p1 - r_p0;
649  array_1d<double, 3> c3 = r_p2 - rPoint;
650 
651  const double aux1 = MathUtils<double>::Dot3(c1, c1);
652  if (aux1 < TOLERANCE) {
653  // The geometry is a straight line, fall back to Line3D2.h
654  auto line = Line3D2<TPointType>(
655  this->pGetPoint(0), this->pGetPoint(1));
656  return line.PointLocalCoordinates(rResult, rPoint);
657  }
658 
659  const double aux2 = MathUtils<double>::Dot3(c1, c3);
660  if (std::abs(aux2) < TOLERANCE) {
661  // r_p2 == rPoint (we got the center of the line),
662  //the local coordinate is 0
663  return rResult;
664  }
665 
666  PolynomialUtilities::PolynomialType distance_objective{
667  0.5 * aux1,
668  0.75 * MathUtils<double>::Dot3(c1, c2),
669  0.25 * MathUtils<double>::Dot3(c2, c2) + aux2,
670  0.5 * MathUtils<double>::Dot3(c2, c3)
671  };
672 
673  std::vector<PolynomialUtilities::IntervalType> root_ranges;
675  root_ranges, distance_objective,
677 
678  Vector shape;
679  for (const auto& interval: root_ranges) {
680  double root = PolynomialUtilities::FindRoot(distance_objective, interval);
681  // if point == line(root) we found our coordinate;
682  rResult[0] = root;
683  this->ShapeFunctionsValues(shape, rResult);
684  array_1d<double,3> d = (shape[0]*r_p0 + shape[1]*r_p1 + shape[2]*r_p2) - rPoint;
685  if (MathUtils<double>::Dot3(d, d) < TOLERANCE) {
686  return rResult;
687  }
688  }
689 
690  // No points in the interval [-1,1] correspond to our local coordinate
691  rResult[0] = 2.0;
692  return rResult;
693  }
694 
704  {
705  if(rResult.size1() != 3 || rResult.size2() != 1) {
706  rResult.resize( 3, 1, false );
707  }
708  noalias( rResult ) = ZeroMatrix( 3, 1 );
709 
710  rResult( 0, 0 ) = rPoint[0] - 0.5;
711  rResult( 1, 0 ) = rPoint[0] + 0.5;
712  rResult( 2, 0 ) = -rPoint[0] * 2.0;
713  return rResult;
714  }
715 
719 
726  std::string Info() const override
727  {
728  return "1 dimensional line with 3 nodes in 3D space";
729  }
730 
737  void PrintInfo( std::ostream& rOStream ) const override
738  {
739  rOStream << "1 dimensional line with 3 nodes in 3D space";
740  }
741 
750  void PrintData( std::ostream& rOStream ) const override
751  {
752  // Base Geometry class PrintData call
753  BaseType::PrintData( rOStream );
754  std::cout << std::endl;
755 
756  // If the geometry has valid points, calculate and output its data
757  if (this->AllPointsAreValid()) {
758  Matrix jacobian;
759  this->Jacobian( jacobian, PointType() );
760  rOStream << " Jacobian\t : " << jacobian;
761  }
762  }
763 
767 
769 protected:
772 
776 
780 
784 
788 
792 
796 
798 private:
801 
802  static const GeometryData msGeometryData;
803 
804  static const GeometryDimension msGeometryDimension;
805 
809 
813 
814  friend class Serializer;
815 
816  void save( Serializer& rSerializer ) const override
817  {
819  }
820 
821  void load( Serializer& rSerializer ) override
822  {
824  }
825 
826  Line3D3(): BaseType( PointsArrayType(), &msGeometryData ) {}
827 
831 
835 
836  static Matrix CalculateShapeFunctionsIntegrationPointsValues( typename BaseType::IntegrationMethod ThisMethod )
837  {
838  const IntegrationPointsContainerType& all_integration_points = AllIntegrationPoints();
839  const IntegrationPointsArrayType& IntegrationPoints = all_integration_points[static_cast<int>(ThisMethod)];
840  int integration_points_number = IntegrationPoints.size();
841  Matrix N( integration_points_number, 3 );
842 
843  for ( int it_gp = 0; it_gp < integration_points_number; it_gp++ )
844  {
845  double e = IntegrationPoints[it_gp].X();
846  N( it_gp, 0 ) = 0.5 * ( e - 1 ) * e;
847  N( it_gp, 2 ) = 1.0 - e * e;
848  N( it_gp, 1 ) = 0.5 * ( 1 + e ) * e;
849  }
850 
851  return N;
852  }
853 
854  static ShapeFunctionsGradientsType CalculateShapeFunctionsIntegrationPointsLocalGradients(
855  typename BaseType::IntegrationMethod ThisMethod )
856  {
857  const IntegrationPointsContainerType& all_integration_points = AllIntegrationPoints();
858  const IntegrationPointsArrayType& IntegrationPoints = all_integration_points[static_cast<int>(ThisMethod)];
860  std::fill( DN_De.begin(), DN_De.end(), Matrix( 3, 1 ) );
861 
862  for ( unsigned int it_gp = 0; it_gp < IntegrationPoints.size(); it_gp++ )
863  {
864  Matrix aux_mat = ZeroMatrix(3,1);
865  const double e = IntegrationPoints[it_gp].X();
866  aux_mat(0,0) = e - 0.5;
867  aux_mat(2,0) = -2.0 * e;
868  aux_mat(1,0) = e + 0.5;
869  DN_De[it_gp] = aux_mat;
870  }
871 
872  return DN_De;
873  }
874 
875  static const IntegrationPointsContainerType AllIntegrationPoints()
876  {
877  IntegrationPointsContainerType integration_points = {{
878  Quadrature<LineGaussLegendreIntegrationPoints1, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
879  Quadrature<LineGaussLegendreIntegrationPoints2, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
880  Quadrature<LineGaussLegendreIntegrationPoints3, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
881  Quadrature<LineGaussLegendreIntegrationPoints4, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
882  Quadrature<LineGaussLegendreIntegrationPoints5, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
883  Quadrature<LineCollocationIntegrationPoints1, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
884  Quadrature<LineCollocationIntegrationPoints2, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
885  Quadrature<LineCollocationIntegrationPoints3, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
886  Quadrature<LineCollocationIntegrationPoints4, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
887  Quadrature<LineCollocationIntegrationPoints5, 1, IntegrationPoint<3> >::GenerateIntegrationPoints()
888  }
889  };
890  return integration_points;
891  }
892 
893  static const ShapeFunctionsValuesContainerType AllShapeFunctionsValues()
894  {
895  ShapeFunctionsValuesContainerType shape_functions_values = {{
896  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_GAUSS_1 ),
897  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_GAUSS_2 ),
898  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_GAUSS_3 ),
899  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_GAUSS_4 ),
900  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_GAUSS_5 ),
901  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_1 ),
902  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_2 ),
903  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_3 ),
904  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_4 ),
905  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 )
906  }
907  };
908  return shape_functions_values;
909  }
910 
911  static const ShapeFunctionsLocalGradientsContainerType AllShapeFunctionsLocalGradients()
912  {
913  ShapeFunctionsLocalGradientsContainerType shape_functions_local_gradients = {{
914  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_1 ),
915  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_2 ),
916  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_3 ),
917  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_4 ),
918  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_5 ),
919  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_1 ),
920  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_2 ),
921  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_3 ),
922  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_4 ),
923  Line3D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 )
924  }
925  };
926  return shape_functions_local_gradients;
927  }
928 
932 
933 
937 
938 
942 
943  template<class TOtherPointType> friend class Line3D3;
944 
948 
950 
951 }; // Class Geometry
952 
954 
957 
958 
962 
963 
965 template<class TPointType>
966 inline std::istream& operator >> ( std::istream& rIStream,
967  Line3D3<TPointType>& rThis );
968 
970 template<class TPointType>
971 inline std::ostream& operator << ( std::ostream& rOStream,
972  const Line3D3<TPointType>& rThis )
973 {
974  rThis.PrintInfo( rOStream );
975  rOStream << std::endl;
976  rThis.PrintData( rOStream );
977 
978  return rOStream;
979 }
980 
982 
983 
984 template<class TPointType>
985 const GeometryData Line3D3<TPointType>::msGeometryData(
988  Line3D3<TPointType>::AllIntegrationPoints(),
989  Line3D3<TPointType>::AllShapeFunctionsValues(),
990  AllShapeFunctionsLocalGradients() );
991 
992 template<class TPointType>
993 const GeometryDimension Line3D3<TPointType>::msGeometryDimension(3, 1);
994 
995 } // 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
IntegrationMethod DefaultIntegrationMethod() const
Definition: geometry_data.h:425
Definition: geometry_dimension.h:42
Geometry base class.
Definition: geometry.h:71
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
const Matrix & ShapeFunctionsValues() const
Definition: geometry.h:3393
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
const IntegrationPointsArrayType & IntegrationPoints() const
Definition: geometry.h:2284
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
SizeType IntegrationPointsNumber() const
Definition: geometry.h:2257
GeometryData::IntegrationMethod IntegrationMethod
Definition: geometry.h:122
Short class definition.
Definition: integration_point.h:52
static double ComputeDomainSize(const TGeometryType &rGeometry)
This method calculates and returns the domain size of the geometry from any geometry in a generic man...
Definition: integration_utilities.h:63
static GeometryData::IntegrationMethod GetIntegrationMethodForExactMassMatrixEvaluation(const Geometry< TPointType > &rGeometry)
This method returns the integration order for the exact mass matrix evaluation.
Definition: integration_utilities.h:42
Definition: amatrix_interface.h:41
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
An two node 3D line geometry with linear shape functions.
Definition: line_3d_2.h:64
An three node 3D line geometry with quadratic shape functions.
Definition: line_3d_3.h:66
BaseType::Pointer Create(const IndexType NewGeometryId, const BaseType &rGeometry) const override
Creates a new geometry pointer.
Definition: line_3d_3.h:296
virtual ShapeFunctionsGradientsType ShapeFunctionsLocalGradients(IntegrationMethod ThisMethod)
Definition: line_3d_3.h:532
BaseType::IntegrationPointType IntegrationPointType
Definition: line_3d_3.h:113
double DomainSize() const override
Definition: line_3d_3.h:376
Line3D3 & operator=(const Line3D3 &rOther)
Definition: line_3d_3.h:251
Line3D3(Line3D3 const &rOther)
Definition: line_3d_3.h:204
double DeterminantOfJacobian(IndexType IntegrationPointIndex, IntegrationMethod ThisMethod) const override
Determinant of jacobian in specific integration point of given integration method....
Definition: line_3d_3.h:432
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: line_3d_3.h:314
bool IsInside(const CoordinatesArrayType &rPoint, CoordinatesArrayType &rResult, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Returns whether given arbitrary point is inside the Geometry and the respective local point for the g...
Definition: line_3d_3.h:389
Vector & ShapeFunctionsValues(Vector &rResult, const CoordinatesArrayType &rCoordinates) const override
This method gives all non-zero shape functions values evaluated at the rCoordinates provided.
Definition: line_3d_3.h:484
CoordinatesArrayType & PointLocalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rPoint) const override
Returns the local coordinates of a given arbitrary point.
Definition: line_3d_3.h:616
BaseType::GeometriesArrayType GeometriesArrayType
Definition: line_3d_3.h:85
TPointType PointType
Definition: line_3d_3.h:89
BaseType::JacobiansType JacobiansType
Definition: line_3d_3.h:142
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: line_3d_3.h:120
SizeType EdgesNumber() const override
Definition: line_3d_3.h:462
BaseType::SizeType SizeType
Definition: line_3d_3.h:102
BaseType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: line_3d_3.h:148
BaseType::IndexType IndexType
Definition: line_3d_3.h:95
std::string Info() const override
Definition: line_3d_3.h:726
BaseType::Pointer Create(const IndexType NewGeometryId, PointsArrayType const &rThisPoints) const override
Creates a new geometry pointer.
Definition: line_3d_3.h:282
virtual ShapeFunctionsGradientsType ShapeFunctionsLocalGradients()
Definition: line_3d_3.h:553
~Line3D3() override
Destructor. Do nothing!!!
Definition: line_3d_3.h:225
BaseType::PointsArrayType PointsArrayType
Definition: line_3d_3.h:107
Geometry< TPointType > BaseType
Geometry as base class.
Definition: line_3d_3.h:73
Line3D3(typename PointType::Pointer pFirstPoint, typename PointType::Pointer pSecondPoint, typename PointType::Pointer pThirdPoint)
Definition: line_3d_3.h:163
Vector & DeterminantOfJacobian(Vector &rResult, IntegrationMethod ThisMethod) const override
Determinant of jacobians for given integration method.
Definition: line_3d_3.h:410
SizeType FacesNumber() const override
Returns the number of faces of the current geometry.
Definition: line_3d_3.h:467
double Area() const override
Definition: line_3d_3.h:360
BaseType::IntegrationPointsContainerType IntegrationPointsContainerType
Definition: line_3d_3.h:126
Line3D3 & operator=(Line3D3< TOtherPointType > const &rOther)
Definition: line_3d_3.h:266
BaseType::NormalType NormalType
Definition: line_3d_3.h:152
double Length() const override
Definition: line_3d_3.h:343
KRATOS_CLASS_POINTER_DEFINITION(Line3D3)
Pointer definition of Line3D3.
BaseType::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: line_3d_3.h:136
double ShapeFunctionValue(IndexType ShapeFunctionIndex, const CoordinatesArrayType &rPoint) const override
This method gives value of given shape function evaluated in given point.
Definition: line_3d_3.h:509
Line3D3(const IndexType GeometryId, const PointsArrayType &rThisPoints)
Constructor with Geometry Id.
Definition: line_3d_3.h:180
GeometryData::IntegrationMethod IntegrationMethod
Definition: line_3d_3.h:80
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: line_3d_3.h:227
void PrintData(std::ostream &rOStream) const override
Definition: line_3d_3.h:750
Line3D3(const std::string &rGeometryName, const PointsArrayType &rThisPoints)
Constructor with Geometry Name.
Definition: line_3d_3.h:189
Line3D3(Line3D3< TOtherPointType > const &rOther)
Definition: line_3d_3.h:219
Line3D3(const PointsArrayType &ThisPoints)
Definition: line_3d_3.h:172
BaseType::ShapeFunctionsValuesContainerType ShapeFunctionsValuesContainerType
Definition: line_3d_3.h:131
friend class Line3D3
Definition: line_3d_3.h:943
Matrix & PointsLocalCoordinates(Matrix &rResult) const override
Definition: line_3d_3.h:598
void PrintInfo(std::ostream &rOStream) const override
Definition: line_3d_3.h:737
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: line_3d_3.h:157
double DeterminantOfJacobian(const CoordinatesArrayType &rPoint) const override
Determinant of jacobian in given point. This method calculate determinant of jacobian matrix in given...
Definition: line_3d_3.h:448
GeometryData::KratosGeometryType GetGeometryType() const override
Definition: line_3d_3.h:232
Matrix & ShapeFunctionsLocalGradients(Matrix &rResult, const CoordinatesArrayType &rPoint) const override
Definition: line_3d_3.h:578
virtual Matrix & ShapeFunctionsGradients(Matrix &rResult, CoordinatesArrayType &rPoint)
Definition: line_3d_3.h:703
Various mathematical utilitiy functions.
Definition: math_utils.h:62
static double Dot3(const Vector &a, const Vector &b)
Performs the dot product of two vectors of dimension 3.
Definition: math_utils.h:654
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
Short class definition.
Definition: array_1d.h:61
BOOST_UBLAS_INLINE void clear()
Definition: array_1d.h:325
#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
std::vector< double > PolynomialType
Definition: polynomial_utilities.h:26
void IsolateRoots(std::vector< IntervalType > &rRootIntervals, const PolynomialType &rPolynomial, const IntervalType &rRange)
Define disjoint subintervals of rRange, each containing a single root of rPolynomial.
Definition: polynomial_utilities.cpp:153
double FindRoot(const PolynomialType &rPolynomial, const IntervalType &rRange)
Find a root of rPolynomial within the interval defined by rRange.
Definition: polynomial_utilities.cpp:212
std::array< double, 2 > IntervalType
Definition: polynomial_utilities.h:27
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
const GeometryData Line3D3< TPointType >::msGeometryData & msGeometryDimension(), Line3D3< TPointType >::AllShapeFunctionsValues(), AllShapeFunctionsLocalGradients()
Definition: brep_curve.h:483
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
float aux2
Definition: isotropic_damage_automatic_differentiation.py:240
float aux1
Definition: isotropic_damage_automatic_differentiation.py:239
def load(f)
Definition: ode_solve.py:307
int d
Definition: ode_solve.py:397
J
Definition: sensitivityMatrix.py:58
N
Definition: sensitivityMatrix.py:29
subroutine d1(DSTRAN, D, dtime, NDI, NSHR, NTENS)
Definition: TensorModule.f:594
e
Definition: run_cpp_mpi_tests.py:31