mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Using valid entries of connectivity only
This commit is contained in:
parent
90608665b7
commit
4f93f26d81
1 changed files with 5 additions and 7 deletions
|
|
@ -1476,7 +1476,7 @@ class UnstructuredMesh(MeshBase):
|
|||
Coordinates of the mesh vertices with array shape (n_elements, 3)
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
connectivity : numpy.ndarray
|
||||
connectivity : numpy.ndarray
|
||||
Connectivity of the elements with array shape (n_elements, 8)
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
|
@ -1562,10 +1562,6 @@ class UnstructuredMesh(MeshBase):
|
|||
def total_volume(self):
|
||||
return np.sum(self.volumes)
|
||||
|
||||
@property
|
||||
def centroids(self):
|
||||
return self._centroids
|
||||
|
||||
@property
|
||||
def vertices(self):
|
||||
return self._vertices
|
||||
|
|
@ -1628,8 +1624,8 @@ class UnstructuredMesh(MeshBase):
|
|||
Parameters
|
||||
----------
|
||||
bin : int
|
||||
Bin ID for the returned centroid
|
||||
|
||||
Bin ID for the returned centroid
|
||||
|
||||
Returns
|
||||
-------
|
||||
numpy.ndarray
|
||||
|
|
@ -1637,6 +1633,8 @@ class UnstructuredMesh(MeshBase):
|
|||
|
||||
"""
|
||||
conn = self.connectivity[bin]
|
||||
# remove invalid connectivity values
|
||||
conn = conn[conn >= 0]
|
||||
coords = self.vertices[conn]
|
||||
return coords.mean(axis=0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue