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.
projection_3D_2D_mapper.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: Vicente Mataix Ferrandiz
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
26 
27 namespace Kratos
28 {
31 
35 
36 // Geometric definitions
37 using NodeType = Node;
38 using GeometryType = Geometry<NodeType>;
39 
43 
47 
53 GeometryType::Pointer GetGeometryFromModelPart(const ModelPart& rModelPart)
54 {
55  return (rModelPart.NumberOfElements() > 0 ? rModelPart.ElementsBegin()->pGetGeometry() : rModelPart.NumberOfConditions() > 0 ? rModelPart.ConditionsBegin()->pGetGeometry() : nullptr);
56 }
57 
64 {
65  // Get partition with entities
66  auto p_geometry = GetGeometryFromModelPart(rModelPart);
67  const int partition_entity = (p_geometry != nullptr) ? rModelPart.GetCommunicator().GetDataCommunicator().Rank() : -1;
68  return rModelPart.GetCommunicator().GetDataCommunicator().MaxAll(partition_entity);
69 }
70 
77 {
78  // Getting local space dimension
79  auto p_geometry = GetGeometryFromModelPart(rModelPart);
80  const unsigned int local_space_dimension = (p_geometry == nullptr) ? 0 : p_geometry->LocalSpaceDimension();
81  return rModelPart.GetCommunicator().GetDataCommunicator().MaxAll(local_space_dimension);
82 }
83 
90 ModelPart& Determine2DModelPart(ModelPart& rFirstModelPart, ModelPart& rSecondModelPart)
91 {
92  // Getting the maximum local space dimension
93  const unsigned int max_local_space_dimension_1 = DetermineModelPartMaximumLocalDimension(rFirstModelPart);
94  const unsigned int max_local_space_dimension_2 = DetermineModelPartMaximumLocalDimension(rSecondModelPart);
95  KRATOS_ERROR_IF(max_local_space_dimension_1 == 3 && max_local_space_dimension_2 == 3) << "Both model parts are 3D" << std::endl;
96  KRATOS_ERROR_IF(max_local_space_dimension_1 == 1 || max_local_space_dimension_2 == 1) << "One model part is 1D, not compatible" << std::endl;
97  KRATOS_ERROR_IF(max_local_space_dimension_1 == 0 || max_local_space_dimension_2 == 0) << "Impossible to determine local space dimension in at least one model part" << std::endl;
98  if (max_local_space_dimension_1 == 2) {
99  return rFirstModelPart;
100  } else if (max_local_space_dimension_2 == 2) {
101  return rSecondModelPart;
102  } else { // Corner case a priori impossible
103  KRATOS_ERROR << "Impossible to detect 2D model part" << std::endl;
104  }
105  return rFirstModelPart;
106 }
107 
115 ModelPart& Determine3DModelPart(ModelPart& rFirstModelPart, ModelPart& rSecondModelPart)
116 {
117  // Getting the maximum local space dimension
118  const unsigned int max_local_space_dimension_1 = DetermineModelPartMaximumLocalDimension(rFirstModelPart);
119  const unsigned int max_local_space_dimension_2 = DetermineModelPartMaximumLocalDimension(rSecondModelPart);
120  KRATOS_ERROR_IF(max_local_space_dimension_1 == 3 && max_local_space_dimension_2 == 3) << "Both model parts are 3D" << std::endl;
121  KRATOS_ERROR_IF(max_local_space_dimension_1 == 1 || max_local_space_dimension_2 == 1) << "One model part is 1D, not compatible" << std::endl;
122  KRATOS_ERROR_IF(max_local_space_dimension_1 == 0 || max_local_space_dimension_2 == 0) << "Impossible to determine local space dimension in at least one model part" << std::endl;
123  if (max_local_space_dimension_1 == 3) {
124  return rFirstModelPart;
125  } else if (max_local_space_dimension_2 == 3) {
126  return rSecondModelPart;
127  } else { // Corner case a priori impossible
128  KRATOS_ERROR << "Impossible to detect 3D model part" << std::endl;
129  }
130  return rFirstModelPart;
131 }
132 
136 
143 template<class TSparseSpace, class TDenseSpace, class TMapperBackend>
145  : public InterpolativeMapperBase<TSparseSpace, TDenseSpace, TMapperBackend>
146 {
147 public:
150 
153 
159 
161  typedef typename TMapperBackend::InterfaceCommunicatorType InterfaceCommunicatorType;
163 
168 
172 
176  enum class EntityTypeMesh
177  {
178  NONE,
179  CONDITIONS,
180  ELEMENTS
181  };
182 
186 
187  // Default constructor, needed for registration
189  ModelPart& rModelPartOrigin,
190  ModelPart& rModelPartDestination
191  ) : BaseType(rModelPartOrigin, rModelPartDestination),
192  // NOTE: TO AVOID ERROR AT REGISTER
193  mr2DModelPart(rModelPartOrigin),
194  mr3DModelPart(rModelPartDestination)
195  {
196  }
197 
198  // Constructor with settings
200  ModelPart& rModelPartOrigin,
201  ModelPart& rModelPartDestination,
202  Parameters JsonParameters
203  ) : BaseType(rModelPartOrigin, rModelPartDestination, JsonParameters),
204  mr2DModelPart(Determine2DModelPart(rModelPartOrigin, rModelPartDestination)),
205  mr3DModelPart(Determine3DModelPart(rModelPartOrigin, rModelPartDestination))
206  {
207  KRATOS_TRY;
208 
209  // Validate input
210  this->ValidateInput();
211 
212  // Copying parameters
213  mCopiedParameters = JsonParameters.Clone();
214 
215  // Checking if the 2D modelpart is the origin model part
216  CheckOriginIs2D();
217 
218  // Type of metamapper considered
219  mMetaMapperType = mCopiedParameters["base_mapper"].GetString();
220 
221  // Pre mapper creation operations when model part of origin is 2D
222  if (mOriginIs2D) {
223  // Type of mesh entity considered
224  GetEntityMeshType();
225 
226  // Getting the normal and reference plane
227  GetNormalAndReferencePlane();
228 
229  // Move mesh
230  MoveModelParts();
231  }
232 
233  // Cleaning the parameters
234  mCopiedParameters.RemoveValue("base_mapper");
235 
236  // Initializing the base mapper
237  CreateBaseMapper();
238 
239  // Post mapper creation operations when model part of origin is 2D
240  if (mOriginIs2D) {
241  // Unmove mesh
242  UnMoveModelParts();
243  }
244 
245  // Calling initialize
246  this->Initialize();
247 
248  // Now we copy the mapping matrix
249  BaseType::mpMappingMatrix = Kratos::make_unique<TMappingMatrixType>(mpBaseMapper->GetMappingMatrix());
250 
251  KRATOS_CATCH("");
252  }
253 
255  ~Projection3D2DMapper() override = default;
256 
260 
264 
275  Kratos::Flags MappingOptions,
276  double SearchRadius
277  ) override
278  {
279  KRATOS_TRY;
280 
281  // Pre mapper creation operations when model part of origin is 2D
282  if (mOriginIs2D) {
283  // Move mesh
284  MoveModelParts();
285  }
286 
287  // Initializing the base mapper
288  CreateBaseMapper();
289 
290  // Update interface base mapper
291  mpBaseMapper->UpdateInterface(MappingOptions, SearchRadius);
292 
293  // Post mapper creation operations when model part of origin is 2D
294  if (mOriginIs2D) {
295  // Unmove mesh
296  UnMoveModelParts();
297  }
298 
299  // Calling initialize
300  BaseType::UpdateInterface(MappingOptions, SearchRadius);
301 
302  // Now we copy the mapping matrix
303  BaseType::mpMappingMatrix = Kratos::make_unique<TMappingMatrixType>(mpBaseMapper->GetMappingMatrix());
304 
305  KRATOS_CATCH("");
306  }
307 
316  ModelPart& rModelPartOrigin,
317  ModelPart& rModelPartDestination,
318  Parameters JsonParameters
319  ) const override
320  {
321  KRATOS_TRY;
322 
323  return Kratos::make_unique<Projection3D2DMapper<TSparseSpace, TDenseSpace, TMapperBackend>>(rModelPartOrigin, rModelPartDestination, JsonParameters);
324 
325  KRATOS_CATCH("");
326  }
327 
331 
337  {
338  return mr2DModelPart;
339  }
340 
346  {
347  return mr3DModelPart;
348  }
349 
353 
357 
358 
362 
364  std::string Info() const override
365  {
366  return "Projection3D2DMapper";
367  }
368 
370  void PrintInfo(std::ostream& rOStream) const override
371  {
372  rOStream << "Projection3D2DMapper";
373  }
374 
376  void PrintData(std::ostream& rOStream) const override
377  {
378  BaseType::PrintData(rOStream);
379  }
380 
381 private:
384 
388 
389  ModelPart& mr2DModelPart;
390  ModelPart& mr3DModelPart;
391  BaseMapperUniquePointerType mpBaseMapper;
392  array_1d<double, 3> mNormalPlane;
393  Point mPointPlane;
394  Parameters mCopiedParameters;
395  std::string mMetaMapperType;
396  EntityTypeMesh mEntityTypeMesh;
397  bool mOriginIs2D;
398 
402 
406  void CheckOriginIs2D()
407  {
408  KRATOS_TRY;
409 
410  const auto* p_origin_model_part = &(this->GetOriginModelPart());
411  const auto* p_2d_model_part = &(this->Get2DModelPart());
412  mOriginIs2D = p_origin_model_part == p_2d_model_part ? true : false;
413 
414  KRATOS_CATCH("");
415  }
416 
420  void GetEntityMeshType()
421  {
422  KRATOS_TRY;
423 
424  // A priori in the constructor we have already checked that the 2D is not empty
425  const auto& r_2d_model_part = this->Get2DModelPart();
426  if (r_2d_model_part.NumberOfConditions() > 0) {
427  mEntityTypeMesh = EntityTypeMesh::CONDITIONS;
428  } else if (r_2d_model_part.NumberOfElements() > 0) {
429  mEntityTypeMesh = EntityTypeMesh::ELEMENTS;
430  } else {
431  mEntityTypeMesh = EntityTypeMesh::NONE; // Enum is zero, will be used to check if not elements/conditions in MPI
432  }
433 
434  KRATOS_CATCH("");
435  }
436 
440  void GetNormalAndReferencePlane()
441  {
442  KRATOS_TRY;
443 
444  // We retrieve the values of interest
445  const auto& r_2d_model_part = this->Get2DModelPart();
446  const bool is_distributed = r_2d_model_part.IsDistributed();
447  auto p_geometry = GetGeometryFromModelPart(r_2d_model_part);
448 
449  // MPI data
450  const auto& r_communicator = r_2d_model_part.GetCommunicator();
451  const auto& r_data_communicator = r_communicator.GetDataCommunicator();
452  const int mpi_rank = r_data_communicator.Rank();
453  const int mpi_size = r_data_communicator.Size();
454 
455  // Getting the partition with entities index
456  const int partition_entity = DeterminePartitionWithEntities(r_2d_model_part);
457 
458  // Define the send tag
459  const int tag_send_normal = 1;
460  const int tag_send_point = 2;
461 
462  // Getting from parameters if not elements or conditions
463  if (partition_entity != mpi_rank) {
464  // Now transfer the normal plane and the point plane between partitions
465  if (is_distributed) {
466  // The partitions that receive
467  r_data_communicator.Recv(mNormalPlane, partition_entity, tag_send_normal);
468  r_data_communicator.Recv(mPointPlane.Coordinates(), partition_entity, tag_send_point);
469  }
470  } else {
472  noalias(mPointPlane.Coordinates()) = p_geometry->Center();
473  p_geometry->PointLocalCoordinates(aux_coords, mPointPlane);
474  noalias(mNormalPlane) = p_geometry->UnitNormal(aux_coords);
475 
476  // Doing a check that all normals are aligned
477  std::size_t check_normal;
478  const double numerical_limit = std::numeric_limits<double>::epsilon() * 1.0e4;
479  struct normal_check {
480  normal_check(array_1d<double, 3>& rNormal) : reference_normal(rNormal) {};
481  array_1d<double, 3> reference_normal;
483  };
484  if (mEntityTypeMesh == EntityTypeMesh::CONDITIONS) {
485  check_normal = block_for_each<SumReduction<std::size_t>>(r_2d_model_part.Conditions(), normal_check(mNormalPlane), [&numerical_limit](auto& r_cond, normal_check& nc) {
486  auto& r_geom = r_cond.GetGeometry();
487  r_geom.PointLocalCoordinates(nc.aux_coords, r_geom.Center());
488  const auto normal = r_geom.UnitNormal(nc.aux_coords);
489  return (norm_2(normal - nc.reference_normal) > numerical_limit);
490  });
491  } else {
492  check_normal = block_for_each<SumReduction<std::size_t>>(r_2d_model_part.Elements(), normal_check(mNormalPlane), [&numerical_limit](auto& r_elem, normal_check& nc) {
493  auto& r_geom = r_elem.GetGeometry();
494  r_geom.PointLocalCoordinates(nc.aux_coords, r_geom.Center());
495  const auto normal = r_geom.UnitNormal(nc.aux_coords);
496  return (norm_2(normal - nc.reference_normal) > numerical_limit);
497  });
498  }
499  KRATOS_ERROR_IF_NOT(check_normal == 0) << "The 2D reference model part has not consistent normals. Please check that is properly aligned" << std::endl;
500 
501  // The partition that sends
502  if (is_distributed) {
503  const auto& r_point_coordinates = mPointPlane.Coordinates();
504  for (int i_rank = 0; i_rank < mpi_size; ++i_rank) {
505  if (i_rank != partition_entity) {
506  r_data_communicator.Send(mNormalPlane, i_rank, tag_send_normal);
507  r_data_communicator.Send(r_point_coordinates, i_rank, tag_send_point);
508  }
509  }
510  }
511  }
512 
513  KRATOS_CATCH("");
514  }
515 
519  void CreateBaseMapper()
520  {
521  KRATOS_TRY;
522 
523  // Model parts
524  auto& r_origin_model_part = this->GetOriginModelPart();
525  auto& r_destination_model_part = this->GetDestinationModelPart();
526 
527  // Creating the base mapper
528  if (mMetaMapperType == "nearest_neighbor") {
529  if (mCopiedParameters.Has("interpolation_type")) mCopiedParameters.RemoveValue("interpolation_type");
530  if (mCopiedParameters.Has("local_coord_tolerance")) mCopiedParameters.RemoveValue("local_coord_tolerance");
531  mpBaseMapper = Kratos::make_unique<NearestNeighborMapperType>(r_origin_model_part, r_destination_model_part, mCopiedParameters);
532  } else if (mMetaMapperType == "nearest_element") {
533  if (mCopiedParameters.Has("interpolation_type")) mCopiedParameters.RemoveValue("interpolation_type");
534  mpBaseMapper = Kratos::make_unique<NearestElementMapperType>(r_origin_model_part, r_destination_model_part, mCopiedParameters);
535  } else if (mMetaMapperType == "barycentric") {
536  mpBaseMapper = Kratos::make_unique<BarycentricMapperType>(r_origin_model_part, r_destination_model_part, mCopiedParameters);
537  } else {
538  KRATOS_ERROR << "Mapper " << mCopiedParameters["base_mapper"].GetString() << " is not available as base mapper for projection" << std::endl;
539  }
540 
541  KRATOS_CATCH("");
542  }
543 
548  void MoveModelParts()
549  {
550  KRATOS_TRY;
551 
552  // The 3D model part
553  auto& r_3d_model_part = this->Get3DModelPart();
554 
555  // Save current configuration
557 
558  // Definition of projection variables
559  struct ProjectionVariables
560  {
561  ProjectionVariables(array_1d<double, 3>& rNormal, Point& rPoint) : reference_normal(rNormal), reference_point(rPoint) {};
562  array_1d<double, 3> reference_normal;
563  Point reference_point;
564  double distance;
565  array_1d<double, 3> projected_point_coordinates;
566  };
567 
568  // Iterate over the existing nodes
569  block_for_each(r_3d_model_part.Nodes(), ProjectionVariables(mNormalPlane, mPointPlane), [&](auto& r_node, ProjectionVariables& p) {
570  noalias(p.projected_point_coordinates) = GeometricalProjectionUtilities::FastProject(p.reference_point, r_node, p.reference_normal, p.distance).Coordinates();
571  noalias(r_node.Coordinates()) = p.projected_point_coordinates;
572  });
573 
574  KRATOS_CATCH("");
575  }
576 
580  void UnMoveModelParts()
581  {
582  KRATOS_TRY;
583 
584  // The 3D model part
585  auto& r_3d_model_part = this->Get3DModelPart();
586 
587  // Restore configuration
589 
590  KRATOS_CATCH("");
591  }
592 
593  // Functions for customizing the behavior of this Mapper
594  void CreateMapperLocalSystems(
595  const Communicator& rModelPartCommunicator,
596  std::vector<Kratos::unique_ptr<MapperLocalSystem>>& rLocalSystems
597  ) override
598  {
599  // Calling base mapper method. But not sure if this must be changed
600  AccessorInterpolativeMapperBase<TMapperBackend>::CreateMapperLocalSystems(*mpBaseMapper, rModelPartCommunicator, rLocalSystems);
601  }
602 
603  MapperInterfaceInfoUniquePointerType GetMapperInterfaceInfo() const override
604  {
606  }
607 
608  Parameters GetMapperDefaultSettings() const override
609  {
610  return Parameters( R"({
611  "search_settings" : {},
612  "echo_level" : 0,
613  "interpolation_type" : "unspecified",
614  "local_coord_tolerance" : 0.25,
615  "use_initial_configuration" : false,
616  "print_pairing_status_to_file" : false,
617  "pairing_status_file_path" : "",
618  "base_mapper" : "nearest_neighbor"
619  })");
620  }
621 
623 
624 }; // Class Projection3D2DMapper
625 
627 } // namespace Kratos.
static MapperInterfaceInfoUniquePointerType GetMapperInterfaceInfo(const TMapper &rMapper)
Definition: interpolative_mapper_base.h:70
static void CreateMapperLocalSystems(TMapper &rMapper, const Communicator &rModelPartCommunicator, std::vector< Kratos::unique_ptr< MapperLocalSystem >> &rLocalSystems)
Definition: interpolative_mapper_base.h:60
Barycentric Mapper.
Definition: barycentric_mapper.h:111
virtual const DataCommunicator & GetDataCommunicator() const
Definition: communicator.cpp:340
virtual int Rank() const
Get the parallel rank for this DataCommunicator.
Definition: data_communicator.h:587
Definition: flags.h:58
static TPointClass3 FastProject(const TPointClass1 &rPointOrigin, const TPointClass2 &rPointToProject, const array_1d< double, 3 > &rNormal, double &rDistance)
Project a point over a plane (avoiding some steps)
Definition: geometrical_projection_utilities.h:135
PointType::CoordinatesArrayType CoordinatesArrayType
Definition: geometry.h:147
Kratos::unique_ptr< MapperInterfaceInfo > MapperInterfaceInfoUniquePointerType
Definition: interface_communicator.h:53
Definition: interpolative_mapper_base.h:81
ModelPart & GetDestinationModelPart()
This function destination model part.
Definition: interpolative_mapper_base.h:331
ModelPart & GetOriginModelPart()
This function origin model part.
Definition: interpolative_mapper_base.h:322
void Initialize()
Initializing the Mapper This has to be called in the constructor of the derived classes,...
Definition: interpolative_mapper_base.h:262
void ValidateInput()
Definition: interpolative_mapper_base.h:271
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: interpolative_mapper_base.h:245
TMappingMatrixUniquePointerType mpMappingMatrix
Definition: interpolative_mapper_base.h:254
void UpdateInterface(Kratos::Flags MappingOptions, double SearchRadius) override
Updates the mapping-system after the geometry/mesh has changed After changes in the topology (e....
Definition: interpolative_mapper_base.h:137
Base Class for all Mappers.
Definition: mapper.h:43
TSparseSpace::MatrixType TMappingMatrixType
Definition: mapper.h:55
Kratos::unique_ptr< Mapper > MapperUniquePointerType
Definition: mapper.h:53
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
Communicator & GetCommunicator()
Definition: model_part.h:1821
SizeType NumberOfElements(IndexType ThisIndex=0) const
Definition: model_part.h:1027
SizeType NumberOfConditions(IndexType ThisIndex=0) const
Definition: model_part.h:1218
Interpolative Mapper.
Definition: nearest_element_mapper.h:186
Nearest Neighbor Mapper.
Definition: nearest_neighbor_mapper.h:139
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
bool RemoveValue(const std::string &rEntry)
This method removes an entry of the Parameters given a certain key.
Definition: kratos_parameters.cpp:482
Parameters Clone() const
Generates a clone of the current document.
Definition: kratos_parameters.cpp:397
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
bool Has(const std::string &rEntry) const
This method checks if the Parameter contains a certain entry.
Definition: kratos_parameters.cpp:520
Point class.
Definition: point.h:59
CoordinatesArrayType const & Coordinates() const
Definition: point.h:215
This mapper simplifies the mapping between two model parts thanks to the projection over a reference ...
Definition: projection_3D_2D_mapper.h:146
KRATOS_CLASS_POINTER_DEFINITION(Projection3D2DMapper)
Pointer definition of Projection3D2DMapper.
InterfaceCommunicator::MapperInterfaceInfoUniquePointerType MapperInterfaceInfoUniquePointerType
Definition: projection_3D_2D_mapper.h:162
Projection3D2DMapper(ModelPart &rModelPartOrigin, ModelPart &rModelPartDestination, Parameters JsonParameters)
Definition: projection_3D_2D_mapper.h:199
ModelPart & Get2DModelPart()
This method returns the 2D model part.
Definition: projection_3D_2D_mapper.h:336
InterpolativeMapperBase< TSparseSpace, TDenseSpace, TMapperBackend > BaseType
BaseType definitions.
Definition: projection_3D_2D_mapper.h:155
ModelPart & Get3DModelPart()
This method returns the 3D model part.
Definition: projection_3D_2D_mapper.h:345
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: projection_3D_2D_mapper.h:376
~Projection3D2DMapper() override=default
Destructor.
NearestNeighborMapper< TSparseSpace, TDenseSpace, TMapperBackend > NearestNeighborMapperType
Other mappers definition.
Definition: projection_3D_2D_mapper.h:165
std::string Info() const override
Turn back information as a string.
Definition: projection_3D_2D_mapper.h:364
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: projection_3D_2D_mapper.h:370
BaseType::MapperUniquePointerType MapperUniquePointerType
Definition: projection_3D_2D_mapper.h:158
BaseType::TMappingMatrixType TMappingMatrixType
Definition: projection_3D_2D_mapper.h:157
Kratos::unique_ptr< BaseType > BaseMapperUniquePointerType
Definition: projection_3D_2D_mapper.h:156
BarycentricMapper< TSparseSpace, TDenseSpace, TMapperBackend > BarycentricMapperType
Definition: projection_3D_2D_mapper.h:167
void UpdateInterface(Kratos::Flags MappingOptions, double SearchRadius) override
Updates the mapping-system after the geometry/mesh has changed After changes in the topology (e....
Definition: projection_3D_2D_mapper.h:274
TMapperBackend::InterfaceCommunicatorType InterfaceCommunicatorType
Interface definitions.
Definition: projection_3D_2D_mapper.h:161
EntityTypeMesh
Entity type mesh considered.
Definition: projection_3D_2D_mapper.h:177
Projection3D2DMapper(ModelPart &rModelPartOrigin, ModelPart &rModelPartDestination)
Definition: projection_3D_2D_mapper.h:188
MapperUniquePointerType Clone(ModelPart &rModelPartOrigin, ModelPart &rModelPartDestination, Parameters JsonParameters) const override
Cloning the Mapper returns a clone of the current Mapper pure virtual, has to be implemented in every...
Definition: projection_3D_2D_mapper.h:315
NearestElementMapper< TSparseSpace, TDenseSpace, TMapperBackend > NearestElementMapperType
Definition: projection_3D_2D_mapper.h:166
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
void SaveCurrentConfiguration(ModelPart &rModelPart)
Definition: mapper_utilities.cpp:280
void RestoreCurrentConfiguration(ModelPart &rModelPart)
Definition: mapper_utilities.cpp:291
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
GeometryType::Pointer GetGeometryFromModelPart(const ModelPart &rModelPart)
This method retrieves the first geometry from a model part.
Definition: projection_3D_2D_mapper.h:53
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
ModelPart & Determine2DModelPart(ModelPart &rFirstModelPart, ModelPart &rSecondModelPart)
This method determines the 2D model part.
Definition: projection_3D_2D_mapper.h:90
void block_for_each(TIterator itBegin, TIterator itEnd, TFunction &&rFunction)
Execute a functor on all items of a range in parallel.
Definition: parallel_utilities.h:299
std::unique_ptr< T > unique_ptr
Definition: smart_pointers.h:33
ModelPart & Determine3DModelPart(ModelPart &rFirstModelPart, ModelPart &rSecondModelPart)
This method determines the 3D model part.
Definition: projection_3D_2D_mapper.h:115
Geometry< Node > GeometryType
The definition of the geometry.
Definition: mortar_classes.h:37
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
int DeterminePartitionWithEntities(const ModelPart &rModelPart)
This method determines the partition where the model part has at least one entity.
Definition: projection_3D_2D_mapper.h:63
unsigned int DetermineModelPartMaximumLocalDimension(ModelPart &rModelPart)
This method determines maximum local space dimension of a ModelPart.
Definition: projection_3D_2D_mapper.h:76
is_distributed
Definition: convergence_accelerator_factory.py:10
p
Definition: sensitivityMatrix.py:52