Apply suggestions from @paulromano

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Patrick Shriwise 2022-07-29 00:47:27 +01:00 committed by GitHub
parent 1e4371549c
commit 25ab9d28ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 10 deletions

View file

@ -1485,7 +1485,7 @@ class UnstructuredMesh(MeshBase):
element_types : Iterable of integers
Mesh element types
.. versionadded:: 0.13
.. versionadded:: 0.13.1
total_volume : float
Volume of the unstructured mesh in total
"""
@ -1770,8 +1770,8 @@ class UnstructuredMesh(MeshBase):
vertices = group['vertices'][()]
mesh._vertices = vertices.reshape((-1, 3))
connectvity = group['connectivity'][()]
mesh._connectivity = connectvity.reshape((-1, 8))
connectivity = group['connectivity'][()]
mesh._connectivity = connectivity.reshape((-1, 8))
mesh._element_types = group['element_types'][()]
if 'length_multiplier' in group:

View file

@ -812,7 +812,6 @@ void write_unstructured_mesh_results()
auto umesh =
dynamic_cast<UnstructuredMesh*>(model::meshes[mesh_idx].get());
if (!umesh)
continue;

View file

@ -17,11 +17,10 @@ def ids_func(param):
test_params = (['libmesh', 'moab'],
['tets', 'hexes'])
test_cases = []
for library, elem_type in product(*test_params):
test_case = {'library' : library,
'elem_type' : elem_type}
test_cases.append(test_case)
test_cases = [
{'library' : library, 'elem_type' : elem_type}
for library, elem_type in product(*test_params)
]
@pytest.mark.parametrize("test_opts", test_cases, ids=ids_func)
def test_unstructured_mesh_to_vtk(run_in_tmpdir, request, test_opts):
@ -60,7 +59,7 @@ def test_unstructured_mesh_to_vtk(run_in_tmpdir, request, test_opts):
with openmc.StatePoint(sp_file) as sp:
umesh = sp.meshes[umesh.id]
test_data = {'ids' : np.arange(umesh.n_elements)}
test_data = {'ids': np.arange(umesh.n_elements)}
umesh.write_data_to_vtk('umesh.vtk',
datasets=test_data,
volume_normalization=False)