@@ -168,6 +168,39 @@ def test_fields_container_plot(allkindofcomplexity):
168168 disp_fc .plot ()
169169
170170
171+ @pytest .mark .skipif (not HAS_PYVISTA , reason = "Please install pyvista" )
172+ def test_fields_container_plot_same_mesh (multishells ):
173+ import numpy as np
174+
175+ fc = core .FieldsContainer ()
176+ f1 = core .fields_factory .create_scalar_field (num_entities = 1 , location = core .locations .elemental )
177+ f1 .append (data = [2.0 ], scopingid = 1 )
178+ f2 = core .fields_factory .create_scalar_field (num_entities = 1 , location = core .locations .elemental )
179+ f2 .append (data = [4.0 ], scopingid = 2 )
180+ fc .add_label (label = "id" , default_value = 0 )
181+ fc .add_field ({"id" : 1 }, f1 )
182+ fc .add_field ({"id" : 2 }, f2 )
183+
184+ mesh = core .meshed_region .MeshedRegion (num_nodes = 6 , num_elements = 2 )
185+ arr = np .array (
186+ [
187+ [0.0 , 0.0 , 0.0 ],
188+ [1.0 , 0.0 , 0.0 ],
189+ [1.0 , 1.0 , 0.0 ],
190+ [0.0 , 1.0 , 0.0 ],
191+ [0.0 , 2.0 , 0.0 ],
192+ [1.0 , 2.0 , 0.0 ],
193+ ]
194+ )
195+ coord = core .field_from_array (arr )
196+ mesh .set_coordinates_field (coordinates_field = coord )
197+ mesh .elements .add_shell_element (id = 1 , connectivity = [0 , 1 , 2 , 3 ])
198+ mesh .elements .add_shell_element (id = 2 , connectivity = [2 , 3 , 4 , 5 ])
199+ f1 .meshed_region = mesh
200+ f2 .meshed_region = mesh
201+ fc .plot ()
202+
203+
171204@pytest .mark .skipif (not HAS_PYVISTA , reason = "Please install pyvista" )
172205def test_field_elemental_plot (allkindofcomplexity ):
173206 model = Model (allkindofcomplexity )
0 commit comments