Skip to content

Commit 24e7c77

Browse files
anur7pyansys-ci-botgmalinveSamuelopez-ansys
authored
FIX: analyze_from_zero (#6425)
Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Giulia Malinverno <[email protected]> Co-authored-by: samuel <[email protected]>
1 parent 51a6d85 commit 24e7c77

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

doc/changelog.d/6425.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Analyze_from_zero

src/ansys/aedt/core/maxwell.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,15 @@ def analyze_from_zero(self):
16491649
raise AEDTRuntimeError("This methods work only with Maxwell Transient Analysis.")
16501650

16511651
self.oanalysis.ResetSetupToTimeZero(self._setup)
1652-
self.analyze()
1652+
if any(boundary.type == "Balloon" for boundary in self.boundaries):
1653+
self.logger.warning(
1654+
"With Balloon boundary, it is not possible to parallelize the simulation "
1655+
"using the Time Decomposition Method (TDM). "
1656+
"Running the simulation without HPC auto settings and using one single core."
1657+
)
1658+
self.analyze(use_auto_settings=False, cores=1)
1659+
else:
1660+
self.analyze()
16531661
return True
16541662

16551663
@pyaedt_function_handler(val="angle")

tests/system/general/test_27_Maxwell2D.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,3 +846,21 @@ def test_export_rl_matrix(self, local_scratch, m2d_export_matrix):
846846
matrix_type="RL", matrix_name="Matrix1", output_file=export_path_2
847847
)
848848
assert export_path_2.exists()
849+
850+
def test_analyze_from_zero(self, m2d_app):
851+
m2d_app.solution_type = SolutionsMaxwell2D.TransientXY
852+
conductor = m2d_app.modeler.create_circle(origin=[0, 0, 0], radius=10, material="Copper")
853+
m2d_app.assign_winding(assignment=conductor.name, is_solid=False, current="5*cos(2*PI*50*time)")
854+
region = m2d_app.modeler.create_region(pad_percent=100)
855+
bound = m2d_app.assign_balloon(region.edges)
856+
setup1 = m2d_app.create_setup()
857+
setup1.props["StopTime"] = "2/50s"
858+
setup1.props["TimeStep"] = "1/500s"
859+
assert m2d_app.analyze_from_zero()
860+
bound.delete()
861+
m2d_app.assign_vector_potential(assignment=region.edges)
862+
assert m2d_app.analyze_from_zero()
863+
m2d_app.solution_type = SolutionsMaxwell2D.MagnetostaticXY
864+
m2d_app.create_setup()
865+
with pytest.raises(AEDTRuntimeError):
866+
m2d_app.analyze_from_zero()

0 commit comments

Comments
 (0)