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.
plane_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_PLANE_BOUNDING_BOX_H_INCLUDED )
11 #define KRATOS_PLANE_BOUNDING_BOX_H_INCLUDED
12 
13 // External includes
14 
15 // System includes
16 
17 // Project includes
19 #include "geometries/line_2d_2.h"
21 
22 namespace Kratos
23 {
24 
27 
31 
35 
39 
43 
45 
56  : public SpatialBoundingBox
57 {
58 public:
59 
60  //typedef BoundedVector<double, 3> PointType;
64  typedef NodesContainerType::Pointer NodesContainerTypePointer;
68 
69 protected:
70 
72  {
73 
74  PointType Point; // plane point
75  PointType Normal; // plane normal
76 
77 
78  public:
79 
80  void Initialize()
81  {
82 
83  Point.clear();
84  Normal.clear();
85 
86  }
87 
88  };
89 
90 
91 public:
94 
97 
101 
104  {
105  KRATOS_TRY
106 
107  std::cout<< "Calling Rigid Plane Wall BBX empty constructor" <<std::endl;
108 
109  KRATOS_CATCH("")
110  }
111 
112  //**************************************************************************
113  //**************************************************************************
114 
115  PlaneBoundingBox(Parameters CustomParameters)
116  {
117 
118  KRATOS_TRY
119 
120  Parameters DefaultParameters( R"(
121  {
122  "parameters_list":[{
123  "point": [0.0, 0.0, 0.0],
124  "normal": [0.0, 0.0, 0.0],
125  "convexity": 1
126  }],
127  "velocity": [0.0, 0.0, 0.0],
128  "plane_size": 1.0
129 
130  } )" );
131 
132 
133  //validate against defaults -- this also ensures no type mismatch
134  CustomParameters.ValidateAndAssignDefaults(DefaultParameters);
135 
136  if(CustomParameters["parameters_list"].IsArray() == true && CustomParameters["parameters_list"].size() != 1)
137  {
138  KRATOS_THROW_ERROR(std::runtime_error,"paramters_list for the Plane BBX must contain only one term",CustomParameters.PrettyPrintJsonString());
139  }
140 
141  mBox.Initialize();
142  mPlane.Initialize();
143 
144  Parameters BoxParameters = CustomParameters["parameters_list"][0];
145 
146  mPlane.Point[0] = BoxParameters["point"][0].GetDouble();
147  mPlane.Point[1] = BoxParameters["point"][1].GetDouble();
148  mPlane.Point[2] = BoxParameters["point"][2].GetDouble();
149 
150  mPlane.Normal[0] = BoxParameters["normal"][0].GetDouble();
151  mPlane.Normal[1] = BoxParameters["normal"][1].GetDouble();
152  mPlane.Normal[2] = BoxParameters["normal"][2].GetDouble();
153 
155 
156  mBox.Velocity[0] = CustomParameters["velocity"][0].GetDouble();
157  mBox.Velocity[1] = CustomParameters["velocity"][1].GetDouble();
158  mBox.Velocity[2] = CustomParameters["velocity"][2].GetDouble();
159 
160  mBox.Radius = CustomParameters["plane_size"].GetDouble();
161 
162  PointType UpperPoint(3);
163  PointType LowerPoint(3);
164 
165  //calculate upper and lower points
166  for(unsigned int i=0; i<3; i++)
167  {
169  mBox.LowerPoint[i] = (-1) * mBox.Radius;
170  }
171 
174 
175  mBox.Convexity = BoxParameters["convexity"].GetInt();
176 
178 
179  mRigidBodyCenterSupplied = false;
180 
181  KRATOS_CATCH("")
182  }
183 
184 
185  //**************************************************************************
186  //**************************************************************************
187 
188  // General Wall constructor
190  PointType Normal,
191  PointType Velocity,
192  int Convexity)
193  {
194  KRATOS_TRY
195 
196  std::cout<<" [--PLANE WALL--] "<<std::endl;
197 
198  mBox.Center = Point;
199  mPlane.Point = Point;
200  mBox.Convexity = Convexity;
201 
202  if( norm_2(Normal) )
203  mPlane.Normal = Normal/norm_2(Normal);
204  else
205  std::cout<<" [ERROR: Normal is Zero]"<<std::endl;
206 
207 
208  std::cout<<" [Convexity:"<<mBox.Convexity<<std::endl;
209  std::cout<<" [Point:"<<mPlane.Point<<std::endl;
210  std::cout<<" [Normal:"<<mPlane.Normal<<std::endl;
211  std::cout<<" [--------] "<<std::endl;
212 
213  mBox.Velocity = Velocity;
214 
216 
217  mRigidBodyCenterSupplied = false;
218 
219  KRATOS_CATCH("")
220  }
221 
222  //**************************************************************************
223  //**************************************************************************
224 
225 
228  {
229  KRATOS_TRY
230 
232  mPlane = rOther.mPlane;
233  return *this;
234 
235  KRATOS_CATCH("")
236  }
237 
238  //**************************************************************************
239  //**************************************************************************
240 
243  :SpatialBoundingBox(rOther)
244  ,mPlane(rOther.mPlane)
245  {
246  }
247 
248  //**************************************************************************
249  //**************************************************************************
250 
252  virtual ~PlaneBoundingBox() {};
253 
254 
258 
259 
260 
264 
265  //**************************************************************************
266  //**************************************************************************
267 
268  void UpdateBoxPosition(const double & rCurrentTime) override
269  {
270 
271  KRATOS_TRY
272 
273  PointType Displacement = this->GetBoxDisplacement(rCurrentTime);
274 
275  mBox.UpdatePosition(Displacement);
276 
278 
279  KRATOS_CATCH("")
280 
281  }
282 
283 
284  //************************************************************************************
285  //************************************************************************************
286 
287 
288  bool IsInside (const PointType& rPoint, double& rCurrentTime, double Radius = 0) override
289  {
290 
291  KRATOS_TRY
292 
293  bool is_inside = false;
294 
295  PointType Displacement = this->GetBoxDisplacement(rCurrentTime);
296 
297  PointType PlanePoint = mBox.InitialCenter + Displacement;
298 
299  if( mBox.Convexity == 1 )
300  PlanePoint += mPlane.Normal * 0.1; //increase the bounding box
301 
302  if( mBox.Convexity == -1 )
303  PlanePoint -= mPlane.Normal * 0.1; //decrease the bounding box
304 
305  is_inside = ContactSearch(rPoint, PlanePoint);
306 
307 
308  return is_inside;
309 
310  KRATOS_CATCH("")
311  }
312 
313 
314  //************************************************************************************
315  //************************************************************************************
316 
317  bool IsInside(BoundingBoxParameters& rValues, const ProcessInfo& rCurrentProcessInfo) override
318  {
319  KRATOS_TRY
320 
321  bool is_inside = false;
322 
323  rValues.SetContactFace(0);
324  rValues.SetRadius(0.0);
325 
326  is_inside = ContactSearch(rValues, rCurrentProcessInfo);
327 
328  return is_inside;
329 
330  KRATOS_CATCH("")
331  }
332 
333 
334  // *********************************************************************************
335  // *********************************************************************************
336  virtual void GetParametricDirections(BoundingBoxParameters & rValues, Vector & rT1, Vector & rT2) override
337  {
338  KRATOS_TRY
339 
340  // GetTheNormalOfThePlane
341  PointType Normal(3);
342  noalias(Normal) = mPlane.Normal;
343  PointType T1(3); PointType T2(3);
344  noalias(T1) = ZeroVector(3); noalias(T2) = ZeroVector(3);
345  this->CalculateOrthonormalBase(Normal, T1, T2);
346 
347  for (unsigned int i = 0; i < 3; i++)
348  {
349  rT1(i) = T1(i); rT2(i) = T2(i);
350  }
351 
352  KRATOS_CATCH("")
353  }
354  //************************************************************************************
355  //************************************************************************************
356 
357  //Plane
358  void CreateBoundingBoxBoundaryMesh(ModelPart& rModelPart, int linear_partitions = 4, int angular_partitions = 4 ) override
359  {
360  KRATOS_TRY
361 
362  unsigned int NodeId = 0;
363  if( rModelPart.IsSubModelPart() )
364  NodeId = this->GetMaxNodeId( rModelPart.GetParentModelPart());
365  else
366  NodeId = this->GetMaxNodeId( rModelPart );
367 
368  unsigned int InitialNodeId = NodeId;
369 
370  //get boundary model parts ( temporary implementation )
371  std::vector<std::string> BoundaryModelPartsName;
372 
373  ModelPart* pMainModelPart = &rModelPart;
374  if( rModelPart.IsSubModelPart() )
375  pMainModelPart = &rModelPart.GetParentModelPart();
376 
377  for(ModelPart::SubModelPartIterator i_mp= pMainModelPart->SubModelPartsBegin() ; i_mp!=pMainModelPart->SubModelPartsEnd(); i_mp++)
378  {
379  if( i_mp->Is(BOUNDARY) || i_mp->Is(ACTIVE) ){
380  for(ModelPart::NodesContainerType::iterator i_node = i_mp->NodesBegin() ; i_node != i_mp->NodesEnd() ; ++i_node)
381  {
382  if( i_node->Id() == rModelPart.Nodes().front().Id() ){
383  BoundaryModelPartsName.push_back(i_mp->Name());
384  break;
385  }
386  }
387  }
388  }
389  //get boundary model parts ( temporary implementation )
390 
391  PointType DirectionX(3);
392  noalias(DirectionX) = mPlane.Normal;
393  PointType DirectionY(3);
394  noalias(DirectionY) = ZeroVector(3);
395  PointType DirectionZ(3);
396  noalias(DirectionZ) = ZeroVector(3);
397 
398  this->CalculateOrthonormalBase(DirectionX, DirectionY, DirectionZ);
399 
400  PointType BasePoint(3);
401  PointType RotationAxis(3);
402  PointType RotatedDirectionY(3);
403 
404  //calculate center
405  PointType Upper = (mBox.UpperPoint - mPlane.Point);
406  Upper -= inner_prod(Upper,mPlane.Normal) * mPlane.Normal;
407 
408  PointType Lower = (mBox.LowerPoint - mPlane.Point);
409  Lower -= inner_prod(Lower,mPlane.Normal) * mPlane.Normal;
410 
411  PointType PlaneCenter = mPlane.Point + 0.5 * (Upper + Lower);
412  double PlaneRadius = norm_2(Upper-Lower);
413  PlaneRadius *= 0.5;
414 
415  double alpha = 0;
417 
418  if( rModelPart.GetProcessInfo()[SPACE_DIMENSION]==2 )
419  angular_partitions = 2;
420  else
421  angular_partitions = 4;
422 
423 
424  for(int k=0; k<angular_partitions; k++)
425  {
426  alpha = (2.0 * 3.14159262 * k)/(double)angular_partitions;
427 
428  //vector of rotation
429  RotationAxis = DirectionX * alpha;
431 
432  RotatedDirectionY = DirectionY;
433 
434  Quaternion.RotateVector3(RotatedDirectionY);
435 
436  //add the angular_partitions points number along the circle
437  NodeId += 1;
438 
439  noalias(BasePoint) = PlaneCenter + PlaneRadius * RotatedDirectionY;
440 
441  NodeType::Pointer pNode = this->CreateNode(rModelPart, BasePoint, NodeId);
442 
443  pNode->Set(RIGID,true);
444 
445  rModelPart.AddNode( pNode );
446 
447  //get boundary model parts ( temporary implementation )
448  for(unsigned int j=0; j<BoundaryModelPartsName.size(); j++)
449  (pMainModelPart->GetSubModelPart(BoundaryModelPartsName[j])).AddNode( pNode );
450  //get boundary model parts ( temporary implementation )
451 
452  }
453 
454  //std::cout<<" Nodes Added "<<NodeId-InitialNodeId<<std::endl;
455  if( rModelPart.GetMesh().WorkingSpaceDimension() == 2 || rModelPart.GetProcessInfo()[SPACE_DIMENSION]==2 ){
456  std::cout<<" CREATE a LINE mesh "<<std::endl;
457  this->CreateLinearBoundaryMesh(rModelPart, InitialNodeId);
458  }
459  else{
460  std::cout<<" CREATE a QUADRILATERAL mesh "<<std::endl;
461  this->CreateQuadrilateralBoundaryMesh(rModelPart, InitialNodeId);
462  }
463 
464  KRATOS_CATCH( "" )
465  }
466 
467 
468 
472 
473 
474 
478 
479 
483 
485  virtual std::string Info() const override
486  {
487  return "PlaneBoundingBox";
488  }
489 
491  virtual void PrintInfo(std::ostream& rOStream) const override
492  {
493  rOStream << Info();
494  }
495 
497  virtual void PrintData(std::ostream& rOStream) const override
498  {
499  rOStream << this->mBox.UpperPoint << " , " << this->mBox.LowerPoint;
500  }
501 
505 
506 
508 
509 protected:
512 
513 
517 
519 
523 
524 
528 
529  //************************************************************************************
530  //************************************************************************************
531 
532  void CreateLinearBoundaryMesh(ModelPart& rModelPart, const unsigned int& rInitialNodeId)
533  {
534 
535  KRATOS_TRY
536 
537  //add elements to computing model part: (in order to be written)
538  ModelPart* pComputingModelPart = NULL;
539  if( rModelPart.IsSubModelPart() )
540  for(ModelPart::SubModelPartIterator i_mp= rModelPart.GetParentModelPart().SubModelPartsBegin() ; i_mp!=rModelPart.GetParentModelPart().SubModelPartsEnd(); i_mp++)
541  {
542  if( i_mp->Is(ACTIVE) ) //computing_domain
543  pComputingModelPart = &rModelPart.GetParentModelPart().GetSubModelPart(i_mp->Name());
544  }
545  else{
546  for(ModelPart::SubModelPartIterator i_mp= rModelPart.SubModelPartsBegin() ; i_mp!=rModelPart.SubModelPartsEnd(); i_mp++)
547  {
548  if( i_mp->Is(ACTIVE) ) //computing_domain
549  pComputingModelPart = &rModelPart.GetSubModelPart(i_mp->Name());
550  }
551  }
552 
553  // Create surface of the cylinder/tube with quadrilateral shell conditions
554  unsigned int ElementId = 0;
555  if( rModelPart.IsSubModelPart() )
556  ElementId = this->GetMaxElementId( rModelPart.GetParentModelPart());
557  else
558  ElementId = this->GetMaxElementId( rModelPart );
559 
560  unsigned int NodeId = 0;
561  if( rModelPart.IsSubModelPart() )
562  NodeId = this->GetMaxNodeId( rModelPart.GetParentModelPart());
563  else
564  NodeId = this->GetMaxNodeId( rModelPart );
565 
566 
567  //GEOMETRY:
568  GeometryType::Pointer pFace;
569  ElementType::Pointer pElement;
570 
571  //PROPERTIES:
572  int number_of_properties = rModelPart.NumberOfProperties();
573  Properties::Pointer pProperties = Kratos::make_shared<Properties>(number_of_properties);
574 
575  int counter = 0;
576  unsigned int Id = rInitialNodeId;
577 
578  Vector FaceNodesIds(2);
579  noalias( FaceNodesIds ) = ZeroVector(2);
580 
581  while(Id < NodeId){
582 
583  counter += 1;
584  ElementId += 1;
585 
586  FaceNodesIds[0] = rInitialNodeId + counter ;
587  FaceNodesIds[1] = rInitialNodeId + counter + 1;
588 
590  FaceNodes.reserve(2);
591 
592  //NOTE: when creating a PointsArrayType
593  //important ask for pGetNode, if you ask for GetNode a copy is created
594  //if a copy is created a segmentation fault occurs when the node destructor is called
595 
596  for(unsigned int j=0; j<2; j++)
597  FaceNodes.push_back(rModelPart.pGetNode(FaceNodesIds[j]));
598 
599  pFace = Kratos::make_shared<Line2D2<NodeType> >(FaceNodes);
600  pElement = Kratos::make_intrusive<Element>(ElementId, pFace, pProperties);
601 
602  rModelPart.AddElement(pElement);
603  pElement->Set(ACTIVE,false);
604  pComputingModelPart->AddElement(pElement);
605 
606  Id = rInitialNodeId + counter + 2;
607 
608  }
609 
610  KRATOS_CATCH( "" )
611 
612  }
613 
614 
615  //************************************************************************************
616  //************************************************************************************
617 
618  void CreateQuadrilateralBoundaryMesh(ModelPart& rModelPart, const unsigned int& rInitialNodeId)
619  {
620 
621  KRATOS_TRY
622 
623  //add elements to computing model part: (in order to be written)
624  ModelPart* pComputingModelPart = NULL;
625  if( rModelPart.IsSubModelPart() )
626  for(ModelPart::SubModelPartIterator i_mp= rModelPart.GetParentModelPart().SubModelPartsBegin() ; i_mp!=rModelPart.GetParentModelPart().SubModelPartsEnd(); i_mp++)
627  {
628  if( i_mp->Is(ACTIVE) ) //computing_domain
629  pComputingModelPart = &rModelPart.GetParentModelPart().GetSubModelPart(i_mp->Name());
630  }
631  else{
632  for(ModelPart::SubModelPartIterator i_mp= rModelPart.SubModelPartsBegin() ; i_mp!=rModelPart.SubModelPartsEnd(); i_mp++)
633  {
634  if( i_mp->Is(ACTIVE) ) //computing_domain
635  pComputingModelPart = &rModelPart.GetSubModelPart(i_mp->Name());
636  }
637  }
638 
639  // Create surface of the cylinder/tube with quadrilateral shell conditions
640  unsigned int ElementId = 0;
641  if( rModelPart.IsSubModelPart() )
642  ElementId = this->GetMaxElementId( rModelPart.GetParentModelPart());
643  else
644  ElementId = this->GetMaxElementId( rModelPart );
645 
646  unsigned int NodeId = 0;
647  if( rModelPart.IsSubModelPart() )
648  NodeId = this->GetMaxNodeId( rModelPart.GetParentModelPart());
649  else
650  NodeId = this->GetMaxNodeId( rModelPart );
651 
652 
653  //GEOMETRY:
654  GeometryType::Pointer pFace;
655  ElementType::Pointer pElement;
656 
657  //PROPERTIES:
658  int number_of_properties = rModelPart.NumberOfProperties();
659  Properties::Pointer pProperties = Kratos::make_shared<Properties>(number_of_properties);
660 
661  int counter = 0;
662  unsigned int Id = rInitialNodeId;
663 
664  Vector FaceNodesIds(4);
665  noalias( FaceNodesIds ) = ZeroVector(4);
666 
667  while(Id < NodeId){
668 
669  counter += 1;
670  ElementId += 1;
671 
672  FaceNodesIds[0] = rInitialNodeId + counter ;
673  FaceNodesIds[1] = rInitialNodeId + counter + 1;
674  FaceNodesIds[2] = rInitialNodeId + counter + 2;
675  FaceNodesIds[3] = rInitialNodeId + counter + 3;
676 
677  //std::cout<<" FaceNodesIds "<<FaceNodesIds<<" element id "<<ElementId<<std::endl;
678 
680  FaceNodes.reserve(4);
681 
682  //NOTE: when creating a PointsArrayType
683  //important ask for pGetNode, if you ask for GetNode a copy is created
684  //if a copy is created a segmentation fault occurs when the node destructor is called
685 
686  for(unsigned int j=0; j<4; j++)
687  FaceNodes.push_back(rModelPart.pGetNode(FaceNodesIds[j]));
688 
689  pFace = Kratos::make_shared<Quadrilateral3D4<NodeType> >(FaceNodes);
690  pElement = Kratos::make_intrusive<Element>(ElementId, pFace, pProperties);
691 
692  rModelPart.AddElement(pElement);
693  pElement->Set(ACTIVE,false);
694  pComputingModelPart->AddElement(pElement);
695 
696  Id = rInitialNodeId + counter + 3;
697 
698  }
699 
700  KRATOS_CATCH( "" )
701 
702  }
703 
707 
708 
712 
713 
717 
718 
720 
721 private:
724 
725 
729 
730 
734  //************************************************************************************
735  //************************************************************************************
736 
737 
738  bool ContactSearch(const PointType& rPoint, const PointType& rPlanePoint)
739  {
740 
741  KRATOS_TRY
742 
743 
744  //1.-compute gap
745  double GapNormal = inner_prod((rPoint - rPlanePoint), mBox.Convexity*mPlane.Normal);
746 
747 
748  if(GapNormal<0)
749  return true;
750  else
751  return false;
752 
753 
754  KRATOS_CATCH( "" )
755 
756  }
757 
758  //************************************************************************************
759  //************************************************************************************
760 
761  //Plane (note: box position has been updated previously)
762  bool ContactSearch(BoundingBoxParameters& rValues, const ProcessInfo& rCurrentProcessInfo)
763  {
764  KRATOS_TRY
765 
766  const PointType& rPoint = rValues.GetPoint();
767  PointType& rNormal = rValues.GetNormal();
768  PointType& rTangent = rValues.GetTangent();
769 
770  double& rGapNormal = rValues.GetGapNormal();
771 
772  rNormal = ZeroVector(3);
773  rTangent = ZeroVector(3);
774 
775  //1.-compute contact normal
776  rNormal = mPlane.Normal;
777 
778  rNormal *= mBox.Convexity;
779 
780  //2.-compute normal gap
781  rGapNormal = inner_prod((rPoint - mPlane.Point), rNormal);
782 
783  this->ComputeContactTangent(rValues,rCurrentProcessInfo);
784 
785  if(rGapNormal<0)
786  return true;
787  else
788  return false;
789 
790  KRATOS_CATCH( "" )
791  }
792 
793 
797 
798 
802 
803 
807 
808 
812 
813 
814 
816 
817 
818 }; // Class PlaneBoundingBox
819 
821 
824 
825 
829 
831 
832 
833 } // namespace Kratos.
834 
835 #endif // KRATOS_PLANE_BOUNDING_BOX_H_INCLUDED defined
Base class for all Elements.
Definition: element.h:60
Geometry base class.
Definition: geometry.h:71
SizeType WorkingSpaceDimension() const
Definition: mesh.h:237
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
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
SubModelPartsContainerType::iterator SubModelPartIterator
Iterator over the sub model parts of this model part.
Definition: model_part.h:258
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
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
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
MeshType & GetMesh(IndexType ThisIndex=0)
Definition: model_part.h:1791
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
Short class definition.
Definition: plane_bounding_box.hpp:57
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: plane_bounding_box.hpp:497
virtual void GetParametricDirections(BoundingBoxParameters &rValues, Vector &rT1, Vector &rT2) override
Definition: plane_bounding_box.hpp:336
PlaneBoundingBox(PointType Point, PointType Normal, PointType Velocity, int Convexity)
Definition: plane_bounding_box.hpp:189
PlaneBoundingBox & operator=(PlaneBoundingBox const &rOther)
Assignment operator.
Definition: plane_bounding_box.hpp:227
ModelPart::ElementType ElementType
Definition: plane_bounding_box.hpp:66
void UpdateBoxPosition(const double &rCurrentTime) override
Definition: plane_bounding_box.hpp:268
NodesContainerType::Pointer NodesContainerTypePointer
Definition: plane_bounding_box.hpp:64
ElementType::GeometryType GeometryType
Definition: plane_bounding_box.hpp:67
PlaneBoundingBox(PlaneBoundingBox const &rOther)
Copy constructor.
Definition: plane_bounding_box.hpp:242
void CreateBoundingBoxBoundaryMesh(ModelPart &rModelPart, int linear_partitions=4, int angular_partitions=4) override
Definition: plane_bounding_box.hpp:358
PlaneBoundingBox()
Default constructor.
Definition: plane_bounding_box.hpp:103
Quaternion< double > QuaternionType
Definition: plane_bounding_box.hpp:65
bool IsInside(BoundingBoxParameters &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: plane_bounding_box.hpp:317
ModelPart::NodesContainerType NodesContainerType
Definition: plane_bounding_box.hpp:63
PlaneBoundingBox(Parameters CustomParameters)
Definition: plane_bounding_box.hpp:115
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: plane_bounding_box.hpp:491
KRATOS_CLASS_POINTER_DEFINITION(PlaneBoundingBox)
Pointer definition of PlaneBoundingBox.
ModelPart::NodeType NodeType
Definition: plane_bounding_box.hpp:62
PlaneVariables mPlane
Definition: plane_bounding_box.hpp:518
virtual ~PlaneBoundingBox()
Destructor.
Definition: plane_bounding_box.hpp:252
virtual std::string Info() const override
Turn back information as a string.
Definition: plane_bounding_box.hpp:485
void CreateQuadrilateralBoundaryMesh(ModelPart &rModelPart, const unsigned int &rInitialNodeId)
Definition: plane_bounding_box.hpp:618
void CreateLinearBoundaryMesh(ModelPart &rModelPart, const unsigned int &rInitialNodeId)
Definition: plane_bounding_box.hpp:532
bool IsInside(const PointType &rPoint, double &rCurrentTime, double Radius=0) override
Definition: plane_bounding_box.hpp:288
array_1d< double, 3 > PointType
Definition: plane_bounding_box.hpp:61
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
PointType GetBoxDisplacement(const double &rCurrentTime)
Definition: spatial_bounding_box.hpp:1181
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
BOOST_UBLAS_INLINE void clear()
Definition: array_1d.h:325
#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
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
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: plane_bounding_box.hpp:72
PointType Normal
Definition: plane_bounding_box.hpp:75
PointType Point
Definition: plane_bounding_box.hpp:74
void Initialize()
Definition: plane_bounding_box.hpp:80
Definition: spatial_bounding_box.hpp:61
void SetContactFace(int ContactFace)
Definition: spatial_bounding_box.hpp:178
void SetRadius(double Radius)
Definition: spatial_bounding_box.hpp:177
PointType InitialCenter
Definition: spatial_bounding_box.hpp:215
void UpdatePosition(PointType &Displacement)
Definition: spatial_bounding_box.hpp:260
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 Center
Definition: spatial_bounding_box.hpp:219
PointType UpperPoint
Definition: spatial_bounding_box.hpp:217
void SetInitialValues()
Definition: spatial_bounding_box.hpp:253
Configure::PointType PointType
Definition: transfer_utility.h:245