Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/codecov/codecov-ac…
Browse files Browse the repository at this point in the history
…tion-5
  • Loading branch information
SMoraisAnsys authored Dec 2, 2024
2 parents c14e41b + e62d2a4 commit fe5fd62
Show file tree
Hide file tree
Showing 41 changed files with 1,322 additions and 206 deletions.
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Description
**Please provide a brief description of the changes made in this pull request.**

## Issue linked
**Please mention the issue number or describe the problem this pull request addresses.**

## Checklist
- [ ] I have tested my changes locally.
- [ ] I have added necessary documentation or updated existing documentation.
- [ ] I have followed the coding style guidelines of this project.
- [ ] I have added appropriate tests (unit, integration, system).
- [ ] I have reviewed my changes before submitting this pull request.
- [ ] I have linked the issue or issues that are solved by the PR if any.
- [ ] I have agreed with the Contributor License Agreement ([CLA](https://developer.ansys.com/form/cla-acceptance)).
12 changes: 6 additions & 6 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:

- name: Create virtual environment
run: |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
python -m venv .venv
source .venv/bin/activate
python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U
Expand All @@ -228,13 +228,13 @@ jobs:
- name: Install pyaedt and tests dependencies
run: |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
source .venv/bin/activate
pip install .[tests]
- name: Run tests marked with 'solvers'
run: |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
source .venv/bin/activate
pytest ${{ env.PYTEST_ARGUMENTS }} -m solvers
Expand Down Expand Up @@ -339,7 +339,7 @@ jobs:

- name: Create virtual environment
run: |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
python -m venv .venv
source .venv/bin/activate
python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U
Expand All @@ -348,7 +348,7 @@ jobs:
- name: Install pyaedt and tests dependencies
run: |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
source .venv/bin/activate
pip install .[tests]
Expand All @@ -366,7 +366,7 @@ jobs:
retry_on: error
timeout_minutes: 50
command: |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
source .venv/bin/activate
pytest ${{ env.PYTEST_ARGUMENTS }} -n 4 --dist loadfile -m general
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nightly-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
uses: ansys/actions/doc-build@v8
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
needs-quarto: true
use-python-cache: false

upload-dev-doc:
name: Upload dev documentation
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ exclude: |
(?x)(
^src/ansys/aedt/core/rpc/|
^src/ansys/aedt/core/sbrplus/matlab/|
^src/ansys/aedt/core/workflows/installer|
tests/system/general/example_models/|
tests/system/solvers/example_models/
)
Expand Down
47 changes: 43 additions & 4 deletions doc/source/User_guide/extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ They are small automated workflow with a simple UI.
:link-type: doc
:margin: 2 2 0 0

Lear how to use the Advanced Fields Calculator.
Lear how to use the Advanced Fields Calculator extension.


.. grid-item-card:: Kernel converter
Expand All @@ -59,20 +59,57 @@ They are small automated workflow with a simple UI.
HFSS 3D Layout extensions
~~~~~~~~~~~~~~~~~~~~~~~~~

Pre-installed extensions are available at HFSS 3D Layout level.
They are small automated workflow with a simple UI.

.. grid:: 2

.. grid-item-card:: Parametrize Layout
:link: pyaedt_extensions_doc/hfss3dlayout/parametrize_edb
:link-type: doc
:margin: 2 2 0 0

Learn how to parametrize a full aedb.
Parametrize a full layout design.


.. grid-item-card:: Generate arbitrary wave ports
:link: pyaedt_extensions_doc/hfss3dlayout/arbitrary_wave_port
:link-type: doc
:margin: 2 2 0 0

Generate arbitrary wave ports in HFSS
Generate arbitrary wave ports in HFSS.


HFSS extensions
~~~~~~~~~~~~~~~

Pre-installed extensions are available at HFSS level.
They are small automated workflow with a simple UI.

.. grid:: 2

.. grid-item-card:: Choke designer
:link: pyaedt_extensions_doc/hfss/choke_designer
:link-type: doc
:margin: 2 2 0 0

Design a choke and import it in HFSS.


Icepak extensions
~~~~~~~~~~~~~~~~~

Pre-installed extensions are available at Icepak level.
They are small automated workflow with a simple UI.

.. grid:: 2

.. grid-item-card:: Create power map
:link: pyaedt_extensions_doc/icepak/create_power_map
:link-type: doc
:margin: 2 2 0 0

Import a CSV file containing sources layout and power dissipation information.


.. toctree::
Expand All @@ -81,13 +118,15 @@ HFSS 3D Layout extensions

pyaedt_extensions_doc/project/index
pyaedt_extensions_doc/hfss3dlayout/index
pyaedt_extensions_doc/hfss/index
pyaedt_extensions_doc/icepak/index


Open source toolkits
--------------------

Open source toolkits are available at application level.
They are complex workflows where backend and frontend are split.
They are advanced workflows where backend and frontend are split.
They are also fully documented and tested.

Here are some links to existing toolkits:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Choke designer
==============

You can design a choke in HFSS.

You can access the extension from the icon created on the **Automation** tab using the Extension Manager.

The following image shows the extension user interface:

.. image:: ../../../_static/extensions/choke_designer_ui.png
:width: 800
:alt: Choke Designer UI


The available argument is: ``choke_config``.

The ``choke_config`` parameter is a dictionary with choke configuration file content. See more information: :ref:`choke-file`.

You can also launch the extension user interface from the terminal. An example can be found here:


.. toctree::
:maxdepth: 2

../commandline
11 changes: 11 additions & 0 deletions doc/source/User_guide/pyaedt_extensions_doc/hfss/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
HFSS extensions
===============

.. grid:: 2

.. grid-item-card:: Choke designer
:link: choke_designer
:link-type: doc
:margin: 2 2 0 0

Design a choke and import it in HFSS.
11 changes: 11 additions & 0 deletions doc/source/User_guide/pyaedt_extensions_doc/icepak/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Icepak extensions
=================

.. grid:: 2

.. grid-item-card:: Create power map
:link: create_power_map
:link-type: doc
:margin: 2 2 0 0

Import a CSV file containing sources layout and power dissipation information.
2 changes: 2 additions & 0 deletions doc/source/User_guide/pyaedt_file_data/choke.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _choke-file:

Choke file
==========

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ integration-tests = [
"pytest-cov>=4.0.0,<6.1",
]
tests = [
"ipython>=7.30.0,<8.30",
"ipython>=7.30.0,<8.31",
"joblib>=1.0.0,<1.5",
"matplotlib>=3.5.0,<3.10",
"mock>=5.1.0,<5.2",
Expand Down Expand Up @@ -132,7 +132,7 @@ installer = [
"SRTM.py",
"utm",
"jupyterlab>=3.6.0,<4.4",
"ipython>=7.30.0,<8.30",
"ipython>=7.30.0,<8.31",
"ipyvtklink>=0.2.0,<0.2.4",
]

Expand Down
3 changes: 1 addition & 2 deletions src/ansys/aedt/core/hfss3dlayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2292,13 +2292,12 @@ def find_scale(data, header_line):
self.oboundary.EditExcitations(
[
"NAME:Excitations",
[source, f"pwl({ds_name_mag}, Freq)", f"pwl({ds_name_phase}, Freq)"],
[source, f"pwl({ds_name_phase}, Freq)", f"pwl({ds_name_mag}, Freq)"],
],
["NAME:Terminations", [source, False, str(impedance) + "ohm", "0ohm"]],
",".join(str_val),
[],
)

self.logger.info("Source Excitation updated with Dataset.")
return True
self.logger.error("Port not found.")
Expand Down
124 changes: 124 additions & 0 deletions src/ansys/aedt/core/maxwell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2961,6 +2961,130 @@ def assign_zero_tangential_h_field(self, assignment, boundary=None):
return bound
return False

@pyaedt_function_handler()
def assign_resistive_sheet(
self,
assignment,
resistance="1ohm",
name=None,
non_linear=False,
anode_a="300000000",
anode_b="5",
anode_c="110000000000000",
anode_d="2",
cathode_a="300000000",
cathode_b="10",
cathode_c="110000000000000",
cathode_d="2",
):
"""Assign a resistive sheet boundary between two conductors.
Available for Maxwell 3D Magnetostatic, Eddy Current and Transient designs.
For 3D Magnetostatic designs, the user can specify the nonlinear anode and cathode coefficients.
To understand the nonlinear relationship used by AEDT between the conductivity and current density,
please refer to Maxwell Help guide.
Parameters
----------
assignment : list of int or :class:`ansys.aedt.core.modeler.cad.object_3d.Object3d`
List of objects to assign an end connection to.
resistance : str, optional
Resistance value with unit.
For 3D Magnetostatic designs if non_linear is ``True``, it is not available.
The default is ``1ohm``.
name : str, optional
Name of the boundary. The default is ``None``, in which case the default name is used.
non_linear: bool, optional
Whether the boundary is non-linear. The default is ``False``.
Valid for 3D Magnetostatic designs only.
anode_a : str, optional
Anode a value that corresponds to the a coefficient in the non-linear relationship
between conductivity and current density.
The default value is ``"300000000"``.
anode_b : str, optional
Anode b value that corresponds to the b coefficient in the non-linear relationship
between conductivity and current density.
The default value is ``"10"``.
anode_c : str, optional
Anode c value that corresponds to the c coefficient in the non-linear relationship
between conductivity and current density.
The default value is ``"110000000000000"``.
anode_d : str, optional
Anode d value that corresponds to the d coefficient in the non-linear relationship
between conductivity and current density.
The default value is ``"2"``.
cathode_a : str, optional
Cathode a value that corresponds to the a coefficient in the non-linear relationship
between conductivity and current density.
The default value is ``"300000000"``.
cathode_b : str, optional
Cathode b value that corresponds to the b coefficient in the non-linear relationship
between conductivity and current density.
The default value is ``"10"``.
cathode_c : str, optional
Cathode c value that corresponds to the c coefficient in the non-linear relationship
between conductivity and current density.
The default value is ``"110000000000000"``.
cathode_d : str, optional
Cathode d value that corresponds to the d coefficient in the non-linear relationship
between conductivity and current density.
The default value is ``"2"``.
Returns
-------
:class:`ansys.aedt.core.modules.boundary.BoundaryObject`
Newly created object. ``False`` if it fails.
References
----------
>>> oModule.AssignResistiveSheet
Examples
--------
>>> import ansys.aedt.core
>>> from ansys.aedt.core.generic.constants import SOLUTIONS
>>> m3d = ansys.aedt.core.Maxwell3d(solution_type="Transient")
>>> my_box = m3d.modeler.create_box(origin=[0, 0, 0], sizes=[0.4, -1, 0.8], material="copper")
>>> resistive_face = my_box.faces[0]
>>> bound = self.aedtapp.assign_resistive_sheet(assignment=resistive_face, resistance="3ohm")
>>> self.aedtapp.solution_type = SOLUTIONS.Maxwell3d.Magnetostatic
>>> bound = self.aedtapp.assign_resistive_sheet(assignment=resistive_face, non_linear=True)
>>> m3d.release_desktop()
"""
if self.solution_type not in ["EddyCurrent", "Transient", "Magnetostatic"]:
self.logger.error(
"Resistive sheet is applicable only to Eddy current, transient and magnetostatic solvers."
)
return False

assignment = self.modeler.convert_to_selections(assignment, True)

if not name:
boundary = generate_unique_name("ResistiveSheet")

props = {
"Faces": assignment,
}

if self.solution_type in ["EddyCurrent", "Transient"]:
props["Resistance"] = resistance
elif self.solution_type == "Magnetostatic":
props["Nonlinear"] = non_linear
props["AnodeParA"] = anode_a
props["AnodeParB"] = anode_b
props["AnodeParC"] = anode_c
props["AnodeParD"] = anode_d
props["CathodeParA"] = cathode_a
props["CathodeParB"] = cathode_b
props["CathodeParC"] = cathode_c
props["CathodeParD"] = cathode_d

bound = BoundaryObject(self, boundary, props, "ResistiveSheet")
if bound.create():
self._boundaries[bound.name] = bound
return bound
return False


class Maxwell2d(Maxwell, FieldAnalysis3D, object):
"""Provides the Maxwell 2D app interface.
Expand Down
Loading

0 comments on commit fe5fd62

Please sign in to comment.