14 #ifndef KRATOS_EMBEDDED_NODES_INITIALIZATION_PROCESS_H
15 #define KRATOS_EMBEDDED_NODES_INITIALIZATION_PROCESS_H
111 #pragma omp parallel for
112 for (
int k = 0; k < static_cast<int>(rNodes.size()); ++
k)
114 ModelPart::NodesContainerType::iterator itNode = rNodes.begin() +
k;
115 const double&
d = itNode->FastGetSolutionStepValue(DISTANCE);
116 const double& dn = itNode->FastGetSolutionStepValue(DISTANCE,1);
118 if ((
d>0) && (dn<=0))
119 itNode->Set(SELECTED,
true);
125 for (
int k = 0; k < static_cast<int>(rElements.size()); ++
k)
127 unsigned int NewNodes = 0;
128 ModelPart::ElementsContainerType::iterator itElement = rElements.begin() +
k;
129 const GeometryType& rGeometry = itElement->GetGeometry();
130 const unsigned int ElemNumNodes = rGeometry.
PointsNumber();
133 for (
unsigned int j=0;
j<ElemNumNodes; ++
j)
135 if (rGeometry[
j].
Is(SELECTED))
143 NodeType::Pointer pNode;
147 for (
unsigned int j=0;
j<ElemNumNodes; ++
j)
149 if (rGeometry[
j].
IsNot(SELECTED))
152 p_avg += rGeometry[
j].FastGetSolutionStepValue(PRESSURE);
153 v_avg += rGeometry[
j].FastGetSolutionStepValue(VELOCITY);
158 pNode = rGeometry(
j);
163 p_avg /= (ElemNumNodes-1);
164 v_avg /= (ElemNumNodes-1);
167 pNode->Set(SELECTED,
false);
170 pNode->FastGetSolutionStepValue(PRESSURE,
step) = p_avg;
171 pNode->FastGetSolutionStepValue(VELOCITY,
step) = v_avg;
178 #pragma omp parallel for
179 for (
int k = 0; k < static_cast<int>(rNodes.size()); ++
k)
181 ModelPart::NodesContainerType::iterator itNode = rNodes.
begin() +
k;
183 if (itNode->Is(SELECTED))
185 itNode->Set(SELECTED,
false);
188 itNode->FastGetSolutionStepValue(PRESSURE,
step) = 0.0;
204 std::string
Info()
const override
206 std::stringstream buffer;
207 buffer <<
"EmbeddedNodesInitializationProcess" ;
212 void PrintInfo(std::ostream& rOStream)
const override {rOStream <<
"EmbeddedNodesInitializationProcess";}
215 void PrintData(std::ostream& rOStream)
const override {}
Definition: embedded_nodes_initialization_process.h:59
EmbeddedNodesInitializationProcess(ModelPart &rModelPart, unsigned int MaxIterations=10)
Constructor.
Definition: embedded_nodes_initialization_process.h:76
Node NodeType
Definition: embedded_nodes_initialization_process.h:67
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: embedded_nodes_initialization_process.h:212
KRATOS_CLASS_POINTER_DEFINITION(EmbeddedNodesInitializationProcess)
Pointer definition of EmbeddedNodesInitializationProcess.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: embedded_nodes_initialization_process.h:215
Geometry< NodeType > GeometryType
Definition: embedded_nodes_initialization_process.h:69
~EmbeddedNodesInitializationProcess() override
Destructor.
Definition: embedded_nodes_initialization_process.h:82
unsigned int mMaxIterations
Definition: embedded_nodes_initialization_process.h:234
ModelPart & mrModelPart
Definition: embedded_nodes_initialization_process.h:233
std::string Info() const override
Turn back information as a string.
Definition: embedded_nodes_initialization_process.h:204
void ExecuteInitializeSolutionStep() override
This function will be executed at every time step BEFORE performing the solve phase.
Definition: embedded_nodes_initialization_process.h:96
NodeType::Pointer NodePointerType
Definition: embedded_nodes_initialization_process.h:68
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 PointsNumber() const
Definition: geometry.h:528
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
IndexType GetBufferSize() const
This method gets the suffer size of the model part database.
Definition: model_part.h:1876
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
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
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
The base class for all processes in Kratos.
Definition: process.h:49
BOOST_UBLAS_INLINE const_iterator begin() const
Definition: array_1d.h:606
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
int step
Definition: face_heat.py:88
int d
Definition: ode_solve.py:397
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648