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.
pyramid_3d_13.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: Philipp Bucher (https://github.com/philbucher)
11 // Ashish Darekar
12 
13 #pragma once
14 
15 // System includes
16 #include <cmath> // std::abs for double
17 
18 // External includes
19 
20 // Project includes
21 #include "includes/define.h"
22 #include "geometries/geometry.h"
25 
26 namespace Kratos {
27 
30 
54 template<class TPointType>
55 class Pyramid3D13 : public Geometry<TPointType>
56 {
57 public:
61 
64 
67 
71 
74  typedef TPointType PointType;
75 
80  typedef typename BaseType::IndexType IndexType;
81 
82 
87  typedef typename BaseType::SizeType SizeType;
88 
93 
99 
106 
112 
117 
124 
131 
136 
142 
143 
147 
148  explicit Pyramid3D13(
149  typename PointType::Pointer pPoint1,
150  typename PointType::Pointer pPoint2,
151  typename PointType::Pointer pPoint3,
152  typename PointType::Pointer pPoint4,
153  typename PointType::Pointer pPoint5,
154  typename PointType::Pointer pPoint6,
155  typename PointType::Pointer pPoint7,
156  typename PointType::Pointer pPoint8,
157  typename PointType::Pointer pPoint9,
158  typename PointType::Pointer pPoint10,
159  typename PointType::Pointer pPoint11,
160  typename PointType::Pointer pPoint12,
161  typename PointType::Pointer pPoint13)
162  : BaseType( PointsArrayType(), &msGeometryData )
163  {
164  this->Points().reserve(13);
165  this->Points().push_back(pPoint1);
166  this->Points().push_back(pPoint2);
167  this->Points().push_back(pPoint3);
168  this->Points().push_back(pPoint4);
169  this->Points().push_back(pPoint5);
170  this->Points().push_back(pPoint6);
171  this->Points().push_back(pPoint7);
172  this->Points().push_back(pPoint8);
173  this->Points().push_back(pPoint9);
174  this->Points().push_back(pPoint10);
175  this->Points().push_back(pPoint11);
176  this->Points().push_back(pPoint12);
177  this->Points().push_back(pPoint13);
178  }
179 
180  explicit Pyramid3D13( const PointsArrayType& ThisPoints )
181  : BaseType( ThisPoints, &msGeometryData )
182  {
183  KRATOS_ERROR_IF( this->PointsNumber() != 13 ) << "Invalid points number. Expected 13, given " << this->PointsNumber() << std::endl;
184  }
185 
187  explicit Pyramid3D13(
188  const IndexType GeometryId,
189  const PointsArrayType& rThisPoints
190  ) : BaseType( GeometryId, rThisPoints, &msGeometryData)
191  {
192  KRATOS_ERROR_IF( this->PointsNumber() != 13 ) << "Invalid points number. Expected 13, given " << this->PointsNumber() << std::endl;
193  }
194 
196  explicit Pyramid3D13(
197  const std::string& rGeometryName,
198  const PointsArrayType& rThisPoints
199  ) : BaseType(rGeometryName, rThisPoints, &msGeometryData)
200  {
201  KRATOS_ERROR_IF(this->PointsNumber() != 13) << "Invalid points number. Expected 13, given " << this->PointsNumber() << std::endl;
202  }
203 
212  Pyramid3D13(Pyramid3D13 const& rOther)
213  : BaseType(rOther)
214  {
215  }
216 
228  template<class TOtherPointType> Pyramid3D13(Pyramid3D13<TOtherPointType> const& rOther)
229  : BaseType(rOther)
230  {
231  }
232 
234  {
236  }
237 
239  {
241  }
242 
246 
258  {
259  BaseType::operator=(rOther);
260 
261  return *this;
262  }
263 
274  template<class TOtherPointType>
276  {
277  BaseType::operator=(rOther);
278 
279  return *this;
280  }
281 
285 
292  typename BaseType::Pointer Create(
293  const IndexType NewGeometryId,
294  PointsArrayType const& rThisPoints
295  ) const override
296  {
297  return typename BaseType::Pointer( new Pyramid3D13( NewGeometryId, rThisPoints ) );
298  }
299 
306  typename BaseType::Pointer Create(
307  const IndexType NewGeometryId,
308  const BaseType& rGeometry
309  ) const override
310  {
311  auto p_geometry = typename BaseType::Pointer( new Pyramid3D13( NewGeometryId, rGeometry.Points() ) );
312  p_geometry->SetData(rGeometry.GetData());
313  return p_geometry;
314  }
315 
319 
330  SizeType EdgesNumber() const override
331  {
332  return 8;
333  }
334 
341  SizeType FacesNumber() const override
342  {
343  return 5;
344  }
345 
354  double Volume() const override
355  {
357  }
358 
370  double DomainSize() const override
371  {
372  return Volume();
373  }
374 
386  const CoordinatesArrayType& rPointLocalCoordinates,
387  const double Tolerance = std::numeric_limits<double>::epsilon()
388  ) const override
389  {
390  if ( std::abs( rPointLocalCoordinates[0] ) <= (1.0 + Tolerance) ) {
391  if ( std::abs( rPointLocalCoordinates[1] ) <= (1.0 + Tolerance) ) {
392  if ( std::abs( rPointLocalCoordinates[2] ) <= (1.0 + Tolerance) ) {
393  if ( (std::abs(rPointLocalCoordinates[0]) +
394  std::abs(rPointLocalCoordinates[1]) +
395  rPointLocalCoordinates[2]) <= (1.0 + Tolerance) ) {
396  return 1;
397  }
398  }
399  }
400  }
401 
402  return 0;
403  }
404 
410  Matrix& PointsLocalCoordinates( Matrix& rResult ) const override
411  {
412  if ( rResult.size1() != 13 || rResult.size2() != 3 )
413  rResult.resize( 13, 3, false );
414 
415  rResult( 0, 0 ) = -1.0;
416  rResult( 0, 1 ) = -1.0;
417  rResult( 0, 2 ) = -1.0;
418 
419  rResult( 1, 0 ) = +1.0;
420  rResult( 1, 1 ) = -1.0;
421  rResult( 1, 2 ) = -1.0;
422 
423  rResult( 2, 0 ) = +1.0;
424  rResult( 2, 1 ) = +1.0;
425  rResult( 2, 2 ) = -1.0;
426 
427  rResult( 3, 0 ) = -1.0;
428  rResult( 3, 1 ) = +1.0;
429  rResult( 3, 2 ) = -1.0;
430 
431  rResult( 4, 0 ) = 0.0;
432  rResult( 4, 1 ) = 0.0;
433  rResult( 4, 2 ) = +1.0;
434 
435  rResult( 5, 0 ) = 0.0;
436  rResult( 5, 1 ) = -0.5;
437  rResult( 5, 2 ) = -1.0;
438 
439  rResult( 6, 0 ) = +0.5;
440  rResult( 6, 1 ) = 0.0;
441  rResult( 6, 2 ) = -1.0;
442 
443  rResult( 7, 0 ) = 0.0;
444  rResult( 7, 1 ) = +0.5;
445  rResult( 7, 2 ) = -1.0;
446 
447  rResult( 8, 0 ) = +0.5;
448  rResult( 8, 1 ) = 0.0;
449  rResult( 8, 2 ) = -1.0;
450 
451  rResult( 9, 0 ) = -0.5;
452  rResult( 9, 1 ) = -0.5;
453  rResult( 9, 2 ) = 0.0;
454 
455  rResult( 10, 0 ) = +0.5;
456  rResult( 10, 1 ) = -0.5;
457  rResult( 10, 2 ) = 0.0;
458 
459  rResult( 11, 0 ) = +0.5;
460  rResult( 11, 1 ) = +0.5;
461  rResult( 11, 2 ) = 0.0;
462 
463  rResult( 12, 0 ) = -0.5;
464  rResult( 12, 1 ) = +0.5;
465  rResult( 12, 2 ) = 0.0;
466 
467  return rResult;
468  }
469 
485  Vector& ShapeFunctionsValues(Vector &rResult, const CoordinatesArrayType& rCoordinates) const override
486  {
487  if(rResult.size() != 13) rResult.resize(13,false);
488 
489  for (std::size_t i=0; i<13; ++i) {
490  rResult[i] = ShapeFunctionValue(i, rCoordinates);
491  }
492 
493  return rResult;
494  }
495 
505  double ShapeFunctionValue( IndexType ShapeFunctionIndex,
506  const CoordinatesArrayType& rPoint ) const override
507  {
508  return ShapeFunctionValueImpl(ShapeFunctionIndex, rPoint);
509  }
510 
521  {
522  IntegrationPointsContainerType all_integration_points = AllIntegrationPoints();
523  IntegrationPointsArrayType integration_points = all_integration_points[static_cast<int>(ThisMethod)];
524  //number of integration points
525  const std::size_t integration_points_number = integration_points.size();
526  //number of nodes in current geometry
527  const std::size_t points_number = 13;
528  //setting up return matrix
529  Matrix shape_function_values( integration_points_number, points_number );
530 
531  //loop over all integration points
532  for (std::size_t pnt = 0; pnt<integration_points_number; ++pnt) {
533  for (std::size_t i=0; i<points_number; ++i) {
534  shape_function_values( pnt, i ) = ShapeFunctionValueImpl(i, integration_points[pnt]);
535  }
536  }
537 
538  return shape_function_values;
539  }
540 
549  Matrix& rResult,
550  const CoordinatesArrayType& rPoint
551  ) const override
552  {
553  if(rResult.size1() != this->PointsNumber() || rResult.size2() != this->LocalSpaceDimension())
554  rResult.resize(this->PointsNumber(),this->LocalSpaceDimension(),false);
555 
556  CalculateShapeFunctionsLocalGradients(rResult, rPoint);
557 
558  return rResult;
559  }
560 
570  Matrix& rResult,
571  const CoordinatesArrayType& rPoint
572  )
573  {
574  rResult.resize( 13, 3, false );
575  noalias( rResult ) = ZeroMatrix( 13, 3 );
576 
577  rResult( 0, 0 ) = (+0.0625) * (1 - rPoint[1]) * (1 - rPoint[2]) * (1 + 6*rPoint[0] + rPoint[1] + 4*rPoint[0]*rPoint[1] + rPoint[2] + 2*rPoint[0]*rPoint[2] - rPoint[1]*rPoint[2] + 4*rPoint[0]*rPoint[1]*rPoint[2]) ;
578  rResult( 0, 1 ) = (+0.0625) * (1 - rPoint[0]) * (1 - rPoint[2]) * (1 + rPoint[0] + 6*rPoint[1] + 4*rPoint[0]*rPoint[1] + rPoint[2] - rPoint[0]*rPoint[2] + 2*rPoint[1]*rPoint[2] + 4*rPoint[0]*rPoint[1]*rPoint[2]) ;
579  rResult( 0, 2 ) = (+0.125) * (1 - rPoint[0]) * (1 - rPoint[1]) * (1 + rPoint[0] + rPoint[1] + 2*rPoint[2] + rPoint[0]*rPoint[2] + rPoint[1]*rPoint[2] + 2*rPoint[0]*rPoint[1]*rPoint[2]) ;
580 
581  rResult( 1, 0 ) = (-0.0625) * (1 - rPoint[1]) * (1 - rPoint[2]) * (1 - 6*rPoint[0] + rPoint[1] - 4*rPoint[0]*rPoint[1] + rPoint[2] - 2*rPoint[0]*rPoint[2] - rPoint[1]*rPoint[2] - 4*rPoint[0]*rPoint[1]*rPoint[2]) ;
582  rResult( 1, 1 ) = (+0.0625) * (1 + rPoint[0]) * (1 - rPoint[2]) * (1 - rPoint[0] + 6*rPoint[1] - 4*rPoint[0]*rPoint[1] + rPoint[2] + rPoint[0]*rPoint[2] + 2*rPoint[1]*rPoint[2] - 4*rPoint[0]*rPoint[1]*rPoint[2]) ;
583  rResult( 1, 2 ) = (+0.125) * (1 + rPoint[0]) * (1 - rPoint[1]) * (1 - rPoint[0] + rPoint[1] + 2*rPoint[2] - rPoint[0]*rPoint[2] + rPoint[1]*rPoint[2] - 2*rPoint[0]*rPoint[1]*rPoint[2]) ;
584 
585  rResult( 2, 0 ) = (-0.0625) * (1 + rPoint[1]) * (1 - rPoint[2]) * (1 - 6*rPoint[0] - rPoint[1] + 4*rPoint[0]*rPoint[1] + rPoint[2] - 2*rPoint[0]*rPoint[2] + rPoint[1]*rPoint[2] + 4*rPoint[0]*rPoint[1]*rPoint[2]) ;
586  rResult( 2, 1 ) = (-0.0625) * (1 + rPoint[0]) * (1 - rPoint[2]) * (1 - rPoint[0] - 6*rPoint[1] + 4*rPoint[0]*rPoint[1] + rPoint[2] + rPoint[0]*rPoint[2] - 2*rPoint[1]*rPoint[2] + 4*rPoint[0]*rPoint[1]*rPoint[2]) ;
587  rResult( 2, 2 ) = (+0.125) * (1 + rPoint[0]) * (1 + rPoint[1]) * (1 - rPoint[0] - rPoint[1] + 2*rPoint[2] - rPoint[0]*rPoint[2] - rPoint[1]*rPoint[2] + 2*rPoint[0]*rPoint[1]*rPoint[2]) ;
588 
589  rResult( 3, 0 ) = (+0.0625) * (1 + rPoint[1]) * (1 - rPoint[2]) * (1 + 6*rPoint[0] - rPoint[1] - 4*rPoint[0]*rPoint[1] + rPoint[2] + 2*rPoint[0]*rPoint[2] + rPoint[1]*rPoint[2] - 4*rPoint[0]*rPoint[1]*rPoint[2]) ;
590  rResult( 3, 1 ) = (-0.0625) * (1 - rPoint[0]) * (1 - rPoint[2]) * (1 + rPoint[0] - 6*rPoint[1] - 4*rPoint[0]*rPoint[1] + rPoint[2] - rPoint[0]*rPoint[2] - 2*rPoint[1]*rPoint[2] - 4*rPoint[0]*rPoint[1]*rPoint[2]) ;
591  rResult( 3, 2 ) = (+0.125) * (1 - rPoint[0]) * (1 + rPoint[1]) * (1 + rPoint[0] - rPoint[1] + 2*rPoint[2] + rPoint[0]*rPoint[2] - rPoint[1]*rPoint[2] - 2*rPoint[0]*rPoint[1]*rPoint[2]) ;
592 
593  rResult( 4, 0 ) = 0.00 ;
594  rResult( 4, 1 ) = 0.00 ;
595  rResult( 4, 2 ) = (0.5) + rPoint[2] ;
596 
597  rResult( 5, 0 ) = (-0.25) * (rPoint[0]) * (1 - rPoint[1]) * (1 - rPoint[2]) * (2 + rPoint[1] + rPoint[1]*rPoint[2]) ;
598  rResult( 5, 1 ) = (-0.125) * (1 - std::pow(rPoint[0],2.0)) * (1 - rPoint[2]) * (1 + 2*rPoint[1] - rPoint[2] + 2*rPoint[1]*rPoint[2]) ;
599  rResult( 5, 2 ) = (-0.25) * (1 - std::pow(rPoint[0],2.0)) * (1 - rPoint[1]) * (1 + rPoint[1]*rPoint[2]) ;
600 
601  rResult( 6, 0 ) = (0.125) * (1 - std::pow(rPoint[1],2.0)) * (1 - rPoint[2]) * (1 - 2*rPoint[0] - rPoint[2] - 2*rPoint[0]*rPoint[2]) ;
602  rResult( 6, 1 ) = (-0.25) * (1 + rPoint[0]) * (rPoint[1]) * (1 - rPoint[2]) * (2 - rPoint[0] - rPoint[0]*rPoint[2]) ;
603  rResult( 6, 2 ) = (-0.25) * (1 + rPoint[0]) * (1 - std::pow(rPoint[1],2.0)) * (1 - rPoint[0]*rPoint[2]) ;
604 
605  rResult( 7, 0 ) = (-0.25) * (rPoint[0]) * (1 + rPoint[1]) * (1 - rPoint[2]) * (2 - rPoint[1] - rPoint[1]*rPoint[2]) ;
606  rResult( 7, 1 ) = (+0.125) * (1 - std::pow(rPoint[0],2.0)) * (1 - rPoint[2]) * (1 - 2*rPoint[1] - rPoint[2] - 2*rPoint[1]*rPoint[2]) ;
607  rResult( 7, 2 ) = (-0.25) * (1 - std::pow(rPoint[0],2.0)) * (1 + rPoint[1]) * (1 - rPoint[1]*rPoint[2]) ;
608 
609  rResult( 8, 0 ) = (-0.125) * (1 - std::pow(rPoint[1],2.0)) * (1 - rPoint[2]) * (1 + 2*rPoint[0] - rPoint[2] + 2*rPoint[0]*rPoint[2]) ;
610  rResult( 8, 1 ) = (-0.25) * (1 - rPoint[0]) * (rPoint[1]) * (1 - rPoint[2]) * (2 + rPoint[0] + rPoint[0]*rPoint[2]) ;
611  rResult( 8, 2 ) = (-0.25) * (1 - rPoint[0]) * (1 - std::pow(rPoint[1],2.0)) * (1 + rPoint[0]*rPoint[2]) ;
612 
613  rResult( 9, 0 ) = (-0.25) * (1 - rPoint[1]) * (1 - std::pow(rPoint[2],2.0)) ;
614  rResult( 9, 1 ) = (-0.25) * (1 - rPoint[0]) * (1 - std::pow(rPoint[2],2.0)) ;
615  rResult( 9, 2 ) = (-0.5) * (1 - rPoint[0]) * (1 - rPoint[1]) * (rPoint[2]) ;
616 
617  rResult( 10, 0 ) = (+0.25) * (1 - rPoint[1]) * (1 - std::pow(rPoint[2],2.0)) ;
618  rResult( 10, 1 ) = (-0.25) * (1 + rPoint[0]) * (1 - std::pow(rPoint[2],2.0)) ;
619  rResult( 10, 2 ) = (-0.5) * (1 + rPoint[0]) * (1 - rPoint[1]) * (rPoint[2]) ;
620 
621  rResult( 11, 0 ) = (+0.25) * (1 + rPoint[1]) * (1 - std::pow(rPoint[2],2.0)) ;
622  rResult( 11, 1 ) = (+0.25) * (1 + rPoint[0]) * (1 - std::pow(rPoint[2],2.0)) ;
623  rResult( 11, 2 ) = (-0.5) * (1 + rPoint[0]) * (1 + rPoint[1]) * (rPoint[2]) ;
624 
625  rResult( 12, 0 ) = (-0.25) * (1 + rPoint[1]) * (1 - std::pow(rPoint[2],2.0)) ;
626  rResult( 12, 1 ) = (+0.25) * (1 - rPoint[0]) * (1 - std::pow(rPoint[2],2.0)) ;
627  rResult( 12, 2 ) = (-0.5) * (1 - rPoint[0]) * (1 + rPoint[1]) * (rPoint[2]) ;
628 
629  return rResult;
630  }
631 
642  {
643  IntegrationPointsContainerType all_integration_points = AllIntegrationPoints();
644  IntegrationPointsArrayType integration_points = all_integration_points[static_cast<int>(ThisMethod)]; //number of integration points
645 
646  const std::size_t integration_points_number = integration_points.size();
647  ShapeFunctionsGradientsType d_shape_f_values(integration_points_number); //initialising container
648 
649  Matrix result;
650 
651  //loop over all integration points
652  for (std::size_t pnt = 0; pnt<integration_points_number; ++pnt) {
653  d_shape_f_values[pnt] = CalculateShapeFunctionsLocalGradients(result, integration_points[pnt]);
654  }
655 
656  return d_shape_f_values;
657  }
658 
662 
669  std::string Info() const override
670  {
671  return "3 dimensional pyramid with 13 nodes in 3D space";
672  }
673 
680  void PrintInfo(std::ostream& rOStream) const override
681  {
682  rOStream << Info();
683  }
684 
693  void PrintData(std::ostream& rOStream) const override
694  {
695  BaseType::PrintData(rOStream);
696  }
697 
699 
700 private:
703 
704  static const GeometryData msGeometryData;
705 
706  static const GeometryDimension msGeometryDimension;
707 
711 
712  friend class Serializer;
713 
714  void save( Serializer& rSerializer ) const override
715  {
717  }
718 
719  void load( Serializer& rSerializer ) override
720  {
722  }
723 
724  Pyramid3D13() : BaseType( PointsArrayType(), &msGeometryData ) {}
725 
729 
730  // see ShapeFunctionValue
731  // special function such that it can also be used in the static methods
732  static double ShapeFunctionValueImpl(
733  IndexType ShapeFunctionIndex,
734  const CoordinatesArrayType& rPoint)
735  {
736  switch ( ShapeFunctionIndex )
737  {
738  case 0:
739  return( (-0.0625) * (1 - rPoint[0]) * (1 - rPoint[1]) * (1 - rPoint[2]) * (4 + 3*rPoint[0] + 3*rPoint[1] + 2*rPoint[0]*rPoint[1] + 2*rPoint[2] + rPoint[0]*rPoint[2] + rPoint[1]*rPoint[2] + 2*rPoint[0]*rPoint[1]*rPoint[2]) );
740  case 1:
741  return( (-0.0625) * (1 + rPoint[0]) * (1 - rPoint[1]) * (1 - rPoint[2]) * (4 - 3*rPoint[0] + 3*rPoint[1] - 2*rPoint[0]*rPoint[1] + 2*rPoint[2] - rPoint[0]*rPoint[2] + rPoint[1]*rPoint[2] - 2*rPoint[0]*rPoint[1]*rPoint[2]) );
742  case 2:
743  return( (-0.0625) * (1 + rPoint[0]) * (1 + rPoint[1]) * (1 - rPoint[2]) * (4 - 3*rPoint[0] - 3*rPoint[1] + 2*rPoint[0]*rPoint[1] + 2*rPoint[2] - rPoint[0]*rPoint[2] - rPoint[1]*rPoint[2] + 2*rPoint[0]*rPoint[1]*rPoint[2]) );
744  case 3:
745  return( (-0.0625) * (1 - rPoint[0]) * (1 + rPoint[1]) * (1 - rPoint[2]) * (4 + 3*rPoint[0] - 3*rPoint[1] - 2*rPoint[0]*rPoint[1] + 2*rPoint[2] + rPoint[0]*rPoint[2] - rPoint[1]*rPoint[2] - 2*rPoint[0]*rPoint[1]*rPoint[2]) );
746  case 4:
747  return( (0.5) * (rPoint[2]) * (1 + rPoint[2]) );
748  case 5:
749  return( (0.125) * (1 - std::pow(rPoint[0],2.0)) * (1 - rPoint[1]) * (1 - rPoint[2]) * (2 + rPoint[1] + rPoint[1]*rPoint[2]) );
750  case 6:
751  return( (0.125) * (1 + rPoint[0]) * (1 - std::pow(rPoint[1],2.0)) * (1 - rPoint[2]) * (2 - rPoint[0] - rPoint[0]*rPoint[2]) );
752  case 7:
753  return( (0.125) * (1 - std::pow(rPoint[0],2.0)) * (1 + rPoint[1]) * (1 - rPoint[2]) * (2 - rPoint[1] - rPoint[1]*rPoint[2]) );
754  case 8:
755  return( (0.125) * (1 - rPoint[0]) * (1 - std::pow(rPoint[1],2.0)) * (1 - rPoint[2]) * (2 + rPoint[0] + rPoint[0]*rPoint[2]) );
756  case 9:
757  return( (0.25) * (1 - rPoint[0]) * (1 - rPoint[1]) * (1 - std::pow(rPoint[2],2.0)) );
758  case 10:
759  return( (0.25) * (1 + rPoint[0]) * (1 - rPoint[1]) * (1 - std::pow(rPoint[2],2.0)) );
760  case 11:
761  return( (0.25) * (1 + rPoint[0]) * (1 + rPoint[1]) * (1 - std::pow(rPoint[2],2.0)) );
762  case 12:
763  return( (0.25) * (1 - rPoint[0]) * (1 + rPoint[1]) * (1 - std::pow(rPoint[2],2.0)) );
764  default:
765  KRATOS_ERROR << "Wrong index of shape function:" << ShapeFunctionIndex << std::endl;
766  }
767 
768  return 0;
769  }
770 
771  static const IntegrationPointsContainerType AllIntegrationPoints()
772  {
773  IntegrationPointsContainerType integration_points =
774  {
775  {
776  Quadrature < PyramidGaussLegendreIntegrationPoints1,
777  3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
778  Quadrature < PyramidGaussLegendreIntegrationPoints2,
779  3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
780  Quadrature < PyramidGaussLegendreIntegrationPoints3,
781  3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
782  Quadrature < PyramidGaussLegendreIntegrationPoints4,
783  3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
784  Quadrature < PyramidGaussLegendreIntegrationPoints5,
785  3, IntegrationPoint<3> >::GenerateIntegrationPoints()
786  }
787  };
788  return integration_points;
789  }
790 
791  static const ShapeFunctionsValuesContainerType AllShapeFunctionsValues()
792  {
793  ShapeFunctionsValuesContainerType shape_functions_values =
794  {
795  {
801  }
802  };
803  return shape_functions_values;
804  }
805 
806  static const ShapeFunctionsLocalGradientsContainerType AllShapeFunctionsLocalGradients()
807  {
808  ShapeFunctionsLocalGradientsContainerType shape_functions_local_gradients =
809  {
810  {
816  }
817  };
818  return shape_functions_local_gradients;
819  }
820 
824 
825 
829 
830 
834 
835  template<class TOtherPointType> friend class Pyramid3D13;
836 
838 
839 }; // Class Geometry
840 
842 
845 
846 
850 
852 template<class TPointType>
853 inline std::istream& operator >> (std::istream& rIStream,
854  Pyramid3D13<TPointType>& rThis);
855 
857 template<class TPointType>
858 inline std::ostream& operator << (std::ostream& rOStream,
859  const Pyramid3D13<TPointType>& rThis)
860 {
861  rThis.PrintInfo(rOStream);
862  rOStream << std::endl;
863  rThis.PrintData(rOStream);
864 
865  return rOStream;
866 }
868 
869 template<class TPointType> const
870 GeometryData Pyramid3D13<TPointType>::msGeometryData(
873  Pyramid3D13<TPointType>::AllIntegrationPoints(),
874  Pyramid3D13<TPointType>::AllShapeFunctionsValues(),
875  AllShapeFunctionsLocalGradients()
876 );
877 
878 template<class TPointType> const
879 GeometryDimension Pyramid3D13<TPointType>::msGeometryDimension(3, 3);
880 
881 } // namespace Kratos.
Definition: geometry_data.h:60
KratosGeometryType
Definition: geometry_data.h:110
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
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
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
std::array< IntegrationPointsArrayType, static_cast< int >GeometryData::IntegrationMethod::NumberOfIntegrationMethods)> IntegrationPointsContainerType
Definition: geometry.h:167
GeometryData::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: geometry.h:177
Short class definition.
Definition: integration_point.h:52
static double ComputeVolume3DGeometry(const Geometry< TPointType > &rGeometry)
This method calculates and returns the volume of the geometry from a 3D geometry.
Definition: integration_utilities.h:168
Definition: amatrix_interface.h:41
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
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
A 13 node pyramid geometry with quadratic shape functions.
Definition: pyramid_3d_13.h:56
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: pyramid_3d_13.h:233
TPointType PointType
Definition: pyramid_3d_13.h:74
void PrintData(std::ostream &rOStream) const override
Definition: pyramid_3d_13.h:693
static Matrix CalculateShapeFunctionsIntegrationPointsValues(typename BaseType::IntegrationMethod ThisMethod)
Definition: pyramid_3d_13.h:520
BaseType::IntegrationPointsContainerType IntegrationPointsContainerType
Definition: pyramid_3d_13.h:111
void PrintInfo(std::ostream &rOStream) const override
Definition: pyramid_3d_13.h:680
SizeType EdgesNumber() const override
This method gives you number of all edges of this geometry.
Definition: pyramid_3d_13.h:330
double DomainSize() const override
Definition: pyramid_3d_13.h:370
BaseType::GeometriesArrayType GeometriesArrayType
Definition: pyramid_3d_13.h:141
BaseType::Pointer Create(const IndexType NewGeometryId, PointsArrayType const &rThisPoints) const override
Creates a new geometry pointer.
Definition: pyramid_3d_13.h:292
friend class Pyramid3D13
Definition: pyramid_3d_13.h:835
BaseType::Pointer Create(const IndexType NewGeometryId, const BaseType &rGeometry) const override
Creates a new geometry pointer.
Definition: pyramid_3d_13.h:306
BaseType::SizeType SizeType
Definition: pyramid_3d_13.h:87
std::string Info() const override
Definition: pyramid_3d_13.h:669
Pyramid3D13(const IndexType GeometryId, const PointsArrayType &rThisPoints)
Constructor with Geometry Id.
Definition: pyramid_3d_13.h:187
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: pyramid_3d_13.h:135
BaseType::PointsArrayType PointsArrayType
Definition: pyramid_3d_13.h:92
Matrix & ShapeFunctionsLocalGradients(Matrix &rResult, const CoordinatesArrayType &rPoint) const override
Definition: pyramid_3d_13.h:548
BaseType::IntegrationPointType IntegrationPointType
Definition: pyramid_3d_13.h:98
Pyramid3D13(Pyramid3D13< TOtherPointType > const &rOther)
Definition: pyramid_3d_13.h:228
double ShapeFunctionValue(IndexType ShapeFunctionIndex, const CoordinatesArrayType &rPoint) const override
Definition: pyramid_3d_13.h:505
Vector & ShapeFunctionsValues(Vector &rResult, const CoordinatesArrayType &rCoordinates) const override
Definition: pyramid_3d_13.h:485
KRATOS_CLASS_POINTER_DEFINITION(Pyramid3D13)
Pointer definition of Pyramid3D13.
SizeType FacesNumber() const override
Returns the number of faces of the current geometry.
Definition: pyramid_3d_13.h:341
Pyramid3D13 & operator=(Pyramid3D13< TOtherPointType > const &rOther)
Definition: pyramid_3d_13.h:275
int IsInsideLocalSpace(const CoordinatesArrayType &rPointLocalCoordinates, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Checks if given point in local space coordinates of this geometry is inside the geometry boundaries.
Definition: pyramid_3d_13.h:385
Pyramid3D13(Pyramid3D13 const &rOther)
Definition: pyramid_3d_13.h:212
Pyramid3D13(const PointsArrayType &ThisPoints)
Definition: pyramid_3d_13.h:180
BaseType::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: pyramid_3d_13.h:130
GeometryData::IntegrationMethod IntegrationMethod
Definition: pyramid_3d_13.h:70
BaseType::IndexType IndexType
Definition: pyramid_3d_13.h:80
Pyramid3D13(const std::string &rGeometryName, const PointsArrayType &rThisPoints)
Constructor with Geometry Name.
Definition: pyramid_3d_13.h:196
BaseType::ShapeFunctionsValuesContainerType ShapeFunctionsValuesContainerType
Definition: pyramid_3d_13.h:116
double Volume() const override
This method calculate and return volume of this geometry.
Definition: pyramid_3d_13.h:354
Matrix & PointsLocalCoordinates(Matrix &rResult) const override
Definition: pyramid_3d_13.h:410
BaseType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: pyramid_3d_13.h:123
GeometryData::KratosGeometryType GetGeometryType() const override
Definition: pyramid_3d_13.h:238
static ShapeFunctionsGradientsType CalculateShapeFunctionsIntegrationPointsLocalGradients(typename BaseType::IntegrationMethod ThisMethod)
Definition: pyramid_3d_13.h:641
Pyramid3D13 & operator=(const Pyramid3D13 &rOther)
Definition: pyramid_3d_13.h:257
static Matrix & CalculateShapeFunctionsLocalGradients(Matrix &rResult, const CoordinatesArrayType &rPoint)
Definition: pyramid_3d_13.h:569
Geometry< TPointType > BaseType
Geometry as base class.
Definition: pyramid_3d_13.h:63
Pyramid3D13(typename PointType::Pointer pPoint1, typename PointType::Pointer pPoint2, typename PointType::Pointer pPoint3, typename PointType::Pointer pPoint4, typename PointType::Pointer pPoint5, typename PointType::Pointer pPoint6, typename PointType::Pointer pPoint7, typename PointType::Pointer pPoint8, typename PointType::Pointer pPoint9, typename PointType::Pointer pPoint10, typename PointType::Pointer pPoint11, typename PointType::Pointer pPoint12, typename PointType::Pointer pPoint13)
Definition: pyramid_3d_13.h:148
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: pyramid_3d_13.h:105
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
#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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
const GeometryData Pyramid3D13< TPointType >::msGeometryData & msGeometryDimension(), Pyramid3D13< TPointType >::AllShapeFunctionsValues(), AllShapeFunctionsLocalGradients()
Definition: brep_curve.h:483
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
def load(f)
Definition: ode_solve.py:307
integer i
Definition: TensorModule.f:17