diff --git a/doc/changelog.d/6425.fixed.md b/doc/changelog.d/6425.fixed.md new file mode 100644 index 00000000000..4e58609f505 --- /dev/null +++ b/doc/changelog.d/6425.fixed.md @@ -0,0 +1 @@ +Analyze_from_zero diff --git a/src/ansys/aedt/core/maxwell.py b/src/ansys/aedt/core/maxwell.py index d6881aa5385..5a2183e9cd5 100644 --- a/src/ansys/aedt/core/maxwell.py +++ b/src/ansys/aedt/core/maxwell.py @@ -1649,7 +1649,15 @@ def analyze_from_zero(self): raise AEDTRuntimeError("This methods work only with Maxwell Transient Analysis.") self.oanalysis.ResetSetupToTimeZero(self._setup) - self.analyze() + if any(boundary.type == "Balloon" for boundary in self.boundaries): + self.logger.warning( + "With Balloon boundary, it is not possible to parallelize the simulation " + "using the Time Decomposition Method (TDM). " + "Running the simulation without HPC auto settings and using one single core." + ) + self.analyze(use_auto_settings=False, cores=1) + else: + self.analyze() return True @pyaedt_function_handler(val="angle") diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index 208fd41bee7..cae0bc2d23b 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -836,3 +836,21 @@ def test_export_rl_matrix(self, local_scratch, m2d_export_matrix): matrix_type="RL", matrix_name="Matrix1", output_file=export_path_2 ) assert export_path_2.exists() + + def test_analyze_from_zero(self, m2d_app): + m2d_app.solution_type = SolutionsMaxwell2D.TransientXY + conductor = m2d_app.modeler.create_circle(origin=[0, 0, 0], radius=10, material="Copper") + m2d_app.assign_winding(assignment=conductor.name, is_solid=False, current="5*cos(2*PI*50*time)") + region = m2d_app.modeler.create_region(pad_percent=100) + bound = m2d_app.assign_balloon(region.edges) + setup1 = m2d_app.create_setup() + setup1.props["StopTime"] = "2/50s" + setup1.props["TimeStep"] = "1/500s" + assert m2d_app.analyze_from_zero() + bound.delete() + m2d_app.assign_vector_potential(assignment=region.edges) + assert m2d_app.analyze_from_zero() + m2d_app.solution_type = SolutionsMaxwell2D.MagnetostaticXY + m2d_app.create_setup() + with pytest.raises(AEDTRuntimeError): + m2d_app.analyze_from_zero()