Skip to content

Commit

Permalink
Add discriminator to medium types in waveguides (#991)
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Heitzmann Gabrielli <lucas@flexcompute.com>
  • Loading branch information
lucas-flexcompute authored Jul 6, 2023
1 parent 1bcd341 commit 9712bbf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tidy3d/plugins/waveguide/rectangular_dielectric.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from ...components.source import ModeSource, GaussianPulse
from ...components.structure import Structure
from ...components.types import ArrayFloat1D, Ax, Axis, Coordinate, Literal, Size1D, Union
from ...components.types import TYPE_TAG_STR
from ...constants import C_0, inf, MICROMETER, RADIAN
from ...exceptions import Tidy3dError, ValidationError
from ...log import log
Expand Down Expand Up @@ -61,18 +62,21 @@ class RectangularDielectric(Tidy3dBaseModel):
...,
title="Core Medium",
description="Medium associated with the core layer.",
discriminator=TYPE_TAG_STR,
)

clad_medium: MediumType = pydantic.Field(
...,
title="Clad Medium",
description="Medium associated with the upper cladding layer.",
discriminator=TYPE_TAG_STR,
)

box_medium: MediumType = pydantic.Field(
None,
title="Box Medium",
description="Medium associated with the lower cladding layer.",
discriminator=TYPE_TAG_STR,
)

slab_thickness: Size1D = pydantic.Field(
Expand Down Expand Up @@ -131,6 +135,7 @@ class RectangularDielectric(Tidy3dBaseModel):
None,
title="Sidewall medium",
description="Medium associated with the sidewall layer to model sidewall losses.",
discriminator=TYPE_TAG_STR,
)

surface_thickness: Size1D = pydantic.Field(
Expand All @@ -145,6 +150,7 @@ class RectangularDielectric(Tidy3dBaseModel):
None,
title="Surface Medium",
description="Medium associated with the surface layer to model surface losses.",
discriminator=TYPE_TAG_STR,
)

origin: Coordinate = pydantic.Field(
Expand Down

0 comments on commit 9712bbf

Please sign in to comment.