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.
refine_fluid_elements_in_edges_mesher_process.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosPfemFluidApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: July 2018 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_REFINE_FLUID_ELEMENTS_IN_EDGES_MESHER_PROCESS_H_INCLUDED )
11 #define KRATOS_REFINE_FLUID_ELEMENTS_IN_EDGES_MESHER_PROCESS_H_INCLUDED
12 
13 
14 // External includes
15 
16 // System includes
17 
18 // Project includes
20 
21 namespace Kratos
22 {
23 
26 
28 
33 {
34  public:
37 
40 
44 
46 
51 
54  MesherUtilities::MeshingParameters& rRemeshingParameters,
55  int EchoLevel) : BaseType(rModelPart,rRemeshingParameters,EchoLevel)
56  {
57  }
58 
59 
62 
63 
67 
69  void operator()()
70  {
71  Execute();
72  }
73 
74 
78 
79 
83 
84 
88 
89 
93 
95  std::string Info() const override
96  {
97  return "RefineFluidElementsInEdgesMesherProcess";
98  }
99 
101  void PrintInfo(std::ostream& rOStream) const override
102  {
103  rOStream << "RefineFluidElementsInEdgesMesherProcess";
104  }
105 
107  void PrintData(std::ostream& rOStream) const override
108  {
109  }
110 
111 
115 
117 
118  protected:
119 
132 
133 
134  //**************************************************************************
135  //**************************************************************************
136 
138  ModelPart::ElementsContainerType& rBoundaryEdgedElements) override
139  {
140  KRATOS_TRY
141 
142  bool is_full_rigid_boundary = false;
143  bool is_full_fluid_boundary = false;
144  for(ModelPart::ElementsContainerType::iterator i_elem = rModelPart.ElementsBegin();
145  i_elem != rModelPart.ElementsEnd(); ++i_elem)
146  {
147  Geometry< Node >& rGeometry = i_elem->GetGeometry();
148 
149  is_full_rigid_boundary = true;
150  for(unsigned int i=0; i<rGeometry.size(); ++i)
151  {
152  if( rGeometry[i].IsNot(BOUNDARY) || rGeometry[i].IsNot(RIGID) ){
153  is_full_rigid_boundary = false;
154  break;
155  }
156 
157  }
158 
159  is_full_fluid_boundary = true;
160  for(unsigned int i=0; i<rGeometry.size(); ++i)
161  {
162  if( rGeometry[i].IsNot(FREE_SURFACE) || rGeometry[i].Is(RIGID) || rGeometry[i].Is(SOLID) ){
163  is_full_fluid_boundary = false;
164  break;
165  }
166 
167  // this condition fails
168  // if ( rGeometry[i].GetValue(NEIGHBOUR_NODES).size() > rGeometry.size()-1 ){
169  // is_full_fluid_boundary = false;
170  // break;
171  // }
172 
173  NodeWeakPtrVectorType& nNodes = rGeometry[i].GetValue(NEIGHBOUR_NODES);
174  for(auto& i_nnode : nNodes)
175  {
176  if(i_nnode.Is(SOLID) || i_nnode.Is(RIGID))
177  {
178  is_full_fluid_boundary = false;
179  break;
180  }
181  }
182  }
183  // if( is_full_rigid_boundary )
184  // std::cout<<" is full rigid boundary "<<std::endl;
185 
186  // if( is_full_fluid_boundary )
187  // std::cout<<" is full fluid boundary "<<std::endl;
188 
189  if( is_full_rigid_boundary || is_full_fluid_boundary ){
190  rBoundaryEdgedElements.push_back(*(i_elem.base()));
191  }
192 
193  }
194 
195  KRATOS_CATCH( "" )
196  }
197 
208 
209  private:
230 
233 
234 
236 
237 
239  //Process(Process const& rOther);
240 
241 
243 
244 }; // Class Process
245 
247 
250 
251 
255 
256 
258 inline std::istream& operator >> (std::istream& rIStream,
260 
262 inline std::ostream& operator << (std::ostream& rOStream,
264 {
265  rThis.PrintInfo(rOStream);
266  rOStream << std::endl;
267  rThis.PrintData(rOStream);
268 
269  return rOStream;
270 }
272 
273 
274 } // namespace Kratos.
275 
276 #endif // KRATOS_REFINE_FLUID_ELEMENTS_IN_EDGES_MESHER_PROCESS_H_INCLUDED defined
Base class for all Conditions.
Definition: condition.h:59
bool Is(Flags const &rOther) const
Definition: flags.h:274
bool IsNot(Flags const &rOther) const
Definition: flags.h:291
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometry.h:627
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
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
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
Refine Mesh Elements Process 2D and 3D.
Definition: refine_elements_in_edges_mesher_process.hpp:39
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: refine_elements_in_edges_mesher_process.hpp:88
Refine Mesh Elements Process 2D and 3D.
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:33
ConditionType::GeometryType GeometryType
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:43
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:69
RefineElementsInEdgesMesherProcess BaseType
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:45
std::string Info() const override
Turn back information as a string.
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:95
void SelectFullBoundaryEdgedElements(ModelPart &rModelPart, ModelPart::ElementsContainerType &rBoundaryEdgedElements) override
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:137
RefineFluidElementsInEdgesMesherProcess(ModelPart &rModelPart, MesherUtilities::MeshingParameters &rRemeshingParameters, int EchoLevel)
Default constructor.
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:53
ModelPart::ConditionType ConditionType
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:41
ModelPart::PropertiesType PropertiesType
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:42
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:101
virtual ~RefineFluidElementsInEdgesMesherProcess()
Destructor.
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:61
GlobalPointersVector< Node > NodeWeakPtrVectorType
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:47
KRATOS_CLASS_POINTER_DEFINITION(RefineFluidElementsInEdgesMesherProcess)
Pointer definition of Process.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: refine_fluid_elements_in_edges_mesher_process.hpp:107
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
static int EchoLevel
Definition: co_sim_EMPIRE_API.h:42
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
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
integer i
Definition: TensorModule.f:17
Definition: mesher_utilities.hpp:631