Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::BasicRayMeshIntersection Class Reference

Basic service for calculating intersection between segments and mesh. More...

Inheritance diagram for Arcane::BasicRayMeshIntersection:
Collaboration diagram for Arcane::BasicRayMeshIntersection:

Public Member Functions

 BasicRayMeshIntersection (const ServiceBuildInfo &sbi)
virtual void build ()
 Build-level construction of the service.
virtual void compute (Real3ConstArrayView segments_position, Real3ConstArrayView segments_direction, Int32ConstArrayView segments_orig_face, Int32ArrayView user_values, Real3ArrayView intersections, RealArrayView distances, Int32ArrayView faces_local_id)
 Calculates the intersection.
virtual void compute (IItemFamily *ray_family, VariableParticleReal3 &rays_position, VariableParticleReal3 &rays_direction, VariableParticleInt32 &rays_orig_face, VariableParticleInt32 &user_values, VariableParticleReal3 &intersections, VariableParticleReal &distances, VariableParticleInt32 &rays_face)
 Calculates the intersection of rays.
virtual void setFaceIntersector (IRayFaceIntersector *intersector)
 Sets the intersection callback.
virtual IRayFaceIntersectorfaceIntersector ()
 Intersector used (0 if none specified).
void _checkBoundingBox (Real3 p, Real3 *ARCANE_RESTRICT min_bounding_box, Real3 *ARCANE_RESTRICT max_bounding_box)
Public Member Functions inherited from Arcane::BasicService
 ~BasicService () override
 Releases resources.
virtual ISubDomainsubDomain ()
Public Member Functions inherited from Arcane::AbstractService
 ~AbstractService () override
 Destructor.
IServiceInfoserviceInfo () const override
 Access to service information. See IServiceInfo for details.
IBaseserviceParent () const override
 Access to the base interface of main Arcane objects.
IServiceserviceInterface () override
 Returns the low-level IService interface of the service.
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const
Public Member Functions inherited from Arcane::IService
virtual ~IService ()
 Releases resources.
Public Member Functions inherited from Arcane::MeshAccessor
 MeshAccessor (ISubDomain *sd)
 MeshAccessor (IMesh *mesh)
 MeshAccessor (const MeshHandle &mesh_handle)
Integer nbCell () const
 Returns the number of cells in the mesh.
Integer nbFace () const
 Returns the number of faces in the mesh.
Integer nbEdge () const
 Returns the number of edges in the mesh.
Integer nbNode () const
 Returns the number of nodes in the mesh.
VariableNodeReal3nodesCoordinates () const
 Returns the coordinates of the mesh nodes.
NodeGroup allNodes () const
 Returns the group containing all nodes.
EdgeGroup allEdges () const
 Returns the group containing all edges.
FaceGroup allFaces () const
 Returns the group containing all faces.
CellGroup allCells () const
 Returns the group containing all cells.
FaceGroup outerFaces () const
 Returns the group containing all boundary faces.
NodeGroup ownNodes () const
 Returns the group containing all nodes specific to this domain.
CellGroup ownCells () const
 Returns the group containing all cells specific to this domain.
FaceGroup ownFaces () const
 Group containing all faces specific to this domain.
EdgeGroup ownEdges () const
 Group containing all edges specific to this domain.
IMeshmesh () const
const MeshHandlemeshHandle () const
Public Member Functions inherited from Arcane::CommonVariables
 CommonVariables (IModule *c)
 Constructs the references of the common variables for the module c.
 CommonVariables (IVariableMng *variable_mng)
 Constructs the references of the common variables for the manager variable_mng.
 CommonVariables (ISubDomain *sd)
 Constructs the references of the common variables for the subdomain sd.
virtual ~CommonVariables ()
 Releases resources.
Int32 globalIteration () const
 Current iteration number.
Real globalTime () const
 Current time.
Real globalOldTime () const
 Previous current time.
Real globalFinalTime () const
 Final time of the simulation.
Real globalDeltaT () const
 Current Delta T.
Real globalCPUTime () const
 CPU time used (in seconds).
Real globalOldCPUTime () const
 Previous CPU time used (in seconds).
Real globalElapsedTime () const
 Clock time (elapsed) used (in seconds).
Real globalOldElapsedTime () const
 Previous clock time (elapsed) used (in seconds).
Public Member Functions inherited from Arcane::IRayMeshIntersection
virtual ~IRayMeshIntersection ()=default
 Frees resources.

Private Attributes

IRayFaceIntersectorm_face_intersector

Additional Inherited Members

Public Attributes inherited from Arcane::CommonVariables
VariableScalarInt32 m_global_iteration
 Current iteration.
VariableScalarReal m_global_time
 Current time.
VariableScalarReal m_global_deltat
 Global Delta T.
VariableScalarReal m_global_old_time
 Time previous to the current time.
VariableScalarReal m_global_old_deltat
 Delta T at the time previous to the global time.
VariableScalarReal m_global_final_time
 Final time of the case.
VariableScalarReal m_global_old_cpu_time
 Previous CPU time used (in seconds).
VariableScalarReal m_global_cpu_time
 CPU time used (in seconds).
VariableScalarReal m_global_old_elapsed_time
 Previous clock time used (in seconds).
VariableScalarReal m_global_elapsed_time
 Clock time used (in seconds).
Protected Member Functions inherited from Arcane::BasicService
 BasicService (const ServiceBuildInfo &)
Protected Member Functions inherited from Arcane::AbstractService
 AbstractService (const ServiceBuildInfo &)
 Constructor from a ServiceBuildInfo.
Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const
Protected Member Functions inherited from Arcane::IService
 IService ()
 Constructor.

Detailed Description

Basic service for calculating intersection between segments and mesh.

Definition at line 434 of file BasicRayMeshIntersection.cc.

Constructor & Destructor Documentation

◆ BasicRayMeshIntersection()

Arcane::BasicRayMeshIntersection::BasicRayMeshIntersection ( const ServiceBuildInfo & sbi)

Definition at line 500 of file BasicRayMeshIntersection.cc.

◆ ~BasicRayMeshIntersection()

virtual Arcane::BasicRayMeshIntersection::~BasicRayMeshIntersection ( )
inlinevirtual

Definition at line 441 of file BasicRayMeshIntersection.cc.

Member Function Documentation

◆ _checkBoundingBox()

void Arcane::BasicRayMeshIntersection::_checkBoundingBox ( Real3 p,
Real3 *ARCANE_RESTRICT min_bounding_box,
Real3 *ARCANE_RESTRICT max_bounding_box )
inline

Definition at line 474 of file BasicRayMeshIntersection.cc.

◆ build()

virtual void Arcane::BasicRayMeshIntersection::build ( void )
inlinevirtual

Build-level construction of the service.

This method is called right after the constructor.

Reimplemented from Arcane::AbstractService.

Definition at line 445 of file BasicRayMeshIntersection.cc.

◆ compute() [1/2]

void Arcane::BasicRayMeshIntersection::compute ( IItemFamily * ray_family,
VariableParticleReal3 & rays_position,
VariableParticleReal3 & rays_direction,
VariableParticleInt32 & rays_orig_face,
VariableParticleInt32 & user_values,
VariableParticleReal3 & intersections,
VariableParticleReal & distances,
VariableParticleInt32 & rays_face )
virtual

Calculates the intersection of rays.

Calculates the intersection of rays in the family ray_family with the surface of the mesh. The position and direction of the rays are given by the variables rays_position and rays_direction. The array rays_orig_face contains the local ID of the face from which the ray originates. This array is used in the IRayFaceIntersector.

In return, rays_face will contain for each ray the localId() of the intersected face or NULL_ITEM_LOCAL_ID if a ray does not intersect any face. The array rays_intersection returns the position of the intersection point and rays_distance the distance of the intersection point relative to the ray origin. The array user_values is filled in return by the IRayFaceIntersector.

In parallel, the rays in the family are exchanged between sub-domains so that a ray is in the same sub-domain as the owner of the intersected face. If a ray does not intersect any face, it remains in this sub-domain.

Implements Arcane::IRayMeshIntersection.

Definition at line 632 of file BasicRayMeshIntersection.cc.

References Arcane::Array< T >::add(), Arcane::IParallelMng::allGatherVariable(), Arcane::IItemFamily::allItems(), Arcane::arcaneCheckArraySize(), Arcane::IParallelMng::commRank(), compute(), Arcane::Array< T >::data(), ENUMERATE_ITEM, ENUMERATE_PARTICLE, Arcane::IParticleFamily::exchangeParticles(), Arcane::Array< T >::fill(), Arcane::TraceAccessor::info(), Arcane::IParallelMng::isParallel(), Arcane::IItemFamily::itemsNewOwner(), Arcane::IItemFamily::mesh(), Arcane::IItemFamily::nbItem(), Arcane::IParallelMng::reduce(), Arcane::MessagePassing::ReduceSum, Arcane::Array< T >::resize(), Arcane::AbstractArray< T >::size(), Arcane::ConstArrayView< T >::size(), Arcane::ItemGroup::size(), Arcane::IItemFamily::toParticleFamily(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.

Here is the call graph for this function:

◆ compute() [2/2]

void Arcane::BasicRayMeshIntersection::compute ( Real3ConstArrayView segments_position,
Real3ConstArrayView segments_direction,
Int32ConstArrayView orig_faces_local_id,
Int32ArrayView user_values,
Real3ArrayView intersections,
RealArrayView distances,
Int32ArrayView faces_local_id )
virtual

Calculates the intersection.

In return, the array faces_local_id contains the local ID of the intersected face for each segment. If a segment does not intersect any face, the corresponding local_id is NULL_ITEM_LOCAL_ID.

Implements Arcane::IRayMeshIntersection.

Definition at line 510 of file BasicRayMeshIntersection.cc.

References ENUMERATE_FACE, Arcane::TraceAccessor::fatal(), Arcane::ArrayView< T >::fill(), Arcane::TraceAccessor::info(), Arcane::Item::isOwn(), Arcane::Item::localId(), Arcane::ItemWithNodes::nbNode(), Arcane::ItemWithNodes::nodes(), Arcane::Array< T >::resize(), Arcane::ConstArrayView< T >::size(), Arcane::ItemGroup::size(), and Arcane::TraceAccessor::traceMng().

Referenced by compute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ faceIntersector()

virtual IRayFaceIntersector * Arcane::BasicRayMeshIntersection::faceIntersector ( )
inlinevirtual

Intersector used (0 if none specified).

Implements Arcane::IRayMeshIntersection.

Definition at line 467 of file BasicRayMeshIntersection.cc.

◆ setFaceIntersector()

virtual void Arcane::BasicRayMeshIntersection::setFaceIntersector ( IRayFaceIntersector * intersector)
inlinevirtual

Sets the intersection callback.

This allows the caller to specify its method for calculating the intersection of a ray with a face. If this method is not called, a default intersector is used.

Implements Arcane::IRayMeshIntersection.

Definition at line 463 of file BasicRayMeshIntersection.cc.

Member Data Documentation

◆ m_face_intersector

IRayFaceIntersector* Arcane::BasicRayMeshIntersection::m_face_intersector
private

Definition at line 494 of file BasicRayMeshIntersection.cc.


The documentation for this class was generated from the following file: