Skip to content

Commit b0d8cec

Browse files
committed
wip
1 parent c34ea2a commit b0d8cec

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

tidy3d/components/tcad/data/monitor_data/mesh.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Union
5+
from typing import Union
66

77
import pydantic.v1 as pd
88

@@ -27,9 +27,9 @@ class VolumeMeshData(HeatChargeMonitorData):
2727
)
2828

2929
@property
30-
def field_components(self) -> Dict[str, UnstructuredFieldType]:
30+
def field_components(self) -> dict[str, UnstructuredFieldType]:
3131
"""Maps the field components to their associated data."""
32-
return dict(mesh=self.mesh)
32+
return {"mesh": self.mesh}
3333

3434
def field_name(self, val: str) -> str:
3535
"""Gets the name of the fields to be plot."""
@@ -39,5 +39,5 @@ def field_name(self, val: str) -> str:
3939
def symmetry_expanded_copy(self) -> VolumeMeshData:
4040
"""Return copy of self with symmetry applied."""
4141

42-
new_temp = self._symmetry_expanded_copy(property=self.temperature)
43-
return self.updated_copy(temperature=new_temp, symmetry=(0, 0, 0))
42+
new_mesh = self._symmetry_expanded_copy(property=self.mesh)
43+
return self.updated_copy(mesh=new_mesh, symmetry=(0, 0, 0))

tidy3d/components/tcad/data/sim_data.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ class DeviceCharacteristics(Tidy3dBaseModel):
8686

8787

8888
class AbstractHeatChargeSimulationData(AbstractSimulationData, ABC):
89-
pass
90-
91-
92-
class HeatChargeSimulationData(AbstractHeatChargeSimulationData):
9389
"""Stores results of a :class:`HeatChargeSimulation`.
9490
9591
Example
@@ -226,7 +222,7 @@ def plot_field(
226222
# field.name = field_name
227223
field_data = self._field_component_value(field, val)
228224

229-
if isinstance(monitor_data, TemperatureData):
225+
if isinstance(monitor_data, (TemperatureData, VolumeMeshData)):
230226
property_to_plot = "heat_conductivity"
231227
elif isinstance(monitor_data, SteadyPotentialData):
232228
property_to_plot = "electric_conductivity"
@@ -362,6 +358,10 @@ def plot_field(
362358
return ax
363359

364360

361+
class HeatChargeSimulationData(AbstractHeatChargeSimulationData):
362+
pass
363+
364+
365365
class HeatSimulationData(HeatChargeSimulationData):
366366
"""DEPRECATED: Wrapper for Heat Simulation data.
367367

tidy3d/components/tcad/mesher.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
from __future__ import annotations
2+
13
import pydantic as pd
24

35
from tidy3d.components.base import Tidy3dBaseModel
46
from tidy3d.components.tcad.monitors.mesh import VolumeMeshMonitor
5-
from tidy3d.components.tcad.simulation.heat_charge import HeatChargeSimulation
7+
from tidy3d.components.tcad.simulation.heat_charge import HeatChargeSimulation, TCADAnalysisTypes
68

79

810
class VolumeMesher(Tidy3dBaseModel):
@@ -17,3 +19,6 @@ class VolumeMesher(Tidy3dBaseModel):
1719
title="Monitors",
1820
description="List of monitors to be used for the mesher.",
1921
)
22+
23+
def _get_simulation_types(self) -> list[TCADAnalysisTypes]:
24+
return [TCADAnalysisTypes.MESH]

tidy3d/components/tcad/simulation/heat_charge.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class TCADAnalysisTypes(str, Enum):
105105
HEAT = "Heat"
106106
CONDUCTION = "Conduction"
107107
CHARGE = "Charge"
108+
MESH = "Mesh"
108109

109110

110111
class HeatChargeSimulation(AbstractSimulation):

0 commit comments

Comments
 (0)