@@ -150,96 +150,6 @@ def test_cartesian_and_surface_flux_warning(quantity, sys):
150150 my_model .initialise ()
151151
152152
153- @pytest .mark .parametrize (
154- "quantity" ,
155- [
156- F .AverageSurfaceCylindrical (field = "solute" , surface = 1 ),
157- F .AverageVolumeCylindrical (field = "solute" , volume = 1 ),
158- ],
159- )
160- @pytest .mark .parametrize ("sys" , ["cartesian" , "spherical" ])
161- def test_cylindrical_quantities_warning (quantity , sys ):
162- """
163- Creates a Simulation object and checks that, if either a cartesian
164- or spherical meshes are given with a AverageSurfaceCylindrical, a warning is raised.
165-
166- Args:
167- sys (str): type of the coordinate system
168- """
169- # build
170- my_model = F .Simulation ()
171- my_model .mesh = F .MeshFromVertices ([1 , 2 , 3 ], type = sys )
172- my_model .materials = F .Material (id = 1 , D_0 = 1 , E_D = 0 )
173- my_model .T = F .Temperature (100 )
174- my_model .dt = F .Stepsize (initial_value = 3 )
175- my_model .settings = F .Settings (
176- absolute_tolerance = 1e-10 , relative_tolerance = 1e-10 , final_time = 4
177- )
178-
179- derived_quantities = F .DerivedQuantities ([quantity ])
180- my_model .exports = [derived_quantities ]
181-
182- # test
183- with pytest .warns (UserWarning , match = f"may not work as intended for { sys } meshes" ):
184- my_model .initialise ()
185-
186-
187- def test_avg_surf_spherical_quantities_warning ():
188- """
189- Creates a Simulation object and checks that, if a cylindrical
190- mesh is given with a AverageSurfaceSpherical, a warning is raised.
191- """
192- # build
193- my_model = F .Simulation ()
194- my_model .mesh = F .MeshFromVertices ([1 , 2 , 3 ], type = "cylindrical" )
195- my_model .materials = F .Material (id = 1 , D_0 = 1 , E_D = 0 )
196- my_model .T = F .Temperature (100 )
197- my_model .dt = F .Stepsize (initial_value = 3 )
198- my_model .settings = F .Settings (
199- absolute_tolerance = 1e-10 , relative_tolerance = 1e-10 , final_time = 4
200- )
201-
202- derived_quantities = F .DerivedQuantities (
203- [F .AverageSurfaceSpherical (field = "solute" , surface = 1 )]
204- )
205- my_model .exports = [derived_quantities ]
206-
207- # test
208- with pytest .warns (
209- UserWarning , match = f"may not work as intended for cylindrical meshes"
210- ):
211- my_model .initialise ()
212-
213-
214- @pytest .mark .parametrize ("sys" , ["cartesian" , "cylindrical" ])
215- def test_avg_volume_spherical_quantities_warning (sys ):
216- """
217- Creates a Simulation object and checks that, if either a cylindrical or
218- cartesian meshes are given with a AverageVolumeSpherical, a warning is raised.
219-
220- Args:
221- sys (str): type of the coordinate system
222- """
223- # build
224- my_model = F .Simulation ()
225- my_model .mesh = F .MeshFromVertices ([1 , 2 , 3 ], type = sys )
226- my_model .materials = F .Material (id = 1 , D_0 = 1 , E_D = 0 )
227- my_model .T = F .Temperature (100 )
228- my_model .dt = F .Stepsize (initial_value = 3 )
229- my_model .settings = F .Settings (
230- absolute_tolerance = 1e-10 , relative_tolerance = 1e-10 , final_time = 4
231- )
232-
233- derived_quantities = F .DerivedQuantities (
234- [F .AverageVolumeSpherical (field = "solute" , volume = 1 )]
235- )
236- my_model .exports = [derived_quantities ]
237-
238- # test
239- with pytest .warns (UserWarning , match = f"may not work as intended for { sys } meshes" ):
240- my_model .initialise ()
241-
242-
243153@pytest .mark .parametrize (
244154 "value" ,
245155 [
0 commit comments