10 #if !defined(KRATOS_CYLINDER_BOUNDING_BOX_H_INCLUDED )
11 #define KRATOS_CYLINDER_BOUNDING_BOX_H_INCLUDED
82 std::cout<<
"Calling Cylinder Wall BBX empty constructor" <<std::endl;
99 "first_center": [0.0, 0.0, 0.0],
100 "second_center": [0.0, 0.0, 0.0],
104 "velocity": [0.0, 0.0, 0.0]
112 if(CustomParameters[
"parameters_list"].IsArray() ==
true && CustomParameters[
"parameters_list"].size() != 1)
119 Parameters BoxParameters = CustomParameters[
"parameters_list"][0];
169 std::cout<<
" [--CYLINDER WALL--] "<<std::endl;
174 mBox.
Center = 0.5 * (FirstCenter+SecondCenter);
179 std::cout<<
" [Radius:"<<
mBox.
Radius<<std::endl;
182 std::cout<<
" [--------] "<<std::endl;
248 bool is_inside =
false;
254 CylinderRadius *= 1.25;
258 CylinderRadius *= 0.75;
275 bool is_inside =
false;
300 double AxisLength =
norm_2(Axis);
306 unsigned int NodeId = 0;
312 unsigned int InitialNodeId = NodeId;
315 std::vector<std::string> BoundaryModelPartsName;
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)
326 if( i_node->Id() == rModelPart.
Nodes().front().Id() ){
327 BoundaryModelPartsName.push_back(i_mp->Name());
336 double SingleLength = AxisLength / (
double)linear_partitions;
368 for(
int i=0;
i<linear_partitions;
i++)
372 for(
int k=0;
k<angular_partitions;
k++)
374 alpha = (2.0 * 3.14159262 *
k)/(
double)angular_partitions;
377 RotationAxis = DirectionX *
alpha;
380 RotatedDirectionY = DirectionY;
393 NodeType::Pointer pNode = this->
CreateNode(rModelPart, BasePoint, NodeId);
395 pNode->Set(RIGID,
true);
399 for(
unsigned int j=0;
j<BoundaryModelPartsName.size();
j++)
400 (pMainModelPart->
GetSubModelPart(BoundaryModelPartsName[
j])).AddNode( pNode );
431 std::string
Info()
const override
433 return "CylinderBoundingBox";
497 double GapNormal =
norm_2(rPoint-Projection)-rRadius;
539 rNormal = rPoint-Projection;
542 rNormal /=
norm_2(rNormal);
577 if( i_mp->Is(ACTIVE) )
583 if( i_mp->Is(ACTIVE) )
589 unsigned int ElementId = 0;
596 unsigned int NodeId = 0;
604 GeometryType::Pointer pFace;
605 ElementType::Pointer pElement;
609 Properties::Pointer pProperties = Kratos::make_shared<Properties>(number_of_properties);
611 unsigned int local_counter = 1;
613 unsigned int Id = rInitialNodeId;
622 if( local_counter < angular_partitions ){
624 FaceNodesIds[0] = rInitialNodeId +
counter ;
625 FaceNodesIds[1] = rInitialNodeId +
counter + 1;
626 FaceNodesIds[2] = rInitialNodeId +
counter + angular_partitions + 1;
627 FaceNodesIds[3] = rInitialNodeId +
counter + angular_partitions;
638 for(
unsigned int j=0;
j<4;
j++)
641 pFace = Kratos::make_shared<Quadrilateral3D4<NodeType> >(FaceNodes);
642 pElement = Kratos::make_intrusive<Element>(ElementId, pFace, pProperties);
645 pElement->Set(ACTIVE,
false);
646 pComputingModelPart->AddElement(pElement);
651 else if( local_counter == angular_partitions ){
653 FaceNodesIds[0] = rInitialNodeId +
counter ;
654 FaceNodesIds[1] = rInitialNodeId +
counter + 1 - angular_partitions;
655 FaceNodesIds[2] = rInitialNodeId +
counter + 1;
656 FaceNodesIds[3] = rInitialNodeId +
counter + angular_partitions;
663 for(
unsigned int j=0;
j<4;
j++)
666 pFace = Kratos::make_shared<Quadrilateral3D4<NodeType> >(FaceNodes);
667 pElement = Kratos::make_intrusive<Element>(ElementId, pFace, pProperties);
670 pElement->Set(ACTIVE,
false);
671 pComputingModelPart->AddElement(pElement);
676 Id = rInitialNodeId +
counter + angular_partitions;
Short class definition.
Definition: cylinder_bounding_box.hpp:56
NodesContainerType::Pointer NodesContainerTypePointer
Definition: cylinder_bounding_box.hpp:68
std::string Info() const override
Turn back information as a string.
Definition: cylinder_bounding_box.hpp:431
CylinderBoundingBox(CylinderBoundingBox const &rOther)
Copy constructor.
Definition: cylinder_bounding_box.hpp:215
CylinderBoundingBox()
Default constructor.
Definition: cylinder_bounding_box.hpp:78
PointType mSecondCenter
Definition: cylinder_bounding_box.hpp:460
bool IsInside(const PointType &rPoint, double &rCurrentTime, double Radius=0) override
Definition: cylinder_bounding_box.hpp:243
ElementType::GeometryType GeometryType
Definition: cylinder_bounding_box.hpp:71
CylinderBoundingBox(Parameters CustomParameters)
Definition: cylinder_bounding_box.hpp:91
CylinderBoundingBox(PointType FirstCenter, PointType SecondCenter, double Radius, PointType Velocity, int Convexity)
Definition: cylinder_bounding_box.hpp:160
Quaternion< double > QuaternionType
Definition: cylinder_bounding_box.hpp:69
CylinderBoundingBox & operator=(CylinderBoundingBox const &rOther)
Assignment operator.
Definition: cylinder_bounding_box.hpp:197
ModelPart::ElementType ElementType
Definition: cylinder_bounding_box.hpp:70
array_1d< double, 3 > PointType
Definition: cylinder_bounding_box.hpp:65
bool ContactSearch(BoundingBoxParameters &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: cylinder_bounding_box.hpp:516
KRATOS_CLASS_POINTER_DEFINITION(CylinderBoundingBox)
Pointer definition of CylinderBoundingBox.
ModelPart::NodesContainerType NodesContainerType
Definition: cylinder_bounding_box.hpp:67
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: cylinder_bounding_box.hpp:437
void CreateBoundingBoxBoundaryMesh(ModelPart &rModelPart, int linear_partitions=4, int angular_partitions=4) override
Definition: cylinder_bounding_box.hpp:292
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: cylinder_bounding_box.hpp:443
PointType mFirstCenter
Definition: cylinder_bounding_box.hpp:459
ModelPart::NodeType NodeType
Definition: cylinder_bounding_box.hpp:66
bool IsInside(BoundingBoxParameters &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: cylinder_bounding_box.hpp:271
virtual ~CylinderBoundingBox()
Destructor.
Definition: cylinder_bounding_box.hpp:227
void CreateQuadrilateralBoundaryMesh(ModelPart &rModelPart, const unsigned int &rInitialNodeId, const unsigned int &angular_partitions)
Definition: cylinder_bounding_box.hpp:565
bool ContactSearch(const PointType &rPoint, const double &rRadius)
Definition: cylinder_bounding_box.hpp:483
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
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
#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
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 Center
Definition: spatial_bounding_box.hpp:219
PointType UpperPoint
Definition: spatial_bounding_box.hpp:217
void SetInitialValues()
Definition: spatial_bounding_box.hpp:253