Skip to content

Commit ac85aa7

Browse files
committed
Add VolumeMeshSpec and VOLUME_MESH task type
1 parent 3a9ec06 commit ac85aa7

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed

tidy3d/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
GridRefinementRegion,
4646
UniformUnstructuredGrid,
4747
)
48+
from tidy3d.components.tcad.mesher import VolumeMeshSpec
4849
from tidy3d.components.tcad.monitors.charge import (
4950
SteadyCapacitanceMonitor,
5051
SteadyEnergyBandMonitor,
@@ -610,6 +611,7 @@ def set_logging_level(level: str) -> None:
610611
"TemperatureData",
611612
"TemperatureMonitor",
612613
"HeatChargeSimulation",
614+
"VolumeMeshSpec",
613615
"SteadyPotentialData",
614616
"SteadyFreeCarrierData",
615617
"SteadyEnergyBandData",

tidy3d/components/tcad/mesher.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import pydantic as pd
2+
3+
from tidy3d.components.base import Tidy3dBaseModel
4+
from tidy3d.components.tcad.simulation.heat_charge import HeatChargeSimulation
5+
6+
7+
class VolumeMeshSpec(Tidy3dBaseModel):
8+
"""Specification for a standalone volume mesher."""
9+
10+
simulation: HeatChargeSimulation = pd.Field(
11+
..., description="HeatCharge simulation instance for the mesh specification."
12+
)

tidy3d/web/api/tidy3d_stub.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from pydantic.v1 import BaseModel
1010

1111
from tidy3d.components.tcad.data.sim_data import HeatChargeSimulationData, HeatSimulationData
12+
from tidy3d.components.tcad.mesher import VolumeMeshSpec
1213
from tidy3d.components.tcad.simulation.heat import HeatSimulation
1314
from tidy3d.components.tcad.simulation.heat_charge import HeatChargeSimulation
1415

@@ -88,6 +89,8 @@ def from_file(cls, file_path: str) -> SimulationType:
8889
sim = EMESimulation.from_file(file_path)
8990
elif "ModeSimulation" == type_:
9091
sim = ModeSimulation.from_file(file_path)
92+
elif "VolumeMeshSpec" == type_:
93+
sim = VolumeMeshSpec.from_file(file_path)
9194

9295
return sim
9396

@@ -148,6 +151,8 @@ def get_type(self) -> str:
148151
return TaskType.EME.name
149152
elif isinstance(self.simulation, ModeSimulation):
150153
return TaskType.MODE.name
154+
elif isinstance(self.simulation, VolumeMeshSpec):
155+
return TaskType.VOLUME_MESH.name
151156

152157
def validate_pre_upload(self, source_required) -> None:
153158
"""Perform some pre-checks on instances of component"""

tidy3d/web/api/webapi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
GUI_SUPPORTED_TASK_TYPES = ["FDTD", "MODE_SOLVER", "HEAT"]
4949

5050
# if a solver is in beta stage, cost is subject to change
51-
BETA_TASK_TYPES = ["HEAT", "EME", "HEAT_CHARGE"]
51+
BETA_TASK_TYPES = ["HEAT", "EME", "HEAT_CHARGE", "VOLUME_MESH"]
5252

5353
# map task_type to solver name for display
5454
SOLVER_NAME = {
@@ -58,6 +58,7 @@
5858
"EME": "EME",
5959
"HEAT": "Heat",
6060
"HEAT_CHARGE": "HeatCharge",
61+
"VOLUME_MESH": "VolumeMesh",
6162
}
6263

6364

tidy3d/web/core/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class TaskType(str, Enum):
5454
HEAT_CHARGE = "HEAT_CHARGE"
5555
EME = "EME"
5656
MODE = "MODE"
57+
VOLUME_MESH = "VOLUME_MESH"
5758

5859

5960
class PayType(str, Enum):

0 commit comments

Comments
 (0)