Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : #include "libmesh/mesh.h" 13 : 14 : namespace libMesh 15 : { 16 : class BoundingBox; 17 : } 18 : 19 : /** 20 : * Helper class that computes the intersection of a line segment defined by a point and a direction 21 : * and a bounding box. 22 : */ 23 3070 : class BoundingBoxIntersectionHelper 24 : { 25 : public: 26 : /** 27 : * Constructor. 28 : * \param bbox The bounding box 29 : * \param dim The dimension of the bounding box 30 : */ 31 : BoundingBoxIntersectionHelper(const libMesh::BoundingBox & bbox, const unsigned int dim); 32 : 33 : /** 34 : * \return The intersection of the segment defined by the point \p point and the direction \p 35 : * direction. Will return RayTracingCommon::invalid_point if no intersection is found. 36 : */ 37 : libMesh::Point intersection(const libMesh::Point & point, const libMesh::Point & direction) const; 38 : 39 : private: 40 : /// Dummy communicator for the dummy mesh 41 : libMesh::Parallel::Communicator _comm; 42 : /// Dummy mesh that contains a single element used for TraceRayTools intersection methods 43 : const std::unique_ptr<libMesh::Mesh> _mesh; 44 : /// hmax for the dummy element 45 : libMesh::Real _hmax; 46 : };