10 #if !defined(KRATOS_MANAGE_ISOLATED_NODES_PROCESS_H_INCLUDED)
11 #define KRATOS_MANAGE_ISOLATED_NODES_PROCESS_H_INCLUDED
102 ModelPart::NodesContainerType::iterator it_begin =
105 #pragma omp parallel for
108 ModelPart::NodesContainerType::iterator it = it_begin +
i;
110 if( it->Is(ISOLATED) || (it->Is(RIGID) && (it->IsNot(SOLID) && it->IsNot(FLUID))) ){
112 if(it->SolutionStepsDataHas(PRESSURE)){
113 it->FastGetSolutionStepValue(PRESSURE,0) = 0.0;
114 it->FastGetSolutionStepValue(PRESSURE,1) = 0.0;
116 if(it->SolutionStepsDataHas(PRESSURE_VELOCITY)){
117 it->FastGetSolutionStepValue(PRESSURE_VELOCITY,0) = 0.0;
118 it->FastGetSolutionStepValue(PRESSURE_VELOCITY,1) = 0.0;
120 if(it->SolutionStepsDataHas(PRESSURE_ACCELERATION)){
121 it->FastGetSolutionStepValue(PRESSURE_ACCELERATION,0) = 0.0;
122 it->FastGetSolutionStepValue(PRESSURE_ACCELERATION,1) = 0.0;
141 this->SetSemiIsolatedNodes(mrModelPart);
143 ModelPart::NodesContainerType::iterator it_begin = mrModelPart.
NodesBegin();
145 #pragma omp parallel for
148 ModelPart::NodesContainerType::iterator it = it_begin +
i;
150 if( it->Is(ISOLATED) ){
151 if(it->SolutionStepsDataHas(VOLUME_ACCELERATION)){
152 const array_1d<double,3>& VolumeAcceleration = it->FastGetSolutionStepValue(VOLUME_ACCELERATION);
153 noalias(it->FastGetSolutionStepValue(ACCELERATION)) = VolumeAcceleration;
158 noalias(it->FastGetSolutionStepValue(VELOCITY)) = it->FastGetSolutionStepValue(VELOCITY,1) + it->FastGetSolutionStepValue(ACCELERATION)*TimeStep;
159 noalias(it->Coordinates()) -= it->FastGetSolutionStepValue(DISPLACEMENT);
160 noalias(it->FastGetSolutionStepValue(DISPLACEMENT)) = it->FastGetSolutionStepValue(DISPLACEMENT,1) + it->FastGetSolutionStepValue(VELOCITY)*TimeStep + 0.5*it->FastGetSolutionStepValue(ACCELERATION)*TimeStep*TimeStep;
161 noalias(it->Coordinates()) += it->FastGetSolutionStepValue(DISPLACEMENT);
168 if( !mBoundingBox.
IsInside( it->Coordinates() ) ){
170 std::cout<<
" ISOLATED to erase "<<std::endl;
173 else if( it->Is(VISITED) ){
175 if(it->SolutionStepsDataHas(VOLUME_ACCELERATION)){
176 const array_1d<double,3>& VolumeAcceleration = it->FastGetSolutionStepValue(VOLUME_ACCELERATION);
177 noalias(it->FastGetSolutionStepValue(ACCELERATION)) = VolumeAcceleration;
180 noalias(it->FastGetSolutionStepValue(VELOCITY)) = 0.5 * (it->FastGetSolutionStepValue(VELOCITY) + it->FastGetSolutionStepValue(VELOCITY,1) + it->FastGetSolutionStepValue(ACCELERATION)*TimeStep);
181 noalias(it->Coordinates()) -= it->FastGetSolutionStepValue(DISPLACEMENT);
182 noalias(it->FastGetSolutionStepValue(DISPLACEMENT)) = 0.5 * (it->FastGetSolutionStepValue(DISPLACEMENT) + it->FastGetSolutionStepValue(DISPLACEMENT,1) + it->FastGetSolutionStepValue(VELOCITY)*TimeStep + 0.5*it->FastGetSolutionStepValue(ACCELERATION)*TimeStep*TimeStep);
183 noalias(it->Coordinates()) += it->FastGetSolutionStepValue(DISPLACEMENT);
188 this->ResetSemiIsolatedNodes(mrModelPart);
230 std::string
Info()
const override
232 return "ManageIsolatedNodesProcess";
238 rOStream <<
"ManageIsolatedNodesProcess";
299 void SetSemiIsolatedNodes(
ModelPart& rModelPart)
302 const int nnodes = mrModelPart.Nodes().size();
306 ModelPart::NodesContainerType::iterator it_begin = mrModelPart.NodesBegin();
308 #pragma omp parallel for
311 ModelPart::NodesContainerType::iterator it = it_begin +
i;
313 if( it->Is(FREE_SURFACE) ){
316 unsigned int rigid = 0;
317 for(
auto& i_nnodes : nNodes)
319 if(i_nnodes.Is(RIGID))
322 if( rigid == nNodes.size() )
323 it->Set(VISITED,
true);
331 void ResetSemiIsolatedNodes(ModelPart& rModelPart)
334 const int nnodes = mrModelPart.Nodes().size();
338 ModelPart::NodesContainerType::iterator it_begin = mrModelPart.NodesBegin();
340 #pragma omp parallel for
343 ModelPart::NodesContainerType::iterator it = it_begin +
i;
346 it->Set(VISITED,
false);
394 rOStream << std::endl;
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
Process for managing the time integration of variables for isolated nodes.
Definition: manage_isolated_nodes_process.hpp:32
void ExecuteFinalizeSolutionStep() override
this function will be executed at every time step AFTER performing the solve phase
Definition: manage_isolated_nodes_process.hpp:133
void ExecuteFinalize() override
Definition: manage_isolated_nodes_process.hpp:210
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: manage_isolated_nodes_process.hpp:242
void ExecuteInitialize() override
Definition: manage_isolated_nodes_process.hpp:75
std::string Info() const override
Turn back information as a string.
Definition: manage_isolated_nodes_process.hpp:230
GlobalPointersVector< Node > NodeWeakPtrVectorType
Definition: manage_isolated_nodes_process.hpp:36
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: manage_isolated_nodes_process.hpp:58
ManageIsolatedNodesProcess(ModelPart &rModelPart)
Definition: manage_isolated_nodes_process.hpp:45
virtual ~ManageIsolatedNodesProcess()
Destructor.
Definition: manage_isolated_nodes_process.hpp:50
void ExecuteBeforeOutputStep() override
this function will be executed at every time step BEFORE writing the output
Definition: manage_isolated_nodes_process.hpp:197
void ExecuteBeforeSolutionLoop() override
Definition: manage_isolated_nodes_process.hpp:81
void ExecuteAfterOutputStep() override
this function will be executed at every time step AFTER writing the output
Definition: manage_isolated_nodes_process.hpp:203
KRATOS_CLASS_POINTER_DEFINITION(ManageIsolatedNodesProcess)
Pointer definition of ManageIsolatedNodesProcess.
void Execute() override
Execute method is used to execute the ManageIsolatedNodesProcess algorithms.
Definition: manage_isolated_nodes_process.hpp:69
void ExecuteInitializeSolutionStep() override
this function will be executed at every time step BEFORE performing the solve phase
Definition: manage_isolated_nodes_process.hpp:94
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: manage_isolated_nodes_process.hpp:236
ManageIsolatedNodesProcess(ManageIsolatedNodesProcess const &rOther)
Copy constructor.
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
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
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 nnodes
Definition: sensitivityMatrix.py:24
integer i
Definition: TensorModule.f:17