10 #if !defined(KRATOS_SPATIAL_BOUNDING_BOX_H_INCLUDED )
11 #define KRATOS_SPATIAL_BOUNDING_BOX_H_INCLUDED
93 mpCurrentDisplacement=NULL;
94 mpPreviousDisplacement=NULL;
98 mpRelativeDisplacement=NULL;
123 mpRelativeDisplacement=NULL;
145 mpTangent = &rTangent;
147 mpRelativeDisplacement = &rDisplacement;
149 mpGapNormal = &rGapNormal;
150 mpGapTangent = &rGapTangent;
232 Axisymmetric =
false;
240 InitialUpperPoint.
clear();
241 InitialLowerPoint.
clear();
242 InitialCenter.
clear();
245 AngularVelocity.
clear();
248 InitialLocalQuaternion = QuaternionType::FromRotationMatrix( InitialLocalMatrix );
249 LocalQuaternion = QuaternionType::FromRotationMatrix( InitialLocalMatrix );
255 InitialUpperPoint = UpperPoint;
256 InitialLowerPoint = LowerPoint;
257 InitialCenter = Center;
262 UpperPoint = InitialUpperPoint + Displacement;
263 LowerPoint = InitialLowerPoint + Displacement;
264 Center = InitialCenter + Displacement;
269 std::cout<<
" [--SPATIAL-BOX--] "<<std::endl;
270 std::cout<<
" [Center:"<<Center<<std::endl;
271 std::cout<<
" [UpperPoint:"<<UpperPoint<<std::endl;
272 std::cout<<
" [LowerPoint:"<<LowerPoint<<std::endl;
273 std::cout<<
" [--------] "<<std::endl;
301 mRigidBodyCenterSupplied =
false;
319 "upper_point": [0.0, 0.0, 0.0],
320 "lower_point": [0.0, 0.0, 0.0],
323 "velocity": [0.0, 0.0, 0.0],
324 "angular_velocity": [0.0, 0.0, 0.0],
325 "local_axes":[ [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0] ]
332 if(CustomParameters[
"parameters_list"].IsArray() ==
true && CustomParameters[
"parameters_list"].size() != 1)
339 Parameters BoxParameters = CustomParameters[
"parameters_list"][0];
341 mBox.UpperPoint[0] = BoxParameters[
"upper_point"][0].
GetDouble();
342 mBox.UpperPoint[1] = BoxParameters[
"upper_point"][1].
GetDouble();
343 mBox.UpperPoint[2] = BoxParameters[
"upper_point"][2].
GetDouble();
345 mBox.LowerPoint[0] = BoxParameters[
"lower_point"][0].
GetDouble();
346 mBox.LowerPoint[1] = BoxParameters[
"lower_point"][1].
GetDouble();
347 mBox.LowerPoint[2] = BoxParameters[
"lower_point"][2].
GetDouble();
349 mBox.Center = 0.5 * ( mBox.UpperPoint + mBox.LowerPoint );
350 mBox.Radius = 0.5 *
norm_2(mBox.UpperPoint - mBox.LowerPoint);
352 mBox.Velocity[0] = CustomParameters[
"velocity"][0].
GetDouble();
353 mBox.Velocity[1] = CustomParameters[
"velocity"][1].
GetDouble();
354 mBox.Velocity[2] = CustomParameters[
"velocity"][2].
GetDouble();
356 mBox.AngularVelocity[0] = CustomParameters[
"angular_velocity"][0].
GetDouble();
357 mBox.AngularVelocity[1] = CustomParameters[
"angular_velocity"][1].
GetDouble();
358 mBox.AngularVelocity[2] = CustomParameters[
"angular_velocity"][2].
GetDouble();
360 mBox.Convexity = BoxParameters[
"convexity"].
GetInt();
364 unsigned int size = CustomParameters[
"local_axes"].
size();
366 for(
unsigned int i=0;
i<size;
i++ )
368 Parameters LocalAxesRow = CustomParameters[
"local_axes"][
i];
370 InitialLocalMatrix(0,
i) = LocalAxesRow[0].
GetDouble();
371 InitialLocalMatrix(1,
i) = LocalAxesRow[1].
GetDouble();
372 InitialLocalMatrix(2,
i) = LocalAxesRow[2].
GetDouble();
376 this->MapToLocalFrame(mBox.InitialLocalQuaternion,mBox);
378 BeamMathUtilsType::MapToCurrentLocalFrame(mBox.InitialLocalQuaternion, mBox.Velocity);
379 BeamMathUtilsType::MapToCurrentLocalFrame(mBox.InitialLocalQuaternion, mBox.AngularVelocity);
381 mBox.SetInitialValues();
383 mRigidBodyCenterSupplied =
false;
396 mBox.UpperPoint = rUpperPoint;
397 mBox.LowerPoint = rLowerPoint;
399 mBox.Center = 0.5 * ( rUpperPoint + rLowerPoint );
400 mBox.Radius = 0.5 *
norm_2(rUpperPoint-rLowerPoint);
403 this->MapToLocalFrame(mBox.InitialLocalQuaternion,mBox);
405 BeamMathUtilsType::MapToCurrentLocalFrame(mBox.InitialLocalQuaternion, mBox.Velocity);
406 BeamMathUtilsType::MapToCurrentLocalFrame(mBox.InitialLocalQuaternion, mBox.AngularVelocity);
408 mBox.SetInitialValues();
410 mRigidBodyCenterSupplied =
false;
423 mBox.Center = rCenter;
424 mBox.Radius = rRadius;
427 Side[0] = mBox.Radius;
428 Side[1] = mBox.Radius;
429 Side[2] = mBox.Radius;
431 mBox.UpperPoint = mBox.Center + Side;
432 mBox.LowerPoint = mBox.Center - Side;
435 this->MapToLocalFrame(mBox.InitialLocalQuaternion,mBox);
437 mBox.SetInitialValues();
439 mRigidBodyCenterSupplied =
false;
461 KRATOS_ERROR <<
" spatial_bounding_box: the supplied ModelPart does not have elements or conditions " << std::endl;
466 for(
unsigned int i=0;
i<3; ++
i)
474 for(ModelPart::NodesContainerType::iterator in = rModelPart.
NodesBegin(); in!=rModelPart.
NodesEnd(); ++in)
476 if(in->Is(BOUNDARY) ){
479 if(Maximum[0]<in->X())
482 if(Maximum[1]<in->Y())
485 if(Maximum[2]<in->Z())
489 if(Minimum[0]>in->X())
492 if(Minimum[1]>in->Y())
495 if(Minimum[2]>in->Z())
503 mBox.Center = 0.5*(Maximum+Minimum);
505 double MaxRadius =
min;
507 if(Maximum[0]-Minimum[0] > MaxRadius)
508 MaxRadius = Maximum[0]-Minimum[0];
510 if(Maximum[1]-Minimum[1] > MaxRadius)
511 MaxRadius = Maximum[1]-Minimum[1];
513 if(Maximum[2]-Minimum[2]>MaxRadius)
514 MaxRadius = Maximum[2]-Minimum[2];
517 mBox.Radius = rRadius + 0.5*(MaxRadius);
520 Side[0] = mBox.Radius + mBox.Radius *
factor;
521 Side[1] = mBox.Radius + mBox.Radius *
factor;
522 Side[2] = mBox.Radius + mBox.Radius *
factor;
524 mBox.UpperPoint = mBox.Center + Side;
525 mBox.LowerPoint = mBox.Center - Side;
528 this->MapToLocalFrame(mBox.InitialLocalQuaternion,mBox);
530 mRigidBodyCenterSupplied =
false;
559 :mpRigidBodyCenter(rOther.mpRigidBodyCenter)
560 ,mRigidBodyCenterSupplied(rOther.mRigidBodyCenterSupplied)
590 PointType Displacement = this->GetBoxDisplacement(rCurrentTime);
592 mBox.UpdatePosition(Displacement);
594 this->MapToLocalFrame(mBox.LocalQuaternion, mBox);
611 PointType Displacement = this->GetBoxDisplacement(rCurrentTime);
613 mBox.UpdatePosition(Displacement);
615 this->MapToLocalFrame(mBox.LocalQuaternion, mBox);
618 BeamMathUtilsType::MapToCurrentLocalFrame(mBox.InitialLocalQuaternion, LocalPoint);
620 if( (mBox.UpperPoint[0]>=LocalPoint[0] && mBox.LowerPoint[0]<=LocalPoint[0])
621 && (mBox.UpperPoint[1]>=LocalPoint[1] && mBox.LowerPoint[1]<=LocalPoint[1])
622 && (mBox.UpperPoint[2]>=LocalPoint[2] && mBox.LowerPoint[2]<=LocalPoint[2]) ){
630 this->MapToLocalFrame(LocaQuaternionlConjugate, mBox);
651 unsigned int count = 0;
652 for(
unsigned int i=0;
i<mBox.Center.size(); ++
i)
654 if( mBox.UpperPoint[
i] == mBox.LowerPoint[
i] )
660 if(
count == mBox.Center.size() ){
661 std::cout<<
" IsInside:: warning spatial BOX not set "<<std::endl;
668 BeamMathUtilsType::MapToCurrentLocalFrame(mBox.InitialLocalQuaternion, LocalPoint);
680 if( (mBox.UpperPoint[0]>=LocalPoint[0] && mBox.LowerPoint[0]<=LocalPoint[0])
681 && (mBox.UpperPoint[1]>=LocalPoint[1] && mBox.LowerPoint[1]<=LocalPoint[1])
682 && (mBox.UpperPoint[2]>=LocalPoint[2] && mBox.LowerPoint[2]<=LocalPoint[2]) ){
704 std::cout<<
"Calling empty method" <<std::endl;
729 mBox.UpperPoint = rUpperPoint;
730 mBox.InitialUpperPoint = rUpperPoint;
738 mBox.LowerPoint = rLowerPoint;
739 mBox.InitialLowerPoint = rLowerPoint;
748 mBox.Velocity = rVelocity;
749 BeamMathUtilsType::MapToCurrentLocalFrame(mBox.InitialLocalQuaternion, mBox.Velocity);
757 mBox.AngularVelocity = rAngularVelocity;
758 BeamMathUtilsType::MapToCurrentLocalFrame(mBox.InitialLocalQuaternion, mBox.AngularVelocity);
774 mBox.Axisymmetric =
true;
782 mpRigidBodyCenter = pCenter;
783 mRigidBodyCenterSupplied =
true;
810 if( mRigidBodyCenterSupplied ){
812 for(
unsigned int i=0;
i<3; ++
i)
813 Velocity[
i] = rVelocity[
i];
816 Velocity = mBox.Velocity;
817 BeamMathUtilsType::MapToReferenceLocalFrame(mBox.InitialLocalQuaternion, Velocity);
827 BeamMathUtilsType::MapToReferenceLocalFrame(mBox.InitialLocalQuaternion, mBox.Center);
836 KRATOS_WARNING(
"") <<
"Calling spatial bounding box base class method "<<std::endl;
837 BeamMathUtilsType::MapToReferenceLocalFrame(mBox.InitialLocalQuaternion, mBox.Center);
848 ModelPart::ConditionsContainerType::iterator condition_begin = rModelPart.
ConditionsBegin();
849 const unsigned int dimension = condition_begin->GetGeometry().WorkingSpaceDimension();
851 std::vector<PointType > Holes;
853 for(ModelPart::NodesContainerType::iterator in = rModelPart.
NodesBegin(); in!=rModelPart.
NodesEnd(); ++in)
855 if(in->IsNot(BOUNDARY) ){
862 Holes.push_back(
Point);
868 std::cout<<
" Normal "<<Normal<<std::endl;
869 double tolerance = 0.25;
871 Point[0] = in->
X() - Normal[0] * tolerance;
872 Point[1] = in->
Y() - Normal[1] * tolerance;
874 Point[2] = in->
Z() - Normal[2] * tolerance;
876 Holes.push_back(
Point);
889 void GetVertices(std::vector<PointType >& rVertices,
const double& rCurrentTime,
const unsigned int& rDimension)
892 PointType Displacement = this->GetBoxDisplacement( rCurrentTime );
894 PointType Reference = mBox.UpperPoint + Displacement;
896 PointType Side = mBox.UpperPoint - mBox.LowerPoint;
898 Reference[1] -= Side[1];
901 rVertices.push_back(Reference);
903 Reference[1] += Side[1];
906 rVertices.push_back(Reference);
908 Reference[0] -= Side[0];
911 rVertices.push_back(Reference);
913 Reference[1] -= Side[1];
916 rVertices.push_back(Reference);
919 if( rDimension == 3 ){
921 Reference = mBox.LowerPoint + Displacement;
923 Reference[0] += Side[0];
926 rVertices.push_back(Reference);
928 Reference[0] -= Side[0];
931 rVertices.push_back(Reference);
933 Reference[1] += Side[1];
936 rVertices.push_back(Reference);
938 Reference[0] += Side[0];
941 rVertices.push_back(Reference);
954 if( rDimension == 2 ){
956 if(rFaces.size1() != 4 || rFaces.size2() != 2)
972 else if ( rDimension == 3 ){
974 if(rFaces.size1() != 12 || rFaces.size2() != 3)
975 rFaces.
resize(12,3,
false);
1035 if( rDimension == 2 ){
1037 if(rFaces.size1() != 4 || rFaces.size2() != 2)
1038 rFaces.
resize(4,2,
false);
1053 else if ( rDimension == 3 ){
1055 if(rFaces.size1() != 6 || rFaces.size2() != 4)
1056 rFaces.
resize(6,4,
false);
1100 std::cout<<
" Calling Spatial Bounding Box empty boundary mesh creation" <<std::endl;
1117 return "SpatialBoundingBox";
1129 rOStream << mBox.UpperPoint <<
" , " << mBox.LowerPoint;
1170 BeamMathUtilsType::MapToCurrentLocalFrame(rQuaternion, rBox.
UpperPoint);
1171 BeamMathUtilsType::MapToCurrentLocalFrame(rQuaternion, rBox.
LowerPoint);
1172 BeamMathUtilsType::MapToCurrentLocalFrame(rQuaternion, rBox.
Center);
1187 if( mRigidBodyCenterSupplied ){
1189 array_1d<double, 3 > & CurrentDisplacement = mpRigidBodyCenter->FastGetSolutionStepValue(DISPLACEMENT);
1190 for(
int i=0;
i<3; ++
i )
1191 Displacement[
i] = CurrentDisplacement[
i];
1193 if( mpRigidBodyCenter->SolutionStepsDataHas(ROTATION) ){
1194 array_1d<double, 3 > & CurrentRotation = mpRigidBodyCenter->FastGetSolutionStepValue(ROTATION);
1195 for(
int i=0;
i<3; ++
i )
1196 Rotation[
i] = CurrentRotation[
i];
1208 Displacement = mBox.
Velocity * rCurrentTime;
1217 return Displacement;
1232 if( mRigidBodyCenterSupplied ){
1234 array_1d<double, 3 > & CurrentDisplacement = mpRigidBodyCenter->FastGetSolutionStepValue(DISPLACEMENT,0);
1235 array_1d<double, 3 > & PreviousDisplacement = mpRigidBodyCenter->FastGetSolutionStepValue(DISPLACEMENT,1);
1236 for(
int i=0;
i<3; ++
i )
1237 Displacement[
i] = CurrentDisplacement[
i]-PreviousDisplacement[
i];
1256 Displacement = mBox.
Velocity * (rCurrentTime - rPreviousTime);
1268 return Displacement;
1292 rRelativeDisplacement = BoxDeltaDisplacement-PointDeltaDisplacement;
1294 rTangent = (rRelativeDisplacement) -
inner_prod(rRelativeDisplacement, rNormal) * rNormal;
1300 rGapTangent =
norm_2(rTangent);
1303 rTangent/=
norm_2(rTangent);
1318 unsigned int max_id = rModelPart.
Nodes().back().Id();
1320 for(ModelPart::NodesContainerType::iterator i_node = rModelPart.
NodesBegin(); i_node!= rModelPart.
NodesEnd(); ++i_node)
1322 if(i_node->Id() > max_id)
1323 max_id = i_node->Id();
1341 unsigned int max_id = rModelPart.
Elements().back().Id();
1343 for(ModelPart::ElementsContainerType::iterator i_elem = rModelPart.
ElementsBegin(); i_elem!= rModelPart.
ElementsEnd(); ++i_elem)
1345 if(i_elem->Id() > max_id)
1346 max_id = i_elem->Id();
1362 NodeType::Pointer
Node = rModelPart.
CreateNewNode( rNodeId, rPoint[0], rPoint[1], rPoint[2]);
1368 for(NodeType::DofsContainerType::iterator iii = reference_dofs.begin(); iii != reference_dofs.end(); ++iii)
1377 for(NodeType::DofsContainerType::iterator iii = new_dofs.begin(); iii != new_dofs.end(); ++iii)
1421 if( VectorNorm != 0)
1422 rDirectionVectorX /= VectorNorm;
1427 double tolerance = 1.0/64.0;
1428 if(fabs(rDirectionVectorX[0])< tolerance && fabs(rDirectionVectorX[1])< tolerance){
1437 if( VectorNorm != 0)
1438 rDirectionVectorY /= VectorNorm;
1444 if( VectorNorm != 0 )
1445 rDirectionVectorZ /= VectorNorm;
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Definition: beam_math_utilities.hpp:31
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
void FixDof()
Definition: dof.h:338
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
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
static double Norm(const Vector &a)
Calculates the norm of vector "a".
Definition: math_utils.h:703
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
NodeType::Pointer CreateNewNode(int Id, double x, double y, double z, VariablesList::Pointer pNewVariablesList, IndexType ThisIndex=0)
Definition: model_part.cpp:270
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
SizeType NumberOfElements(IndexType ThisIndex=0) const
Definition: model_part.h:1027
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
SizeType NumberOfConditions(IndexType ThisIndex=0) const
Definition: model_part.h:1218
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
TVariableType::Type & FastGetSolutionStepValue(const TVariableType &rThisVariable)
Definition: node.h:435
DofsContainerType & GetDofs()
Definition: node.h:694
std::vector< std::unique_ptr< Dof< double > >> DofsContainerType
The DoF container type definition.
Definition: node.h:92
DofType::Pointer pAddDof(TVariableType const &rDofVariable)
Definition: node.h:759
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
SizeType size() const
This method returns the total size of the current array parameter.
Definition: kratos_parameters.cpp:993
Point class.
Definition: point.h:59
CoordinatesArrayType const & Coordinates() const
Definition: point.h:215
double Y() const
Definition: point.h:187
double Z() const
Definition: point.h:193
double X() const
Definition: point.h:181
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
ProcessInfo & GetPreviousTimeStepInfo(IndexType StepsBefore=1)
Definition: process_info.h:187
Quaternion conjugate() const
Definition: quaternion.h:195
Short class definition.
Definition: spatial_bounding_box.hpp:48
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: spatial_bounding_box.hpp:1121
void SetRigidBodyCenter(NodeType::Pointer pCenter)
Definition: spatial_bounding_box.hpp:780
virtual bool IsInside(const PointType &rPoint)
Definition: spatial_bounding_box.hpp:643
virtual bool IsInside(BoundingBoxParameters &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: spatial_bounding_box.hpp:700
virtual double GetRadius(const PointType &rPoint)
Definition: spatial_bounding_box.hpp:799
virtual void CreateBoundingBoxBoundaryMesh(ModelPart &rModelPart, int linear_partitions=4, int angular_partitions=4)
Definition: spatial_bounding_box.hpp:1096
void SetVelocity(PointType &rVelocity)
Definition: spatial_bounding_box.hpp:746
bool mRigidBodyCenterSupplied
Definition: spatial_bounding_box.hpp:1150
virtual double GetRadius()
Definition: spatial_bounding_box.hpp:791
SpatialBoundingBox(const PointType &rCenter, const double &rRadius)
Definition: spatial_bounding_box.hpp:418
virtual void UpdateBoxPosition(const double &rCurrentTime)
Definition: spatial_bounding_box.hpp:585
PointType GetBoxDisplacement(const double &rCurrentTime)
Definition: spatial_bounding_box.hpp:1181
void GetTriangularFaces(DenseMatrix< unsigned int > &rFaces, const unsigned int &rDimension)
Definition: spatial_bounding_box.hpp:950
void CalculateOrthonormalBase(PointType &rDirectionVectorX, PointType &rDirectionVectorY, PointType &rDirectionVectorZ)
Definition: spatial_bounding_box.hpp:1408
array_1d< double, 3 > PointType
Definition: spatial_bounding_box.hpp:52
BeamMathUtils< double > BeamMathUtilsType
Definition: spatial_bounding_box.hpp:56
void SetAxisymmetric()
Definition: spatial_bounding_box.hpp:772
SpatialBoundingBox(Parameters CustomParameters)
Definition: spatial_bounding_box.hpp:311
virtual std::string Info() const
Turn back information as a string.
Definition: spatial_bounding_box.hpp:1115
void ComputeContactTangent(BoundingBoxParameters &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: spatial_bounding_box.hpp:1274
Quaternion< double > QuaternionType
Definition: spatial_bounding_box.hpp:57
void SetAngularVelocity(PointType &rAngularVelocity)
Definition: spatial_bounding_box.hpp:755
void SetDimension(int dimension)
Definition: spatial_bounding_box.hpp:764
NodeType::Pointer CreateNode(ModelPart &rModelPart, PointType &rPoint, const unsigned int &rNodeId)
Definition: spatial_bounding_box.hpp:1357
SpatialBoundingBox(const PointType &rLowerPoint, const PointType &rUpperPoint)
Definition: spatial_bounding_box.hpp:391
static unsigned int GetMaxNodeId(ModelPart &rModelPart)
Definition: spatial_bounding_box.hpp:1314
virtual PointType GetCenter(const PointType &rPoint)
Definition: spatial_bounding_box.hpp:834
SpatialBoundingBox(SpatialBoundingBox const &rOther)
Copy constructor.
Definition: spatial_bounding_box.hpp:558
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: spatial_bounding_box.hpp:1127
KRATOS_CLASS_POINTER_DEFINITION(SpatialBoundingBox)
Pointer definition of SpatialBoundingBox.
NodesContainerType::Pointer NodesContainerTypePointer
Definition: spatial_bounding_box.hpp:55
virtual PointType GetVelocity()
Definition: spatial_bounding_box.hpp:807
virtual void GetParametricDirections(BoundingBoxParameters &rValues, Vector &rT1, Vector &rT2)
Definition: spatial_bounding_box.hpp:711
void SetLowerPoint(PointType &rLowerPoint)
Definition: spatial_bounding_box.hpp:736
void GetQuadrilateralFaces(DenseMatrix< unsigned int > &rFaces, const unsigned int &rDimension)
Definition: spatial_bounding_box.hpp:1031
static unsigned int GetMaxElementId(ModelPart &rModelPart)
Definition: spatial_bounding_box.hpp:1334
virtual ~SpatialBoundingBox()
Destructor.
Definition: spatial_bounding_box.hpp:570
SpatialBoundingBox(ModelPart &rModelPart, const double &rRadius, double factor=0)
Definition: spatial_bounding_box.hpp:447
NodeType::Pointer mpRigidBodyCenter
Definition: spatial_bounding_box.hpp:1148
ModelPart::NodesContainerType NodesContainerType
Definition: spatial_bounding_box.hpp:54
SpatialBoundingBox()
Default constructor.
Definition: spatial_bounding_box.hpp:296
BoundingBoxVariables mBox
Definition: spatial_bounding_box.hpp:1152
void MapToLocalFrame(QuaternionType &rQuaternion, BoundingBoxVariables &rBox)
Definition: spatial_bounding_box.hpp:1166
PointType GetBoxDeltaDisplacement(const double &rCurrentTime, const double &rPreviousTime)
Definition: spatial_bounding_box.hpp:1224
void SetUpperPoint(PointType &rUpperPoint)
Definition: spatial_bounding_box.hpp:727
virtual SpatialBoundingBox & operator=(SpatialBoundingBox const &rOther)
Assignment operator.
Definition: spatial_bounding_box.hpp:540
virtual bool IsInside(const PointType &rPoint, double &rCurrentTime, double Radius=0)
Definition: spatial_bounding_box.hpp:604
ModelPart::NodeType NodeType
Definition: spatial_bounding_box.hpp:53
std::vector< PointType > GetHoles(ModelPart &rModelPart)
Compute inside holes.
Definition: spatial_bounding_box.hpp:845
void GetVertices(std::vector< PointType > &rVertices, const double &rCurrentTime, const unsigned int &rDimension)
Compute vertices.
Definition: spatial_bounding_box.hpp:889
virtual PointType GetCenter()
Definition: spatial_bounding_box.hpp:825
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
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_WARNING(label)
Definition: logger.h:265
static double max(double a, double b)
Definition: GeometryFunctions.h:79
static double min(double a, double b)
Definition: GeometryFunctions.h:71
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
AMatrix::IdentityMatrix< double > IdentityMatrix
Definition: amatrix_interface.h:564
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
int count
Definition: generate_frictional_mortar_condition.py:212
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
integer i
Definition: TensorModule.f:17
float factor
for node in (self.combined_model_part).Nodes: pold = node.GetSolutionStepValue(PRESSURE,...
Definition: ulf_PGLASS.py:254
Definition: spatial_bounding_box.hpp:61
void SetPreviousDisplacement(const PointType &rDisplacement)
Definition: spatial_bounding_box.hpp:168
BoundingBoxParameters(const NodeType &rNode, double &rGapNormal, double &rGapTangent, PointType &rNormal, PointType &rTangent, PointType &rDisplacement)
Definition: spatial_bounding_box.hpp:136
void SetNode(const NodeType &rNode)
Definition: spatial_bounding_box.hpp:157
void SetVelocity(const PointType &rVelocity)
Definition: spatial_bounding_box.hpp:166
PointType GetDeltaDisplacement()
Definition: spatial_bounding_box.hpp:186
const PointType & GetVelocity()
Definition: spatial_bounding_box.hpp:182
void SetNormal(PointType &rNormal)
Definition: spatial_bounding_box.hpp:170
void SetPoint(const PointType &rPoint)
Definition: spatial_bounding_box.hpp:165
void SetContactFace(int ContactFace)
Definition: spatial_bounding_box.hpp:178
void SetCurrentDisplacement(const PointType &rDisplacement)
Definition: spatial_bounding_box.hpp:167
void SetGapNormal(double &rGapNormal)
Definition: spatial_bounding_box.hpp:174
const PointType & GetPreviousDisplacement()
Definition: spatial_bounding_box.hpp:184
void SetTangent(PointType &rTangent)
Definition: spatial_bounding_box.hpp:171
KRATOS_CLASS_POINTER_DEFINITION(BoundingBoxParameters)
void SetRelativeDisplacement(PointType &rDisplacement)
Definition: spatial_bounding_box.hpp:172
PointType & GetTangent()
Definition: spatial_bounding_box.hpp:189
double & GetGapNormal()
Definition: spatial_bounding_box.hpp:193
BoundingBoxParameters()
Definition: spatial_bounding_box.hpp:87
double & GetRadius()
Definition: spatial_bounding_box.hpp:196
PointType & GetRelativeDisplacement()
Definition: spatial_bounding_box.hpp:190
void SetGapTangent(double &rGapTangent)
Definition: spatial_bounding_box.hpp:175
int & GetContactFace()
Definition: spatial_bounding_box.hpp:197
double & GetGapTangent()
Definition: spatial_bounding_box.hpp:194
const PointType & GetPoint()
Definition: spatial_bounding_box.hpp:181
void SetRadius(double Radius)
Definition: spatial_bounding_box.hpp:177
const PointType & GetCurrentDisplacement()
Definition: spatial_bounding_box.hpp:183
PointType & GetNormal()
Definition: spatial_bounding_box.hpp:188
BoundingBoxParameters(const NodeType &rNode)
Definition: spatial_bounding_box.hpp:111
Definition: spatial_bounding_box.hpp:206
PointType InitialCenter
Definition: spatial_bounding_box.hpp:215
bool Axisymmetric
Definition: spatial_bounding_box.hpp:209
PointType AngularVelocity
Definition: spatial_bounding_box.hpp:222
PointType InitialLowerPoint
Definition: spatial_bounding_box.hpp:214
QuaternionType InitialLocalQuaternion
Definition: spatial_bounding_box.hpp:224
void UpdatePosition(PointType &Displacement)
Definition: spatial_bounding_box.hpp:260
int Dimension
Definition: spatial_bounding_box.hpp:208
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
PointType InitialUpperPoint
Definition: spatial_bounding_box.hpp:213
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
void Print()
Definition: spatial_bounding_box.hpp:267
QuaternionType LocalQuaternion
Definition: spatial_bounding_box.hpp:225