10 #if !defined(KRATOS_REMOVE_FLUID_NODES_MESHER_PROCESS_H_INCLUDED )
11 #define KRATOS_REMOVE_FLUID_NODES_MESHER_PROCESS_H_INCLUDED
100 std::string
Info()
const override
102 return "RemoveFluidNodesMesherProcess";
108 rOStream <<
"RemoveFluidNodesMesherProcess";
137 bool RemoveNodesOnDistance(
ModelPart& rModelPart,
unsigned int& inside_nodes_removed,
unsigned int& boundary_nodes_removed,
bool& any_condition_removed)
override
144 double size_for_distance_inside = 2.0 *
mrRemesh.
Refine->CriticalRadius;
145 double size_for_distance_boundary = 1.5 * size_for_distance_inside;
147 bool any_node_removed =
false;
150 unsigned int bucket_size = 20;
153 std::vector<Node::Pointer> list_of_nodes;
155 for(ModelPart::NodesContainerType::iterator i_node = rModelPart.
NodesBegin() ; i_node != rModelPart.
NodesEnd() ; ++i_node)
157 (list_of_nodes).push_back(*i_node.base());
160 KdtreeType nodes_tree(list_of_nodes.begin(),list_of_nodes.end(), bucket_size);
165 unsigned int num_neighbours = 20;
167 std::vector<Node::Pointer> neighbours (num_neighbours);
168 std::vector<double> neighbour_distances(num_neighbours);
173 Node work_point(0,0.0,0.0,0.0);
174 unsigned int n_points_in_radius;
177 for(ModelPart::NodesContainerType::const_iterator in = rModelPart.
NodesBegin(); in != rModelPart.
NodesEnd(); ++in)
179 if(in->Is(TO_ERASE)){
180 any_node_removed =
true;
181 std::cout<<
" TO_ERASE "<<in->Id()<<
" "<<in->Coordinates()<<std::endl;
184 if( in->IsNot(NEW_ENTITY) && in->IsNot(BLOCKED) && in->IsNot(SOLID) && in->IsNot(TO_ERASE) )
186 radius = size_for_distance_inside;
190 unsigned int FreeSurfaceNeighbours=0;
191 unsigned int RigidNeighbours=0;
193 for(
auto& i_nnode : nNodes)
195 if(i_nnode.Is(BLOCKED) || i_nnode.Is(SOLID)){
198 if(i_nnode.Is(FREE_SURFACE)){
199 ++FreeSurfaceNeighbours;
203 if(in->Is(FREE_SURFACE)){
205 if( RigidNeighbours == nNodes.
size() ){
214 n_points_in_radius = nodes_tree.
SearchInRadius(work_point,
radius, neighbours.begin(),neighbour_distances.begin(), num_neighbours);
216 if (n_points_in_radius>1)
219 if ( in->IsNot(BOUNDARY) )
221 if( this->
mrRemesh.
Refine->RemovingOptions.Is(MesherUtilities::REMOVE_NODES_ON_DISTANCE) ){
224 if(in->IsNot(FREE_SURFACE) && FreeSurfaceNeighbours>=
dimension){
225 this->MoveInsideNode((*in));
228 if( !this->
CheckEngagedNode((*in),neighbours,neighbour_distances,n_points_in_radius) ){
230 any_node_removed =
true;
231 ++inside_nodes_removed;
241 bool engaged_node =
false;
243 for(std::vector<Node::Pointer>::iterator nn=neighbours.begin(); nn!=neighbours.begin() + n_points_in_radius ; ++nn)
246 if ( (*nn)->Is(BOUNDARY) && (neighbour_distances[
counter] < 2.0 * size_for_distance_boundary) && (neighbour_distances[
counter] > 0.0) )
248 if((*nn)->Is(TO_ERASE) || (*nn)->Is(BLOCKED)){
257 if(!engaged_node && in->IsNot(BLOCKED)){
259 ++boundary_nodes_removed;
270 if( boundary_nodes_removed > 0 )
271 this->MoveBoundaries(rModelPart,boundary_nodes_removed);
273 if( boundary_nodes_removed > 0 )
274 any_node_removed =
true;
277 bool critical_nodes_removed =
false;
278 critical_nodes_removed = this->EraseCriticalNodes(rModelPart,inside_nodes_removed);
280 if( any_node_removed || critical_nodes_removed )
281 any_node_removed =
true;
286 std::cout<<
"boundary_nodes_removed "<<boundary_nodes_removed<<std::endl;
287 std::cout<<
"inside_nodes_removed "<<inside_nodes_removed<<std::endl;
288 std::cout<<
"critical_nodes_removed "<<critical_nodes_removed<<std::endl;
297 return any_node_removed;
332 void MoveBoundaries(
ModelPart& rModelPart,
unsigned int& boundary_nodes_removed)
337 for(ModelPart::ConditionsContainerType::const_iterator i_cond = rModelPart.
ConditionsBegin(); i_cond != rModelPart.
ConditionsEnd(); ++i_cond)
340 unsigned int NumberOfVertices = rGeometry.
size();
344 for(
unsigned int i=0;
i<NumberOfVertices; ++
i)
346 if(rGeometry[
i].
Is(TO_ERASE)){
355 if( this->MoveBoundaryNode(rGeometry[
id]) ){
356 rGeometry[id].Set(TO_ERASE,
false);
357 --boundary_nodes_removed;
369 bool CheckApproachingPoint(Node& rNode, Node& rEdgeNode)
373 bool approaching_point =
false;
375 array_1d<double,3> EdgeVelocity = rEdgeNode.FastGetSolutionStepValue(VELOCITY);
377 array_1d<double,3> Direction = rEdgeNode.FastGetSolutionStepValue(NORMAL);
379 Direction /=
norm_2(Direction);
381 array_1d<double,3> Distance = (rEdgeNode.Coordinates()-rNode.Coordinates());
382 double distance =
inner_prod(Distance, Direction);
383 Distance = distance * Direction;
385 array_1d<double,3> VelocityDirection = rNode.FastGetSolutionStepValue(VELOCITY);
392 if(
inner_prod( EdgeVelocity, VelocityDirection ) < 0 ){
394 if(
inner_prod( Distance, VelocityDirection ) > 0 )
395 approaching_point =
true;
397 approaching_point =
false;
401 if(
inner_prod( Distance, VelocityDirection ) > 0 )
402 approaching_point =
true;
404 approaching_point =
false;
407 return approaching_point;
415 bool CheckApproachingEdge(Node& rNode, Node& rEdgeNodeA, Node& rEdgeNodeB)
419 bool approaching_edge =
false;
421 array_1d<double,3> EdgeVelocity = 0.5 * (rEdgeNodeA.FastGetSolutionStepValue(VELOCITY)+rEdgeNodeB.FastGetSolutionStepValue(VELOCITY));
422 array_1d<double,3> MidPoint = 0.5 * (rEdgeNodeA.Coordinates() + rEdgeNodeB.Coordinates());
424 array_1d<double,3> Direction;
425 this->GetDirectionToEdge(Direction,rEdgeNodeA,rEdgeNodeB);
427 array_1d<double,3> Distance = (MidPoint-rNode.Coordinates());
428 double distance =
inner_prod(Distance, Direction);
429 Distance = distance * Direction;
431 array_1d<double,3> VelocityDirection = rNode.FastGetSolutionStepValue(VELOCITY);
438 if(
inner_prod( EdgeVelocity, VelocityDirection ) < 0 ){
440 if(
inner_prod( Distance, VelocityDirection ) > 0 )
441 approaching_edge =
true;
443 approaching_edge =
false;
447 if(
inner_prod( Distance, VelocityDirection ) > 0 )
448 approaching_edge =
true;
450 approaching_edge =
false;
453 return approaching_edge;
462 bool CheckApproachingFace(Node& rNode, Node& rEdgeNodeA, Node& rEdgeNodeB, Node& rEdgeNodeC)
466 bool approaching_face =
false;
468 array_1d<double,3> EdgeVelocity = (1.0/3.0) * (rEdgeNodeA.FastGetSolutionStepValue(VELOCITY)+rEdgeNodeB.FastGetSolutionStepValue(VELOCITY)+rEdgeNodeC.FastGetSolutionStepValue(VELOCITY));
469 array_1d<double,3> MidPoint = (1.0/3.0) * (rEdgeNodeA.Coordinates() + rEdgeNodeB.Coordinates() + rEdgeNodeC.Coordinates());
471 array_1d<double,3> Direction;
472 this->GetDirectionToFace(Direction,rEdgeNodeA,rEdgeNodeB,rEdgeNodeC);
474 array_1d<double,3> Distance = (MidPoint-rNode.Coordinates());
475 double distance =
inner_prod(Distance, Direction);
476 Distance = distance * Direction;
478 array_1d<double,3> VelocityDirection = rNode.FastGetSolutionStepValue(VELOCITY);
485 if(
inner_prod( EdgeVelocity, VelocityDirection ) < 0 ){
487 if(
inner_prod( Distance, VelocityDirection ) > 0 )
488 approaching_face =
true;
490 approaching_face =
false;
494 if(
inner_prod( Distance, VelocityDirection ) > 0 )
495 approaching_face =
true;
497 approaching_face =
false;
500 return approaching_face;
508 double GetDistanceToNode(Node& rNode, Node& rEdgeNode, array_1d<double,3>& rDirection)
512 array_1d<double,3> Direction = rEdgeNode.FastGetSolutionStepValue(NORMAL);
514 Direction /=
norm_2(Direction);
516 array_1d<double,3> Distance = (rEdgeNode.Coordinates()-rNode.Coordinates());
517 double distance = fabs(
inner_prod(Distance, Direction));
527 double GetDistanceToEdge(Node& rNode, Node& rEdgeNodeA, Node& rEdgeNodeB, array_1d<double,3>& rDirection)
531 array_1d<double,3> MidPoint = 0.5 * (rEdgeNodeA.Coordinates() + rEdgeNodeB.Coordinates()) ;
533 this->GetDirectionToEdge(rDirection,rEdgeNodeA,rEdgeNodeB);
535 double distance = fabs(
inner_prod((MidPoint-rNode.Coordinates()), rDirection));
545 double GetDistanceToFace(Node& rNode, Node& rEdgeNodeA, Node& rEdgeNodeB, Node& rEdgeNodeC, array_1d<double,3>& rDirection)
549 array_1d<double,3> MidPoint = (1.0/3.0) * (rEdgeNodeA.Coordinates() + rEdgeNodeB.Coordinates() + rEdgeNodeC.Coordinates() ) ;
551 this->GetDirectionToFace(rDirection,rEdgeNodeA,rEdgeNodeB,rEdgeNodeC);
553 double distance = fabs(
inner_prod((MidPoint-rNode.Coordinates()), rDirection));
564 void GetDirectionToEdge(array_1d<double,3>& rDirection, Node& rEdgeNodeA, Node& rEdgeNodeB)
567 if( rEdgeNodeA.FastGetSolutionStepValue(SHRINK_FACTOR) == 1 && rEdgeNodeB.FastGetSolutionStepValue(SHRINK_FACTOR) == 1 ){
568 rDirection = 0.5 * (rEdgeNodeA.FastGetSolutionStepValue(NORMAL) + rEdgeNodeB.FastGetSolutionStepValue(NORMAL) ) ;
571 if( rEdgeNodeA.FastGetSolutionStepValue(SHRINK_FACTOR) == 1 ){
572 rDirection = rEdgeNodeA.FastGetSolutionStepValue(NORMAL);
574 else if( rEdgeNodeB.FastGetSolutionStepValue(SHRINK_FACTOR) == 1 ){
575 rDirection = rEdgeNodeB.FastGetSolutionStepValue(NORMAL);
578 rDirection = 0.5 * (rEdgeNodeA.FastGetSolutionStepValue(NORMAL) + rEdgeNodeB.FastGetSolutionStepValue(NORMAL) ) ;
583 rDirection /=
norm_2(rDirection);
590 void GetDirectionToFace(array_1d<double,3>& rDirection, Node& rEdgeNodeA, Node& rEdgeNodeB, Node& rEdgeNodeC)
593 array_1d<double,3> VectorB = rEdgeNodeB.Coordinates() - rEdgeNodeA.Coordinates();
594 array_1d<double,3> VectorC = rEdgeNodeC.Coordinates() - rEdgeNodeA.Coordinates();
599 rDirection /=
norm_2(rDirection);
606 bool EraseCriticalNodes(ModelPart& rModelPart,
unsigned int& inside_nodes_removed)
611 bool any_node_removed =
false;
612 unsigned int erased_nodes=0;
616 MesherUtilities MesherUtils;
617 double MaxRelativeVelocity = 1.5;
619 for(ModelPart::ElementsContainerType::const_iterator ie = rModelPart.ElementsBegin(); ie != rModelPart.ElementsEnd(); ++ie)
622 const unsigned int NumberOfNodes = rGeometry.
size();
624 bool wall_boundary =
false;
625 for(
unsigned int i=0;
i<NumberOfNodes; ++
i)
627 if(rGeometry[
i].
Is(BLOCKED) || rGeometry[
i].
Is(SOLID)){
628 wall_boundary =
true;
635 bool speedy_approach = MesherUtils.CheckRelativeVelocities(rGeometry, MaxRelativeVelocity);
637 if( speedy_approach ){
639 for(
unsigned int i=0;
i<NumberOfNodes; ++
i)
641 if((rGeometry[
i].
IsNot(BLOCKED) && rGeometry[
i].
IsNot(SOLID))){
642 LayerNodes.push_back(rGeometry(
i));
650 const int nnodes = LayerNodes.size();
655 ModelPart::NodesContainerType::iterator it_begin = LayerNodes.begin();
657 unsigned int inside_nodes_removed_accum = 0;
658 #pragma omp parallel for reduction(+:inside_nodes_removed_accum,erased_nodes)
661 ModelPart::NodesContainerType::iterator it = it_begin +
i;
664 array_1d<double,3> Direction;
667 unsigned int face = 0;
671 for(
auto& i_nelem : nElements)
675 DenseMatrix<unsigned int> lpofa;
679 for(
auto& j_nelem : inElements)
681 if (i_nelem.Id() == j_nelem.Id()){
687 const unsigned int NumberOfNodes = rGeometry.size();
689 unsigned int wall_boundary = 0;
690 std::vector<unsigned int> wall_nodes;
691 for(
unsigned int j=1;
j<NumberOfNodes; ++
j)
693 if( rGeometry[lpofa(
j,face)].
Is(BLOCKED) || rGeometry[lpofa(
j,face)].
Is(SOLID) ){
695 wall_nodes.push_back(
j);
699 if( wall_boundary == NumberOfNodes-1 ){
701 if( NumberOfNodes == 3 ){
703 if( this->CheckApproachingEdge(*it,rGeometry[lpofa(1,face)], rGeometry[lpofa(2,face)]) ){
704 distance = this->GetDistanceToEdge(*it, rGeometry[lpofa(1,face)], rGeometry[lpofa(2,face)], Direction);
705 if( distance < MinimumDistance ){
706 MinimumDistance = distance;
713 else if( NumberOfNodes == 4 ){
715 if( this->CheckApproachingFace(*it,rGeometry[lpofa(1,face)], rGeometry[lpofa(2,face)], rGeometry[lpofa(3,face)]) ){
716 distance = this->GetDistanceToFace(*it, rGeometry[lpofa(1,face)], rGeometry[lpofa(2,face)], rGeometry[lpofa(3,face)], Direction);
717 if( distance < MinimumDistance ){
718 MinimumDistance = distance;
726 else if( wall_boundary == NumberOfNodes-2 ){
728 if( NumberOfNodes == 3 ){
730 if( this->CheckApproachingPoint(*it,rGeometry[lpofa(wall_nodes.front(),face)]) ){
731 distance = this->GetDistanceToNode(*it, rGeometry[lpofa(wall_nodes.front(),face)], Direction);
732 if( distance < MinimumDistance ){
733 MinimumDistance = distance;
738 else if( NumberOfNodes == 4 ){
740 if( this->CheckApproachingEdge(*it,rGeometry[lpofa(wall_nodes.front(),face)],rGeometry[lpofa(wall_nodes.back(),face)]) ){
741 distance = this->GetDistanceToEdge(*it, rGeometry[lpofa(wall_nodes.front(),face)], rGeometry[lpofa(wall_nodes.back(),face)], Direction);
742 if( distance < MinimumDistance ){
743 MinimumDistance = distance;
754 if( MinimumDistance < 0.25 * mrRemesh.Refine->CriticalRadius ){
757 ++inside_nodes_removed_accum;
759 else if( MinimumDistance < 1.5 * mrRemesh.Refine->CriticalRadius ){
760 distance = (1.5 *
mrRemesh.
Refine->CriticalRadius - MinimumDistance);
761 this->MoveLayerNode(*it, Direction, distance);
766 inside_nodes_removed += inside_nodes_removed_accum;
771 any_node_removed =
true;
774 return any_node_removed;
783 bool MoveBoundaryNode(Node& rNode)
788 bool moved_node =
false;
790 unsigned int FreeSurfaceNodes = 0;
793 for(
auto i_nnodes(nNodes.begin()); i_nnodes != nNodes.end(); ++i_nnodes)
795 if(i_nnodes->Is(FREE_SURFACE) ){
796 FreeNeighbours.push_back(*i_nnodes.base());
801 if( FreeSurfaceNodes == 2 )
803 array_1d<double,3> MidPoint = 0.5 * (FreeNeighbours.front().Coordinates()+FreeNeighbours.back().Coordinates());
804 array_1d<double,3> Direction = (FreeNeighbours.front().Coordinates()-FreeNeighbours.back().Coordinates());
807 Direction/=
norm_2(Direction);
809 array_1d<double,3> Displacement =
inner_prod( (MidPoint-rNode.Coordinates()), Direction ) * Direction;
810 noalias(rNode.Coordinates()) += Displacement;
811 noalias(rNode.FastGetSolutionStepValue(DISPLACEMENT)) += Displacement;
812 noalias(rNode.FastGetSolutionStepValue(DISPLACEMENT,1)) += Displacement;
814 for(
auto& i_fnnodes : FreeNeighbours)
816 noalias(rNode.FastGetSolutionStepValue(VELOCITY)) += i_fnnodes.FastGetSolutionStepValue(VELOCITY);
817 noalias(rNode.FastGetSolutionStepValue(VELOCITY,1)) += i_fnnodes.FastGetSolutionStepValue(VELOCITY,1);
818 noalias(rNode.FastGetSolutionStepValue(ACCELERATION)) += i_fnnodes.FastGetSolutionStepValue(ACCELERATION);
819 noalias(rNode.FastGetSolutionStepValue(ACCELERATION,1)) += i_fnnodes.FastGetSolutionStepValue(ACCELERATION,1);
820 rNode.FastGetSolutionStepValue(PRESSURE) += i_fnnodes.FastGetSolutionStepValue(PRESSURE);
821 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY) += i_fnnodes.FastGetSolutionStepValue(PRESSURE_VELOCITY);
822 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY,1) += i_fnnodes.FastGetSolutionStepValue(PRESSURE_VELOCITY,1);
826 double quotient = 1.0/
double(FreeSurfaceNodes+1);
827 rNode.FastGetSolutionStepValue(VELOCITY) *= quotient;
828 rNode.FastGetSolutionStepValue(VELOCITY,1) *= quotient;
829 rNode.FastGetSolutionStepValue(ACCELERATION) *= quotient;
830 rNode.FastGetSolutionStepValue(ACCELERATION,1) *= quotient;
831 rNode.FastGetSolutionStepValue(PRESSURE) *= quotient;
832 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY) *= quotient;
833 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY,1) *= quotient;
838 else if(FreeSurfaceNodes > 2) {
840 array_1d<double,3> MidPoint;
842 double quotient = 1.0/
double(FreeSurfaceNodes);
843 for(
auto& i_fnnodes : FreeNeighbours)
845 MidPoint += i_fnnodes.Coordinates();
847 noalias(rNode.FastGetSolutionStepValue(VELOCITY)) += i_fnnodes.FastGetSolutionStepValue(VELOCITY);
848 noalias(rNode.FastGetSolutionStepValue(VELOCITY,1)) += i_fnnodes.FastGetSolutionStepValue(VELOCITY,1);
849 noalias(rNode.FastGetSolutionStepValue(ACCELERATION)) += i_fnnodes.FastGetSolutionStepValue(ACCELERATION);
850 noalias(rNode.FastGetSolutionStepValue(ACCELERATION,1)) += i_fnnodes.FastGetSolutionStepValue(ACCELERATION,1);
851 rNode.FastGetSolutionStepValue(PRESSURE) += i_fnnodes.FastGetSolutionStepValue(PRESSURE);
852 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY) += i_fnnodes.FastGetSolutionStepValue(PRESSURE_VELOCITY);
853 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY,1) += i_fnnodes.FastGetSolutionStepValue(PRESSURE_VELOCITY,1);
855 MidPoint *= quotient;
856 array_1d<double,3> Normal = rNode.FastGetSolutionStepValue(NORMAL);
861 array_1d<double,3> Displacement = (MidPoint-rNode.Coordinates()) -
inner_prod( (MidPoint-rNode.Coordinates()), Normal ) * Normal;
862 noalias(rNode.Coordinates()) += Displacement;
863 noalias(rNode.FastGetSolutionStepValue(DISPLACEMENT)) += Displacement;
864 noalias(rNode.FastGetSolutionStepValue(DISPLACEMENT,1)) += Displacement;
866 quotient = 1.0/
double(FreeSurfaceNodes+1);
867 rNode.FastGetSolutionStepValue(VELOCITY) *= quotient;
868 rNode.FastGetSolutionStepValue(VELOCITY,1) *= quotient;
869 rNode.FastGetSolutionStepValue(ACCELERATION) *= quotient;
870 rNode.FastGetSolutionStepValue(ACCELERATION,1) *= quotient;
871 rNode.FastGetSolutionStepValue(PRESSURE) *= quotient;
872 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY) *= quotient;
873 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY,1) *= quotient;
878 std::cout<<
" Boundary node with only one FREE_SURFACE neighbour "<<std::endl;
891 void MoveInsideNode(Node& rNode)
897 unsigned int NumberOfNeighbourNodes = nNodes.size();
903 for(
auto& i_nnode : nNodes)
905 noalias(rNode.Coordinates()) += i_nnode.Coordinates();
906 noalias(rNode.FastGetSolutionStepValue(DISPLACEMENT)) += i_nnode.FastGetSolutionStepValue(DISPLACEMENT);
907 noalias(rNode.FastGetSolutionStepValue(DISPLACEMENT,1)) += i_nnode.FastGetSolutionStepValue(DISPLACEMENT,1);
908 noalias(rNode.FastGetSolutionStepValue(VELOCITY)) += i_nnode.FastGetSolutionStepValue(VELOCITY);
909 noalias(rNode.FastGetSolutionStepValue(VELOCITY,1)) += i_nnode.FastGetSolutionStepValue(VELOCITY,1);
910 noalias(rNode.FastGetSolutionStepValue(ACCELERATION)) += i_nnode.FastGetSolutionStepValue(ACCELERATION);
911 noalias(rNode.FastGetSolutionStepValue(ACCELERATION,1)) += i_nnode.FastGetSolutionStepValue(ACCELERATION,1);
912 rNode.FastGetSolutionStepValue(PRESSURE) += i_nnode.FastGetSolutionStepValue(PRESSURE);
913 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY) += i_nnode.FastGetSolutionStepValue(PRESSURE_VELOCITY);
914 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY,1) += i_nnode.FastGetSolutionStepValue(PRESSURE_VELOCITY,1);
917 double quotient = 1.0/
double(NumberOfNeighbourNodes+1);
919 rNode.Coordinates() *= quotient;
920 rNode.FastGetSolutionStepValue(DISPLACEMENT) *= quotient;
921 rNode.FastGetSolutionStepValue(DISPLACEMENT,1) *= quotient;
924 rNode.GetInitialPosition() = Point(rNode.Coordinates() - rNode.FastGetSolutionStepValue(DISPLACEMENT));
925 rNode.FastGetSolutionStepValue(VELOCITY) *= quotient;
926 rNode.FastGetSolutionStepValue(VELOCITY,1) *= quotient;
927 rNode.FastGetSolutionStepValue(ACCELERATION) *= quotient;
928 rNode.FastGetSolutionStepValue(ACCELERATION,1) *= quotient;
929 rNode.FastGetSolutionStepValue(PRESSURE) *= quotient;
930 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY) *= quotient;
931 rNode.FastGetSolutionStepValue(PRESSURE_VELOCITY,1) *= quotient;
941 void MoveLayerNode(Node& rNode,
const array_1d<double,3>& rDirection,
const double& rDistance)
948 const array_1d<double,3>& VelocityDirection = rNode.FastGetSolutionStepValue(VELOCITY);
951 if(
inner_prod(VelocityDirection,rDirection) > 0 )
954 noalias(rNode.Coordinates()) +=
sign * rDistance * rDirection;
955 rNode.FastGetSolutionStepValue(DISPLACEMENT) +=
sign * rDistance * rDirection;
956 rNode.FastGetSolutionStepValue(DISPLACEMENT,1) +=
sign * rDistance * rDirection;
1008 rOStream << std::endl;
Short class definition.
Definition: bucket.h:57
Base class for all Conditions.
Definition: condition.h:59
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: element.h:83
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 size() const
Definition: geometry.h:518
virtual void NodesInFaces(DenseMatrix< unsigned int > &rNodesInFaces) const
Definition: geometry.h:2195
PointerVector< TPointType > PointsArrayType
Definition: geometry.h:118
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
size_type size() const
Definition: global_pointers_vector.h:307
static T CrossProduct(const T &a, const T &b)
Performs the vector product of the two input vectors a,b.
Definition: math_utils.h:762
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
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
SizeType NumberOfNodes(IndexType ThisIndex=0) const
Definition: model_part.h:341
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
ConditionIterator ConditionsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1371
This class defines the node.
Definition: node.h:65
CoordinatesArrayType const & Coordinates() const
Definition: point.h:215
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
Remove Fluid Nodes Process for 2D and 3D cases.
Definition: remove_fluid_nodes_mesher_process.hpp:40
GlobalPointersVector< Element > ElementWeakPtrVectorType
Definition: remove_fluid_nodes_mesher_process.hpp:56
ConditionType::GeometryType GeometryType
Definition: remove_fluid_nodes_mesher_process.hpp:50
KRATOS_CLASS_POINTER_DEFINITION(RemoveFluidNodesMesherProcess)
Pointer definition of Process.
GlobalPointersVector< Node > NodeWeakPtrVectorType
Definition: remove_fluid_nodes_mesher_process.hpp:55
ModelPart::MeshType::GeometryType::PointsArrayType PointsArrayType
Definition: remove_fluid_nodes_mesher_process.hpp:53
ModelPart::PropertiesType PropertiesType
Definition: remove_fluid_nodes_mesher_process.hpp:49
virtual ~RemoveFluidNodesMesherProcess()
Destructor.
Definition: remove_fluid_nodes_mesher_process.hpp:72
RemoveFluidNodesMesherProcess(ModelPart &rModelPart, MesherUtilities::MeshingParameters &rRemeshingParameters, int EchoLevel)
Default constructor.
Definition: remove_fluid_nodes_mesher_process.hpp:63
ModelPart::ConditionType ConditionType
Definition: remove_fluid_nodes_mesher_process.hpp:48
Bucket< 3, Node, std::vector< Node::Pointer >, Node::Pointer, std::vector< Node::Pointer >::iterator, std::vector< double >::iterator > BucketType
Definition: remove_fluid_nodes_mesher_process.hpp:51
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: remove_fluid_nodes_mesher_process.hpp:112
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: remove_fluid_nodes_mesher_process.hpp:80
std::string Info() const override
Turn back information as a string.
Definition: remove_fluid_nodes_mesher_process.hpp:100
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: remove_fluid_nodes_mesher_process.hpp:106
bool RemoveNodesOnDistance(ModelPart &rModelPart, unsigned int &inside_nodes_removed, unsigned int &boundary_nodes_removed, bool &any_condition_removed) override
Definition: remove_fluid_nodes_mesher_process.hpp:137
Tree< KDTreePartition< BucketType > > KdtreeType
Definition: remove_fluid_nodes_mesher_process.hpp:52
GlobalPointersVector< Condition > ConditionWeakPtrVectorType
Definition: remove_fluid_nodes_mesher_process.hpp:57
Remove Mesh Nodes Process for 2D and 3D cases.
Definition: remove_nodes_mesher_process.hpp:63
MesherUtilities::MeshingParameters & mrRemesh
Definition: remove_nodes_mesher_process.hpp:301
int mEchoLevel
Definition: remove_nodes_mesher_process.hpp:305
virtual bool CheckEngagedNode(Node &rNode, std::vector< Node::Pointer > &rNeighbours, std::vector< double > &rNeighbourDistances, unsigned int &rn_points_in_radius)
Definition: remove_nodes_mesher_process.hpp:506
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: remove_nodes_mesher_process.hpp:117
A generic tree data structure for spatial partitioning.
Definition: tree.h:190
SizeType SearchInRadius(PointType const &ThisPoint, CoordinateType Radius, IteratorType Results, DistanceIteratorType ResultsDistances, SizeType MaxNumberOfResults)
Search for points within a given radius of a point.
Definition: tree.h:434
#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
static double max(double a, double b)
Definition: GeometryFunctions.h:79
static int sign(const double a)
Definition: GeometryFunctions.h:61
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
float velocity
Definition: PecletTest.py:54
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
float radius
Definition: mesh_to_mdpa_converter.py:18
int j
Definition: quadrature.py:648
int counter
Definition: script_THERMAL_CORRECT.py:218
int nnodes
Definition: sensitivityMatrix.py:24
integer i
Definition: TensorModule.f:17
Definition: mesher_utilities.hpp:631
RefiningParameters::Pointer Refine
Definition: mesher_utilities.hpp:684