Skip to content

Commit 26b1eef

Browse files
committed
Use manufactured field instead
1 parent 10bbea8 commit 26b1eef

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tests/test_vtk_translate.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,15 @@ def test_dpf_field_to_vtk(simple_rst, fluent_mixing_elbow_steady_state, server_t
9797

9898

9999
@pytest.mark.skipif(not HAS_PYVISTA, reason="Please install pyvista")
100-
def test_dpf_field_to_vtk_errors(simple_rst, server_type):
101-
model = dpf.Model(simple_rst, server=server_type)
100+
def test_dpf_field_to_vtk_errors(server_type):
102101
# Elemental Field to VTK
103-
field = model.results.elemental_volume.on_last_time_freq().eval()[0]
104-
if conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0:
105-
# Elemental fields are shipped with mesh now
106-
assert field.meshed_region.elements.n_elements > 0 and field.meshed_region.nodes.n_nodes > 0
107-
else:
108-
with pytest.raises(ValueError, match="The field does not have a meshed_region."):
109-
_ = dpf_field_to_vtk(field=field)
102+
field = dpf.fields_factory.create_scalar_field(
103+
num_entities=3, location=dpf.locations.elemental, server=server_type
104+
)
105+
field.scoping.ids = [4, 67, 8]
106+
field.data = [0.0, 4.0, 5.0]
107+
with pytest.raises(ValueError, match="The field does not have a meshed_region."):
108+
_ = dpf_field_to_vtk(field=field)
110109

111110

112111
@pytest.mark.skipif(

0 commit comments

Comments
 (0)