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.
sphere_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_SPHERE_BOUNDING_BOX_H_INCLUDED )
11 #define KRATOS_SPHERE_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;
69  typedef NodesContainerType::Pointer NodesContainerTypePointer;
73 
77 
80  {
82 
83  std::cout<< "Calling Rigid Sphere Wall BBX empty constructor" <<std::endl;
84 
85  KRATOS_CATCH("")
86  }
87 
88 
89  //**************************************************************************
90  //**************************************************************************
91 
92  SphereBoundingBox(Parameters CustomParameters)
93  {
94 
96 
97  Parameters DefaultParameters( R"(
98  {
99  "parameters_list":[{
100  "center": [0.0, 0.0, 0.0],
101  "radius": 0.0,
102  "convexity": 1
103  }],
104  "velocity": [0.0, 0.0, 0.0]
105 
106  } )" );
107 
108 
109  //validate against defaults -- this also ensures no type mismatch
110  CustomParameters.ValidateAndAssignDefaults(DefaultParameters);
111 
112  if(CustomParameters["parameters_list"].IsArray() == true && CustomParameters["parameters_list"].size() != 1)
113  {
114  KRATOS_THROW_ERROR(std::runtime_error,"paramters_list for the Sphere BBX must contain only one term",CustomParameters.PrettyPrintJsonString());
115  }
116 
117  mBox.Initialize();
118 
119  Parameters BoxParameters = CustomParameters["parameters_list"][0];
120 
121  mBox.Center[0] = BoxParameters["center"][0].GetDouble();
122  mBox.Center[1] = BoxParameters["center"][1].GetDouble();
123  mBox.Center[2] = BoxParameters["center"][2].GetDouble();
124 
125  mBox.Radius = BoxParameters["radius"].GetDouble();
126 
127  mBox.Velocity[0] = CustomParameters["velocity"][0].GetDouble();
128  mBox.Velocity[1] = CustomParameters["velocity"][1].GetDouble();
129  mBox.Velocity[2] = CustomParameters["velocity"][2].GetDouble();
130 
131  mBox.Convexity = BoxParameters["convexity"].GetInt();
132 
133  PointType Side;
134  Side[0] = mBox.Radius;
135  Side[1] = mBox.Radius;
136  Side[2] = mBox.Radius;
137 
138  mBox.UpperPoint = mBox.Center + Side;
139  mBox.LowerPoint = mBox.Center - Side;
140 
142 
143  mRigidBodyCenterSupplied = false;
144 
145  KRATOS_CATCH("")
146  }
147 
148 
149  //**************************************************************************
150  //**************************************************************************
151 
152 
153  // General Wall constructor
155  double Radius,
156  PointType Velocity,
157  int Convexity)
158 
159  {
160  KRATOS_TRY
161 
162  std::cout<<" [--CIRCLE/SPHERE WALL--] "<<std::endl;
163 
164  mBox.Center = Center;
165  mBox.Radius = Radius;
166  mBox.Convexity = Convexity;
167 
168  std::cout<<" [Convexity:"<<mBox.Convexity<<std::endl;
169  std::cout<<" [Radius:"<<mBox.Radius<<std::endl;
170  std::cout<<" [Center:"<<mBox.Center<<std::endl;
171  std::cout<<" [--------] "<<std::endl;
172 
173  mBox.Velocity = Velocity;
174 
176 
177  mRigidBodyCenterSupplied = false;
178 
179  KRATOS_CATCH("")
180  }
181 
182  //**************************************************************************
183  //**************************************************************************
184 
187  {
188  KRATOS_TRY
189 
191  return *this;
192 
193  KRATOS_CATCH("")
194  }
195 
196  //**************************************************************************
197  //**************************************************************************
198 
201  :SpatialBoundingBox(rOther)
202  {
203  }
204 
205 
206  //**************************************************************************
207  //**************************************************************************
208 
210  virtual ~SphereBoundingBox() {};
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 SphereRadius = mBox.Radius;
234 
235  if( mBox.Convexity == 1)
236  SphereRadius *= 1.25; //increase the bounding box
237 
238  if( mBox.Convexity == -1)
239  SphereRadius *= 0.75; //decrease the bounding box
240 
241  is_inside = ContactSearch(rPoint, SphereRadius);
242 
243  return is_inside;
244 
245  KRATOS_CATCH("")
246  }
247 
248 
249  //************************************************************************************
250  //************************************************************************************
251 
252  bool IsInside(BoundingBoxParameters& rValues, const ProcessInfo& rCurrentProcessInfo) override
253  {
254  KRATOS_TRY
255 
256  bool is_inside = false;
257 
258  rValues.SetContactFace(2);
259 
260  is_inside = ContactSearch(rValues, rCurrentProcessInfo);
261 
262  return is_inside;
263 
264  KRATOS_CATCH("")
265  }
266 
267  // *********************************************************************************
268  // *********************************************************************************
269  virtual void GetParametricDirections(BoundingBoxParameters & rValues, Vector & rT1, Vector & rT2) override
270  {
271  KRATOS_TRY
272 
273  // GetTheNormalOfThePlane
274  const PointType & rPoint = rValues.GetPoint();
275  PointType Normal(3);
276 
277  Normal = rPoint - mBox.Center;
278  Normal /= norm_2(Normal);
279 
280  rT1 = Normal;
281  if ( fabs(Normal(2)) > 1e-5) {
282  rT1(2) = (-pow(Normal(0),2) - pow(Normal(1),2) ) / Normal(2);
283  rT1 /= norm_2(rT1);
284  } else {
285  rT1(0) = 0; rT1(1) = 0; rT1(2) = 1;
286  }
287 
288  rT2 = ZeroVector(3);
289  rT2(0) = Normal(1) * rT1(2) - Normal(2)*rT1(1);
290  rT2(1) = -Normal(0) * rT1(2) + Normal(2)*rT1(0);
291  rT2(2) = Normal(0) * rT1(1) - Normal(1)*rT1(0);
292 
293  KRATOS_CATCH("")
294  }
295 
296  //************************************************************************************
297  //************************************************************************************
298 
299  //Sphere
300  void CreateBoundingBoxBoundaryMesh(ModelPart& rModelPart, int linear_partitions = 4, int angular_partitions = 4 ) override
301  {
302  KRATOS_TRY
303 
304  //std::cout<<" Create Sphere Mesh NODES "<<std::endl;
305 
306  unsigned int NodeId = 0;
307  if( rModelPart.IsSubModelPart() )
308  NodeId = this->GetMaxNodeId( rModelPart.GetParentModelPart());
309  else
310  NodeId = this->GetMaxNodeId( rModelPart );
311 
312  unsigned int InitialNodeId = NodeId;
313 
314  //get boundary model parts ( temporary implementation )
315  std::vector<std::string> BoundaryModelPartsName;
316 
317  ModelPart* pMainModelPart = &rModelPart;
318  if( rModelPart.IsSubModelPart() )
319  pMainModelPart = &rModelPart.GetParentModelPart();
320 
321  for(ModelPart::SubModelPartIterator i_mp= pMainModelPart->SubModelPartsBegin() ; i_mp!=pMainModelPart->SubModelPartsEnd(); i_mp++)
322  {
323  if( i_mp->Is(BOUNDARY) || i_mp->Is(ACTIVE) ){
324  for(ModelPart::NodesContainerType::iterator i_node = i_mp->NodesBegin() ; i_node != i_mp->NodesEnd() ; ++i_node)
325  {
326  if( i_node->Id() == rModelPart.Nodes().front().Id() ){
327  BoundaryModelPartsName.push_back(i_mp->Name());
328  break;
329  }
330  }
331  }
332  }
333  //get boundary model parts ( temporary implementation )
334 
335  PointType DirectionX(3);
336  DirectionX[0] = 0;
337  DirectionX[1] = 0;
338  DirectionX[2] = 1;
339 
340  PointType DirectionY(3);
341  noalias(DirectionY) = ZeroVector(3);
342  PointType DirectionZ(3);
343  noalias(DirectionZ) = ZeroVector(3);
344 
345  this->CalculateOrthonormalBase(DirectionX, DirectionY, DirectionZ);
346 
347  PointType BasePoint(3);
348  PointType RotationAxis(3);
349  PointType RotatedDirectionY(3);
350 
351  double alpha = 0;
353 
354  std::vector<PointType> FacePoints;
355 
356  for(int k=0; k<=angular_partitions; k++)
357  {
358  alpha = (3.14159262 * k)/(double)angular_partitions;
359 
360  //vector of rotation
361  RotationAxis = DirectionX * alpha;
363 
364  RotatedDirectionY = DirectionY;
365 
366  Quaternion.RotateVector3(RotatedDirectionY);
367 
368  //std::cout<<" Rotated "<<RotatedDirectionY<<" alpha "<<alpha<<std::endl;
369 
370  noalias(BasePoint) = mBox.Center + mBox.Radius * RotatedDirectionY;
371 
372  FacePoints.push_back(BasePoint);
373  }
374 
375  unsigned int size = FacePoints.size();
376 
377  for(int k=1; k<=angular_partitions; k++)
378  {
379  alpha = (2 * 3.14159262 * k)/((double)angular_partitions+1);
380 
381  //vector of rotation
382  RotationAxis = DirectionY * alpha;
384 
385  for(unsigned int j=1; j<size-1; j++)
386  {
387  RotatedDirectionY = FacePoints[j]-mBox.Center;
388 
389  Quaternion.RotateVector3(RotatedDirectionY);
390 
391  //std::cout<<" Rotated "<<RotatedDirectionY<<" alpha "<<alpha<<std::endl;
392 
393  noalias(BasePoint) = mBox.Center + RotatedDirectionY;
394 
395  FacePoints.push_back(BasePoint);
396  }
397 
398  }
399 
400  //create modelpart nodes
401  for(unsigned int i=0; i<FacePoints.size(); i++)
402  {
403 
404  NodeId += 1;
405 
406  //std::cout<<" Node["<<NodeId<<"] "<<FacePoints[i]<<std::endl;
407 
408  NodeType::Pointer pNode = this->CreateNode(rModelPart, FacePoints[i], NodeId);
409 
410  pNode->Set(RIGID,true);
411 
412  rModelPart.AddNode( pNode );
413 
414  //get boundary model parts ( temporary implementation )
415  for(unsigned int j=0; j<BoundaryModelPartsName.size(); j++)
416  (pMainModelPart->GetSubModelPart(BoundaryModelPartsName[j])).AddNode( pNode );
417  //get boundary model parts ( temporary implementation )
418 
419  }
420 
421 
422  //std::cout<<" Nodes Added "<<NodeId-InitialNodeId<<std::endl;
423  this->CreateSphereBoundaryMesh(rModelPart, InitialNodeId, angular_partitions);
424 
425  KRATOS_CATCH( "" )
426  }
427 
428 
432 
433 
437 
438 
442 
444  virtual std::string Info() const override
445  {
446  return "SphereBoundingBox";
447  }
448 
450  virtual void PrintInfo(std::ostream& rOStream) const override
451  {
452  rOStream << Info();
453  }
454 
456  virtual void PrintData(std::ostream& rOStream) const override
457  {
458  rOStream << this->mBox.UpperPoint << " , " << this->mBox.LowerPoint;
459  }
460 
464 
465 
467 
468 protected:
471 
472 
476 
477 
481 
482 
486 
487 
488 
489 
490  //************************************************************************************
491  //************************************************************************************
492 
493 
494  bool ContactSearch(const PointType& rPoint, const double& rRadius)
495  {
496 
497  KRATOS_TRY
498 
499  //1.-compute point projection
500  PointType Projection(3);
501  Projection = rRadius * ( (rPoint-mBox.Center)/ norm_2(rPoint-mBox.Center) ) + mBox.Center;
502 
503 
504  //2.-compute gap
505  double GapNormal = 0;
506  if( norm_2(mBox.Center-rPoint) <= rRadius ){
507  GapNormal = (-1) * norm_2(rPoint - Projection);
508  }
509  else{
510  GapNormal = norm_2(Projection - rPoint);
511  }
512 
513  GapNormal *= mBox.Convexity;
514 
515  if(GapNormal<0)
516  return true;
517  else
518  return false;
519 
520 
521  KRATOS_CATCH( "" )
522 
523  }
524 
525 
526  //************************************************************************************
527  //************************************************************************************
528 
529  //Sphere (note: box position has been updated previously)
530  bool ContactSearch(BoundingBoxParameters& rValues, const ProcessInfo& rCurrentProcessInfo)
531  {
532  KRATOS_TRY
533 
534  const PointType& rPoint = rValues.GetPoint();
535  PointType& rNormal = rValues.GetNormal();
536  PointType& rTangent = rValues.GetTangent();
537 
538  double& rGapNormal = rValues.GetGapNormal();
539 
540  rNormal = ZeroVector(3);
541  rTangent = ZeroVector(3);
542 
543  //1.-compute point projection
544  PointType Projection = mBox.Radius * ( (rPoint-mBox.Center) / norm_2(rPoint-mBox.Center) ) + mBox.Center;
545 
546  //2.-compute contact normal
547  rNormal = (Projection-mBox.Center)/mBox.Radius;
548 
549  rNormal *= mBox.Convexity;
550 
551  //3.-compute gap
552  if( norm_2(mBox.Center-rPoint) <= mBox.Radius ){
553  rGapNormal = (-1) * norm_2(rPoint - Projection);
554  }
555  else{
556  rGapNormal = norm_2(Projection - rPoint);
557  }
558 
559  rGapNormal *= mBox.Convexity;
560 
561  this->ComputeContactTangent(rValues,rCurrentProcessInfo);
562 
563  if(rGapNormal<0)
564  return true;
565  else
566  return false;
567 
568 
569  KRATOS_CATCH( "" )
570  }
571 
572 
573  //************************************************************************************
574  //************************************************************************************
575 
576  void CreateSphereBoundaryMesh(ModelPart& rModelPart, const unsigned int& rInitialNodeId, const unsigned int& angular_partitions )
577  {
578 
579  KRATOS_TRY
580 
581  //std::cout<<" Create Sphere Mesh ELEMENTS "<<std::endl;
582 
583  //add elements to computing model part: (in order to be written)
584  ModelPart* pComputingModelPart = NULL;
585  if( rModelPart.IsSubModelPart() )
586  for(ModelPart::SubModelPartIterator i_mp= rModelPart.GetParentModelPart().SubModelPartsBegin() ; i_mp!=rModelPart.GetParentModelPart().SubModelPartsEnd(); i_mp++)
587  {
588  if( i_mp->Is(ACTIVE) ) //computing_domain
589  pComputingModelPart = &rModelPart.GetParentModelPart().GetSubModelPart(i_mp->Name());
590  }
591  else{
592  for(ModelPart::SubModelPartIterator i_mp= rModelPart.SubModelPartsBegin() ; i_mp!=rModelPart.SubModelPartsEnd(); i_mp++)
593  {
594  if( i_mp->Is(ACTIVE) ) //computing_domain
595  pComputingModelPart = &rModelPart.GetSubModelPart(i_mp->Name());
596  }
597  }
598 
599  // Create surface of the cylinder/tube with quadrilateral shell conditions
600  unsigned int ElementId = 0;
601  if( rModelPart.IsSubModelPart() )
602  ElementId = this->GetMaxElementId( rModelPart.GetParentModelPart());
603  else
604  ElementId = this->GetMaxElementId( rModelPart );
605 
606 
607  //GEOMETRY:
608  GeometryType::Pointer pFace;
609  ElementType::Pointer pElement;
610 
611  //PROPERTIES:
612  int number_of_properties = rModelPart.NumberOfProperties();
613  Properties::Pointer pProperties = Kratos::make_shared<Properties>(number_of_properties);
614 
615  //Shere numeration matrix:
616  matrix<int> Connectivities(angular_partitions+2,angular_partitions+1);
617  int counter = 1;
618  for(unsigned int i=0; i<=angular_partitions; i++)
619  {
620  Connectivities(i,0) = 1;
621  if( i == 0){
622  for(unsigned int j=1; j<=angular_partitions; j++)
623  {
624  counter +=1;
625  Connectivities(i,j) = counter;
626  }
627  }
628  else{
629  Connectivities(i,angular_partitions) = angular_partitions+1;
630  for(unsigned int j=1; j<angular_partitions; j++)
631  {
632  counter +=1;
633  Connectivities(i,j) = counter;
634  }
635  }
636 
637  }
638  for(unsigned int i=0; i<=angular_partitions; i++)
639  {
640  Connectivities(angular_partitions+1,i) = Connectivities(0,i);
641  }
642 
643  //std::cout<<" Connectivities "<<Connectivities<<std::endl;
644 
645  Vector FaceNodesIds = ZeroVector(4);
646 
647  for( unsigned int i=0; i<=angular_partitions; i++ )
648  {
649  ElementId += 1;
650 
651  FaceNodesIds[0] = rInitialNodeId + Connectivities(i,0) ;
652  FaceNodesIds[1] = rInitialNodeId + Connectivities(i,1);
653  FaceNodesIds[2] = rInitialNodeId + Connectivities(i+1,1);
654 
656  FaceNodes.reserve(3);
657 
658  //NOTE: when creating a PointsArrayType
659  //important ask for pGetNode, if you ask for GetNode a copy is created
660  //if a copy is created a segmentation fault occurs when the node destructor is called
661 
662  for(unsigned int j=0; j<3; j++)
663  FaceNodes.push_back(rModelPart.pGetNode(FaceNodesIds[j]));
664 
665  //std::cout<<" ElementA "<<FaceNodesIds<<std::endl;
666 
667  pFace = Kratos::make_shared<Triangle3D3<NodeType> >( FaceNodes );
668  pElement = Kratos::make_intrusive<Element>(ElementId, pFace, pProperties);
669 
670  rModelPart.AddElement(pElement);
671  pElement->Set(ACTIVE,false);
672  pComputingModelPart->AddElement(pElement);
673 
674  }
675 
676  counter = 0;
677  for( unsigned int i=1; i<angular_partitions-1; i++)
678  {
679  for( unsigned int k=0; k<=angular_partitions; k++ )
680  {
681  ElementId += 1;
682 
683  FaceNodesIds[0] = rInitialNodeId + Connectivities(k,i);
684  FaceNodesIds[1] = rInitialNodeId + Connectivities(k,i+1);
685  FaceNodesIds[2] = rInitialNodeId + Connectivities(k+1,i+1);
686  FaceNodesIds[3] = rInitialNodeId + Connectivities(k+1,i);
687 
689  FaceNodes.reserve(4);
690 
691  //NOTE: when creating a PointsArrayType
692  //important ask for pGetNode, if you ask for GetNode a copy is created
693  //if a copy is created a segmentation fault occurs when the node destructor is called
694 
695  for(unsigned int j=0; j<4; j++)
696  FaceNodes.push_back(rModelPart.pGetNode(FaceNodesIds[j]));
697 
698  //std::cout<<" ElementB "<<FaceNodesIds<<std::endl;
699 
700  pFace = Kratos::make_shared<Quadrilateral3D4<NodeType> >(FaceNodes);
701  pElement = Kratos::make_intrusive<Element>(ElementId, pFace, pProperties);
702 
703  rModelPart.AddElement(pElement);
704  pElement->Set(ACTIVE,false);
705  pComputingModelPart->AddElement(pElement);
706 
707  }
708  }
709 
710 
711  for( unsigned int i=0; i<=angular_partitions; i++ )
712  {
713  ElementId += 1;
714 
715  FaceNodesIds[0] = rInitialNodeId + Connectivities(i,angular_partitions-1);
716  FaceNodesIds[1] = rInitialNodeId + Connectivities(i,angular_partitions);
717  FaceNodesIds[2] = rInitialNodeId + Connectivities(i+1,angular_partitions-1);
718 
720  FaceNodes.reserve(3);
721 
722  //NOTE: when creating a PointsArrayType
723  //important ask for pGetNode, if you ask for GetNode a copy is created
724  //if a copy is created a segmentation fault occurs when the node destructor is called
725 
726  for(unsigned int j=0; j<3; j++)
727  FaceNodes.push_back(rModelPart.pGetNode(FaceNodesIds[j]));
728 
729 
730  //std::cout<<" ElementC "<<FaceNodesIds<<std::endl;
731 
732  pFace = Kratos::make_shared<Triangle3D3<NodeType>>(FaceNodes);
733  pElement = Kratos::make_intrusive<Element>(ElementId, pFace, pProperties);
734 
735  rModelPart.AddElement(pElement);
736  pElement->Set(ACTIVE,false);
737  pComputingModelPart->AddElement(pElement);
738 
739  }
740 
741 
742  //std::cout<<" Create Sphere Mesh ELEMENTS Created "<<std::endl;
743 
744  KRATOS_CATCH( "" )
745 
746  }
747 
748 
752 
753 
757 
758 
762 
763 
765 
766 private:
769 
770 
774 
775 
779 
780 
784 
785 
789 
790 
794 
795 
799 
800 
802 
803 
804 }; // Class SphereBoundingBox
805 
807 
810 
811 
815 
817 
818 
819 } // namespace Kratos.
820 
821 #endif // KRATOS_SPHERE_BOUNDING_BOX_H_INCLUDED defined
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
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
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
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
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: sphere_bounding_box.hpp:57
virtual void GetParametricDirections(BoundingBoxParameters &rValues, Vector &rT1, Vector &rT2) override
Definition: sphere_bounding_box.hpp:269
bool IsInside(const PointType &rPoint, double &rCurrentTime, double Radius=0) override
Definition: sphere_bounding_box.hpp:226
SphereBoundingBox & operator=(SphereBoundingBox const &rOther)
Assignment operator.
Definition: sphere_bounding_box.hpp:186
SphereBoundingBox(Parameters CustomParameters)
Definition: sphere_bounding_box.hpp:92
SphereBoundingBox(SphereBoundingBox const &rOther)
Copy constructor.
Definition: sphere_bounding_box.hpp:200
bool ContactSearch(const PointType &rPoint, const double &rRadius)
Definition: sphere_bounding_box.hpp:494
bool ContactSearch(BoundingBoxParameters &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: sphere_bounding_box.hpp:530
Quaternion< double > QuaternionType
Definition: sphere_bounding_box.hpp:70
ModelPart::NodesContainerType NodesContainerType
Definition: sphere_bounding_box.hpp:68
NodesContainerType::Pointer NodesContainerTypePointer
Definition: sphere_bounding_box.hpp:69
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: sphere_bounding_box.hpp:456
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: sphere_bounding_box.hpp:450
void CreateBoundingBoxBoundaryMesh(ModelPart &rModelPart, int linear_partitions=4, int angular_partitions=4) override
Definition: sphere_bounding_box.hpp:300
virtual std::string Info() const override
Turn back information as a string.
Definition: sphere_bounding_box.hpp:444
SphereBoundingBox()
Default constructor.
Definition: sphere_bounding_box.hpp:79
ModelPart::NodeType NodeType
Definition: sphere_bounding_box.hpp:67
ModelPart::ElementType ElementType
Definition: sphere_bounding_box.hpp:71
array_1d< double, 3 > PointType
Definition: sphere_bounding_box.hpp:66
bool IsInside(BoundingBoxParameters &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: sphere_bounding_box.hpp:252
KRATOS_CLASS_POINTER_DEFINITION(SphereBoundingBox)
Pointer definition of SphereBoundingBox.
virtual ~SphereBoundingBox()
Destructor.
Definition: sphere_bounding_box.hpp:210
ElementType::GeometryType GeometryType
Definition: sphere_bounding_box.hpp:72
void CreateSphereBoundaryMesh(ModelPart &rModelPart, const unsigned int &rInitialNodeId, const unsigned int &angular_partitions)
Definition: sphere_bounding_box.hpp:576
SphereBoundingBox(PointType Center, double Radius, PointType Velocity, int Convexity)
Definition: sphere_bounding_box.hpp:154
BOOST_UBLAS_INLINE size_type size() const
Definition: array_1d.h:370
#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
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
e
Definition: run_cpp_mpi_tests.py:31
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 Center
Definition: spatial_bounding_box.hpp:219
PointType UpperPoint
Definition: spatial_bounding_box.hpp:217
void SetInitialValues()
Definition: spatial_bounding_box.hpp:253