Skip to content

Commit

Permalink
CHORE: refacto maxwell test (#5601)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sébastien Morais <[email protected]>
Co-authored-by: samuel <[email protected]>
  • Loading branch information
4 people authored Jan 13, 2025
1 parent a5cbc5e commit d396cae
Show file tree
Hide file tree
Showing 14 changed files with 1,143 additions and 57,493 deletions.
3 changes: 0 additions & 3 deletions src/ansys/aedt/core/application/analysis_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -1312,9 +1312,6 @@ def import_dxf(
import_method : int, bool
Whether the import method is ``Script`` or ``Acis``.
The default is ``1``, which means that the ``Acis`` is used.
sheet_bodies_2d : bool, optional
Whether importing as 2D sheet bodies causes imported objects to
be organized in terms of 2D sheets. The default is ``True``.
Returns
-------
Expand Down
526 changes: 207 additions & 319 deletions src/ansys/aedt/core/maxwell.py

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/ansys/aedt/core/modules/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,6 @@ def assign_length_mesh(self, assignment, inside_selection=True, maximum_length=1
if maximum_length is None and maximum_elements is None:
self.logger.error("mesh not assigned due to incorrect settings")
return
assignment = self._app.modeler.convert_to_selections(assignment, True)

if isinstance(assignment[0], int) and not inside_selection:
seltype = "Faces"
Expand Down Expand Up @@ -1318,7 +1317,6 @@ def assign_curvilinear_elements(self, assignment, enable=True, name=None):
name = generate_unique_name(name)
else:
name = generate_unique_name("CurvilinearElements")
assignment = self._app.modeler.convert_to_selections(assignment, True)

if isinstance(assignment[0], int):
seltype = "Faces"
Expand Down
19 changes: 5 additions & 14 deletions src/ansys/aedt/core/modules/solve_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ def add_mesh_link(
Name of the source design.
solution : str, optional
Name of the source design solution in the format ``"name : solution_name"``.
If ``None``, the default value is ``name : LastAdaptive``.
If ``None``, the default value is taken from the nominal adaptive solution.
parameters : dict, optional
Dictionary of the "mapping" variables from the source design.
If ``None``, the default is `appname.available_variations.nominal_w_values_dict`.
Expand Down Expand Up @@ -919,9 +919,7 @@ def add_mesh_link(
design_type = self.p_app.design_type
meshlinks["Product"] = design_type
# design name
if not design or design is None:
raise ValueError("Provide design name to add mesh link to.")
elif design not in self.p_app.design_list:
if design not in self.p_app.design_list:
raise ValueError("Design does not exist in current project.")
else:
meshlinks["Design"] = design
Expand All @@ -939,15 +937,8 @@ def add_mesh_link(
meshlinks["ImportMesh"] = True
# solution name
if solution is None:
meshlinks["Soln"] = (
f'{self.p_app.oproject.GetDesign(design).GetChildObject("Analysis").GetChildNames()[0]} : '
f"LastAdaptive"
)
elif (
solution.split()[0] in self.p_app.oproject.GetDesign(design).GetChildObject("Analysis").GetChildNames()
):
meshlinks["Soln"] = f"{solution.split()[0]} : LastAdaptive"
else:
meshlinks["Soln"] = self.p_app.nominal_adaptive
elif solution.split()[0] not in self.p_app.existing_analysis_setups:
raise ValueError("Setup does not exist in current design.")
# parameters
meshlinks["Params"] = {}
Expand All @@ -964,7 +955,7 @@ def add_mesh_link(
meshlinks["ForceSourceToSolve"] = force_source_to_solve
meshlinks["PreservePartnerSoln"] = preserve_partner_solution
meshlinks["ApplyMeshOp"] = apply_mesh_operations
if self.p_app.design_type != "Maxwell 2D" or self.p_app.design_type != "Maxwell 3D":
if self.p_app.design_type not in ["Maxwell 2D", "Maxwell 3D"]:
meshlinks["AdaptPort"] = adapt_port
self.update()
self.auto_update = auto_update
Expand Down
1 change: 0 additions & 1 deletion tests/system/general/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
# Initialize default desktop configuration
default_version = "2024.2"


if inside_desktop and "oDesktop" in dir(sys.modules["__main__"]):
default_version = sys.modules["__main__"].oDesktop.GetVersion()[0:6]
config = {
Expand Down
Loading

0 comments on commit d396cae

Please sign in to comment.