10 #if !defined(KRATOS_CIRCLE_BOUNDING_BOX_H_INCLUDED )
11 #define KRATOS_CIRCLE_BOUNDING_BOX_H_INCLUDED
81 std::cout<<
"Calling Rigid Circle Wall BBX empty constructor" <<std::endl;
164 unsigned int NodeId = 0;
170 unsigned int InitialNodeId = NodeId;
173 std::vector<std::string> BoundaryModelPartsName;
181 if( i_mp->Is(BOUNDARY) || i_mp->Is(ACTIVE) ){
182 for(ModelPart::NodesContainerType::iterator i_node = i_mp->NodesBegin() ; i_node != i_mp->NodesEnd() ; i_node++)
184 if( i_node->Id() == rModelPart.
Nodes().front().Id() ){
185 BoundaryModelPartsName.push_back(i_mp->Name());
212 for(
int k=0;
k<angular_partitions;
k++)
214 alpha = (2.0 * 3.14159262 *
k)/(
double)angular_partitions;
217 RotationAxis = DirectionX *
alpha;
220 RotatedDirectionY = DirectionY;
229 std::cout<<
" node id "<<NodeId<<std::endl;
233 NodeType::Pointer pNode = this->
CreateNode(rModelPart, BasePoint, NodeId);
235 pNode->Set(RIGID,
true);
240 for(
unsigned int j=0;
j<BoundaryModelPartsName.size();
j++)
241 (pMainModelPart->
GetSubModelPart(BoundaryModelPartsName[
j])).AddNode( pNode );
268 std::string
Info()
const override
270 return "CircleBoundingBox";
324 if( i_mp->Is(ACTIVE) )
330 if( i_mp->Is(ACTIVE) )
336 unsigned int ElementId = 0;
342 unsigned int NodeId = 0;
350 GeometryType::Pointer pFace;
351 ElementType::Pointer pElement;
355 Properties::Pointer pProperties = Kratos::make_shared<Properties>(number_of_properties);
358 unsigned int Id = rInitialNodeId;
367 FaceNodesIds[0] = rInitialNodeId +
counter ;
368 FaceNodesIds[1] = rInitialNodeId +
counter + 1;
379 for(
unsigned int j=0;
j<2;
j++)
382 pFace = Kratos::make_shared<Line2D2<NodeType> >(FaceNodes);
383 pElement = Kratos::make_intrusive<Element>(ElementId, pFace, pProperties);
386 pElement->Set(ACTIVE,
false);
387 pComputingModelPart->AddElement(pElement);
389 Id = rInitialNodeId +
counter + 1;
397 FaceNodesIds[0] = rInitialNodeId +
counter + 1;
398 FaceNodesIds[1] = rInitialNodeId + 1;
407 for(
unsigned int j=0;
j<2;
j++)
412 pFace = Kratos::make_shared<Line2D2<NodeType> >(FaceNodes);
413 pElement = Kratos::make_intrusive<Element>(ElementId, pFace, pProperties);
416 pElement->Set(ACTIVE,
false);
417 pComputingModelPart->AddElement(pElement);
Short class definition.
Definition: circle_bounding_box.hpp:56
ModelPart::NodesContainerType NodesContainerType
Definition: circle_bounding_box.hpp:67
void CreateBoundingBoxBoundaryMesh(ModelPart &rModelPart, int linear_partitions=4, int angular_partitions=4) override
Definition: circle_bounding_box.hpp:160
CircleBoundingBox(CircleBoundingBox const &rOther)
Copy constructor.
Definition: circle_bounding_box.hpp:134
ModelPart::NodeType NodeType
Definition: circle_bounding_box.hpp:66
NodesContainerType::Pointer NodesContainerTypePointer
Definition: circle_bounding_box.hpp:68
std::string Info() const override
Turn back information as a string.
Definition: circle_bounding_box.hpp:268
CircleBoundingBox(PointType Center, double Radius, PointType Velocity, int Convexity)
Definition: circle_bounding_box.hpp:103
void CreateLinearBoundaryMesh(ModelPart &rModelPart, const unsigned int &rInitialNodeId)
Definition: circle_bounding_box.hpp:314
CircleBoundingBox(Parameters CustomParameters)
Definition: circle_bounding_box.hpp:90
CircleBoundingBox()
Default constructor.
Definition: circle_bounding_box.hpp:77
ElementType::GeometryType GeometryType
Definition: circle_bounding_box.hpp:71
Quaternion< double > QuaternionType
Definition: circle_bounding_box.hpp:69
KRATOS_CLASS_POINTER_DEFINITION(CircleBoundingBox)
Pointer definition of CircleBoundingBox.
array_1d< double, 3 > PointType
Definition: circle_bounding_box.hpp:65
CircleBoundingBox & operator=(CircleBoundingBox const &rOther)
Assignment operator.
Definition: circle_bounding_box.hpp:120
ModelPart::ElementType ElementType
Definition: circle_bounding_box.hpp:70
virtual ~CircleBoundingBox()
Destructor.
Definition: circle_bounding_box.hpp:144
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: circle_bounding_box.hpp:274
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: circle_bounding_box.hpp:280
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
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
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
void CalculateOrthonormalBase(PointType &rDirectionVectorX, PointType &rDirectionVectorY, PointType &rDirectionVectorZ)
Definition: spatial_bounding_box.hpp:1408
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
Short class definition.
Definition: sphere_bounding_box.hpp:57
SphereBoundingBox & operator=(SphereBoundingBox const &rOther)
Assignment operator.
Definition: sphere_bounding_box.hpp:186
#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
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
PointType LowerPoint
Definition: spatial_bounding_box.hpp:218
double Radius
Definition: spatial_bounding_box.hpp:211
PointType Center
Definition: spatial_bounding_box.hpp:219
PointType UpperPoint
Definition: spatial_bounding_box.hpp:217