10 #if !defined(KRATOS_MANAGE_SELECTED_ELEMENTS_PROCESS_H_INCLUDED)
11 #define KRATOS_MANAGE_SELECTED_ELEMENTS_PROCESS_H_INCLUDED
108 ModelPart::ElementsContainerType::iterator it_begin = mrModelPart.
ElementsBegin();
110 #pragma omp parallel for
111 for (
int i = 0;
i < nelements; ++
i)
113 ModelPart::ElementsContainerType::iterator it = it_begin +
i;
118 const unsigned int number_of_nodes = rGeometry.
size();
119 unsigned int selected_nodes = 0;
120 for(
unsigned int j=0;
j<number_of_nodes; ++
j)
122 if(rGeometry[
j].
Is(SELECTED))
126 if(selected_nodes == number_of_nodes){
127 it->Set(SELECTED,
true);
128 it->Set(ACTIVE,
false);
146 ModelPart::ElementsContainerType::iterator it_begin = mrModelPart.
ElementsBegin();
149 for (
int i = 0;
i < nelements; ++
i)
151 ModelPart::ElementsContainerType::iterator it = it_begin +
i;
153 if( it->Is(FLUID) && it->Is(SELECTED) ){
156 const unsigned int number_of_nodes = rGeometry.
size();
158 for(
unsigned int j=0;
j<number_of_nodes; ++
j)
160 rGeometry[
j].Set(SELECTED,
true);
162 it->Set(SELECTED,
false);
163 it->Set(ACTIVE,
true);
172 ModelPart::NodesContainerType::iterator it_begin = mrModelPart.
NodesBegin();
174 #pragma omp parallel for
177 ModelPart::NodesContainerType::iterator it = it_begin +
i;
179 if( it->Is(SELECTED) ){
181 if(
norm_2(it->FastGetSolutionStepValue(VELOCITY)) > 1.5 *
norm_2(it->FastGetSolutionStepValue(VELOCITY,1)) ||
182 norm_2(it->FastGetSolutionStepValue(ACCELERATION)) > 1.5 *
norm_2(it->FastGetSolutionStepValue(ACCELERATION,1)) ){
187 noalias(it->FastGetSolutionStepValue(VELOCITY)) = it->FastGetSolutionStepValue(VELOCITY,1);
188 noalias(it->FastGetSolutionStepValue(ACCELERATION)) = it->FastGetSolutionStepValue(ACCELERATION,1);
189 noalias(it->Coordinates()) -= it->FastGetSolutionStepValue(DISPLACEMENT);
190 noalias(it->FastGetSolutionStepValue(DISPLACEMENT)) = it->FastGetSolutionStepValue(DISPLACEMENT,1);
191 noalias(it->Coordinates()) += it->FastGetSolutionStepValue(DISPLACEMENT);
201 if( it->Is(FREE_SURFACE) ){
202 if( !mBoundingBox.
IsInside( it->Coordinates() ) ){
203 it->Set(TO_ERASE,
true);
204 std::cout<<
" SELECTED to erase "<<std::endl;
208 it->Set(SELECTED,
false);
252 std::string
Info()
const override
254 return "ManageSelectedElementsProcess";
260 rOStream <<
"ManageSelectedElementsProcess";
361 rOStream << std::endl;
bool Is(Flags const &rOther) const
Definition: flags.h:274
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
Process for managing the time integration of variables for selected elements.
Definition: manage_selected_elements_process.hpp:37
void ExecuteFinalizeSolutionStep() override
this function will be executed at every time step AFTER performing the solve phase
Definition: manage_selected_elements_process.hpp:138
void ExecuteAfterOutputStep() override
this function will be executed at every time step AFTER writing the output
Definition: manage_selected_elements_process.hpp:225
void ExecuteBeforeOutputStep() override
this function will be executed at every time step BEFORE writing the output
Definition: manage_selected_elements_process.hpp:219
ManageSelectedElementsProcess(ModelPart &rModelPart)
Definition: manage_selected_elements_process.hpp:51
void ExecuteInitialize() override
Definition: manage_selected_elements_process.hpp:81
KRATOS_CLASS_POINTER_DEFINITION(ManageSelectedElementsProcess)
Pointer definition of ManageSelectedElementsProcess.
std::string Info() const override
Turn back information as a string.
Definition: manage_selected_elements_process.hpp:252
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: manage_selected_elements_process.hpp:64
void ExecuteFinalize() override
Definition: manage_selected_elements_process.hpp:232
void ExecuteBeforeSolutionLoop() override
Definition: manage_selected_elements_process.hpp:87
void Execute() override
Execute method is used to execute the ManageSelectedElementsProcess algorithms.
Definition: manage_selected_elements_process.hpp:75
ModelPart::ElementType::GeometryType GeometryType
Definition: manage_selected_elements_process.hpp:42
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: manage_selected_elements_process.hpp:258
void ExecuteInitializeSolutionStep() override
this function will be executed at every time step BEFORE performing the solve phase
Definition: manage_selected_elements_process.hpp:100
ManageSelectedElementsProcess(ManageSelectedElementsProcess const &rOther)
Copy constructor.
virtual ~ManageSelectedElementsProcess()
Destructor.
Definition: manage_selected_elements_process.hpp:56
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: manage_selected_elements_process.hpp:264
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
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
SizeType NumberOfElements(IndexType ThisIndex=0) const
Definition: model_part.h:1027
SizeType NumberOfNodes(IndexType ThisIndex=0) const
Definition: model_part.h:341
The base class for all processes in Kratos.
Definition: process.h:49
Short class definition.
Definition: spatial_bounding_box.hpp:48
virtual bool IsInside(const PointType &rPoint, double &rCurrentTime, double Radius=0)
Definition: spatial_bounding_box.hpp:604
#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
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
int j
Definition: quadrature.py:648
int nnodes
Definition: sensitivityMatrix.py:24
integer i
Definition: TensorModule.f:17