diff --git a/src/ansys/edb/core/inner/messages.py b/src/ansys/edb/core/inner/messages.py index 596fe89330..669094b17e 100644 --- a/src/ansys/edb/core/inner/messages.py +++ b/src/ansys/edb/core/inner/messages.py @@ -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)) diff --git a/src/ansys/edb/core/inner/parser.py b/src/ansys/edb/core/inner/parser.py index 16432c0a0a..0102e3bf3e 100644 --- a/src/ansys/edb/core/inner/parser.py +++ b/src/ansys/edb/core/inner/parser.py @@ -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 diff --git a/src/ansys/edb/core/simulation_setup/mesh_operation.py b/src/ansys/edb/core/simulation_setup/mesh_operation.py index 89dcdb8962..e4d65277ad 100644 --- a/src/ansys/edb/core/simulation_setup/mesh_operation.py +++ b/src/ansys/edb/core/simulation_setup/mesh_operation.py @@ -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__( @@ -26,6 +28,7 @@ def __init__( enabled=True, refine_inside=False, mesh_region="", + solve_inside=False, ): """Create a mesh operation.""" self._name = name @@ -33,6 +36,7 @@ def __init__( self._enabled = enabled self._refine_inside = refine_inside self._mesh_region = mesh_region + self._solve_inside = solve_inside @property def name(self): @@ -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. @@ -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" @@ -119,6 +134,7 @@ def __init__( enabled=True, refine_inside=False, mesh_region="", + solve_inside=False, skin_depth="1um", surface_triangle_length="1mm", num_layers="2", @@ -126,7 +142,7 @@ def __init__( 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 @@ -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 @@ -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