Source code for tidy3d.components.tcad.source.heat
"""Defines heat-charge material specifications for 'HeatChargeSimulation'"""from__future__importannotationsfromtypingimportUnionimportpydantic.v1aspdfromtidy3d.components.tcad.source.abstractimportStructureBasedHeatChargeSourcefromtidy3d.constantsimportVOLUMETRIC_HEAT_RATEfromtidy3d.logimportlog
[docs]classHeatSource(StructureBasedHeatChargeSource):"""Adds a volumetric heat source (heat sink if negative values are provided) to specific structures in the scene. Example ------- >>> heat_source = HeatSource(rate=1, structures=["box"]) """rate:Union[float]=pd.Field(title="Volumetric Heat Rate",description="Volumetric rate of heating or cooling (if negative) in units of "f"{VOLUMETRIC_HEAT_RATE}.",units=VOLUMETRIC_HEAT_RATE,)
[docs]classUniformHeatSource(HeatSource):"""Volumetric heat source. This class is deprecated. You can use 'HeatSource' instead. Example ------- >>> heat_source = UniformHeatSource(rate=1, structures=["box"]) # doctest: +SKIP """# NOTE: wrapper for backwards compatibility.
[docs]@pd.root_validator(skip_on_failure=True)defissue_warning_deprecated(cls,values):"""Issue warning for 'UniformHeatSource'."""log.warning("'UniformHeatSource' is deprecated and will be discontinued. You can use ""'HeatSource' instead.")returnvalues