Skip to content

Commit 2daa477

Browse files
feat: downsample frequencies in mode monitors (fxc-3351)
1 parent 1fac5c3 commit 2daa477

File tree

18 files changed

+3225
-105
lines changed

18 files changed

+3225
-105
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3535
- Added support for `nonlinear_spec` in `CustomMedium` and `CustomDispersiveMedium`.
3636
- `tidy3d.plugins.design.DesignSpace.run(..., fn_post=...)` now accepts a `priority` keyword to propagate vGPU queue priority to all automatically batched simulations.
3737
- Introduced `BroadbandPulse` for exciting simulations across a wide frequency spectrum.
38+
- Added `interp_spec` in `ModeSpec` to allow downsampling and interpolation of waveguide modes in frequency.
3839

3940
### Breaking Changes
4041
- Edge singularity correction at PEC and lossy metal edges defaults to `True`.

docs/api/mode.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ Mode Specifications
77
:toctree: _autosummary/
88
:template: module.rst
99

10-
tidy3d.ModeSpec
10+
tidy3d.ModeSpec
11+
tidy3d.ModeSortSpec
12+
tidy3d.ModeInterpSpec

schemas/EMESimulation.json

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,6 +1748,30 @@
17481748
},
17491749
"type": "object"
17501750
},
1751+
"ChebSampling": {
1752+
"additionalProperties": false,
1753+
"properties": {
1754+
"attrs": {
1755+
"default": {},
1756+
"type": "object"
1757+
},
1758+
"num_points": {
1759+
"minimum": 3,
1760+
"type": "integer"
1761+
},
1762+
"type": {
1763+
"default": "ChebSampling",
1764+
"enum": [
1765+
"ChebSampling"
1766+
],
1767+
"type": "string"
1768+
}
1769+
},
1770+
"required": [
1771+
"num_points"
1772+
],
1773+
"type": "object"
1774+
},
17511775
"ClipOperation": {
17521776
"additionalProperties": false,
17531777
"properties": {
@@ -3907,6 +3931,39 @@
39073931
],
39083932
"type": "object"
39093933
},
3934+
"CustomSampling": {
3935+
"additionalProperties": false,
3936+
"properties": {
3937+
"attrs": {
3938+
"default": {},
3939+
"type": "object"
3940+
},
3941+
"freqs": {
3942+
"anyOf": [
3943+
{
3944+
"items": {
3945+
"type": "number"
3946+
},
3947+
"type": "array"
3948+
},
3949+
{
3950+
"type": "ArrayLike"
3951+
}
3952+
]
3953+
},
3954+
"type": {
3955+
"default": "CustomSampling",
3956+
"enum": [
3957+
"CustomSampling"
3958+
],
3959+
"type": "string"
3960+
}
3961+
},
3962+
"required": [
3963+
"freqs"
3964+
],
3965+
"type": "object"
3966+
},
39103967
"CustomSellmeier": {
39113968
"additionalProperties": false,
39123969
"properties": {
@@ -5232,6 +5289,13 @@
52325289
],
52335290
"default": false
52345291
},
5292+
"interp_spec": {
5293+
"allOf": [
5294+
{
5295+
"$ref": "#/definitions/ModeInterpSpec"
5296+
}
5297+
]
5298+
},
52355299
"num_modes": {
52365300
"default": 1,
52375301
"exclusiveMinimum": 0,
@@ -7967,6 +8031,13 @@
79678031
}
79688032
]
79698033
},
8034+
"interp_spec": {
8035+
"allOf": [
8036+
{
8037+
"$ref": "#/definitions/ModeInterpSpec"
8038+
}
8039+
]
8040+
},
79708041
"num_modes": {
79718042
"default": 1,
79728043
"exclusiveMinimum": 0,
@@ -8073,6 +8144,7 @@
80738144
"bend_radius": null,
80748145
"filter_pol": null,
80758146
"group_index_step": false,
8147+
"interp_spec": null,
80768148
"num_modes": 1,
80778149
"num_pml": [
80788150
0,
@@ -8133,6 +8205,60 @@
81338205
],
81348206
"type": "object"
81358207
},
8208+
"ModeInterpSpec": {
8209+
"additionalProperties": false,
8210+
"properties": {
8211+
"attrs": {
8212+
"default": {},
8213+
"type": "object"
8214+
},
8215+
"method": {
8216+
"default": "linear",
8217+
"enum": [
8218+
"cubic",
8219+
"linear",
8220+
"poly"
8221+
],
8222+
"type": "string"
8223+
},
8224+
"reduce_data": {
8225+
"default": false,
8226+
"type": "boolean"
8227+
},
8228+
"sampling_spec": {
8229+
"discriminator": {
8230+
"mapping": {
8231+
"ChebSampling": "#/definitions/ChebSampling",
8232+
"CustomSampling": "#/definitions/CustomSampling",
8233+
"UniformSampling": "#/definitions/UniformSampling"
8234+
},
8235+
"propertyName": "type"
8236+
},
8237+
"oneOf": [
8238+
{
8239+
"$ref": "#/definitions/ChebSampling"
8240+
},
8241+
{
8242+
"$ref": "#/definitions/CustomSampling"
8243+
},
8244+
{
8245+
"$ref": "#/definitions/UniformSampling"
8246+
}
8247+
]
8248+
},
8249+
"type": {
8250+
"default": "ModeInterpSpec",
8251+
"enum": [
8252+
"ModeInterpSpec"
8253+
],
8254+
"type": "string"
8255+
}
8256+
},
8257+
"required": [
8258+
"sampling_spec"
8259+
],
8260+
"type": "object"
8261+
},
81368262
"ModeSolverMonitor": {
81378263
"additionalProperties": false,
81388264
"properties": {
@@ -8299,6 +8425,7 @@
82998425
"bend_radius": null,
83008426
"filter_pol": null,
83018427
"group_index_step": false,
8428+
"interp_spec": null,
83028429
"num_modes": 1,
83038430
"num_pml": [
83048431
0,
@@ -8515,6 +8642,13 @@
85158642
],
85168643
"default": false
85178644
},
8645+
"interp_spec": {
8646+
"allOf": [
8647+
{
8648+
"$ref": "#/definitions/ModeInterpSpec"
8649+
}
8650+
]
8651+
},
85188652
"num_modes": {
85198653
"default": 1,
85208654
"exclusiveMinimum": 0,
@@ -12052,6 +12186,30 @@
1205212186
],
1205312187
"type": "object"
1205412188
},
12189+
"UniformSampling": {
12190+
"additionalProperties": false,
12191+
"properties": {
12192+
"attrs": {
12193+
"default": {},
12194+
"type": "object"
12195+
},
12196+
"num_points": {
12197+
"minimum": 2,
12198+
"type": "integer"
12199+
},
12200+
"type": {
12201+
"default": "UniformSampling",
12202+
"enum": [
12203+
"UniformSampling"
12204+
],
12205+
"type": "string"
12206+
}
12207+
},
12208+
"required": [
12209+
"num_points"
12210+
],
12211+
"type": "object"
12212+
},
1205512213
"VarshniEnergyBandGap": {
1205612214
"additionalProperties": false,
1205712215
"properties": {

0 commit comments

Comments
 (0)