Skip to content

Commit

Permalink
T1015218: Add solve_inside property in MeshOperation.
Browse files Browse the repository at this point in the history
  • Loading branch information
chenchienjacklin committed Apr 4, 2024
1 parent f3a8dc5 commit 1984c77
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/ansys/edb/core/inner/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,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
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 1984c77

Please sign in to comment.