Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST: Improve Icepak tests #5624

Merged
merged 17 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 11 additions & 8 deletions src/ansys/aedt/core/icepak.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,13 +1129,13 @@ def assign_priority_on_intersections(self, component_prefix="COMP_"):
i += 1
return True

@pyaedt_function_handler()
def find_top(self, gravityDir):
@pyaedt_function_handler(gravityDir="gravity_dir")
def find_top(self, gravity_dir):
"""Find the top location of the layout given a gravity.

Parameters
----------
gravityDir :
gravity_dir :
Gravity direction from -X to +Z. Options are ``0`` to ``5``.

Returns
Expand All @@ -1160,10 +1160,10 @@ def find_top(self, gravityDir):
]
self.modeler.oeditor.ChangeProperty(args)
oBoundingBox = self.modeler.get_model_bounding_box()
if gravityDir < 3:
return oBoundingBox[gravityDir + 3]
if gravity_dir < 3:
return oBoundingBox[gravity_dir + 3]
else:
return oBoundingBox[gravityDir - 3]
return oBoundingBox[gravity_dir - 3]

@pyaedt_function_handler(matname="material")
def create_parametric_fin_heat_sink(
Expand Down Expand Up @@ -2596,6 +2596,7 @@ def copyGroupFrom(self, group_name, source_design, source_project_name=None, sou
>>> oEditor.Copy
>>> oeditor.Paste
"""
pj_names = self.project_list
if "groupName" in kwargs:
warnings.warn(
"The ``groupName`` parameter was deprecated in 0.6.43. Use the ``group_name`` parameter instead.",
Expand Down Expand Up @@ -2639,6 +2640,8 @@ def copyGroupFrom(self, group_name, source_design, source_project_name=None, sou
self.modeler.oeditor.Paste()
self.modeler.refresh_all_ids()
self.materials._load_from_project()
if not (source_project_name in pj_names or source_project_name is None):
active_project.close()
return True

@pyaedt_function_handler()
Expand Down Expand Up @@ -2902,9 +2905,9 @@ def generate_fluent_mesh(
meshtype : str, optional
Mesh type. Options are ``"tethraedral"`` or ``"hexcore"``.
min_size : float, optional
Minimum mesh size. Default is smallest edge of objects/20.
Minimum mesh size. Default is the smallest edge of objects/20.
max_size : float, optional
Maximum mesh size. Default is smallest edge of objects/5.
Maximum mesh size. Default is the smallest edge of objects/5.
inflation_layer_number : int, optional
Inflation layer number. Default is ``3``.
inflation_growth_rate : float, optional
Expand Down
2 changes: 2 additions & 0 deletions src/ansys/aedt/core/modeler/cad/primitives_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,8 @@ def insert_3d_component(
"""
if password is None:
password = os.getenv("PYAEDT_ENCRYPTED_PASSWORD", "")
if not input_file.endswith(".a3dcomp"):
input_file += ".a3dcomp"
aedt_fh = open_file(input_file, "rb")
if aedt_fh:
temp = aedt_fh.read().splitlines()
Expand Down
224 changes: 174 additions & 50 deletions src/ansys/aedt/core/modules/boundary/layout_boundary.py

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions src/ansys/aedt/core/modules/mesh_icepak.py
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,9 @@ def automatic_mesh_pcb(self, accuracy=2):

@pyaedt_function_handler(accuracy2="accuracy", stairStep="enable_stair_step")
def automatic_mesh_3D(self, accuracy, enable_stair_step=True):
"""Create a generic custom mesh for a custom 3D object.
"""Create a generic custom mesh.

.. deprecated:: 0.13.0

Parameters
----------
Expand All @@ -1360,14 +1362,14 @@ def automatic_mesh_3D(self, accuracy, enable_stair_step=True):
xsize = self.boundingdimension[0] / (10 * accuracy * accuracy)
ysize = self.boundingdimension[1] / (10 * accuracy * accuracy)
zsize = self.boundingdimension[2] / (10 * accuracy)
self.global_mesh_region.MaxElementSizeX = xsize
self.global_mesh_region.MaxElementSizeY = ysize
self.global_mesh_region.MaxElementSizeZ = zsize
self.global_mesh_region.UserSpecifiedSettings = True
self.global_mesh_region.MinGapX = str(xsize / 100)
self.global_mesh_region.MinGapY = str(ysize / 100)
self.global_mesh_region.MinGapZ = str(zsize / 100)
self.global_mesh_region.StairStepMeshing = enable_stair_step
self.global_mesh_region.manual_settings = True
self.global_mesh_region.settings["MaxElementSizeX"] = xsize
self.global_mesh_region.settings["MaxElementSizeY"] = ysize
self.global_mesh_region.settings["MaxElementSizeZ"] = zsize
self.global_mesh_region.settings["MinGapX"] = str(xsize / 100)
self.global_mesh_region.settings["MinGapY"] = str(ysize / 100)
self.global_mesh_region.settings["MinGapZ"] = str(zsize / 100)
self.global_mesh_region.settings["StairStepMeshing"] = enable_stair_step
self.global_mesh_region.update()
return True

Expand Down
Loading