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.
coupling_geometry.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: Tobias Teschemacher
11 // Pooyan Dadvand
12 // Philipp Bucher
13 //
14 
15 #if !defined(KRATOS_COUPLING_GEOMETRY_H_INCLUDED )
16 #define KRATOS_COUPLING_GEOMETRY_H_INCLUDED
17 
18 // System includes
19 
20 // External includes
21 
22 // Project includes
23 #include "geometry.h"
24 
27 
28 namespace Kratos
29 {
32 
39 template<class TPointType> class CouplingGeometry
40  : public Geometry<TPointType>
41 {
42 public:
46 
50 
51  typedef typename GeometryType::Pointer GeometryPointer;
52  typedef std::vector<GeometryPointer> GeometryPointerVector;
53 
56 
57  typedef TPointType PointType;
58 
59  typedef typename BaseType::IndexType IndexType;
60  typedef typename BaseType::SizeType SizeType;
61 
65  typedef std::vector<CoordinatesArrayType> CoordinatesArrayVectorType;
67 
71 
72  static constexpr IndexType Master = 0;
73  static constexpr IndexType Slave = 1;
74 
78 
81  GeometryPointer pMasterGeometry,
82  GeometryPointer pSlaveGeometry)
83  : BaseType(PointsArrayType(), &(pMasterGeometry->GetGeometryData()))
84  {
85  mpGeometries.resize(2);
86 
87  mpGeometries[0] = pMasterGeometry;
88  mpGeometries[1] = pSlaveGeometry;
89  }
90 
95  , mpGeometries(GeometryPointerVector)
96  {
97  }
98 
99  explicit CouplingGeometry()
100  : BaseType()
101  {
102  }
103 
106  : BaseType( rOther )
107  , mpGeometries(rOther.mpGeometries)
108  {
109  }
110 
112  template<class TOtherPointType> explicit CouplingGeometry(
113  CouplingGeometry<TOtherPointType> const& rOther )
114  : BaseType( rOther )
115  , mpGeometries( rOther.mpGeometries )
116  {
117  }
118 
120  ~CouplingGeometry() override = default;
121 
125 
128  {
129  BaseType::operator=( rOther );
130  mpGeometries = rOther.mpGeometries;
131  return *this;
132  }
133 
135  template<class TOtherPointType>
137  CouplingGeometry<TOtherPointType> const & rOther )
138  {
139  BaseType::operator=( rOther );
140  mpGeometries = rOther.mpGeometries;
141  return *this;
142  }
143 
147 
148  typename BaseType::Pointer Create(
149  PointsArrayType const& ThisPoints ) const override
150  {
151  return Kratos::make_shared<CouplingGeometry>();
152  }
153 
157 
166  {
167  KRATOS_DEBUG_ERROR_IF(mpGeometries.size() <= Index) << "Index "
168  << Index << " out of range. CouplingGeometry #" << this->Id()
169  << " has " << mpGeometries.size() << " geometries." << std::endl;
170 
171  return mpGeometries[Index];
172  }
173 
181  const GeometryPointer pGetGeometryPart(const IndexType Index) const override
182  {
183  KRATOS_DEBUG_ERROR_IF(mpGeometries.size() <= Index) << "Index \""
184  << Index << "\" out of range. CouplingGeometry #" << this->Id()
185  << " has " << mpGeometries.size() << " geometries." << std::endl;
186 
187  return mpGeometries[Index];
188  }
189 
196  const IndexType Index,
197  GeometryPointer pGeometry
198  ) override
199  {
200  KRATOS_DEBUG_ERROR_IF(mpGeometries.size() <= Index) << "Index out of range: "
201  << Index << " composite contains only of: "
202  << mpGeometries.size() << " geometries." << std::endl;
203 
204  if (Index == 0){
205  this->SetGeometryData(&(pGeometry->GetGeometryData()));
206  }
207 
208  mpGeometries[Index] = pGeometry;
209  }
210 
216  {
217  const IndexType new_index = mpGeometries.size();
218 
219  mpGeometries.push_back(pGeometry);
220 
221  return new_index;
222  }
223 
228  void RemoveGeometryPart(GeometryPointer pGeometry) override
229  {
230  const IndexType geometry_id = pGeometry->Id();
231  IndexType to_remove_id = 0;
232  for (const auto& p_geom : mpGeometries) {
233  if (p_geom->Id() == geometry_id) {
234  break;
235  }
236  ++to_remove_id;
237  }
238 
239  RemoveGeometryPart(to_remove_id);
240  }
241 
246  void RemoveGeometryPart(const IndexType Index) override
247  {
248  KRATOS_ERROR_IF(Index == 0) << "Master geometry should not be removed from the CouplingGeometry" << std::endl;
249 
250  const SizeType number_of_geometries = NumberOfGeometryParts();
251  for (IndexType i = Index; i < number_of_geometries - 1; ++i) {
252  mpGeometries[i] = mpGeometries[i + 1];
253  }
254  mpGeometries[number_of_geometries - 1] = nullptr;
255  mpGeometries.erase(mpGeometries.begin() + number_of_geometries - 1);
256  }
257 
263  bool HasGeometryPart(const IndexType Index) const override
264  {
265  if (Index < NumberOfGeometryParts()) {
266  return true;
267  } else {
268  return false;
269  }
270  }
271 
277  {
278  return mpGeometries.size();
279  }
280 
284 
289  double DomainSize() const override
290  {
291  KRATOS_DEBUG_ERROR_IF(mpGeometries.size() == 0) << "No master assigned. Geometry vector of size 0." << std::endl;
292 
293  return mpGeometries[0]->DomainSize();
294  }
295 
300  Point Center() const override
301  {
302  KRATOS_DEBUG_ERROR_IF(mpGeometries.size() == 0) << "No master assigned. Geometry vector of size 0." << std::endl;
303 
304  return mpGeometries[0]->Center();
305  }
306 
310 
311  /* @brief Provides the combined spans of all geometry parts of this geometry
312  * in local paramater coordinates of the geometry
313  * according to its direction from LocalDirectionIndex.
314  *
315  * @param resulting vector of span intervals.
316  * @param LocalDirectionIndex of chosen direction, for curves always 0.
317  */
318  virtual void SpansLocalSpace(
319  std::vector<double>& rSpans,
320  IndexType LocalDirectionIndex = 0) const override
321  {
322  const double model_tolerance = 1e-2;
323 
324  if (this->LocalSpaceDimension() == 1) {
325  std::vector<double> master_span_intersections_in_master_local_space;
326  std::vector<double> slave_span_intersections_in_master_local_space;
327 
328  mpGeometries[0]->SpansLocalSpace(master_span_intersections_in_master_local_space);
329 
330  // Create tessellation for estimation of initial guesses.
331  CurveTessellation<PointerVector<TPointType>> curve_tessellation_master;
332  curve_tessellation_master.Tessellate(
333  *(mpGeometries[0].get()),
334  master_span_intersections_in_master_local_space,
335  1e-2, mpGeometries[0]->PolynomialDegree(0), false);
336 
337  CoordinatesArrayType local_coords_span_intersection_on_slave = ZeroVector(3);
338  CoordinatesArrayType global_coords_span_intersection_on_slave = ZeroVector(3);
339  CoordinatesArrayType local_coords_master = ZeroVector(3);
340  CoordinatesArrayType global_coords_master;
341  for (IndexType i = 1; i < mpGeometries.size(); ++i) {
342  std::vector<double> intersection_slave_spans;
343  mpGeometries[i]->SpansLocalSpace(intersection_slave_spans);
344 
345  for (IndexType j = 0; j < intersection_slave_spans.size(); ++j) {
346  local_coords_span_intersection_on_slave[0] = intersection_slave_spans[j];
347  // Get global coordinates of span intersection on slave.
348  mpGeometries[i]->GlobalCoordinates(
349  global_coords_span_intersection_on_slave, local_coords_span_intersection_on_slave);
350  // Get initial guess for projection on master curve.
351  curve_tessellation_master.GetClosestPoint(
352  global_coords_span_intersection_on_slave, global_coords_master, local_coords_master);
353  // Projection on master curve.
354  int success = mpGeometries[0]->ProjectionPointGlobalToLocalSpace(
355  global_coords_span_intersection_on_slave, local_coords_master);
356 
357  #ifdef KRATOS_DEBUG
358  mpGeometries[0]->GlobalCoordinates(global_coords_master, local_coords_master);
359  #endif
360  KRATOS_DEBUG_ERROR_IF((success > 1 && (norm_2(global_coords_span_intersection_on_slave - local_coords_master) > model_tolerance))
361  || (success == 0 && (norm_2(global_coords_span_intersection_on_slave - local_coords_master) < model_tolerance)))
362  << "Projection of intersection spans failed. Global Coordinates on slave: "
363  << global_coords_span_intersection_on_slave << ", and global coordinates on master: "
364  << global_coords_master << ". Difference: " << norm_2(global_coords_span_intersection_on_slave - global_coords_master)
365  << " larger than model tolerance: " << model_tolerance << std::endl;
366 
367  // If success == 0, it is considered that the projection is on one of the boundaries.
368  slave_span_intersections_in_master_local_space.push_back(local_coords_master[0]);
369  }
370  }
371 
372  MergeSpans(rSpans, master_span_intersections_in_master_local_space, slave_span_intersections_in_master_local_space);
373  }
374  }
375 
379 
382  {
383  const SizeType local_space_dimension = this->LocalSpaceDimension();
384 
385  std::vector<SizeType> number_of_points_per_span_per_direction(local_space_dimension);
386  std::vector<IntegrationInfo::QuadratureMethod> quadrature_method_per_direction(local_space_dimension);
387  for (IndexType i = 0; i < local_space_dimension; ++i) {
388  SizeType max_p = 0;
389  for (IndexType j = 0; j < NumberOfGeometryParts(); ++j) {
390  max_p = std::max(mpGeometries[j]->PolynomialDegree(i) + 1, max_p);
391  }
392  number_of_points_per_span_per_direction[i] = max_p;
393  quadrature_method_per_direction[i] = IntegrationInfo::QuadratureMethod::GAUSS;
394  }
395 
396  return IntegrationInfo(number_of_points_per_span_per_direction, quadrature_method_per_direction);
397  }
398 
402 
403  /* Creates integration points on the master considering all slave intersections.
404  * @return integration points.
405  */
407  IntegrationPointsArrayType& rIntegrationPoints,
408  IntegrationInfo& rIntegrationInfo) const override
409  {
410  if (this->LocalSpaceDimension() == 1) {
411  std::vector<double> spans;
412  this->SpansLocalSpace(spans, 0);
413 
415  rIntegrationPoints, spans, rIntegrationInfo);
416  }
417  }
418 
419  /* @brief This method creates a list of quadrature point geometries
420  * from a list of integration points.
421  * Initially, all integration points are transformed to
422  * quadrature point geometries on the master. Then all points
423  * are mapped to all slave geometries. Finally, coupling geometries,
424  * containing quadrature point geometries per integration point on
425  * master and all slaves are created.
426  *
427  * @param rResultGeometries list of quadrature point geometries.
428  * @param NumberOfShapeFunctionDerivatives the number of evaluated
429  * derivatives of shape functions at the quadrature point geometries.
430  *
431  * @see quadrature_point_geometry.h
432  */
434  GeometriesArrayType& rResultGeometries,
435  IndexType NumberOfShapeFunctionDerivatives,
436  const IntegrationPointsArrayType& rIntegrationPoints,
437  IntegrationInfo& rIntegrationInfo) override
438  {
439  const double model_tolerance = 1e-2;
440 
441  const SizeType num_integration_points = rIntegrationPoints.size();
442 
443  if (rResultGeometries.size() != num_integration_points) {
444  rResultGeometries.resize(num_integration_points);
445  }
446 
447  // Create quadrature points on master
448  GeometriesArrayType master_quadrature_points(num_integration_points);
449  mpGeometries[0]->CreateQuadraturePointGeometries(
450  master_quadrature_points,
451  NumberOfShapeFunctionDerivatives,
452  rIntegrationPoints,
453  rIntegrationInfo);
454 
455  // Compute vector of location
456  CoordinatesArrayVectorType integration_points_global_coords_vector(num_integration_points);
457  for (SizeType i = 0; i < num_integration_points; ++i) {
458  integration_points_global_coords_vector[i] = master_quadrature_points[i].Center();
459  }
460 
461  // First slave
462  IntegrationPointsArrayType integration_points_slave = rIntegrationPoints;
463  CoordinatesArrayType local_slave_coords = ZeroVector(3);
464  CoordinatesArrayType global_slave_coords = ZeroVector(3);
465 
466  if (!rIntegrationInfo.Is(IntegrationInfo::DO_NOT_CREATE_TESSELLATION_ON_SLAVE)) {
467  if (this->LocalSpaceDimension() == 1) {
469  curve_tesselation.Tessellate(*(mpGeometries[1].get()), 1e-2, mpGeometries[1]->PolynomialDegree(0));
470 
471  for (SizeType j = 0; j < num_integration_points; ++j) {
472  curve_tesselation.GetClosestPoint(
473  integration_points_global_coords_vector[j],
474  global_slave_coords,
475  local_slave_coords);
476 
477  mpGeometries[1]->ProjectionPointGlobalToLocalSpace(
478  integration_points_global_coords_vector[j],
479  local_slave_coords);
480 
481  integration_points_slave[j][0] = local_slave_coords[0];
482  integration_points_slave[j][1] = local_slave_coords[1];
483  integration_points_slave[j][2] = local_slave_coords[2];
484  }
485  }
486  else {
487  KRATOS_ERROR << "Tessellation for " << this->LocalSpaceDimension()
488  << "-dimensional objects is not implemented." << std::endl;
489  }
490  }
491  else {
492  for (SizeType j = 0; j < num_integration_points; ++j) {
493  mpGeometries[1]->ProjectionPointGlobalToLocalSpace(
494  integration_points_global_coords_vector[j],
495  local_slave_coords);
496 
497  integration_points_slave[j][0] = local_slave_coords[0];
498  integration_points_slave[j][1] = local_slave_coords[1];
499  integration_points_slave[j][2] = local_slave_coords[2];
500  }
501  }
502 
503  GeometriesArrayType slave_quadrature_points(num_integration_points);
504  mpGeometries[1]->CreateQuadraturePointGeometries(
505  slave_quadrature_points,
506  NumberOfShapeFunctionDerivatives,
507  integration_points_slave,
508  rIntegrationInfo);
509 
510  for (SizeType i = 0; i < num_integration_points; ++i) {
511  KRATOS_DEBUG_ERROR_IF(norm_2(master_quadrature_points(i)->Center() - slave_quadrature_points(i)->Center()) > model_tolerance)
512  << "Difference between master and slave coordinates above model tolerance of " << model_tolerance
513  << ". Location of master: " << master_quadrature_points(i)->Center() << ", location of slave: "
514  << slave_quadrature_points(i)->Center() << ". Distance: "
515  << norm_2(master_quadrature_points(i)->Center() - slave_quadrature_points(i)->Center()) << std::endl;
516 
517  rResultGeometries(i) = Kratos::make_shared<CouplingGeometry<PointType>>(
518  master_quadrature_points(i), slave_quadrature_points(i));
519  }
520 
521  KRATOS_ERROR_IF(mpGeometries.size() > 2)
522  << "CreateQuadraturePointGeometries not implemented for coupling of more than 2 geomtries. "
523  << mpGeometries.size() << " are given." << std::endl;
524  }
525 
527  GeometriesArrayType& rResultGeometries,
528  IndexType NumberOfShapeFunctionDerivatives,
529  IntegrationInfo& rIntegrationInfo) override
530  {
531  const double model_tolerance = 1e-3;
532 
533  if (this->LocalSpaceDimension() != 0) {
534  BaseType::CreateQuadraturePointGeometries(rResultGeometries, NumberOfShapeFunctionDerivatives, rIntegrationInfo);
535  }
536  else {
537  rResultGeometries.resize(1);
538 
539  GeometriesArrayType master_quadrature_points(1);
540  mpGeometries[0]->CreateQuadraturePointGeometries(
541  master_quadrature_points,
542  NumberOfShapeFunctionDerivatives,
543  rIntegrationInfo);
544 
545  GeometriesArrayType slave_quadrature_points(1);
546  mpGeometries[1]->CreateQuadraturePointGeometries(
547  slave_quadrature_points,
548  NumberOfShapeFunctionDerivatives,
549  rIntegrationInfo);
550 
551  KRATOS_DEBUG_ERROR_IF(norm_2(master_quadrature_points(0)->Center() - slave_quadrature_points(0)->Center()) > model_tolerance)
552  << "Difference between master and slave coordinates above model tolerance of " << model_tolerance
553  << ". Location of master: " << master_quadrature_points(0)->Center() << ", location of slave: "
554  << slave_quadrature_points(0)->Center() << ". Distance: "
555  << norm_2(master_quadrature_points(0)->Center() - slave_quadrature_points(0)->Center()) << std::endl;
556 
557  rResultGeometries(0) = Kratos::make_shared<CouplingGeometry<PointType>>(
558  master_quadrature_points(0), slave_quadrature_points(0));
559 
560  if (mpGeometries.size() > 2) {
561  for (IndexType i = 2; i < mpGeometries.size(); ++i) {
562  GeometriesArrayType more_slave_quadrature_points(1);
563  mpGeometries[i]->CreateQuadraturePointGeometries(
564  more_slave_quadrature_points,
565  NumberOfShapeFunctionDerivatives,
566  rIntegrationInfo);
567 
568  KRATOS_DEBUG_ERROR_IF(norm_2(master_quadrature_points(0)->Center() - more_slave_quadrature_points(0)->Center()) > model_tolerance)
569  << "Difference between master and slave coordinates above model tolerance of " << model_tolerance
570  << ". Location of master: " << master_quadrature_points(0)->Center() << ", location of slave: "
571  << more_slave_quadrature_points(0)->Center() << ". Distance: "
572  << norm_2(master_quadrature_points(0)->Center() - more_slave_quadrature_points(0)->Center()) << std::endl;
573 
574  rResultGeometries(0)->AddGeometryPart(more_slave_quadrature_points(0));
575  }
576  }
577  }
578  }
579 
583 
584  static void MergeSpans(
585  std::vector<double>& rResultSpans,
586  const std::vector<double>& rSpans1,
587  const std::vector<double>& rSpans2,
588  double Tolerance = 1e-6)
589  {
590  NurbsInterval interval_1(rSpans1[0], rSpans1[rSpans1.size() - 1]);
591  NurbsInterval interval_2(rSpans2[0], rSpans2[rSpans2.size() - 1]);
592 
593  for (IndexType i = 0; i < rSpans1.size(); ++i) {
594  double temp = rSpans1[i];
595  interval_2.IsInside(temp);
596  rResultSpans.push_back(temp);
597  }
598  for (IndexType i = 0; i < rSpans2.size(); ++i) {
599  double temp = rSpans2[i];
600  interval_1.IsInside(temp);
601  rResultSpans.push_back(temp);
602  }
603 
604  SortUnique(rResultSpans, Tolerance);
605  }
606 
607  static void SortUnique(
608  std::vector<double>& rResultSpans,
609  const double Tolerance)
610  {
611  std::sort(std::begin(rResultSpans), std::end(rResultSpans));
612 
613  auto last = std::unique(std::begin(rResultSpans), std::end(rResultSpans),
614  [Tolerance](double a, double b) { return b - a < Tolerance; });
615 
616  auto nb_unique = std::distance(std::begin(rResultSpans), last);
617 
618  rResultSpans.resize(nb_unique);
619  }
620 
624 
626  {
628  }
629 
631  {
633  }
634 
638 
640  std::string Info() const override
641  {
642  return "Coupling geometry that holds a master and a set of slave geometries.";
643  }
644 
646  void PrintInfo( std::ostream& rOStream ) const override
647  {
648  rOStream << "Coupling geometry that holds a master and a set of slave geometries.";
649  }
650 
652  void PrintData( std::ostream& rOStream ) const override
653  {
654  BaseType::PrintData( rOStream );
655  std::cout << std::endl;
656  rOStream << " CouplingGeometry with " << mpGeometries.size() << " geometries.";
657  }
658 
660 private:
663 
664  GeometryPointerVector mpGeometries;
665 
669 
670  friend class Serializer;
671 
672  void save( Serializer& rSerializer ) const override
673  {
675  rSerializer.save("Geometries", mpGeometries);
676  }
677 
678  void load( Serializer& rSerializer ) override
679  {
681  rSerializer.load("Geometries", mpGeometries);
682  }
683 
687 
688  template<class TOtherPointType> friend class CouplingGeometry;
689 
691 }; // Class Geometry
692 
696 
699 template<class TPointType> inline std::istream& operator >> (
700  std::istream& rIStream,
705 template<class TPointType> inline std::ostream& operator << (
706  std::ostream& rOStream,
707  const CouplingGeometry<TPointType>& rThis )
708 {
709  rThis.PrintInfo( rOStream );
710  rOStream << std::endl;
711  rThis.PrintData( rOStream );
712  return rOStream;
713 }
714 
716 }// namespace Kratos.
717 
718 #endif // KRATOS_COUPLING_GEOMETRY_H_INCLUDED defined
The CouplingGeometry connects two or more geometries of different types and entities.
Definition: coupling_geometry.h:41
KRATOS_CLASS_POINTER_DEFINITION(CouplingGeometry)
Pointer definition of CouplingGeometry.
BaseType::Pointer Create(PointsArrayType const &ThisPoints) const override
Creates a new geometry pointer.
Definition: coupling_geometry.h:148
void CreateQuadraturePointGeometries(GeometriesArrayType &rResultGeometries, IndexType NumberOfShapeFunctionDerivatives, const IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo) override
Definition: coupling_geometry.h:433
virtual void SpansLocalSpace(std::vector< double > &rSpans, IndexType LocalDirectionIndex=0) const override
Definition: coupling_geometry.h:318
BaseType::IndexType IndexType
Definition: coupling_geometry.h:59
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: coupling_geometry.h:652
CouplingGeometry(CouplingGeometry const &rOther)
Copy constructor.
Definition: coupling_geometry.h:105
PointerVector< GeometryType > GeometriesArrayType
Definition: coupling_geometry.h:66
void RemoveGeometryPart(const IndexType Index) override
Removes a geometry part.
Definition: coupling_geometry.h:246
void CreateIntegrationPoints(IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo) const override
Definition: coupling_geometry.h:406
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: coupling_geometry.h:64
bool HasGeometryPart(const IndexType Index) const override
Use to check if certain Indexed object is within the geometry parts of this geometry.
Definition: coupling_geometry.h:263
CouplingGeometry(GeometryPointer pMasterGeometry, GeometryPointer pSlaveGeometry)
Constructor for coupling one master to one slave geometry.
Definition: coupling_geometry.h:80
static constexpr IndexType Master
Definition: coupling_geometry.h:72
Geometry< TPointType > GeometryType
Definition: coupling_geometry.h:49
GeometryData::KratosGeometryType GetGeometryType() const override
Definition: coupling_geometry.h:630
CouplingGeometry & operator=(CouplingGeometry< TOtherPointType > const &rOther)
Assignment operator with different point type.
Definition: coupling_geometry.h:136
~CouplingGeometry() override=default
Destructor.
std::vector< GeometryPointer > GeometryPointerVector
Definition: coupling_geometry.h:52
void RemoveGeometryPart(GeometryPointer pGeometry) override
Removes a geometry part.
Definition: coupling_geometry.h:228
IndexType AddGeometryPart(GeometryPointer pGeometry) override
Allows to enhance the coupling geometry, with another geometry.
Definition: coupling_geometry.h:215
static constexpr IndexType Slave
Definition: coupling_geometry.h:73
GeometryPointer pGetGeometryPart(const IndexType Index) override
This function returns the pointer of the geometry part which is corresponding to the index....
Definition: coupling_geometry.h:165
BaseType::SizeType SizeType
Definition: coupling_geometry.h:60
CouplingGeometry(CouplingGeometry< TOtherPointType > const &rOther)
Copy constructor with other point type.
Definition: coupling_geometry.h:112
GeometryType::Pointer GeometryPointer
Definition: coupling_geometry.h:51
static void MergeSpans(std::vector< double > &rResultSpans, const std::vector< double > &rSpans1, const std::vector< double > &rSpans2, double Tolerance=1e-6)
Definition: coupling_geometry.h:584
double DomainSize() const override
Returns the domain size of the master geometry.
Definition: coupling_geometry.h:289
TPointType PointType
Definition: coupling_geometry.h:57
CouplingGeometry & operator=(const CouplingGeometry &rOther)
Assignment operator.
Definition: coupling_geometry.h:127
Geometry< TPointType > BaseType
Geometry as base class.
Definition: coupling_geometry.h:48
CouplingGeometry()
Definition: coupling_geometry.h:99
BaseType::PointsArrayType PointsArrayType
Definition: coupling_geometry.h:63
CouplingGeometry(GeometryPointerVector GeometryPointerVector)
Constructor for coupling multiple points.
Definition: coupling_geometry.h:92
std::vector< CoordinatesArrayType > CoordinatesArrayVectorType
Definition: coupling_geometry.h:65
void SetGeometryPart(const IndexType Index, GeometryPointer pGeometry) override
Allows to exchange certain geometries.
Definition: coupling_geometry.h:195
Point Center() const override
Returns the center of the master geometry.
Definition: coupling_geometry.h:300
const GeometryPointer pGetGeometryPart(const IndexType Index) const override
This function returns the const pointer of the geometry part which is corresponding to the index....
Definition: coupling_geometry.h:181
static void SortUnique(std::vector< double > &rResultSpans, const double Tolerance)
Definition: coupling_geometry.h:607
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: coupling_geometry.h:62
SizeType NumberOfGeometryParts() const override
The number of geometry part.
Definition: coupling_geometry.h:276
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: coupling_geometry.h:625
IntegrationInfo GetDefaultIntegrationInfo() const override
Provides the default integration per geometry.
Definition: coupling_geometry.h:381
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: coupling_geometry.h:646
std::string Info() const override
Turn back information as a string.
Definition: coupling_geometry.h:640
void CreateQuadraturePointGeometries(GeometriesArrayType &rResultGeometries, IndexType NumberOfShapeFunctionDerivatives, IntegrationInfo &rIntegrationInfo) override
Definition: coupling_geometry.h:526
Definition: curve_tessellation.h:32
void Tessellate(const GeometryType &rGeometry, const int PolynomialDegree, const NurbsInterval DomainInterval, const std::vector< NurbsInterval > &rKnotSpanIntervals, const double Tolerance)
Definition: curve_tessellation.h:68
static void GetClosestPoint(const CoordinatesArrayType &rPointGlobalCoordinates, CoordinatesArrayType &rClosestPointGlobalCoordinates, CoordinatesArrayType &rClosestPointLocalCoordinates, const TessellationType &rTesselation)
Definition: curve_tessellation.h:318
bool Is(Flags const &rOther) const
Definition: flags.h:274
KratosGeometryType
Definition: geometry_data.h:110
KratosGeometryFamily
Definition: geometry_data.h:91
Geometry base class.
Definition: geometry.h:71
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
void SetGeometryData(GeometryData const *pGeometryData)
updates the pointer to GeometryData of the respective geometry.
Definition: geometry.h:3878
SizeType LocalSpaceDimension() const
Definition: geometry.h:1300
std::size_t SizeType
Definition: geometry.h:144
std::size_t IndexType
Definition: geometry.h:137
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
virtual SizeType PolynomialDegree(IndexType LocalDirectionIndex) const
Return polynomial degree of the geometry in a certain direction.
Definition: geometry.h:1310
virtual void CreateQuadraturePointGeometries(GeometriesArrayType &rResultGeometries, IndexType NumberOfShapeFunctionDerivatives, const IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo)
Definition: geometry.h:2331
GeometryData const & GetGeometryData() const
GeometryData contains all information about dimensions and has a set of precomputed values for integr...
Definition: geometry.h:942
Integration information for the creation of integration points.
Definition: integration_info.h:35
static void CreateIntegrationPoints1D(IntegrationPointsArrayType &rIntegrationPoints, const std::vector< double > &rSpansLocalSpace, const IntegrationInfo &rIntegrationInfo)
Definition: integration_point_utilities.cpp:18
Class for optimized use of intervals.
Definition: nurbs_interval.h:36
bool IsInside(double &ParameterT) const
Definition: nurbs_interval.h:143
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
size_type size() const
Definition: pointer_vector.h:255
void resize(size_type dim)
Definition: pointer_vector.h:314
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
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
#define KRATOS_DEBUG_ERROR_IF(conditional)
Definition: exception.h:171
end
Definition: DEM_benchmarks.py:180
static double max(double a, double b)
Definition: GeometryFunctions.h:79
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
def Index()
Definition: hdf5_io_tools.py:38
def load(f)
Definition: ode_solve.py:307
int j
Definition: quadrature.py:648
float temp
Definition: rotating_cone.py:85
integer i
Definition: TensorModule.f:17
e
Definition: run_cpp_mpi_tests.py:31