KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
tube_bounding_box.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosContactMechanicsApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: July 2016 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_TUBE_BOUNDING_BOX_H_INCLUDED )
11 #define KRATOS_TUBE_BOUNDING_BOX_H_INCLUDED
12 
13 // External includes
14 
15 // System includes
16 
17 // Project includes
21 
22 namespace Kratos
23 {
24 
27 
31 
35 
39 
43 
45 
56  : public SpatialBoundingBox
57 {
58 public:
61 
64 
65  //typedef BoundedVector<double, 3> PointType;
67  typedef Node NodeType;
69  typedef NodesContainerType::Pointer NodesContainerTypePointer;
74 
75  //definitions for spatial search
76  typedef NodeType::Pointer NodePointerType;
77  typedef std::vector<NodePointerType> NodePointerTypeVector;
78  typedef std::vector<NodeType> NodeTypeVector;
79  typedef NodePointerTypeVector::iterator NodePointerIterator;
80  typedef std::vector<double> DistanceVector;
81  typedef std::vector<double>::iterator DistanceIterator;
84 
85 
86 public:
87 
91 
94  {
96 
97  std::cout<< "Calling Tube BBX empty constructor" <<std::endl;
98 
99  KRATOS_CATCH("")
100  }
101 
102 
103  //**************************************************************************
104  //**************************************************************************
105 
106  TubeBoundingBox(ModelPart& rModelPart, Parameters CustomParameters)
107  {
108 
109  KRATOS_TRY
110 
111  Parameters DefaultParameters( R"(
112  {
113  "parameters_list":[{
114  "radius": 0.0,
115  "convexity": 1
116  }],
117  "velocity": [0.0, 0.0, 0.0]
118 
119  } )" );
120 
121 
122  //validate against defaults -- this also ensures no type mismatch
123  CustomParameters.ValidateAndAssignDefaults(DefaultParameters);
124 
125  if(CustomParameters["parameters_list"].IsArray() == true && CustomParameters["parameters_list"].size() != 1)
126  {
127  KRATOS_THROW_ERROR(std::runtime_error,"paramters_list for the Tube BBX must contain only one term",CustomParameters.PrettyPrintJsonString());
128  }
129 
130  mBox.Initialize();
131 
132  Parameters BoxParameters = CustomParameters["parameters_list"][0];
133 
134  mBox.Radius = BoxParameters["radius"].GetDouble();
135 
136  mBox.Velocity[0] = CustomParameters["velocity"][0].GetDouble();
137  mBox.Velocity[1] = CustomParameters["velocity"][1].GetDouble();
138  mBox.Velocity[2] = CustomParameters["velocity"][2].GetDouble();
139 
140  mBox.Convexity = BoxParameters["convexity"].GetInt();
141 
143 
144  mRigidBodyCenterSupplied = false;
145 
146  this->CreateKnotsList(rModelPart);
147 
148  KRATOS_CATCH("")
149  }
150 
151 
152  //**************************************************************************
153  //**************************************************************************
154 
155  TubeBoundingBox(ModelPart& rModelPart, double Radius, int Convexity)
156  {
157 
158  KRATOS_TRY
159 
160 
161  mBox.Initialize();
162 
163  mBox.Radius = Radius;
164 
165  mBox.Convexity = Convexity;
166 
168 
169  mRigidBodyCenterSupplied = false;
170 
171  this->CreateKnotsList(rModelPart);
172 
173  KRATOS_CATCH("")
174  }
175 
176  //**************************************************************************
177  //**************************************************************************
178 
181  {
182  KRATOS_TRY
183 
185 
186  mKnotsList = rOther.mKnotsList;
187  mpKnotsKdtree = rOther.mpKnotsKdtree;
188 
189  return *this;
190 
191  KRATOS_CATCH("")
192  }
193 
194  //**************************************************************************
195  //**************************************************************************
196 
199  :SpatialBoundingBox(rOther)
200  ,mKnotsList(rOther.mKnotsList)
202  {
203  }
204 
205 
206  //**************************************************************************
207  //**************************************************************************
208 
210  virtual ~TubeBoundingBox() {};
211 
212 
216 
217 
221 
222 
223  //************************************************************************************
224  //************************************************************************************
225 
226  bool IsInside (const PointType& rPoint, double& rCurrentTime, double Radius = 0) override
227  {
228 
229  KRATOS_TRY
230 
231  bool is_inside = false;
232 
233  double TubeRadius = mBox.Radius-Radius;
234 
235  //outside
236  if( mBox.Convexity == 1)
237  TubeRadius *= 1.25; //increase the bounding box
238 
239  //inside
240  if( mBox.Convexity == -1)
241  TubeRadius *= 0.75; //decrease the bounding box
242 
243  is_inside = ContactSearch(rPoint, TubeRadius);
244 
245  return is_inside;
246 
247  KRATOS_CATCH("")
248  }
249 
250 
251  //************************************************************************************
252  //************************************************************************************
253 
254  bool IsInside(BoundingBoxParameters& rValues, const ProcessInfo& rCurrentProcessInfo) override
255  {
256  KRATOS_TRY
257 
258  bool is_inside = false;
259 
260  rValues.SetContactFace(2);
261 
262  is_inside = ContactSearch(rValues, rCurrentProcessInfo);
263 
264  return is_inside;
265 
266  KRATOS_CATCH("")
267  }
268 
269 
270 
271  //************************************************************************************
272  //************************************************************************************
273 
274  //Tube
275  void CreateBoundingBoxBoundaryMesh(ModelPart& rModelPart, int linear_partitions = 4, int angular_partitions = 4 ) override
276  {
277  KRATOS_TRY
278 
279  //std::cout<<" Create Tube Mesh "<<std::endl;
280 
281  unsigned int NodeId = 0;
282  if( rModelPart.IsSubModelPart() )
283  NodeId = this->GetMaxNodeId( rModelPart.GetParentModelPart());
284  else
285  NodeId = this->GetMaxNodeId( rModelPart );
286 
287  unsigned int InitialNodeId = NodeId;
288 
289  //get boundary model parts ( temporary implementation )
290  std::vector<std::string> BoundaryModelPartsName;
291 
292  ModelPart* pMainModelPart = &rModelPart;
293  if( rModelPart.IsSubModelPart() )
294  pMainModelPart = &rModelPart.GetParentModelPart();
295 
296  for(ModelPart::SubModelPartIterator i_mp= pMainModelPart->SubModelPartsBegin() ; i_mp!=pMainModelPart->SubModelPartsEnd(); i_mp++)
297  {
298  if( i_mp->Is(BOUNDARY) || i_mp->Is(ACTIVE) ){
299  for(ModelPart::NodesContainerType::iterator i_node = i_mp->NodesBegin() ; i_node != i_mp->NodesEnd() ; ++i_node)
300  {
301  if( i_node->Id() == rModelPart.Nodes().front().Id() ){
302  BoundaryModelPartsName.push_back(i_mp->Name());
303  break;
304  }
305  }
306  }
307  }
308  //get boundary model parts ( temporary implementation )
309 
310 
312  double PointId = 0;
313  int KnotId = 0;
314  int number_of_segments = linear_partitions;
315 
316  PointType Point(3);
317 
318  // Create Axis generatrix
319  // for(int i=1; i<mKnotsList.size()-2; i++)
320  // {
321  // Point[0] = mKnotsList[i]->X();
322  // Point[1] = mKnotsList[i]->Y();
323  // Point[2] = mKnotsList[i]->Z();
324 
325  // NodeId += 1;
326  // NodeType::Pointer pNode = this->CreateNode(rModelPart, Point, NodeId);
327  // pNode->Set(RIGID,true);
328  // rModelPart.AddNode( pNode );
329 
330  // //get boundary model parts ( temporary implementation )
331  // for(unsigned int j=0; j<BoundaryModelPartsName.size(); j++)
332  // (pMainModelPart->GetSubModelPart(BoundaryModelPartsName[j])).AddNode( pNode );
333  // //get boundary model parts ( temporary implementation )
334 
335  // KnotId = mKnotsList[i]->Id();
336 
337  // mSplineCurveUtilities.SetSpline(Spline, mKnotsList, KnotId);
338 
339  // PointId = KnotId;
340 
341  // if( i == mKnotsList.size()-3 ) //last segment write last point only
342  // number_of_segments = 1;
343 
344 
345  // for(int j=0; j<number_of_segments; j++)
346  // {
347  // PointId = j/double(linear_partitions);
348 
349  // Point = ZeroVector(3);
350  // Point = mSplineCurveUtilities.PointOnCurve(Point, Spline, PointId);
351 
352  // NodeId += 1;
353  // NodeType::Pointer pNode = this->CreateNode(rModelPart, Point, NodeId);
354  // pNode->Set(RIGID,true);
355  // rModelPart.AddNode( pNode );
356 
357  // //get boundary model parts ( temporary implementation )
358  // for(unsigned int j=0; j<BoundaryModelPartsName.size(); j++)
359  // (pMainModelPart->GetSubModelPart(BoundaryModelPartsName[j])).AddNode( pNode );
360  // //get boundary model parts ( temporary implementation )
361 
362  // }
363 
364  // }
365  // number_of_segments = linear_partitions;
366  // InitialNodeId = NodeId;
367 
368  PointType DirectionX(3);
369 noalias(DirectionX) = ZeroVector(3);
370  PointType DirectionY(3);
371  noalias(DirectionY) = ZeroVector(3);
372  PointType DirectionZ(3);
373  noalias(DirectionZ) = ZeroVector(3);
374 
375  PointType BasePoint(3);
376  PointType RotationAxis(3);
377  PointType RotatedDirectionY(3);
378 
379  double alpha = 0;
381 
382 
383  for(unsigned int i=1; i<mKnotsList.size()-2; i++)
384  {
385  Point[0] = mKnotsList[i]->X();
386  Point[1] = mKnotsList[i]->Y();
387  Point[2] = mKnotsList[i]->Z();
388 
389  KnotId = mKnotsList[i]->Id();
390 
391  mSplineCurveUtilities.SetSpline(Spline, mKnotsList, KnotId);
392 
393  PointId = KnotId;
394 
395  if( i == mKnotsList.size()-3 ) //last segment write last point only
396  number_of_segments = 1;
397 
398  for(int j=0; j<number_of_segments; j++)
399  {
400 
401  PointId = j/double(linear_partitions);
402 
403  Point = ZeroVector(3);
404  Point = mSplineCurveUtilities.PointOnCurve(Point, Spline, PointId);
405 
406  DirectionX = mSplineCurveUtilities.PointOnCurveFirstDerivative(Spline, PointId);
407 
408  this->CalculateOrthonormalBase(DirectionX, DirectionY, DirectionZ);
409 
410 
411  for(int k=0; k<angular_partitions; k++)
412  {
413  alpha = (2.0 * 3.14159262 * k)/(double)angular_partitions;
414 
415  //vector of rotation
416  RotationAxis = DirectionX * alpha;
418 
419  RotatedDirectionY = DirectionY;
420 
421  Quaternion.RotateVector3(RotatedDirectionY);
422 
423  // std::cout<<" alpha "<<alpha<<" cos "<<Q(1,1)<<std::endl;
424  //std::cout<<" Rotated "<<RotatedDirectionY<<" alpha "<<alpha<<std::endl;
425 
426  //add the angular_partitions points number along the circular base of the cylinder
427  NodeId += 1;
428  noalias(BasePoint) = Point + mBox.Radius * RotatedDirectionY;
429 
430  //std::cout<<" BasePoint["<<NodeId<<"] "<<BasePoint<<" radius "<<mBox.Radius<<std::endl;
431 
432  NodeType::Pointer pNode = this->CreateNode(rModelPart, BasePoint, NodeId);
433 
434  pNode->Set(RIGID,true);
435  rModelPart.AddNode( pNode );
436 
437  //get boundary model parts ( temporary implementation )
438  for(unsigned int j=0; j<BoundaryModelPartsName.size(); j++)
439  (pMainModelPart->GetSubModelPart(BoundaryModelPartsName[j])).AddNode( pNode );
440  //get boundary model parts ( temporary implementation )
441 
442  }
443  }
444  }
445 
446  //std::cout<<" Create Tube Mesh NODES "<<std::endl;
447 
448  this->CreateQuadrilateralBoundaryMesh(rModelPart, InitialNodeId, angular_partitions);
449 
450  KRATOS_CATCH( "" )
451  }
452 
453 
457 
458 
459 
463 
464 
468 
470  std::string Info() const override
471  {
472  return "TubeBoundingBox";
473  }
474 
476  void PrintInfo(std::ostream& rOStream) const override
477  {
478  rOStream << Info();
479  }
480 
482  void PrintData(std::ostream& rOStream) const override
483  {
484  rOStream << this->mBox.UpperPoint << " , " << this->mBox.LowerPoint;
485  }
486 
490 
491 
493 
494 protected:
497 
498  std::vector<NodeType::Pointer> mKnotsList;
499 
501 
503 
507 
508 
512 
513 
517 
518  //************************************************************************************
519  //************************************************************************************
520 
521  void CreateKnotsList(ModelPart& rModelPart)
522  {
523  KRATOS_TRY
524  //1.-Create Generatrix
525  NodePointerTypeVector GeneratrixPoints;
526 
527  //Set generatrix control points for a given set of two noded line conditions
528  unsigned int id = 0; //start with 0;
529 
530  NodePointerType GeneratrixPoint;
531 
532  for(ElementsContainerType::iterator ie = rModelPart.ElementsBegin(); ie!=rModelPart.ElementsEnd(); ++ie)
533  {
534  if( ie->GetGeometry().size() > 1){
535 
536  GeneratrixPoint = Kratos::make_intrusive<NodeType>(id, ie->GetGeometry()[0].X(), ie->GetGeometry()[0].Y(), ie->GetGeometry()[0].Z());
537  GeneratrixPoints.push_back( GeneratrixPoint );
538 
539  //std::cout<<" Point ["<<ie->GetGeometry()[0].X()<<", "<<ie->GetGeometry()[0].Y()<<", "<<ie->GetGeometry()[0].Z()<<"] "<<std::endl;
540 
541  id++;
542  }
543  }
544 
545 
546  ElementsContainerType::iterator LastElement = rModelPart.ElementsEnd()-1;
547  int num_nodes = LastElement->GetGeometry().size()-1;
548 
549  GeneratrixPoint = Kratos::make_intrusive<NodeType>(id,LastElement->GetGeometry()[num_nodes].X(),LastElement->GetGeometry()[num_nodes].Y(),LastElement->GetGeometry()[num_nodes].Z());
550  GeneratrixPoints.push_back( GeneratrixPoint );
551 
552  std::cout<<" [DEFINED BY:"<<GeneratrixPoints.size()<<" control points]"<<std::endl;
553 
554  //2.-Create Arch Length Parametrized Spline Curve
555  int SegmentsNumber = 250;
556  mSplineCurveUtilities.CreateParametrizedCurve(GeneratrixPoints, mKnotsList, SegmentsNumber);
557 
558  // for(unsigned int i=0; i<mKnotsList.size(); i++)
559  // std::cout<<" mKnotsListI ["<<i<<"]: "<<mKnotsList[i]->Id()<<std::endl;
560 
561  std::cout<<" [REDEFINED WITH: "<<mKnotsList.size()<<" knots]"<<std::endl;
562 
563 
564  this->CreateKnotsKdtree();
565 
566 
567  KRATOS_CATCH("")
568  }
569 
570  //************************************************************************************
571  //************************************************************************************
572 
574  {
575  KRATOS_TRY
576 
577 
578  //creating an auxiliary list for the pre integration points
579  unsigned int bucket_size = 20;
580 
581  NodePointerTypeVector KnotsList = mKnotsList;
582 
583  unsigned int knots_begin = 1;
584  unsigned int knots_end = 3;
585 
586  mpKnotsKdtree = new KdtreeType(KnotsList.begin()+knots_begin,KnotsList.end()-knots_end,bucket_size);
587 
588 
589  KRATOS_CATCH("")
590  }
591 
592 
593  //************************************************************************************
594  //************************************************************************************
595 
596 
597  bool ContactSearch(const PointType& rPoint, const double& rRadius)
598  {
599 
600  KRATOS_TRY
601 
602  //1.-compute point projection
603  PointType Projection(3);
604  Projection = mSplineCurveUtilities.CalculatePointProjection( rPoint, *mpKnotsKdtree, mKnotsList, Projection );
605 
606  //2.-compute gap
607  double GapNormal = norm_2(rPoint-Projection)-rRadius;
608 
609  GapNormal *= mBox.Convexity;
610 
611  if(GapNormal<0)
612  return true;
613  else
614  return false;
615 
616 
617  KRATOS_CATCH( "" )
618 
619  }
620 
621 
622  //************************************************************************************
623  //************************************************************************************
624 
625  //Tube (note: box position has been updated previously)
626  bool ContactSearch(BoundingBoxParameters& rValues, const ProcessInfo& rCurrentProcessInfo)
627  {
628  KRATOS_TRY
629 
630  const PointType& rPoint = rValues.GetPoint();
631  PointType& rNormal = rValues.GetNormal();
632  PointType& rTangent = rValues.GetTangent();
633 
634  double& rGapNormal = rValues.GetGapNormal();
635 
636  rNormal = ZeroVector(3);
637  rTangent = ZeroVector(3);
638 
639  //1.-compute point projection
640  PointType Projection(3);
641  Projection = mSplineCurveUtilities.CalculatePointProjection( rPoint, *mpKnotsKdtree, mKnotsList, Projection );
642 
643  //2.-compute contact normal
644  rNormal = rPoint-Projection;
645 
646  if(norm_2(rNormal))
647  rNormal /= norm_2(rNormal);
648 
649  rNormal *= mBox.Convexity;
650 
651  //3.-compute gap
652  rGapNormal = norm_2(rPoint-Projection)-mBox.Radius;
653 
654  rGapNormal *= mBox.Convexity;
655 
656  this->ComputeContactTangent(rValues,rCurrentProcessInfo);
657 
658  if(rGapNormal<0)
659  return true;
660  else
661  return false;
662 
663  KRATOS_CATCH( "" )
664  }
665 
666 
667  //************************************************************************************
668  //************************************************************************************
669 
670  void CreateQuadrilateralBoundaryMesh(ModelPart& rModelPart, const unsigned int& rInitialNodeId, const unsigned int& angular_partitions )
671  {
672 
673  KRATOS_TRY
674 
675  //std::cout<<" Create Tube Mesh ELEMENTS "<<std::endl;
676 
677  //add elements to computing model part: (in order to be written)
678  ModelPart* pComputingModelPart = NULL;
679  if( rModelPart.IsSubModelPart() )
680  for(ModelPart::SubModelPartIterator i_mp= rModelPart.GetParentModelPart().SubModelPartsBegin() ; i_mp!=rModelPart.GetParentModelPart().SubModelPartsEnd(); i_mp++)
681  {
682  if( i_mp->Is(ACTIVE) ) //computing_domain
683  pComputingModelPart = &rModelPart.GetParentModelPart().GetSubModelPart(i_mp->Name());
684  }
685  else{
686  for(ModelPart::SubModelPartIterator i_mp= rModelPart.SubModelPartsBegin() ; i_mp!=rModelPart.SubModelPartsEnd(); i_mp++)
687  {
688  if( i_mp->Is(ACTIVE) ) //computing_domain
689  pComputingModelPart = &rModelPart.GetSubModelPart(i_mp->Name());
690  }
691  }
692 
693  // Create surface of the cylinder/tube with quadrilateral shell conditions
694  unsigned int ElementId = 0;
695  if( rModelPart.IsSubModelPart() )
696  ElementId = this->GetMaxElementId( rModelPart.GetParentModelPart());
697  else
698  ElementId = this->GetMaxElementId( rModelPart );
699 
700 
701  unsigned int NodeId = 0;
702  if( rModelPart.IsSubModelPart() )
703  NodeId = this->GetMaxNodeId( rModelPart.GetParentModelPart());
704  else
705  NodeId = this->GetMaxNodeId( rModelPart );
706 
707 
708  //GEOMETRY:
709  GeometryType::Pointer pFace;
710  ElementType::Pointer pElement;
711 
712  //PROPERTIES:
713  int number_of_properties = rModelPart.NumberOfProperties();
714  Properties::Pointer pProperties = Kratos::make_shared<Properties>(number_of_properties);
715 
716  unsigned int local_counter = 1;
717  unsigned int counter = 0;
718  unsigned int Id = rInitialNodeId;
719 
720  Vector FaceNodesIds = ZeroVector(4);
721 
722  while(Id < NodeId){
723 
724  counter += 1;
725  ElementId += 1;
726 
727  if( local_counter < angular_partitions ){
728 
729  FaceNodesIds[0] = rInitialNodeId + counter ;
730  FaceNodesIds[1] = rInitialNodeId + counter + 1;
731  FaceNodesIds[2] = rInitialNodeId + counter + angular_partitions + 1;
732  FaceNodesIds[3] = rInitialNodeId + counter + angular_partitions;
733 
734  //std::cout<<" ElementA "<<FaceNodesIds<<std::endl;
735 
737  FaceNodes.reserve(4);
738 
739  //NOTE: when creating a PointsArrayType
740  //important ask for pGetNode, if you ask for GetNode a copy is created
741  //if a copy is created a segmentation fault occurs when the node destructor is called
742 
743  for(unsigned int j=0; j<4; j++)
744  FaceNodes.push_back(rModelPart.pGetNode(FaceNodesIds[j]));
745 
746  pFace = Kratos::make_shared<Quadrilateral3D4<NodeType> >(FaceNodes);
747  pElement = Kratos::make_intrusive<Element>(ElementId, pFace, pProperties);
748 
749  rModelPart.AddElement(pElement);
750  pElement->Set(ACTIVE,false);
751  pComputingModelPart->AddElement(pElement);
752 
753  local_counter++;
754 
755  }
756  else if( local_counter == angular_partitions ){
757 
758  FaceNodesIds[0] = rInitialNodeId + counter ;
759  FaceNodesIds[1] = rInitialNodeId + counter + 1 - angular_partitions;
760  FaceNodesIds[2] = rInitialNodeId + counter + 1;
761  FaceNodesIds[3] = rInitialNodeId + counter + angular_partitions;
762 
763  //std::cout<<" ElementB "<<FaceNodesIds<<std::endl;
764 
766  FaceNodes.reserve(4);
767 
768  for(unsigned int j=0; j<4; j++)
769  FaceNodes.push_back(rModelPart.pGetNode(FaceNodesIds[j]));
770 
771  pFace = Kratos::make_shared<Quadrilateral3D4<NodeType> >(FaceNodes);
772  pElement = Kratos::make_intrusive<Element>(ElementId, pFace, pProperties);
773 
774  rModelPart.AddElement(pElement);
775  pElement->Set(ACTIVE,false);
776  pComputingModelPart->AddElement(pElement);
777 
778  local_counter = 1;
779  }
780 
781  Id = rInitialNodeId + counter + angular_partitions;
782  }
783 
784 
785  //std::cout<<" Create Tube Mesh ELEMENTS CREATED "<<std::endl;
786 
787  KRATOS_CATCH( "" )
788 
789  }
790 
791 
795 
796 
800 
801 
805 
806 
808 
809 private:
812 
813 
817 
818 
822 
823 
827 
828 
832 
833 
837 
838 
842 
843 
845 
846 
847 }; // Class TubeBoundingBox
848 
850 
853 
854 
858 
860 
861 
862 } // namespace Kratos.
863 
864 #endif // KRATOS_TUBE_BOUNDING_BOX_H_INCLUDED defined
Short class definition.
Definition: bucket.h:57
Base class for all Elements.
Definition: element.h:60
Geometry base class.
Definition: geometry.h:71
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
SubModelPartIterator SubModelPartsEnd()
Definition: model_part.h:1708
SubModelPartIterator SubModelPartsBegin()
Definition: model_part.h:1698
void AddNode(NodeType::Pointer pNewNode, IndexType ThisIndex=0)
Definition: model_part.cpp:211
SizeType NumberOfProperties(IndexType ThisIndex=0) const
Returns the number of properties of the mesh.
Definition: model_part.cpp:575
bool IsSubModelPart() const
Definition: model_part.h:1893
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
SubModelPartsContainerType::iterator SubModelPartIterator
Iterator over the sub model parts of this model part.
Definition: model_part.h:258
NodeType::Pointer pGetNode(IndexType NodeId, IndexType ThisIndex=0)
Definition: model_part.h:421
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
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
void AddElement(ElementType::Pointer pNewElement, IndexType ThisIndex=0)
Definition: model_part.cpp:917
ModelPart & GetParentModelPart()
Definition: model_part.cpp:2124
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
double GetDouble() const
This method returns the double contained in the current Parameter.
Definition: kratos_parameters.cpp:657
const std::string PrettyPrintJsonString() const
This method returns a string with the corresponding text to the equivalent *.json file (this version ...
Definition: kratos_parameters.cpp:415
int GetInt() const
This method returns the integer contained in the current Parameter.
Definition: kratos_parameters.cpp:666
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
Point class.
Definition: point.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
void reserve(size_type dim)
Definition: pointer_vector.h:319
void push_back(const TPointerType &x)
Definition: pointer_vector.h:270
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
void RotateVector3(const TVector3_A &a, TVector3_B &b) const
Definition: quaternion.h:325
static Quaternion FromRotationVector(double rx, double ry, double rz)
Definition: quaternion.h:427
Short class definition.
Definition: spatial_bounding_box.hpp:48
bool mRigidBodyCenterSupplied
Definition: spatial_bounding_box.hpp:1150
void CalculateOrthonormalBase(PointType &rDirectionVectorX, PointType &rDirectionVectorY, PointType &rDirectionVectorZ)
Definition: spatial_bounding_box.hpp:1408
void ComputeContactTangent(BoundingBoxParameters &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: spatial_bounding_box.hpp:1274
NodeType::Pointer CreateNode(ModelPart &rModelPart, PointType &rPoint, const unsigned int &rNodeId)
Definition: spatial_bounding_box.hpp:1357
static unsigned int GetMaxNodeId(ModelPart &rModelPart)
Definition: spatial_bounding_box.hpp:1314
static unsigned int GetMaxElementId(ModelPart &rModelPart)
Definition: spatial_bounding_box.hpp:1334
BoundingBoxVariables mBox
Definition: spatial_bounding_box.hpp:1152
virtual SpatialBoundingBox & operator=(SpatialBoundingBox const &rOther)
Assignment operator.
Definition: spatial_bounding_box.hpp:540
Short class definition.
Definition: spline_curve_utilities.hpp:44
PointType PointOnCurveFirstDerivative(const SplineType &rSpline, double &t, double s=0.5)
Definition: spline_curve_utilities.hpp:1006
void SetSpline(SplineType &rOutputSpline, const SplineType &rInputSpline)
Definition: spline_curve_utilities.hpp:509
PointType & CalculatePointProjection(const PointType &rPoint, KdtreeType &rKnotsKdtree, const NodePointerTypeVector &rKnotsList, PointType &rPointProjection)
Definition: spline_curve_utilities.hpp:567
PointType & PointOnCurve(PointType &rPoint, const SplineType &rSpline, double &t, double s=0.5)
Definition: spline_curve_utilities.hpp:987
void CreateParametrizedCurve(NodePointerTypeVector &rGeneratrixPoints, NodePointerTypeVector &rKnotsList, int m)
Definition: spline_curve_utilities.hpp:101
A generic tree data structure for spatial partitioning.
Definition: tree.h:190
Short class definition.
Definition: tube_bounding_box.hpp:57
bool ContactSearch(BoundingBoxParameters &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: tube_bounding_box.hpp:626
bool IsInside(const PointType &rPoint, double &rCurrentTime, double Radius=0) override
Definition: tube_bounding_box.hpp:226
bool ContactSearch(const PointType &rPoint, const double &rRadius)
Definition: tube_bounding_box.hpp:597
array_1d< double, 3 > PointType
Definition: tube_bounding_box.hpp:66
TubeBoundingBox(TubeBoundingBox const &rOther)
Copy constructor.
Definition: tube_bounding_box.hpp:198
std::string Info() const override
Turn back information as a string.
Definition: tube_bounding_box.hpp:470
KRATOS_CLASS_POINTER_DEFINITION(TubeBoundingBox)
Pointer definition of TubeBoundingBox.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: tube_bounding_box.hpp:476
virtual ~TubeBoundingBox()
Destructor.
Definition: tube_bounding_box.hpp:210
std::vector< NodeType > NodeTypeVector
Definition: tube_bounding_box.hpp:78
ModelPart::ElementType ElementType
Definition: tube_bounding_box.hpp:72
Node NodeType
Definition: tube_bounding_box.hpp:67
TubeBoundingBox & operator=(TubeBoundingBox const &rOther)
Assignment operator.
Definition: tube_bounding_box.hpp:180
TubeBoundingBox(ModelPart &rModelPart, Parameters CustomParameters)
Definition: tube_bounding_box.hpp:106
std::vector< NodeType::Pointer > mKnotsList
Definition: tube_bounding_box.hpp:498
Bucket< 3, NodeType, NodePointerTypeVector, NodePointerType, NodePointerIterator, DistanceIterator > BucketType
Definition: tube_bounding_box.hpp:82
Tree< KDTreePartition< BucketType > > KdtreeType
Definition: tube_bounding_box.hpp:83
ElementType::GeometryType GeometryType
Definition: tube_bounding_box.hpp:73
std::vector< double > DistanceVector
Definition: tube_bounding_box.hpp:80
NodePointerTypeVector::iterator NodePointerIterator
Definition: tube_bounding_box.hpp:79
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: tube_bounding_box.hpp:482
KdtreeType * mpKnotsKdtree
Definition: tube_bounding_box.hpp:500
ModelPart::NodesContainerType NodesContainerType
Definition: tube_bounding_box.hpp:68
std::vector< NodePointerType > NodePointerTypeVector
Definition: tube_bounding_box.hpp:77
NodesContainerType::Pointer NodesContainerTypePointer
Definition: tube_bounding_box.hpp:69
TubeBoundingBox()
Default constructor.
Definition: tube_bounding_box.hpp:93
void CreateKnotsKdtree()
Definition: tube_bounding_box.hpp:573
NodeType::Pointer NodePointerType
Definition: tube_bounding_box.hpp:76
ModelPart::ElementsContainerType ElementsContainerType
Definition: tube_bounding_box.hpp:70
void CreateQuadrilateralBoundaryMesh(ModelPart &rModelPart, const unsigned int &rInitialNodeId, const unsigned int &angular_partitions)
Definition: tube_bounding_box.hpp:670
std::vector< double >::iterator DistanceIterator
Definition: tube_bounding_box.hpp:81
Quaternion< double > QuaternionType
Definition: tube_bounding_box.hpp:71
TubeBoundingBox(ModelPart &rModelPart, double Radius, int Convexity)
Definition: tube_bounding_box.hpp:155
void CreateBoundingBoxBoundaryMesh(ModelPart &rModelPart, int linear_partitions=4, int angular_partitions=4) override
Definition: tube_bounding_box.hpp:275
void CreateKnotsList(ModelPart &rModelPart)
Definition: tube_bounding_box.hpp:521
SplineCurveUtilities mSplineCurveUtilities
Definition: tube_bounding_box.hpp:502
bool IsInside(BoundingBoxParameters &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: tube_bounding_box.hpp:254
#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
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
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
alpha
Definition: generate_convection_diffusion_explicit_element.py:113
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
int counter
Definition: script_THERMAL_CORRECT.py:218
integer i
Definition: TensorModule.f:17
Definition: spatial_bounding_box.hpp:61
void SetContactFace(int ContactFace)
Definition: spatial_bounding_box.hpp:178
PointType & GetTangent()
Definition: spatial_bounding_box.hpp:189
double & GetGapNormal()
Definition: spatial_bounding_box.hpp:193
const PointType & GetPoint()
Definition: spatial_bounding_box.hpp:181
PointType & GetNormal()
Definition: spatial_bounding_box.hpp:188
int Convexity
Definition: spatial_bounding_box.hpp:210
PointType Velocity
Definition: spatial_bounding_box.hpp:221
PointType LowerPoint
Definition: spatial_bounding_box.hpp:218
double Radius
Definition: spatial_bounding_box.hpp:211
void Initialize()
Definition: spatial_bounding_box.hpp:229
PointType UpperPoint
Definition: spatial_bounding_box.hpp:217
void SetInitialValues()
Definition: spatial_bounding_box.hpp:253
Definition: spline_curve_utilities.hpp:66