Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions src/ansys/aedt/core/visualization/post/post_maxwell.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler
from ansys.aedt.core.internal.checks import min_aedt_version
from ansys.aedt.core.internal.errors import AEDTRuntimeError
from ansys.aedt.core.visualization.post.field_data import FieldPlot
from ansys.aedt.core.visualization.post.post_3dlayout import PostProcessor3DLayout
from ansys.aedt.core.visualization.post.post_common_3d import PostProcessor3D
Expand Down Expand Up @@ -348,3 +350,60 @@ def create_fieldplot_layers_nets(
return self.post_3dlayout.create_fieldplot_layers_nets(
layers_nets, quantity, setup, intrinsics, plot_on_surface, plot_name
)

@pyaedt_function_handler()
@min_aedt_version("2026.1")
def evaluate_inception_voltage(self, plot_name, field_line_number=None):
"""Perform Inception voltage evaluation on selected field line traces.

.. note::
This method requires field line traces to be computed beforehand.

Parameters
----------
plot_name : str
Name of the field fine trace plot as it appears in the AEDT GUI project manager tree.
field_line_number: list of int, optional
List of line objects on which the evaluation will be performed.
If the field line traces plot does not exist, this can be created with ``app.post.create_fieldplot_line_traces``.
The default value is ``None``, in which case the inception voltage evaluation will be carried out for all existing field line traces.

Returns
-------
bool
``True`` when successful.

References
----------
>>> oModule.EvaluateInceptionVoltage

Examples
--------
Create an instance of Maxwell and link to a project named
``projectname``. If this project does not exist, create one with
this name.
Comment on lines +382 to +384
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Create an instance of Maxwell and link to a project named
``projectname``. If this project does not exist, create one with
this name.
Create an instance of Maxwell and attach it to an existing session where project name is ``project_name``. If this project does not exist, create one with this name.


>>> from ansys.aedt.core import Maxwell2d
>>> m2d = Maxwell2d(project_name)

Create a field line traces plot in the Region from seeding faces (insulator faces).
>>> plot = m2d.post.create_fieldplot_line_traces(
>>> seeding_faces = (["Ground", "Electrode", "Region"],)
>>> in_volume_tracing_objs = (["Region"],)
>>> plot_name="LineTracesTest")
Comment on lines +390 to +393
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add the tabs here?


Now the inception voltage evaluation can be performed on all (or a subset) of the created field line traces.
>>> m2d.post.evaluate_inception_voltage(plot_name=plot.name, field_line_number=[1, 2, 4])
>>> m2d.desktop_class.release_desktop()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

"""
if self._app.solution_type != "Electrostatic":
raise AEDTRuntimeError("Field line traces is valid only for electrostatic solution")
if plot_name not in (self.field_plot_names):
raise AEDTRuntimeError("The Field Line Tracing Plot needs to be generated.")
if not field_line_number:
self.ofieldsreporter.EvaluateInceptionVoltage(plot_name)
return True
else:
self.ofieldsreporter.EvaluateInceptionVoltage(plot_name, field_line_number)
return True
13 changes: 13 additions & 0 deletions tests/system/visualization/test_12_PostProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from ansys.aedt.core import TwinBuilder
from ansys.aedt.core.generic.general_methods import is_linux
from ansys.aedt.core.generic.settings import settings
from ansys.aedt.core.internal.errors import AEDTRuntimeError
from ansys.aedt.core.visualization.plot.pyvista import _parse_aedtplt
from ansys.aedt.core.visualization.plot.pyvista import _parse_streamline
from tests import TESTS_VISUALIZATION_PATH
Expand Down Expand Up @@ -795,3 +796,15 @@ def test_twinbuilder_spectral(self, tb_app):
new_report.time_start = "0ns"
new_report.time_stop = "40ms"
assert new_report.create()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here add the decorator skipif

@pytest.mark.skipif(config["desktopVersion"] < "2026.1", reason="Method not available before 2026.1")
def test_m2d_evaluate_inception_voltage(self, m2dtest):
m2dtest.set_active_design("field_line_trace")
with pytest.raises(AEDTRuntimeError):
m2dtest.post.evaluate_inception_voltage("my_plot", [1, 2, 4])
plot = m2dtest.post.create_fieldplot_line_traces(["Ground", "Electrode"], "Region")
assert m2dtest.post.evaluate_inception_voltage(plot.name)
assert m2dtest.post.evaluate_inception_voltage(plot.name, [1, 2, 4])
m2dtest.solution_type = "Magnetostatic"
with pytest.raises(AEDTRuntimeError):
m2dtest.post.evaluate_inception_voltage("my_plot", [1, 2, 4])
Loading