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.
simple_mortar_mapper_process.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 #include <unordered_map>
17 
18 // External includes
19 
20 // Project includes
21 #include "processes/process.h"
23 #include "includes/model_part.h"
25 #include "spaces/ublas_space.h"
29 
30 /* Tree structures */
32 #include "spatial_containers/spatial_containers.h" // kd-tree
33 
34 namespace Kratos
35 {
38 
42 
44  using SizeType = std::size_t;
45 
49 
53 
57 
70 template< const SizeType TDim, const SizeType TNumNodes, class TVarType, const SizeType TNumNodesMaster = TNumNodes>
71 class KRATOS_API(KRATOS_CORE) SimpleMortarMapperProcess
72  : public Process
73 {
74 public:
77 
78  // DEFINITION OF FLAGS TO CONTROL THE BEHAVIOUR
79  KRATOS_DEFINE_LOCAL_FLAG(AVERAGE_NORMAL);
80  KRATOS_DEFINE_LOCAL_FLAG(DISCONTINOUS_INTERFACE);
81  KRATOS_DEFINE_LOCAL_FLAG(ORIGIN_IS_HISTORICAL);
82  KRATOS_DEFINE_LOCAL_FLAG(DESTINATION_IS_HISTORICAL);
83  KRATOS_DEFINE_LOCAL_FLAG(ORIGIN_SKIN_IS_CONDITION_BASED);
84  KRATOS_DEFINE_LOCAL_FLAG(DESTINATION_SKIN_IS_CONDITION_BASED);
85  KRATOS_DEFINE_LOCAL_FLAG(CONSIDER_TESELLATION);
86 
89 
91  using PointType = Point;
92 
95 
98 
101 
104 
107 
110 
113 
116 
119 
122 
125 
127  using IndexType = std::size_t;
128 
130  using IntMap = std::unordered_map<IndexType, IndexType>;
131 
134 
137  using PointTypePointer = typename PointMapperType::Pointer;
138  using PointVector = std::vector<PointTypePointer>;
139 
140  // KDtree definitions
143 
149 
151  struct TLS {
152  MortarKinematicVariablesType this_kinematic_variables; // Create and initialize condition variables:
153  MortarOperatorType this_mortar_operators; // Create the mortar operators
154  ExactMortarIntegrationUtilityType integration_utility; // We call the exact integration utility
155  };
156 
160 
169  ModelPart& rOriginModelPart,
170  ModelPart& rDestinationModelPart,
171  Parameters ThisParameters = Parameters(R"({})" ),
172  LinearSolverType::Pointer pThisLinearSolver = nullptr
173  );
174 
184  ModelPart& rOriginModelPart,
185  ModelPart& rDestinationModelPart,
186  TVarType& rThisVariable,
187  Parameters ThisParameters = Parameters(R"({})" ),
188  LinearSolverType::Pointer pThisLinearSolver = nullptr
189  );
190 
201  ModelPart& rOriginModelPart,
202  ModelPart& rDestinationModelPart,
203  TVarType& rOriginVariable,
204  TVarType& rDestinationVariable,
205  Parameters ThisParameters = Parameters(R"({})" ),
206  LinearSolverType::Pointer pThisLinearSolver = nullptr
207  );
208 
210  ~SimpleMortarMapperProcess() override = default;
211 
215 
219 
223 
227 
231 
232  void operator()()
233  {
234  Execute();
235  }
236 
240 
244  void Execute() override;
245 
249  void ExecuteInitializeSolutionStep() override;
250 
257  void Map(
258  TVarType& rOriginVariable,
259  TVarType& rDestinationVariable,
260  const Flags Flag = Flags()
261  )
262  {
263  // Reassign the variables
264  mpOriginVariable = &rOriginVariable;
265  mpDestinationVariable = &rDestinationVariable;
266 
267  // Execute the process
268  Execute();
269  }
270 
274  const Parameters GetDefaultParameters() const override;
275 
279 
283 
287 
289  std::string Info() const override
290  {
291  return "SimpleMortarMapperProcess";
292  }
293 
295  void PrintInfo(std::ostream& rOStream) const override
296  {
297  rOStream << "SimpleMortarMapperProcess";
298  }
299 
301  void PrintData(std::ostream& rOStream) const override
302  {
303  }
304 
308 
310 private:
316 
317  ModelPart& mOriginModelPart;
318  ModelPart& mDestinationModelPart;
319  const TVarType* mpOriginVariable;
320  const TVarType* mpDestinationVariable;
321 
322  double mMappingCoefficient = 1.0;
323  Flags mOptions;
324 
325  unsigned int mEchoLevel = 0;
326  Parameters mThisParameters;
327 
328  LinearSolverType::Pointer mpThisLinearSolver;
329 
333 
337 
341  void CheckAndPerformSearch();
342 
346  void ResetNodalArea();
347 
351  double GetReferenceArea();
352 
364  void AssemblyMortarOperators(
365  const std::vector<array_1d<PointType,TDim>>& rGeometricalObjectsPointSlave,
366  const GeometryType& rSlaveGeometry,
367  const GeometryType& rMasterGeometry,
368  const array_1d<double, 3>& rMasterNormal,
369  MortarKinematicVariablesType& rThisKinematicVariables,
370  MortarOperatorType& rThisMortarOperators,
371  const IntegrationMethod& rThisIntegrationMethod,
372  const BoundedMatrixType Ae = IdentityMatrix(TNumNodes)
373  );
374 
383  static inline BoundedMatrixType CalculateAe(
384  GeometryType& rSlaveGeometry,
385  MortarKinematicVariablesType& rThisKinematicVariables,
386  std::vector<array_1d<PointType,TDim>>& rConditionsPointsSlave,
387  const IntegrationMethod& rThisIntegrationMethod
388  );
389 
395  static inline BoundedMatrixType InvertDiagonalMatrix(const BoundedMatrixType& rInputMatrix);
396 
402  static inline void InvertDiagonalMatrix(
403  const BoundedMatrixType& rInputMatrix,
404  BoundedMatrixType& rInvertedMatrix
405  );
406 
411  void LumpMatrix(BoundedMatrixType& rInputMatrix);
412 
417  void GetSystemSize(SizeType& rSizeSystem);
418 
425  void CreateSlaveConectivityDatabase(
426  SizeType& rSizeSystem,
427  IntMap& rConectivityDatabase,
428  IntMap& rInverseConectivityDatabase
429  );
430 
435  IntegrationMethod GetIntegrationMethod();
436 
442  bool CheckWholeVector(std::vector<bool>& rVectorToCheck);
443 
451  void ComputeResidualMatrix(
452  Matrix& rResidualMatrix,
453  const GeometryType& rSlaveGeometry,
454  const GeometryType& rMasterGeometry,
455  const MortarOperatorType& rThisMortarOperators
456  );
457 
468  void AssembleRHSAndLHS(
469  MatrixType& rA,
470  std::vector<VectorType>& rb,
471  const SizeType VariableSize,
472  const Matrix& rResidualMatrix,
473  const GeometryType& rSlaveGeometry,
474  IntMap& rInverseConectivityDatabase,
475  const MortarOperatorType& rThisMortarOperators
476  );
477 
486  void AssembleRHS(
487  std::vector<VectorType>& rb,
488  const SizeType VariableSize,
489  const Matrix& rResidualMatrix,
490  const GeometryType& rSlaveGeometry,
491  IntMap& rInverseConectivityDatabase
492  );
493 
497  void ExecuteExplicitMapping();
498 
502  void ExecuteImplicitMapping();
503 
518  template<class TClassType, bool TImplicit = false>
519  void PerformMortarOperations(
520  MatrixType& rA,
521  std::vector<VectorType>& rb,
522  IntMap& rInverseConectivityDatabase,
523  typename TClassType::Pointer pIndexesPairs,
524  GeometricalObject& rGeometricalObject,
525  ExactMortarIntegrationUtilityType& rIntegrationUtility,
526  MortarKinematicVariablesType& rThisKineticVariables,
527  MortarOperatorType& rThisMortarOperators,
528  const IndexType Iteration
529  )
530  {
531  // The root model part
532  ModelPart& r_root_model_part = mOriginModelPart.GetRootModelPart();
533 
534  // Getting the auxiliar variable
535  const TVarType& r_aux_variable = KratosComponents<TVarType>::Get(MortarUtilities::GetAuxiliarVariable<TVarType>());
536 
537  // Indexes of the pair to be removed
538  std::vector<IndexType> indexes_to_remove, geometrical_objects_to_erase;
539 
540  // Getting discontinous factor
541  const double discontinous_interface_factor = mOptions.Is(DISCONTINOUS_INTERFACE) ? mThisParameters["discontinous_interface_factor"].GetDouble() : 1.0;
542 
543  // Declare auxiliar coordinates
545 
546  // Geometrical values
547  auto& r_slave_geometry = rGeometricalObject.GetGeometry();
548  r_slave_geometry.PointLocalCoordinates(aux_coords, r_slave_geometry.Center());
549  const array_1d<double, 3> slave_normal = r_slave_geometry.UnitNormal(aux_coords);
550 
551  // The model part as const to avoid race conditions
552  const auto& r_const_origin_model_part = mOriginModelPart;
553  const auto& r_const_destination_model_part = mDestinationModelPart;
554 
555  for (auto it_pair = pIndexesPairs->begin(); it_pair != pIndexesPairs->end(); ++it_pair ) {
556  const IndexType master_id = pIndexesPairs->GetId(it_pair); // MASTER
557 
558  const auto& r_master_geometry = mOptions.Is(ORIGIN_SKIN_IS_CONDITION_BASED) ? r_const_origin_model_part.GetCondition(master_id).GetGeometry() : r_const_origin_model_part.GetElement(master_id).GetGeometry();
559  r_master_geometry.PointLocalCoordinates(aux_coords, r_master_geometry.Center());
560  const array_1d<double, 3> master_normal = r_master_geometry.UnitNormal(aux_coords);
561 
562  const IntegrationMethod& r_integration_method = GetIntegrationMethod();
563 
564  // Reading integration points
565  std::vector<array_1d<PointType,TDim>> geometrical_objects_points_slave; // These are the segmentation points, with this points it is possible to create the lines or triangles used on the mapping
566  const bool is_inside = rIntegrationUtility.GetExactIntegration(r_slave_geometry, slave_normal, r_master_geometry, master_normal, geometrical_objects_points_slave);
567 
568  if (is_inside) {
569  // Initialize general variables for the current master element
570  rThisKineticVariables.Initialize();
571 
572  // Initialize the mortar operators
573  rThisMortarOperators.Initialize();
574 
575  const BoundedMatrixType Ae = CalculateAe(r_slave_geometry, rThisKineticVariables, geometrical_objects_points_slave, r_integration_method);
576 
577  AssemblyMortarOperators( geometrical_objects_points_slave, r_slave_geometry, r_master_geometry,master_normal, rThisKineticVariables, rThisMortarOperators, r_integration_method, Ae);
578 
579  /* We compute the residual */
580  const IndexType size_to_compute = MortarUtilities::SizeToCompute<TDim, TVarType>();
581  Matrix residual_matrix(TNumNodes, size_to_compute);
582  ComputeResidualMatrix(residual_matrix, r_slave_geometry, r_master_geometry, rThisMortarOperators);
583 
584  if (!TImplicit) {
585  MortarUtilities::AddValue<TVarType, MortarUtilitiesSettings::SaveAsNonHistoricalVariable>(r_slave_geometry, r_aux_variable, residual_matrix);
586  }
587 
588  // We check if DOperator is diagonal
589  if (mEchoLevel > 1) {
590  BoundedMatrixType aux_copy_D = rThisMortarOperators.DOperator;
591  LumpMatrix(aux_copy_D);
592  const BoundedMatrixType aux_diff = aux_copy_D - rThisMortarOperators.DOperator;
593  const double norm_diff = norm_frobenius(aux_diff);
594  if (norm_diff > 1.0e-4)
595  KRATOS_WARNING("D OPERATOR") << " THE MORTAR OPERATOR D IS NOT DIAGONAL" << std::endl;
596  if (mEchoLevel == 3) {
597  KRATOS_WATCH(norm_diff);
598  KRATOS_WATCH(rThisMortarOperators.DOperator);
599  }
600  }
601 
602  if (Iteration == 0) { // Just assembled the first iteration
603  if constexpr (TImplicit) {
604  /* We compute the residual and assemble */
605  const SizeType variable_size = MortarUtilities::SizeToCompute<TDim, TVarType>();
606  AssembleRHSAndLHS(rA, rb, variable_size, residual_matrix, r_slave_geometry, rInverseConectivityDatabase, rThisMortarOperators);
607  } else {
608  for (IndexType i_node = 0; i_node < TNumNodes; ++i_node) {
609  double& r_nodal_area = r_slave_geometry[i_node].GetValue(NODAL_AREA);
610  AtomicAdd(r_nodal_area, rThisMortarOperators.DOperator(i_node, i_node));
611  }
612  // In case of discontinous interface we add contribution to near nodes
613  if (mOptions.Is(DISCONTINOUS_INTERFACE)) {
614  const double element_length = r_slave_geometry.Length();
615 
616  // Iterating over nodes
617  for (IndexType i_node = 0; i_node < TNumNodes; ++i_node) {
618  const double nodal_area_contribution = rThisMortarOperators.DOperator(i_node, i_node);
619 
620  // The original node coordinates
621  const auto& r_slave_node = r_slave_geometry[i_node];
622 
623  // Iterating over other paired geometrical objects
624  const auto& r_index_masp_master = mOptions.Is(ORIGIN_SKIN_IS_CONDITION_BASED) ? r_const_origin_model_part.GetCondition(master_id).GetValue(INDEX_SET) : r_const_origin_model_part.GetElement(master_id).GetValue(INDEX_SET);
625  for (auto it_master_pair = r_index_masp_master->begin(); it_master_pair != r_index_masp_master->end(); ++it_master_pair ) {
626 
627  const IndexType auxiliar_slave_id = r_index_masp_master->GetId(it_master_pair);
628  if (rGeometricalObject.Id() != auxiliar_slave_id) {
629  GeometryType& r_auxiliar_slave_geometry = const_cast<GeometryType&>(mOptions.Is(DESTINATION_SKIN_IS_CONDITION_BASED) ? r_const_destination_model_part.GetCondition(auxiliar_slave_id).GetGeometry() : r_const_destination_model_part.GetElement(auxiliar_slave_id).GetGeometry());
630 
631  for (IndexType j_node = 0; j_node < TNumNodes; ++j_node) {
632  // The auxiliary node distance
633  auto& r_auxiliary_slave_node = r_auxiliar_slave_geometry[j_node];
634  const double distance = r_auxiliary_slave_node.Distance(r_slave_node);
635  const double contribution_coeff = 1.0/std::pow((1.0 + distance/(discontinous_interface_factor * element_length)), 2);
636 
637  double& r_nodal_area = r_auxiliary_slave_node.GetValue(NODAL_AREA);
638  AtomicAdd(r_nodal_area, contribution_coeff * nodal_area_contribution);
639  }
640  }
641  }
642  }
643  }
644  }
645  } else if constexpr (TImplicit) {
646  const SizeType variable_size = MortarUtilities::SizeToCompute<TDim, TVarType>();
647  AssembleRHS(rb, variable_size, residual_matrix, r_slave_geometry, rInverseConectivityDatabase);
648  }
649  } else { // NOTE: The geometrical object considered maybe is to tight
650  indexes_to_remove.push_back(master_id);
651  const IndexType other_id = pIndexesPairs->GetOtherId(it_pair);
652  if (std::is_same<TClassType, IndexMap>::value && other_id != 0) {
653  geometrical_objects_to_erase.push_back(other_id);
654  }
655  }
656  }
657 
658  // Clear indexes
659  for (IndexType i_to_remove = 0; i_to_remove < indexes_to_remove.size(); ++i_to_remove) {
660  if (mOptions.Is(ORIGIN_SKIN_IS_CONDITION_BASED)) {
661  for (auto& id : geometrical_objects_to_erase ) {
662  auto& r_cond = r_root_model_part.GetCondition(id);
663  r_cond.Set(TO_ERASE, true);
664  }
665  } else {
666  for (auto& id : geometrical_objects_to_erase ) {
667  auto& r_elem = r_root_model_part.GetElement(id);
668  r_elem.Set(TO_ERASE, true);
669  }
670  }
671  pIndexesPairs->RemoveId(indexes_to_remove[i_to_remove]);
672  }
673  }
674 
682  template<class TClassType>
683  void ClearIndexes(
684  typename TClassType::Pointer pIndexesPairs,
685  GeometricalObject& rGeometricalObject,
686  ExactMortarIntegrationUtilityType& rIntegrationUtility
687  )
688  {
689  // The root model part
690  ModelPart& r_root_model_part = mOriginModelPart.GetRootModelPart();
691 
692  // Indexes of the pair to be removed
693  std::vector<IndexType> indexes_to_remove, geometrical_objects_to_erase;
694 
695  // Declare auxiliar coordinates
697 
698  // Geometrical values
699  auto& r_slave_geometry = rGeometricalObject.GetGeometry();
700  r_slave_geometry.PointLocalCoordinates(aux_coords, r_slave_geometry.Center());
701  const array_1d<double, 3> slave_normal = r_slave_geometry.UnitNormal(aux_coords);
702 
703  // The model part as const to avoid race conditions
704  const auto& r_const_origin_model_part = mOriginModelPart;
705 
706  for (auto it_pair = pIndexesPairs->begin(); it_pair != pIndexesPairs->end(); ++it_pair ) {
707  const IndexType master_id = pIndexesPairs->GetId(it_pair); // MASTER
708 
709  const auto& r_master_geometry = mOptions.Is(ORIGIN_SKIN_IS_CONDITION_BASED) ? r_const_origin_model_part.GetCondition(master_id).GetGeometry() : r_const_origin_model_part.GetElement(master_id).GetGeometry();
710  r_master_geometry.PointLocalCoordinates(aux_coords, r_master_geometry.Center());
711  const array_1d<double, 3> master_normal = r_master_geometry.UnitNormal(aux_coords);
712 
713  // Reading integration points
714  std::vector<array_1d<PointType,TDim>> geometrical_objects_points_slave; // These are the segmentation points, with this points it is possible to create the lines or triangles used on the mapping
715  const bool is_inside = rIntegrationUtility.GetExactIntegration(r_slave_geometry, slave_normal, r_master_geometry, master_normal, geometrical_objects_points_slave);
716 
717  if (!is_inside) {
718  indexes_to_remove.push_back(master_id);
719  const IndexType other_id = pIndexesPairs->GetOtherId(it_pair);
720  if (std::is_same<TClassType, IndexMap>::value && other_id != 0) {
721  geometrical_objects_to_erase.push_back(other_id);
722  }
723  }
724  }
725 
726  // Clear indexes
727  for (IndexType i_to_remove = 0; i_to_remove < indexes_to_remove.size(); ++i_to_remove) {
728  if (mOptions.Is(ORIGIN_SKIN_IS_CONDITION_BASED)) {
729  for (auto& id : geometrical_objects_to_erase ) {
730  auto& r_cond = r_root_model_part.GetCondition(id);
731  r_cond.Set(TO_ERASE, true);
732  }
733  } else {
734  for (auto& id : geometrical_objects_to_erase ) {
735  auto& r_elem = r_root_model_part.GetElement(id);
736  r_elem.Set(TO_ERASE, true);
737  }
738  }
739  pIndexesPairs->RemoveId(indexes_to_remove[i_to_remove]);
740  }
741  }
742 
750  template<class TEntity>
751  void FillDatabase(
752  TEntity& rGeometricalObject,
753  KDTreeType& rTreePoints,
754  const SizeType AllocationSize,
755  const double SearchFactor
756  )
757  {
758  // Initialize values
759  PointVector points_found(AllocationSize);
760 
761  GeometryType& r_geometry = rGeometricalObject.GetGeometry();
762  const Point center = r_geometry.Center();
763 
764  double radius = 0.0;
765  for(IndexType i_node = 0; i_node < r_geometry.PointsNumber(); ++i_node) {
766  const array_1d<double, 3> aux_vector = center.Coordinates() - r_geometry[i_node].Coordinates();
767  const double aux_value = inner_prod(aux_vector, aux_vector);
768  if(aux_value > radius) radius = aux_value;
769  }
770 
771  const double search_radius = SearchFactor * std::sqrt(radius);
772 
773  const SizeType number_points_found = rTreePoints.SearchInRadius(center, search_radius, points_found.begin(), AllocationSize);
774 
775  if (number_points_found > 0) {
776  // In case of missing is created
777  if (!rGeometricalObject.Has(INDEX_SET))
778  rGeometricalObject.SetValue(INDEX_SET, Kratos::make_shared<IndexSet>());
779 
780  // Accessing to the index set
781  IndexSet::Pointer indexes_set = rGeometricalObject.GetValue(INDEX_SET);
782 
783  for (IndexType i_point = 0; i_point < number_points_found; ++i_point ) {
784  auto p_geometrical_object_master = points_found[i_point]->pGetObject();
785  indexes_set->AddId(p_geometrical_object_master->Id());
786  }
787  }
788  }
789 
793  void CreateInverseDatabase();
794 
800  void UpdateInterface();
801 
806 
810 
814 
817 
819  SimpleMortarMapperProcess& operator=(SimpleMortarMapperProcess const& rOther) = delete;
820 
822  //SimpleMortarMapperProcess(SimpleMortarMapperProcess const& rOther);
823 
825 };// class SimpleMortarMapperProcess
826 
830 
831 
835 
837 
838 } // namespace Kratos.
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Short class definition.
Definition: bucket.h:57
This is the definition dual lagrange multiplier operators according to the work of Alexander Popp: ht...
Definition: mortar_classes.h:1513
Definition: flags.h:58
std::size_t IndexType
Definition: flags.h:74
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
bool Is(Flags const &rOther) const
Definition: flags.h:274
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
virtual CoordinatesArrayType & PointLocalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rPoint) const
Returns the local coordinates of a given arbitrary point.
Definition: geometry.h:1854
PointType::CoordinatesArrayType CoordinatesArrayType
Definition: geometry.h:147
IndexType Id() const
Definition: indexed_object.h:107
Definition: amatrix_interface.h:41
static const TComponentType & Get(const std::string &rName)
Retrieves a component with the specified name.
Definition: kratos_components.h:114
An two node 2D line geometry with linear shape functions.
Definition: line_2d_2.h:65
Base class for all the linear solvers in Kratos.
Definition: linear_solver.h:65
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ConditionType & GetCondition(IndexType ConditionId, IndexType ThisIndex=0)
Definition: model_part.h:1313
ElementType & GetElement(IndexType ElementId, IndexType ThisIndex=0)
Definition: model_part.h:1121
ModelPart & GetRootModelPart()
Definition: model_part.cpp:510
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
double GetDouble() const
This method returns the double contained in the current Parameter.
Definition: kratos_parameters.cpp:657
Point class.
Definition: point.h:59
Custom Point container to be used by the search.
Definition: point_object.h:56
The base class for all processes in Kratos.
Definition: process.h:49
This is basic mapper of values between domains using mortar formulation.
Definition: simple_mortar_mapper_process.h:73
typename SparseSpaceType::VectorType VectorType
Type definition for vector.
Definition: simple_mortar_mapper_process.h:121
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: simple_mortar_mapper_process.h:295
KRATOS_DEFINE_LOCAL_FLAG(CONSIDER_TESELLATION)
If the entities to take into account on the destination model part are the conditions,...
typename std::conditional< TDim==2, LineType, TriangleType >::type DecompositionType
Type definition for DecompositionType based on TDim value.
Definition: simple_mortar_mapper_process.h:109
KRATOS_DEFINE_LOCAL_FLAG(ORIGIN_IS_HISTORICAL)
If interface is discontinous.
KRATOS_DEFINE_LOCAL_FLAG(ORIGIN_SKIN_IS_CONDITION_BASED)
If the destination variables is historical.
KRATOS_DEFINE_LOCAL_FLAG(DESTINATION_IS_HISTORICAL)
If the origin variables is historical.
void operator()()
Definition: simple_mortar_mapper_process.h:232
typename SparseSpaceType::MatrixType MatrixType
Type definition for matrix.
Definition: simple_mortar_mapper_process.h:118
std::vector< PointTypePointer > PointVector
Definition: simple_mortar_mapper_process.h:138
KRATOS_DEFINE_LOCAL_FLAG(AVERAGE_NORMAL)
KRATOS_CLASS_POINTER_DEFINITION(SimpleMortarMapperProcess)
If we consider the tesellation in the mortar integration.
typename PointMapperType::Pointer PointTypePointer
Definition: simple_mortar_mapper_process.h:137
void Map(TVarType &rOriginVariable, TVarType &rDestinationVariable, const Flags Flag=Flags())
This method is a direct map between the origin and destination modelpart with custom variables.
Definition: simple_mortar_mapper_process.h:257
KRATOS_DEFINE_LOCAL_FLAG(DESTINATION_SKIN_IS_CONDITION_BASED)
If the entities to take into account on the origin model part are the conditions, otherwise we will t...
std::string Info() const override
Turn back information as a string.
Definition: simple_mortar_mapper_process.h:289
std::unordered_map< IndexType, IndexType > IntMap
A map for integers.
Definition: simple_mortar_mapper_process.h:130
~SimpleMortarMapperProcess() override=default
Destructor.
KRATOS_DEFINE_LOCAL_FLAG(DISCONTINOUS_INTERFACE)
If using average normal.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: simple_mortar_mapper_process.h:301
A generic tree data structure for spatial partitioning.
Definition: tree.h:190
A three node 3D triangle geometry with linear shape functions.
Definition: triangle_3d_3.h:77
A class template for handling data types, matrices, and vectors in a Ublas space.
Definition: ublas_space.h:121
TMatrixType MatrixType
The matrix type considered.
Definition: ublas_space.h:133
TVectorType VectorType
The vector type considered.
Definition: ublas_space.h:136
Short class definition.
Definition: array_1d.h:61
#define KRATOS_WATCH(variable)
Definition: define.h:806
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
#define KRATOS_WARNING(label)
Definition: logger.h:265
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
std::unordered_map< IndexType, IndexType > IntMap
A map for integers.
Definition: mortar_utilities.h:91
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
AMatrix::IdentityMatrix< double > IdentityMatrix
Definition: amatrix_interface.h:564
void AtomicAdd(TDataType &target, const TDataType &value)
Definition: atomic_utilities.h:55
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
Geometry< Node > GeometryType
The definition of the geometry.
Definition: mortar_classes.h:37
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
std::vector< PointTypePointer > PointVector
Definition: internal_variables_interpolation_process.h:53
TExpressionType::data_type norm_frobenius(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:687
type
Definition: generate_gid_list_file.py:35
float radius
Definition: mesh_to_mdpa_converter.py:18
Auxiliar struct for mapping.
Definition: simple_mortar_mapper_process.h:151
ExactMortarIntegrationUtilityType integration_utility
Definition: simple_mortar_mapper_process.h:154
MortarOperatorType this_mortar_operators
Definition: simple_mortar_mapper_process.h:153
MortarKinematicVariablesType this_kinematic_variables
Definition: simple_mortar_mapper_process.h:152