tidy3d.VolumeMesherData#
- class VolumeMesherData[source]#
Bases:
AbstractHeatChargeSimulationData
Stores results of a
VolumeMesher
.- Parameters:
attrs (dict = {}) β Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields,
attrs
are mutable. For example, the following is allowed for setting anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.json()
.simulation (HeatChargeSimulation) β Original
HeatChargeSimulation
associated with the data.data (Tuple[VolumeMeshData, ...]) β List of
MonitorData
instances associated with the monitors of the originalVolumeMesher
.log (Optional[str] = None) β A string containing the log information from the simulation run.
monitors (Tuple[VolumeMeshMonitor, ...]) β List of monitors to be used for the mesher.
Example
>>> import tidy3d as td >>> import numpy as np >>> mesh_mnt = td.VolumeMeshMonitor(size=(1, 2, 3), name="mesh") >>> temp_mnt = td.TemperatureMonitor(size=(1, 2, 3), name="sample") >>> heat_sim = td.HeatChargeSimulation( ... size=(3.0, 3.0, 3.0), ... structures=[ ... td.Structure( ... geometry=td.Box(size=(1, 1, 1), center=(0, 0, 0)), ... medium=td.Medium( ... permittivity=2.0, heat_spec=td.SolidSpec( ... conductivity=1, ... capacity=1, ... ) ... ), ... name="box", ... ), ... ], ... medium=td.Medium(permittivity=3.0, heat_spec=td.FluidSpec()), ... grid_spec=td.UniformUnstructuredGrid(dl=0.1), ... sources=[td.HeatSource(rate=1, structures=["box"])], ... boundary_spec=[ ... td.HeatChargeBoundarySpec( ... placement=td.StructureBoundary(structure="box"), ... condition=td.TemperatureBC(temperature=500), ... ) ... ], ... monitors=[temp_mnt], ... ) >>> tet_grid_points = td.PointDataArray( ... [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0], [0.0, 0.0, 1.0]], ... dims=("index", "axis"), ... ) >>> tet_grid_cells = td.CellDataArray( ... [[0, 1, 2, 4], [1, 2, 3, 4]], ... dims=("cell_index", "vertex_index"), ... ) >>> tet_grid_values = td.IndexedDataArray( ... np.zeros((tet_grid_points.shape[0],)), ... dims=("index",), ... name="Mesh", ... ) >>> tet_grid = td.TetrahedralGridDataset( ... points=tet_grid_points, ... cells=tet_grid_cells, ... values=tet_grid_values, ... ) >>> mesh_mnt_data = td.VolumeMeshData(monitor=mesh_mnt, mesh=tet_grid) >>> mesh_data = td.VolumeMesherData(simulation=heat_sim, data=[mesh_mnt_data], monitors=[mesh_mnt])
Attributes
Get the mesher associated with this mesher data.
Custom logger to avoid the complexities of the logging module
Methods
data_monitors_match_sim
(values)Ensure each
AbstractMonitorData
in.data
corresponds to a monitor in.simulation
.get_monitor_by_name
(name)Return monitor named 'name'.
Inherited Common Usage
- monitors#
- data#
- property mesher#
Get the mesher associated with this mesher data.
- classmethod data_monitors_match_sim(values)[source]#
Ensure each
AbstractMonitorData
in.data
corresponds to a monitor in.simulation
.
- __hash__()#
Hash method.