From 847b499ea08af24b72979a58447516cce50eba04 Mon Sep 17 00:00:00 2001 From: Giulia Malinverno Date: Tue, 23 Apr 2024 15:13:49 +0200 Subject: [PATCH] fix export field plot streamline + test displacement current --- _unittest/test_28_Maxwell3D.py | 1 + examples/03-Maxwell/Maxwell2D_Electrostatic.py | 7 ------- pyaedt/modules/AdvancedPostProcessing.py | 4 ++-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/_unittest/test_28_Maxwell3D.py b/_unittest/test_28_Maxwell3D.py index 281e2fbe4b9..92f87bc5cab 100644 --- a/_unittest/test_28_Maxwell3D.py +++ b/_unittest/test_28_Maxwell3D.py @@ -198,6 +198,7 @@ def test_05a_assign_coil(self): def test_05_draw_region(self): assert self.aedtapp.modeler.create_air_region(*[300] * 6) + @pytest.mark.skipif(desktop_version == "2024.2", reason="GetDisplacementCurrent not working in 2024.2") def test_06_eddycurrent(self): assert self.aedtapp.eddy_effects_on(["Plate"], enable_eddy_effects=True) oModule = self.aedtapp.odesign.GetModule("BoundarySetup") diff --git a/examples/03-Maxwell/Maxwell2D_Electrostatic.py b/examples/03-Maxwell/Maxwell2D_Electrostatic.py index 6eb50df7baf..3f044ffd9bc 100644 --- a/examples/03-Maxwell/Maxwell2D_Electrostatic.py +++ b/examples/03-Maxwell/Maxwell2D_Electrostatic.py @@ -198,13 +198,6 @@ M2D.post.export_field_plot(plot_name="LineTracesTest", output_dir=M2D.toolkit_directory, file_format="fldplt") -########################################################## -# Export a field plot to an image file -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Export the flux lines plot to an image file using PyVista Python package. - -M2D.post.plot_field_from_fieldplot(plot.name, show=False) - ########################################################## # Export the mesh field plot # ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/pyaedt/modules/AdvancedPostProcessing.py b/pyaedt/modules/AdvancedPostProcessing.py index a2b76fb55f3..6b5650d6074 100644 --- a/pyaedt/modules/AdvancedPostProcessing.py +++ b/pyaedt/modules/AdvancedPostProcessing.py @@ -328,6 +328,8 @@ def plot_field_from_fieldplot( ): """Export a field plot to an image file (JPG or PNG) using Python PyVista. + This method does not support streamlines plot. + .. note:: The PyVista module rebuilds the mesh and the overlap fields on the mesh. @@ -392,8 +394,6 @@ def plot_field_from_fieldplot( else: self.ofieldsreporter.UpdateQuantityFieldsPlots(plot_folder) - if self.field_plots[plot_name].field_type == "DC R/L Fields": - file_format = "fldplt" file_to_add = self.export_field_plot(plot_name, self._app.working_directory, file_format=file_format) model = self.get_model_plotter_geometries( generate_mesh=False,