A couple small changes from original PR comments

This commit is contained in:
Patrick Shriwise 2022-12-29 08:15:45 -06:00
parent c6f0d36bdb
commit 43549cf1f1
2 changed files with 4 additions and 5 deletions

View file

@ -627,7 +627,7 @@ class MeshSpatial(Spatial):
This distribution specifies a mesh to sample over, chooses whether it will
be volume normalized, and can set the source strengths.
.. versionadded:: 0.13
.. versionadded:: 0.13.3
Parameters
----------
@ -651,8 +651,7 @@ class MeshSpatial(Spatial):
Whether or not the strengths will be normalized by volume.
"""
def __init__(self,
mesh, strengths=None, volume_normalized=True):
def __init__(self, mesh, strengths=None, volume_normalized=True):
self.mesh = mesh
self.strengths = strengths
self.volume_normalized = volume_normalized

View file

@ -243,8 +243,8 @@ Position MeshSpatial::sample(uint64_t* seed) const
// Create random variable for sampling element from mesh
double eta = prn(seed);
// Sample over the CDF defined in initialization above
int32_t elem_bin = lower_bound_index(mesh_CDF_.begin(), mesh_CDF_.end(), eta);
return mesh_ptr_->sample(seed, elem_bin);
int32_t elem_idx = lower_bound_index(mesh_CDF_.begin(), mesh_CDF_.end(), eta);
return mesh_ptr_->sample(seed, elem_idx);
}
//==============================================================================