Skip to content

Commit

Permalink
Merge branch 'main' into D388_dm_dev_0
Browse files Browse the repository at this point in the history
  • Loading branch information
drewm102 authored Apr 17, 2024
2 parents dbbfd17 + 2609df2 commit 7578151
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [

# FIXME: add ansys-api-edb version
dependencies = [
"ansys-api-edb==1.0.1",
"ansys-api-edb==1.0.2",
"protobuf>=3.19.3,<4",
"grpcio>=1.44.0"
]
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/edb/core/hierarchy/hierarchy_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class HierarchyObj(conn_obj.ConnObj):
def transform(self):
""":class:`Transform <ansys.edb.core.utility.Transform>`: Transformation information of the hierarchy object."""
transform_msg = self.__stub.GetTransform(self.msg)
return Transform(
return Transform.create(
transform_msg.scale,
transform_msg.angle,
transform_msg.mirror,
Expand Down
5 changes: 3 additions & 2 deletions src/ansys/edb/core/inner/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,13 +810,13 @@ def term_find_by_name_message(layout, name):

def term_get_product_solver_message(term, product_id):
"""Convert to a ``TermGetProductSolversMessage`` object."""
return TermGetProductSolversMessage(term=term.msg, product_id=product_id)
return TermGetProductSolversMessage(term=term.msg, product_id=product_id.value)


def term_set_solver_option_message(term, product_id, name, option):
"""Convert to a ``TermSetSolverOptionMessage`` object."""
return TermSetSolverOptionMessage(
term=term.msg, product_id=product_id, name=name, option=option
term=term.msg, product_id=product_id.value, name=name, option=option
)


Expand Down Expand Up @@ -964,6 +964,7 @@ def mesh_operation_message(mesh_op):
refine_inside=mesh_op.refine_inside,
mesh_region=mesh_op.mesh_region,
net_layer_info=[_mesh_op_net_layer_message(*nl) for nl in mesh_op.net_layer_info],
solve_inside=mesh_op.solve_inside,
)
if isinstance(mesh_op, LengthMeshOperation):
mesh_op_msg.length_mesh_op.CopyFrom(_length_mesh_operation_message(mesh_op))
Expand Down
1 change: 1 addition & 0 deletions src/ansys/edb/core/inner/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ def _to_mesh_op(message):
mesh_op.enabled = message.enabled
mesh_op.mesh_region = message.mesh_region
mesh_op.refine_inside = message.refine_inside
mesh_op.solve_inside = message.solve_inside
for nli in message.net_layer_info:
mesh_op.net_layer_info.append((nli.net, nli.layer, nli.is_sheet))
return mesh_op
6 changes: 6 additions & 0 deletions src/ansys/edb/core/primitive/primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,12 @@ def render(cls, width, end_cap1, end_cap2, corner_style, path):
)
)

@property
@parser.to_polygon_data
def polygon_data(self):
""":class:`PolygonData <ansys.edb.geometry.PolygonData>`: Polygon data of this Path."""
return self.__stub.GetPolygonData(self.msg)

@property
@parser.to_polygon_data
def center_line(self):
Expand Down
23 changes: 21 additions & 2 deletions src/ansys/edb/core/simulation_setup/mesh_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class MeshOperation:
Whether to refine inside.
mesh_region : str, default: ""
Mesh region.
solve_inside : bool, default: False
Whether to solve inside.
"""

def __init__(
Expand All @@ -26,13 +28,15 @@ def __init__(
enabled=True,
refine_inside=False,
mesh_region="",
solve_inside=False,
):
"""Create a mesh operation."""
self._name = name
self._net_layer_info = [] if net_layer_info is None else net_layer_info
self._enabled = enabled
self._refine_inside = refine_inside
self._mesh_region = mesh_region
self._solve_inside = solve_inside

@property
def name(self):
Expand Down Expand Up @@ -83,6 +87,15 @@ def mesh_region(self):
def mesh_region(self, mesh_region):
self._mesh_region = mesh_region

@property
def solve_inside(self):
""":obj:`bool`: Flag indicating if solve inside is enabled."""
return self._solve_inside

@solve_inside.setter
def solve_inside(self, solve_inside):
self._solve_inside = solve_inside


class SkinDepthMeshOperation(MeshOperation):
"""Represents a skin depth mesh operation.
Expand All @@ -100,6 +113,8 @@ class SkinDepthMeshOperation(MeshOperation):
Whether to refine inside.
mesh_region : str, default: ""
Mesh region.
solve_inside : bool, default: False
Whether to solve inside.
skin_depth : str, default: "1um"
Skin depth.`.
surface_triangle_length : str, default: "1mm"
Expand All @@ -119,14 +134,15 @@ def __init__(
enabled=True,
refine_inside=False,
mesh_region="",
solve_inside=False,
skin_depth="1um",
surface_triangle_length="1mm",
num_layers="2",
max_elements="1000",
restrict_max_elements=False,
):
"""Create a skin depth mesh operation."""
super().__init__(name, net_layer_info, enabled, refine_inside, mesh_region)
super().__init__(name, net_layer_info, enabled, refine_inside, mesh_region, solve_inside)
self._skin_depth = skin_depth
self._surface_triangle_length = surface_triangle_length
self._num_layers = num_layers
Expand Down Expand Up @@ -195,6 +211,8 @@ class LengthMeshOperation(MeshOperation):
Whether to refine inside.
mesh_region : str, default: ""
Mesh region.
solve_inside : bool, default: False
Whether to solve inside.
max_length : str, default: "1mm"
maximum length of the mesh elements.
restrict_max_length : str, default: True
Expand All @@ -212,13 +230,14 @@ def __init__(
enabled=True,
refine_inside=False,
mesh_region="",
solve_inside=False,
max_length="1mm",
restrict_max_length=True,
max_elements="1000",
restrict_max_elements=False,
):
"""Initialize an instance of a skin depth mesh operation."""
super().__init__(name, net_layer_info, enabled, refine_inside, mesh_region)
super().__init__(name, net_layer_info, enabled, refine_inside, mesh_region, solve_inside)
self._max_length = max_length
self._restrict_max_length = restrict_max_length
self._max_elements = max_elements
Expand Down

0 comments on commit 7578151

Please sign in to comment.