mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
A couple small changes from original PR comments
This commit is contained in:
parent
c6f0d36bdb
commit
43549cf1f1
2 changed files with 4 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue