10 #if !defined(KRATOS_MODEL_START_END_MESHING_FOR_FLUIDS_PROCESS_H_INCLUDED)
11 #define KRATOS_MODEL_START_END_MESHING_FOR_FLUIDS_PROCESS_H_INCLUDED
119 std::string
Info()
const override
121 return "ModelStartEndMeshingForFluidsProcess";
127 rOStream <<
"ModelStartEndMeshingForFluidsProcess";
151 rModelPart.
Nodes().clear();
157 unsigned int nodeId = 1;
158 unsigned int elemId = 1;
164 if ((i_mp->Is(SOLID) && i_mp->IsNot(ACTIVE)) || (i_mp->Is(FLUID) && i_mp->IsNot(ACTIVE)) || (i_mp->Is(BOUNDARY) && i_mp->Is(RIGID)))
168 std::cout <<
" [ SUBMODEL PART [" << i_mp->Name() <<
"] [Elems=" << i_mp->NumberOfElements() <<
"|Nodes=" << i_mp->NumberOfNodes() <<
"|Conds=" << i_mp->NumberOfConditions() <<
"] ] " << std::endl;
173 temporal_nodes.reserve(i_mp->Nodes().size());
174 temporal_nodes.swap(i_mp->Nodes());
176 if (!i_mp->NumberOfElements())
178 for (ModelPart::NodesContainerType::iterator i_node = temporal_nodes.begin(); i_node != temporal_nodes.end(); i_node++)
180 if (i_node->IsNot(TO_ERASE))
182 (i_mp->Nodes()).push_back(*(i_node.base()));
183 (rModelPart.
Nodes()).push_back(*(i_node.base()));
184 rModelPart.
Nodes().back().SetId(nodeId);
192 for (ModelPart::ElementsContainerType::iterator i_elem = i_mp->ElementsBegin(); i_elem != i_mp->ElementsEnd(); i_elem++)
194 if (i_elem->IsNot(TO_ERASE))
198 for (
unsigned int i = 0;
i < vertices.
size();
i++)
200 vertices[
i].Set(BLOCKED);
203 vertices[
i].Set(FLUID);
206 i_elem->SetId(elemId);
207 (rModelPart.
Elements()).push_back(*(i_elem.base()));
208 rModelPart.
Elements().back().SetId(elemId);
213 for (ModelPart::NodesContainerType::iterator i_node = temporal_nodes.begin(); i_node != temporal_nodes.end(); i_node++)
218 if (i_node->Is(BLOCKED) || i_node->Is(RIGID))
220 if (i_node->Is(RIGID) && i_node->IsNot(BLOCKED))
223 i_node->FastGetSolutionStepValue(PRESSURE) = 0;
226 i_node->Reset(FLUID);
230 i_node->Reset(ISOLATED);
231 i_node->Reset(NEW_ENTITY);
232 i_node->Reset(TO_REFINE);
233 i_node->Reset(BLOCKED);
235 if (i_node->IsNot(TO_ERASE))
238 (i_mp->Nodes()).push_back(*(i_node.base()));
239 (rModelPart.
Nodes()).push_back(*(i_node.base()));
240 rModelPart.
Nodes().back().SetId(nodeId);
247 i_node->Set(ISOLATED);
248 i_node->Reset(BOUNDARY);
249 i_node->Reset(NEW_ENTITY);
250 i_node->Reset(TO_REFINE);
251 i_node->Reset(BLOCKED);
253 if (
mOptions.
Is(MesherUtilities::KEEP_ISOLATED_NODES) && i_node->IsNot(TO_ERASE))
255 i_node->FastGetSolutionStepValue(PRESSURE) = 0;
256 (i_mp->Nodes()).push_back(*(i_node.base()));
257 (rModelPart.
Nodes()).push_back(*(i_node.base()));
258 rModelPart.
Nodes().back().SetId(nodeId);
302 if (!((i_mp->Is(ACTIVE) && i_mp->Is(SOLID)) || (i_mp->Is(ACTIVE) && i_mp->Is(FLUID))))
304 if (i_mp->NumberOfElements())
307 for (ModelPart::ElementsContainerType::iterator i_elem = i_mp->ElementsBegin(); i_elem != i_mp->ElementsEnd(); i_elem++)
309 i_elem->SetId(elemId);
310 (rModelPart.
Elements()).push_back(*(i_elem.base()));
311 rModelPart.
Elements().back().SetId(elemId);
350 rModelPart.
Nodes().Unique();
355 unsigned int consecutive_index = 1;
356 for (ModelPart::NodesContainerType::iterator in = rModelPart.
NodesBegin(); in != rModelPart.
NodesEnd(); in++)
357 in->SetId(consecutive_index++);
374 std::string ComputingModelPartName;
378 if ((i_mp->Is(ACTIVE) && i_mp->Is(SOLID)) || (i_mp->Is(ACTIVE) && i_mp->Is(FLUID)))
380 ComputingModelPartName = i_mp->Name();
386 rComputingModelPart.
Nodes().clear();
387 rComputingModelPart.
Elements().clear();
393 if (((i_mp->Is(ACTIVE) && i_mp->Is(SOLID)) || (i_mp->Is(BOUNDARY) && i_mp->Is(RIGID))) || (i_mp->Is(FLUID) && i_mp->IsNot(ACTIVE)))
396 for (ModelPart::NodesContainerType::iterator i_node = i_mp->NodesBegin(); i_node != i_mp->NodesEnd(); i_node++)
398 rComputingModelPart.
Nodes().push_back(*(i_node.base()));
407 for (ModelPart::ElementsContainerType::iterator i_elem = i_mp->ElementsBegin(); i_elem != i_mp->ElementsEnd(); i_elem++)
409 rComputingModelPart.
AddElement(*(i_elem.base()));
420 rComputingModelPart.
Nodes().Unique();
421 rComputingModelPart.
Elements().Unique();
425 std::cout <<
" [ SUBMODEL PART [" << rComputingModelPart.
Name() <<
"] [Elems=" << rComputingModelPart.
NumberOfElements() <<
"|Nodes=" << rComputingModelPart.
NumberOfNodes() <<
"|Conds=" << rComputingModelPart.
NumberOfConditions() <<
"] ] " << std::endl;
519 rOStream << std::endl;
Definition: boundary_normals_calculation_utilities.hpp:48
void CalculateUnitBoundaryNormals(ModelPart &rModelPart, int EchoLevel=0)
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area).
Definition: boundary_normals_calculation_utilities.hpp:83
bool Is(Flags const &rOther) const
Definition: flags.h:274
PointerVector< TPointType > PointsArrayType
Definition: geometry.h:118
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
SubModelPartIterator SubModelPartsEnd()
Definition: model_part.h:1708
SubModelPartIterator SubModelPartsBegin()
Definition: model_part.h:1698
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
std::string & Name()
Definition: model_part.h:1811
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
SubModelPartsContainerType::iterator SubModelPartIterator
Iterator over the sub model parts of this model part.
Definition: model_part.h:258
SizeType NumberOfElements(IndexType ThisIndex=0) const
Definition: model_part.h:1027
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
SizeType NumberOfConditions(IndexType ThisIndex=0) const
Definition: model_part.h:1218
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
SizeType NumberOfNodes(IndexType ThisIndex=0) const
Definition: model_part.h:341
void AddElement(ElementType::Pointer pNewElement, IndexType ThisIndex=0)
Definition: model_part.cpp:917
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
Condition ConditionType
Definition: model_part.h:121
Short class definition.
Definition: model_start_end_meshing_for_fluids_process.hpp:64
KRATOS_CLASS_POINTER_DEFINITION(ModelStartEndMeshingForFluidsProcess)
Pointer definition of ModelStartEndMeshingForFluidsProcess.
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: model_start_end_meshing_for_fluids_process.hpp:98
std::string Info() const override
Turn back information as a string.
Definition: model_start_end_meshing_for_fluids_process.hpp:119
void PerformModelSearches() override
Definition: model_start_end_meshing_for_fluids_process.hpp:430
void BuildComputingDomain(ModelPart &rModelPart, int EchoLevel) override
Definition: model_start_end_meshing_for_fluids_process.hpp:370
ModelStartEndMeshingForFluidsProcess(ModelPart &rMainModelPart, Flags Options, int EchoLevel=0)
Default constructor.
Definition: model_start_end_meshing_for_fluids_process.hpp:77
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: model_start_end_meshing_for_fluids_process.hpp:125
void BuildTotalModelPart(ModelPart &rModelPart, int EchoLevel) override
Definition: model_start_end_meshing_for_fluids_process.hpp:141
virtual ~ModelStartEndMeshingForFluidsProcess()
Destructor.
Definition: model_start_end_meshing_for_fluids_process.hpp:85
void operator()()
Definition: model_start_end_meshing_for_fluids_process.hpp:89
Short class definition.
Definition: nodal_neighbours_search_process.hpp:50
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
Short class definition.
Definition: settle_model_structure_process.hpp:71
Flags mOptions
Definition: settle_model_structure_process.hpp:191
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: settle_model_structure_process.hpp:168
int mEchoLevel
Definition: settle_model_structure_process.hpp:193
ModelPart & mrMainModelPart
Definition: settle_model_structure_process.hpp:189
#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
ModelPart::NodesContainerType NodesContainerType
Definition: find_conditions_neighbours_process.h:44
ConditionsContainerType::iterator ConditionIterator
Definition: settle_model_structure_process.hpp:51
ConditionsContainerType::const_iterator ConditionConstantIterator
Definition: settle_model_structure_process.hpp:52
ModelPart::ConditionsContainerType ConditionsContainerType
Definition: find_conditions_neighbours_process.h:45
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
ModelPart::ElementsContainerType ElementsContainerType
Definition: clear_contact_conditions_mesher_process.hpp:43
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
GeometryType::PointsArrayType PointsArrayType
Definition: settle_model_structure_process.hpp:48
Condition ConditionType
Definition: assign_unique_model_part_collection_tag_utility.h:43
integer i
Definition: TensorModule.f:17
def FindNeighbours(self)
FOR MEMBRANE print "00000" NormalCalculationUtils().CalculateOnSimplex(self.combined_model_part,...
Definition: ulf_PGLASS.py:386