@@ -55,36 +55,34 @@ class PMCBoundary(BoundaryEdge):
55
55
class AbstractABCBoundary (BoundaryEdge , ABC ):
56
56
"""One-way wave equation absorbing boundary conditions abstract base class."""
57
57
58
- small_conductivity_approx : bool = pd .Field (
59
- True ,
60
- title = "Small Conductivity Approximation" ,
61
- description = "If ``False`` then the effective permettivity ``eps`` in the one-wave equation"
62
- " is modified such that the equation exactly satisfy wave propagation at the central "
63
- "frequency." ,
64
- )
65
-
66
58
67
59
class ABCBoundary (AbstractABCBoundary ):
68
- """One-way wave equation absorbing boundary conditions."""
60
+ """One-way wave equation absorbing boundary conditions.
61
+ See, for example, John B. Schneider, Understanding the Finite-Difference Time-Domain Method, Chapter 6.
62
+ """
69
63
70
64
permittivity : Optional [pd .PositiveFloat ] = pd .Field (
71
65
None ,
72
66
title = "Effective Permittivity" ,
73
- description = "Enforced effective permittivity." ,
67
+ description = "Effective permittivity for determining propagation constant. "
68
+ "If ``None``, this value will be automatically inferred from the medium at "
69
+ "the domain boundary and the central frequency of the source." ,
74
70
)
75
71
76
72
conductivity : Optional [pd .NonNegativeFloat ] = pd .Field (
77
73
None ,
78
74
title = "Effective Conductivity" ,
79
- description = "Enforced effective conductivity." ,
75
+ description = "Effective conductivity for determining propagation constant."
76
+ "If ``None``, this value will be automatically inferred from the medium at "
77
+ "the domain boundary and the central frequency of the source." ,
80
78
)
81
79
82
80
@pd .validator ("conductivity" , always = True )
83
81
@skip_if_fields_missing (["permittivity" ])
84
82
def _conductivity_only_with_float_permittivity (cls , val , values ):
85
83
"""Validate that conductivity can be provided only with float permittivity."""
86
84
perm = values ["permittivity" ]
87
- if val is not None and not isinstance ( perm , float ) :
85
+ if val is not None and perm is None :
88
86
raise ValidationError (
89
87
"Field 'conductivity' in 'ABCBoundary' can only be provided "
90
88
"simultaneously with 'permittivity'."
@@ -95,25 +93,17 @@ def _conductivity_only_with_float_permittivity(cls, val, values):
95
93
class ModeABCBoundary (AbstractABCBoundary ):
96
94
"""One-way wave equation absorbing boundary conditions for absorbing a waveguide mode."""
97
95
98
- small_conductivity_approx : bool = pd .Field (
99
- False ,
100
- title = "Small Conductivity Approximation" ,
101
- description = "If ``False`` then the effective permettivity ``eps`` in the one-wave equation"
102
- " is modified such that the equation exactly satisfy wave propagation at the central"
103
- " frequency." ,
104
- )
105
-
106
96
mode_spec : ModeSpec = pd .Field (
107
97
ModeSpec (),
108
98
title = "Mode Specification" ,
109
- description = "Parameters to feed to mode solver which determine modes ." ,
99
+ description = "Parameters that determine the modes computed by the mode solver ." ,
110
100
)
111
101
112
102
mode_index : pd .NonNegativeInt = pd .Field (
113
103
0 ,
114
104
title = "Mode Index" ,
115
105
description = "Index into the collection of modes returned by mode solver. "
116
- " Specifies which mode to absorbed using these boundary conditions . "
106
+ "The absorbing boundary conditions are configured to absorb the specified mode . "
117
107
"If larger than ``mode_spec.num_modes``, "
118
108
"``num_modes`` in the solver will be set to ``mode_index + 1``." ,
119
109
)
@@ -140,19 +130,13 @@ def is_plane(cls, val):
140
130
return val
141
131
142
132
@classmethod
143
- def from_source (
144
- cls , source : ModeSource , small_conductivity_approx : bool = False
145
- ) -> ModeABCBoundary :
133
+ def from_source (cls , source : ModeSource ) -> ModeABCBoundary :
146
134
"""Instantiate from a ``ModeSource``.
147
135
148
136
Parameters
149
137
----------
150
138
source : :class:`ModeSource`
151
139
Mode source.
152
- small_conductivity_approx : bool = False,
153
- If ``False`` then the effective permettivity ``eps`` in the one-wave equation
154
- is modified such that the equation exactly satisfy wave propagation at the central
155
- frequency.
156
140
157
141
Returns
158
142
-------
@@ -172,7 +156,6 @@ def from_source(
172
156
mode_spec = source .mode_spec ,
173
157
mode_index = source .mode_index ,
174
158
frequency = source .source_time .freq0 ,
175
- small_conductivity_approx = small_conductivity_approx ,
176
159
)
177
160
178
161
@classmethod
@@ -181,7 +164,6 @@ def from_monitor(
181
164
monitor : Union [ModeMonitor , ModeSolverMonitor ],
182
165
mode_index : pd .NonNengativeInt = 0 ,
183
166
frequency : Optional [pd .PositiveFloat ] = None ,
184
- small_conductivity_approx : bool = False ,
185
167
) -> ModeABCBoundary :
186
168
"""Instantiate from a ``ModeMonitor`` or ``ModeSolverMonitor``.
187
169
@@ -193,10 +175,6 @@ def from_monitor(
193
175
Mode index.
194
176
frequency : Optional[pd.PositiveFloat] = None
195
177
Frequency for estimating propagation index of absorbed mode.
196
- small_conductivity_approx : bool = False,
197
- If ``False`` then the effective permettivity ``eps`` in the one-wave equation
198
- is modified such that the equation exactly satisfy wave propagation at the central
199
- frequency.
200
178
201
179
Returns
202
180
-------
@@ -215,7 +193,6 @@ def from_monitor(
215
193
mode_spec = monitor .mode_spec ,
216
194
mode_index = mode_index ,
217
195
frequency = frequency ,
218
- small_conductivity_approx = small_conductivity_approx ,
219
196
)
220
197
221
198
@@ -859,7 +836,6 @@ def abc(
859
836
cls ,
860
837
permittivity : Optional [pd .PositiveFloat ] = None ,
861
838
conductivity : Optional [pd .NonNegativeFloat ] = None ,
862
- small_conductivity_approx : bool = True ,
863
839
):
864
840
"""ABC boundary specification on both sides along a dimension.
865
841
@@ -870,12 +846,10 @@ def abc(
870
846
plus = ABCBoundary (
871
847
permittivity = permittivity ,
872
848
conductivity = conductivity ,
873
- small_conductivity_approx = small_conductivity_approx ,
874
849
)
875
850
minus = ABCBoundary (
876
851
permittivity = permittivity ,
877
852
conductivity = conductivity ,
878
- small_conductivity_approx = small_conductivity_approx ,
879
853
)
880
854
return cls (plus = plus , minus = minus )
881
855
@@ -886,7 +860,6 @@ def mode_abc(
886
860
mode_spec : ModeSpec = ModeSpec (),
887
861
mode_index : pd .NonNegativeInt = 0 ,
888
862
frequency : Optional [pd .PositiveFloat ] = None ,
889
- small_conductivity_approx : bool = False ,
890
863
):
891
864
"""One-way wave equation mode ABC boundary specification on both sides along a dimension.
892
865
@@ -895,15 +868,11 @@ def mode_abc(
895
868
plane: Box
896
869
Cross-sectional plane in which the absorbed mode will be computed.
897
870
mode_spec: ModeSpec = ModeSpec()
898
- Parameters to feed to mode solver which determine modes .
871
+ Parameters that determine the modes computed by the mode solver .
899
872
mode_index : pd.NonNengativeInt = 0
900
873
Mode index.
901
874
frequency : Optional[pd.PositiveFloat] = None
902
875
Frequency for estimating propagation index of absorbed mode.
903
- small_conductivity_approx : bool = False,
904
- If ``False`` then the effective permettivity ``eps`` in the one-wave equation
905
- is modified such that the equation exactly satisfy wave propagation at the central
906
- frequency.
907
876
908
877
Example
909
878
-------
@@ -916,30 +885,24 @@ def mode_abc(
916
885
mode_spec = mode_spec ,
917
886
mode_index = mode_index ,
918
887
frequency = frequency ,
919
- small_conductivity_approx = small_conductivity_approx ,
920
888
)
921
889
minus = ModeABCBoundary (
922
890
plane = plane ,
923
891
mode_spec = mode_spec ,
924
892
mode_index = mode_index ,
925
893
frequency = frequency ,
926
- small_conductivity_approx = small_conductivity_approx ,
927
894
)
928
895
929
896
return cls (plus = plus , minus = minus )
930
897
931
898
@classmethod
932
- def mode_abc_from_source (cls , source : ModeSource , small_conductivity_approx : bool = False ):
899
+ def mode_abc_from_source (cls , source : ModeSource ):
933
900
"""One-way wave equation mode ABC boundary specification on both sides along a dimension constructed from a mode source.
934
901
935
902
Parameters
936
903
----------
937
904
source : :class:`ModeSource`
938
905
Mode source.
939
- small_conductivity_approx : bool = False,
940
- If ``False`` then the effective permettivity ``eps`` in the one-wave equation
941
- is modified such that the equation exactly satisfy wave propagation at the central
942
- frequency.
943
906
944
907
Example
945
908
-------
@@ -948,12 +911,8 @@ def mode_abc_from_source(cls, source: ModeSource, small_conductivity_approx: boo
948
911
>>> source = ModeSource(size=(1, 1, 0), source_time=pulse, direction='+')
949
912
>>> abc = Boundary.mode_abc_from_source(source=source)
950
913
"""
951
- plus = ModeABCBoundary .from_source (
952
- source = source , small_conductivity_approx = small_conductivity_approx
953
- )
954
- minus = ModeABCBoundary .from_source (
955
- source = source , small_conductivity_approx = small_conductivity_approx
956
- )
914
+ plus = ModeABCBoundary .from_source (source = source )
915
+ minus = ModeABCBoundary .from_source (source = source )
957
916
return cls (plus = plus , minus = minus )
958
917
959
918
@classmethod
@@ -962,7 +921,6 @@ def mode_abc_from_monitor(
962
921
monitor : Union [ModeMonitor , ModeSolverMonitor ],
963
922
mode_index : pd .NonNengativeInt = 0 ,
964
923
frequency : Optional [pd .PositiveFloat ] = None ,
965
- small_conductivity_approx : bool = False ,
966
924
):
967
925
"""One-way wave equation mode ABC boundary specification on both sides along a dimension constructed from a mode monitor.
968
926
@@ -976,13 +934,11 @@ def mode_abc_from_monitor(
976
934
monitor = monitor ,
977
935
mode_index = mode_index ,
978
936
frequency = frequency ,
979
- small_conductivity_approx = small_conductivity_approx ,
980
937
)
981
938
minus = ModeABCBoundary .from_monitor (
982
939
monitor = monitor ,
983
940
mode_index = mode_index ,
984
941
frequency = frequency ,
985
- small_conductivity_approx = small_conductivity_approx ,
986
942
)
987
943
return cls (plus = plus , minus = minus )
988
944
0 commit comments