At present, the subtypes of SetupSymmetry are used only to distinguish what methods to run. They are chosen by analysing the symmetry between the types Source and Material. The code would however be more elegant and easier to generalise if subtypes, such as WithoutSymmetry, had the fields Material, Source, basis_order, basis_field_order. At present several of these are carried with kws, which leads to more hidden behaviour, and some complications with dispatching to different WaveModes.
|
struct WithoutSymmetry{Dim} <: AbstractSetupSymmetry{Dim} end |
|
|
|
""" |
|
An incident plane-wave and halfspace material will result in all fields being plane-waves. |
|
""" |
|
abstract type AbstractPlanarSymmetry{Dim} <: AbstractSetupSymmetry{Dim} end |
|
struct PlanarSymmetry{Dim} <: AbstractPlanarSymmetry{Dim} end |
|
|
|
""" |
|
For spatial dimension > 2, we can consider problems that have azimuthal symmetry. For example, a plane-wave incident on a sphere. |
|
""" |
|
abstract type AbstractAzimuthalSymmetry{Dim} <: AbstractSetupSymmetry{Dim} end |
|
struct AzimuthalSymmetry{Dim} <: AbstractAzimuthalSymmetry{Dim} end |
|
|
|
AzimuthalSymmetry() = AzimuthalSymmetry{3}() |
|
|
|
""" |
|
For example, a plane-wave with direct incidence on a halfspace will have both azimuthal and plane-wave symmetry. |
|
""" |
|
struct PlanarAzimuthalSymmetry{Dim} <: AbstractPlanarSymmetry{Dim} end |
|
PlanarAzimuthalSymmetry() = PlanarAzimuthalSymmetry{3}() |
At present, the subtypes of SetupSymmetry are used only to distinguish what methods to run. They are chosen by analysing the symmetry between the types Source and Material. The code would however be more elegant and easier to generalise if subtypes, such as WithoutSymmetry, had the fields Material, Source, basis_order, basis_field_order. At present several of these are carried with kws, which leads to more hidden behaviour, and some complications with dispatching to different WaveModes.
EffectiveWaves.jl/src/material_types.jl
Lines 10 to 30 in cf5123f