10 #if !defined(KRATOS_BUILD_MESH_BOUNDARY_FOR_FLUIDS_PROCESS_H_INCLUDED)
11 #define KRATOS_BUILD_MESH_BOUNDARY_FOR_FLUIDS_PROCESS_H_INCLUDED
79 mrRemesh(rRemeshingParameters)
105 bool success =
false;
108 std::cout <<
" [ Build Boundary on ModelPart [" <<
mrModelPart.
Name() <<
"] ]" << std::endl;
114 std::cout <<
" ERROR: BOUNDARY BUILD FAILED ModelPart : [" <<
mrModelPart <<
"] " << std::endl;
133 std::string
Info()
const override
135 return "BuildMeshBoundaryForFluidsProcess";
141 rOStream <<
"BuildMeshBoundaryForFluidsProcess";
177 std::cout <<
" [ Initial Conditions : " << rModelPart.
Conditions().size() << std::endl;
180 if (!rModelPart.
Elements().size() || (rModelPart.
Is(ACTIVE)))
184 std::cout <<
" [ Final Conditions : " << rModelPart.
Conditions().size() << std::endl;
191 bool any_node_to_erase =
false;
192 for (ModelPart::NodesContainerType::const_iterator in = rModelPart.
NodesBegin(); in != rModelPart.
NodesEnd(); in++)
196 unsigned int neighNodes = nNodes.
size();
199 in->FastGetSolutionStepValue(ISOLATED_NODE) = 1;
203 in->FastGetSolutionStepValue(ISOLATED_NODE) = 0;
206 if (in->Is(ISOLATED))
208 in->Set(PFEMFlags::PREVIOUS_ISOLATED,
true);
212 in->Reset(PFEMFlags::PREVIOUS_ISOLATED);
215 if (in->Is(FREE_SURFACE))
217 in->Set(PFEMFlags::PREVIOUS_FREESURFACE,
true);
221 in->Reset(PFEMFlags::PREVIOUS_FREESURFACE);
225 in->Reset(FREE_SURFACE);
227 if (any_node_to_erase ==
false)
228 if (in->Is(TO_ERASE))
229 any_node_to_erase =
true;
251 for (ModelPart::ElementsContainerType::iterator ie = elements_begin; ie != elements_end; ie++)
276 boost::numeric::ublas::matrix<unsigned int> lpofa;
277 boost::numeric::ublas::vector<unsigned int> lnofa;
286 unsigned int iface = 0;
290 unsigned int NumberNodesInFace = lnofa[iface];
292 if ((ne)->Id() == ie->Id())
296 bool freeSurfaceFace =
false;
297 for (
unsigned int j = 1;
j <= NumberNodesInFace;
j++)
299 rElementGeometry[lpofa(
j, iface)].Set(BOUNDARY);
300 if (rElementGeometry[lpofa(
j, iface)].
IsNot(RIGID))
302 freeSurfaceFace =
true;
305 if (freeSurfaceFace ==
true)
307 for (
unsigned int j = 1;
j <= NumberNodesInFace;
j++)
309 rElementGeometry[lpofa(
j, iface)].Set(FREE_SURFACE);
333 bool node_not_preserved =
false;
334 bool condition_not_preserved =
false;
338 for (
unsigned int j = 0;
j < rConditionGeometry.
size();
j++)
340 if (rConditionGeometry[
j].
Is(TO_ERASE) || rConditionGeometry[
j].
Is(TO_REFINE))
341 node_not_preserved =
true;
343 if (rConditionGeometry[
j].
Is(ISOLATED) || rConditionGeometry[
j].
IsNot(BOUNDARY))
344 condition_not_preserved =
true;
347 if (rCondition.
Is(TO_ERASE))
348 condition_not_preserved =
true;
350 if (rCondition.
Is(BOUNDARY))
351 condition_not_preserved =
true;
353 if (node_not_preserved ==
true || condition_not_preserved ==
true)
368 rModelPart.
Conditions().push_back(pCondition);
412 bool FindNodeInCondition(
Geometry<Node> &rConditionGeometry,
Geometry<Node> &rElementGeometry, boost::numeric::ublas::matrix<unsigned int> &lpofa, boost::numeric::ublas::vector<unsigned int> &lnofa,
unsigned int &iface)
417 if (rConditionGeometry.
size() != lnofa[iface])
421 if (lnofa[iface] == 2)
423 if (rConditionGeometry[0].Id() == rElementGeometry[lpofa(1, iface)].Id() ||
424 rConditionGeometry[1].Id() == rElementGeometry[lpofa(2, iface)].Id() ||
425 rConditionGeometry[0].Id() == rElementGeometry[lpofa(2, iface)].Id() ||
426 rConditionGeometry[1].Id() == rElementGeometry[lpofa(1, iface)].Id())
437 if (lnofa[iface] == 3)
439 if (rConditionGeometry[0].Id() == rElementGeometry[lpofa(1, iface)].Id() ||
440 rConditionGeometry[1].Id() == rElementGeometry[lpofa(2, iface)].Id() ||
441 rConditionGeometry[2].Id() == rElementGeometry[lpofa(3, iface)].Id() ||
442 rConditionGeometry[0].Id() == rElementGeometry[lpofa(3, iface)].Id() ||
443 rConditionGeometry[1].Id() == rElementGeometry[lpofa(1, iface)].Id() ||
444 rConditionGeometry[2].Id() == rElementGeometry[lpofa(2, iface)].Id() ||
445 rConditionGeometry[0].Id() == rElementGeometry[lpofa(2, iface)].Id() ||
446 rConditionGeometry[1].Id() == rElementGeometry[lpofa(3, iface)].Id() ||
447 rConditionGeometry[2].Id() == rElementGeometry[lpofa(1, iface)].Id())
457 if (lnofa[iface] > 3)
504 rOStream << std::endl;
Short class definition.
Definition: build_mesh_boundary_for_fluids_process.hpp:62
BuildMeshBoundaryForFluidsProcess(ModelPart &rModelPart, MesherUtilities::MeshingParameters &rRemeshingParameters, int EchoLevel)
Default constructor.
Definition: build_mesh_boundary_for_fluids_process.hpp:75
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: build_mesh_boundary_for_fluids_process.hpp:145
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: build_mesh_boundary_for_fluids_process.hpp:101
bool UniqueSkinSearch(ModelPart &rModelPart)
Definition: build_mesh_boundary_for_fluids_process.hpp:170
virtual ~BuildMeshBoundaryForFluidsProcess()
Destructor.
Definition: build_mesh_boundary_for_fluids_process.hpp:84
std::string Info() const override
Turn back information as a string.
Definition: build_mesh_boundary_for_fluids_process.hpp:133
void AddConditionToModelPart(ModelPart &rModelPart, Condition::Pointer pCondition) override
Definition: build_mesh_boundary_for_fluids_process.hpp:364
void operator()()
Definition: build_mesh_boundary_for_fluids_process.hpp:92
KRATOS_CLASS_POINTER_DEFINITION(BuildMeshBoundaryForFluidsProcess)
Pointer definition of BuildMeshBoundaryForFluidsProcess.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: build_mesh_boundary_for_fluids_process.hpp:139
bool SetBoundaryAndFreeSurface(ModelPart &rModelPart)
Definition: build_mesh_boundary_for_fluids_process.hpp:239
bool CheckAcceptedCondition(ModelPart &rModelPart, Condition &rCondition) override
Definition: build_mesh_boundary_for_fluids_process.hpp:329
Short class definition.
Definition: build_model_part_boundary_process.hpp:79
int mEchoLevel
Definition: build_model_part_boundary_process.hpp:571
ModelPart & mrModelPart
Definition: build_model_part_boundary_process.hpp:567
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
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
virtual void NodesInFaces(DenseMatrix< unsigned int > &rNodesInFaces) const
Definition: geometry.h:2195
virtual void NumberNodesInFaces(DenseVector< unsigned int > &rNumberNodesInFaces) const
Definition: geometry.h:2190
virtual SizeType FacesNumber() const
Returns the number of faces of the current geometry.
Definition: geometry.h:2152
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: global_pointers_vector.h:79
iterator begin()
Definition: global_pointers_vector.h:221
size_type size() const
Definition: global_pointers_vector.h:307
iterator end()
Definition: global_pointers_vector.h:229
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::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
PropertiesType::Pointer pGetProperties(IndexType PropertiesId, IndexType MeshIndex=0)
Returns the Properties::Pointer corresponding to it's identifier.
Definition: model_part.cpp:664
SizeType NumberOfProperties(IndexType ThisIndex=0) const
Returns the number of properties of the mesh.
Definition: model_part.cpp:575
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
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
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
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
ModelPart & GetParentModelPart()
Definition: model_part.cpp:2124
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
GlobalPointersVector< Element > ElementWeakPtrVectorType
Definition: build_model_part_boundary_process.hpp:60
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
ModelPart::ConditionsContainerType ConditionsContainerType
Definition: find_conditions_neighbours_process.h:45
GlobalPointersVector< Node > NodeWeakPtrVectorType
Definition: build_model_part_boundary_process.hpp:59
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
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
int j
Definition: quadrature.py:648
Definition: mesher_utilities.hpp:631