15 #if !defined(KRATOS_FIND_INTERSECTED_GEOMETRICAL_OBJECTS_PROCESS_H_INCLUDED )
16 #define KRATOS_FIND_INTERSECTED_GEOMETRICAL_OBJECTS_PROCESS_H_INCLUDED
53 double mCoordinates[3];
57 double&
X() {
return mCoordinates[0]; }
58 double&
Y() {
return mCoordinates[1]; }
59 double&
Z() {
return mCoordinates[2]; }
61 std::size_t&
Id() {
return mId; }
146 *pDestination = *pSource;
170 auto& r_geometry = pObject->GetGeometry();
173 rHighPoint = r_geometry.GetPoint(0);
174 rLowPoint = r_geometry.GetPoint(0);
177 for (
IndexType point = 1; point< r_geometry.PointsNumber(); ++point) {
178 const auto& r_point = r_geometry.GetPoint(point);
180 rLowPoint[
i] = (rLowPoint[
i] > r_point[
i]) ? r_point[
i] : rLowPoint[
i];
181 rHighPoint[
i] = (rHighPoint[
i] < r_point[
i]) ? r_point[
i] : rHighPoint[
i];
193 const typename GeometricalObject::Pointer pObject,
199 auto& r_geometry = pObject->GetGeometry();
203 rLowPoint[
i] = r_geometry.GetPoint(0)[
i];
204 rHighPoint[
i] = r_geometry.GetPoint(0)[
i];
208 for (
IndexType point = 1; point< r_geometry.PointsNumber(); ++point) {
209 const auto& r_point = r_geometry.GetPoint(point);
211 rLowPoint[
i] = (rLowPoint[
i] > r_point[
i]) ? r_point[
i] : rLowPoint[
i];
212 rHighPoint[
i] = (rHighPoint[
i] < r_point[
i]) ? r_point[
i] : rHighPoint[
i];
224 const typename GeometricalObject::Pointer pObj1,
225 const typename GeometricalObject::Pointer pObj2
228 auto& r_geom_1 = pObj1->GetGeometry();
229 auto& r_geom_2 = pObj2->GetGeometry();
230 return r_geom_1.HasIntersection(r_geom_2);
241 const typename GeometricalObject::Pointer pObject,
246 return pObject->GetGeometry().HasIntersection(rLowPoint, rHighPoint);
257 const typename GeometricalObject::Pointer pObject,
259 const double* rLowPoint,
260 const double* rHighPoint
263 PointType low_point(rLowPoint[0] - Tolerance, rLowPoint[1] - Tolerance, rLowPoint[2] - Tolerance);
264 PointType high_point(rHighPoint[0] + Tolerance, rHighPoint[1] + Tolerance, rHighPoint[2] + Tolerance);
275 virtual std::string
Info()
const
277 return " Spatial Containers Configure";
376 const Flags Options = INTERSECTING_CONDITIONS|INTERSECTING_ELEMENTS|INTERSECTED_CONDITIONS|INTERSECTED_ELEMENTS
409 virtual
void Initialize();
420 virtual
void FindIntersections();
450 void Clear() override;
455 void Execute() override;
467 virtual
void IdentifyNearEntitiesAndCheckEntityForIntersection(
483 return "FindIntersectedGeometricalObjectsProcess";
521 virtual void SetOctreeBoundingBox();
528 virtual void MarkIfIntersected(
538 virtual bool HasIntersection(
573 std::size_t WorkingSpaceDimension();
578 void GenerateOctree();
586 virtual void FindIntersectedSkinObjects(
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
void ExecuteInitialize() override
Definition: periodic_interface_process.hpp:37
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
This class takes two modelparts and marks the intersected ones with SELECTED flag.
Definition: find_intersected_geometrical_objects_process.h:321
KRATOS_DEFINE_LOCAL_FLAG(INTERSECTING_CONDITIONS)
Local Flags.
KRATOS_DEFINE_LOCAL_FLAG(INTERSECTED_ELEMENTS)
KRATOS_DEFINE_LOCAL_FLAG(INTERSECTED_CONDITIONS)
OctreePointerType mpOctree
Local flags.
Definition: find_intersected_geometrical_objects_process.h:508
FindIntersectedGeometricalObjectsProcess(FindIntersectedGeometricalObjectsProcess const &rOther)=delete
Copy constructor.
~FindIntersectedGeometricalObjectsProcess() override=default
Destructor.
KRATOS_CLASS_POINTER_DEFINITION(FindIntersectedGeometricalObjectsProcess)
Pointer definition of FindIntersectedGeometricalObjectsProcess.
Flags mOptions
Model part intersecting.
Definition: find_intersected_geometrical_objects_process.h:507
std::size_t IndexType
Definition of the index type.
Definition: find_intersected_geometrical_objects_process.h:344
ModelPart & mrModelPartIntersected
Definition: find_intersected_geometrical_objects_process.h:505
typename ConfigurationType::cell_node_data_type CellNodeDataType
Definition: find_intersected_geometrical_objects_process.h:340
std::vector< typename OctreeType::cell_type * > OtreeCellVectorType
Definition: find_intersected_geometrical_objects_process.h:341
unique_ptr< OctreeType > OctreePointerType
Definition: find_intersected_geometrical_objects_process.h:339
ModelPart & mrModelPartIntersecting
Model part intersected.
Definition: find_intersected_geometrical_objects_process.h:506
std::vector< PointerVector< GeometricalObject > > mIntersectedObjects
Definition: find_intersected_geometrical_objects_process.h:398
std::size_t SizeType
Definition of the size type.
Definition: find_intersected_geometrical_objects_process.h:347
KRATOS_DEFINE_LOCAL_FLAG(INTERSECTING_ELEMENTS)
Point PointType
Definition of the point type.
Definition: find_intersected_geometrical_objects_process.h:350
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: find_intersected_geometrical_objects_process.h:487
FindIntersectedGeometricalObjectsProcess()=delete
Default constructor.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: find_intersected_geometrical_objects_process.h:492
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
Geometry base class.
Definition: geometry.h:71
This class aims to manage different model parts across multi-physics simulations.
Definition: model.h:60
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
This class represents a cell in an octree to be used with Octree class.
Definition: octree_binary_cell.h:70
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
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
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
TContainerType ContainerType
Definition: pointer_vector_set.h:90
The base class for all processes in Kratos.
Definition: process.h:49
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::unique_ptr< T > unique_ptr
Definition: smart_pointers.h:33
namespace KRATOS_DEPRECATED_MESSAGE("Please use std::filesystem directly") filesystem
Definition: kratos_filesystem.h:33
tuple const
Definition: ode_solve.py:403
namespace
Definition: array_1d.h:793
integer i
Definition: TensorModule.f:17