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.
local_refine_tetrahedra_mesh_only_on_boundaries.hpp
Go to the documentation of this file.
1 // KRATOS __ __ _____ ____ _ _ ___ _ _ ____
2 // | \/ | ____/ ___|| | | |_ _| \ | |/ ___|
3 // | |\/| | _| \___ \| |_| || || \| | | _
4 // | | | | |___ ___) | _ || || |\ | |_| |
5 // |_| |_|_____|____/|_| |_|___|_| \_|\____| APPLICATION
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Pablo Becker
11 //
12 
13 #pragma once
14 
15 // NOTE: Before compute the remeshing it is necessary to compute the neighbours
16 
17 // System includes
18 
19 // External includes
20 
21 // Project includes
24 
25 // Application includes
27 
28 namespace Kratos
29 {
45 {
46 public:
47 
53 
57  {
58  }
59 
62  = default;
63 
65  ModelPart& rThisModelPart,
66  compressed_matrix<int>& rCoord
67  ) override
68  {
69  KRATOS_TRY;
70  for (auto& r_elem: rThisModelPart.Elements()) {
71  if (r_elem.GetValue(SPLIT_ELEMENT)) {
72  Element::GeometryType& r_geom = r_elem.GetGeometry(); // Nodes of the element
73  for (unsigned int i = 0; i < r_geom.size(); i++) {
74  int index_i = mMapNodeIdToPos[r_geom[i].Id()];
75  bool is_boundary_i = r_geom[i].Is(BOUNDARY);
76  for (unsigned int j = 0; j < r_geom.size(); j++) {
77  int index_j = mMapNodeIdToPos[r_geom[j].Id()];
78  bool is_boundary_j = r_geom[j].Is(BOUNDARY);
79  if (index_j > index_i && (is_boundary_j&&is_boundary_i)) {
80  rCoord(index_i, index_j) = -2;
81  }
82  }
83  }
84  }
85  }
86 
87 
88  KRATOS_CATCH("");
89  }
90 
91 
92 protected:
98 
102 
106 
110 
114 
119 
120 private:
123 
127 
131 
135 
139 
143 
148 
149 };
150 
151 } // namespace Kratos.
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
std::unordered_map< std::size_t, unsigned int > mMapNodeIdToPos
The current refinement level.
Definition: local_refine_geometry_mesh.hpp:240
Definition: local_refine_tetrahedra_mesh_only_on_boundaries.hpp:45
~LocalRefineTetrahedraMeshOnlyOnBoundaries()=default
Destructor.
LocalRefineTetrahedraMeshOnlyOnBoundaries(ModelPart &rModelPart)
Default constructors.
Definition: local_refine_tetrahedra_mesh_only_on_boundaries.hpp:55
void SearchEdgeToBeRefined(ModelPart &rThisModelPart, compressed_matrix< int > &rCoord) override
Definition: local_refine_tetrahedra_mesh_only_on_boundaries.hpp:64
Definition: local_refine_tetrahedra_mesh_parallel_to_boundaries.hpp:46
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17