51 for (
const Elem * elem :
_mesh.
getMesh().active_element_ptr_range())
53 std::vector<Point> normals(elem->n_sides());
54 for (
const auto s : elem->side_index_range())
56 _normals.emplace(elem, std::move(normals));
63 const auto find =
_normals.find(elem);
65 mooseError(
"Failed to find normal for elem ", elem->id());
67 const auto & normals = find->second;
68 mooseAssert(normals.size() == elem->n_sides(),
"Normals not sized properly");
69 return normals.data();
virtual void generateNormals()
void setBackfaceCulling(const bool backface_culling)
Enable or disable the use of element normals for backface culling through the getElemNormals() method...
virtual void initialSetup() override
MooseMesh & _mesh
The Mesh.
void initialSetup() override
static InputParameters validParams()
TraceRay & traceRay(const THREAD_ID tid)
Gets the threaded TraceRay object for tid.
const Point * getElemNormals(const Elem *elem, const THREAD_ID tid) override
Gets the outward normals for a given element.
virtual void meshChanged() override
A test study that tests the use of backface culling in TraceRay.
virtual const Point & getSideNormal(const Elem *elem, const unsigned short side, const THREAD_ID tid)
Get the outward normal for a given element side.
std::unordered_map< const Elem *, std::vector< Point > > _normals
BackfaceCullingStudyTest(const InputParameters ¶meters)
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
static InputParameters validParams()
registerMooseObject("RayTracingTestApp", BackfaceCullingStudyTest)
A RayTracingStudy used for generating a lot of rays for testing purposes.
void meshChanged() override