From fba3a9a118220b40065bbdcd7d641a3b8926cb50 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 21 Dec 2022 10:52:52 -0600 Subject: [PATCH] tet_bin to elem_bin suggestion from @eepeterson --- src/distribution_spatial.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/distribution_spatial.cpp b/src/distribution_spatial.cpp index b47b85281d..a0cfec2f03 100644 --- a/src/distribution_spatial.cpp +++ b/src/distribution_spatial.cpp @@ -193,7 +193,7 @@ MeshSpatial::MeshSpatial(pugi::xml_node node) int32_t mesh_id = std::stoi(get_node_value(node, "mesh_id")); // Get pointer to spatial distribution mesh_idx_ = model::mesh_map.at(mesh_id); - + // Check whether mesh pointer points to a mesh mesh_ptr_ = dynamic_cast(model::meshes[mesh_idx_].get()); if (!mesh_ptr_) {fatal_error("Mesh passed to spatial distribution is not a mesh object"); } @@ -237,15 +237,14 @@ MeshSpatial::MeshSpatial(pugi::xml_node node) } Position MeshSpatial::sample(uint64_t* seed) const -{ +{ // Create random variable for sampling element from mesh float eta = prn(seed); // Sample over the CDF defined in initialization above - int32_t tet_bin = lower_bound_index(mesh_CDF_.begin(), mesh_CDF_.end(), eta); - return mesh_ptr_->sample(seed, tet_bin); + int32_t elem_bin = lower_bound_index(mesh_CDF_.begin(), mesh_CDF_.end(), eta); + return mesh_ptr_->sample(seed, elem_bin); } - //============================================================================== // SpatialBox implementation //==============================================================================