Scatterers and Boundary Conditions

A scatterer is the combination of a geometry and a condition on its surface. The geometry is the type, the condition its type parameter: a PEC sphere is a Sphere{PEC}, a sound-hard oblate spheroid an OblateSpheroid{SoundHard}. All of them are subtypes of Scatterer{BC}, where BC is the boundary condition.

The two are independent of each other, so that either can be addressed alone:

addressed byexampleholds for
geometrySpherespheres with any condition
geometry and conditionSphere{SoundHard}sound-hard spheres
physicsScatterer{<:AcousticBoundary}all acoustic scatterers

Type Hierarchy

The scatterers:

Scatterer{BC}
├── Sphere{BC}               centered in the origin
└── Spheroid{BC}             acoustic conditions only (so far)
    ├── OblateSpheroid{BC}   including the disc
    └── ProlateSpheroid{BC}

The boundary conditions, split by physics:

Boundary
├── ElectromagneticBoundary
│   ├── PEC
│   ├── Dielectric
│   ├── Layered
│   └── ThinImpedanceLayer
└── AcousticBoundary
    ├── SoundHard
    └── SoundSoft

See Sphere, Spheroid, OblateSpheroid, ProlateSpheroid, Boundary, ElectromagneticBoundary, AcousticBoundary, PEC, Dielectric, Layered, ThinImpedanceLayer, SoundHard, and SoundSoft.

A condition which requires data, such as the filling of a Dielectric, is stored as a value besides being the type parameter, sp.boundary, whereas a parameter-free one, such as PEC or SoundHard, occupies no memory.

Note

A sphere is not a special case of a spheroid: the spheroidal coordinates degenerate for a sphere, see the oblate and the prolate spheroidal coordinates. A disc, in contrast, is the oblate spheroid of vanishing polar radius.


Constructors

Every scatterer is defined by a constructor with keyword arguments:

scattererconstructortypedetails
PEC spherePECSphere(; radius)Sphere{PEC}PEC sphere
dielectric sphereDielectricSphere(; radius, filling)Sphere{<:Dielectric}dielectric sphere
layered dielectric sphereLayeredSphere(; radii, filling)Sphere{<:Layered{<:Dielectric}}layered sphere
layered dielectric sphere with PEC coreLayeredSpherePEC(; radii, filling)Sphere{<:Layered{PEC}}layered sphere with PEC core
dielectric sphere with thin impedance layerDielectricSphereThinImpedanceLayer(; radius, thickness, thinlayer, filling)Sphere{<:ThinImpedanceLayer}thin impedance layer
sound-hard sphereHardSphere(; radius)Sphere{SoundHard}sound-hard/soft sphere
sound-soft sphereSoftSphere(; radius)Sphere{SoundSoft}sound-hard/soft sphere
spheroidSpheroid{BC}(; equatorialRadius, polarRadius, axis)OblateSpheroid{BC} or ProlateSpheroid{BC}spheroid and disc
discDisc(BC; radius, axis)OblateSpheroid{BC}spheroid and disc

The names of the spheres are aliases of the respective Sphere{BC}, so that they can be dispatched on as well. A Spheroid returns the oblate or the prolate shape, depending on which of its radii is the larger one.

Alternatively, a sphere can be defined by its condition directly, which yields the same scatterers:

using SphericalScattering

sp = SphericalScattering.Sphere{SoundHard}(; radius=1.0)   # parameter-free condition: the type suffices

sp == HardSphere(; radius=1.0)
true
sp = SphericalScattering.Sphere(; radius=1.0, boundary=Dielectric(Medium(2.0, 1.0)))   # condition requiring data

typeof(sp)
DielectricSphere{Float64, Float64} (alias for SphericalScattering.Sphere{Dielectric{Float64}, Float64})

Combining Scatterers and Excitations

The physics of the scatterer has to match that of the excitation: an electromagnetic excitation requires a Scatterer{<:ElectromagneticBoundary}, an acoustic one a Scatterer{<:AcousticBoundary}. Otherwise a descriptive error is thrown:

using StaticArrays

ex = planeWave(; frequency=1e8)   # electromagnetic
sp = HardSphere(; radius=1.0)     # acoustic

try
    scatteredfield(sp, ex, ElectricField([SVector(2.0, 0.0, 0.0)]))
catch err
    showerror(stdout, err)
end
An electromagnetic excitation requires a scatterer with an electromagnetic boundary condition, such as a `PECSphere`.

Which combinations of scatterers and excitations are implemented is summarized in the Feature Overview.

The type parameter can also be used to write methods for all scatterers of one physics:

physics(sp::Scatterer{<:AcousticBoundary}) = "acoustic"
physics(sp::Scatterer{<:ElectromagneticBoundary}) = "electromagnetic"

physics.([PECSphere(; radius=1.0), Disc(SoundSoft; radius=1.0)])
2-element Vector{String}:
 "electromagnetic"
 "acoustic"

Geometric Queries

Besides the solutions, the following functions answer questions about the geometry:

functionscatterersreturns
isinside(sp, point)spheres and spheroidswhether the point lies inside the scatterer
equatorialRadius(sp), polarRadius(sp)spheroidsthe radii of the spheroid
isdisc(sp)spheroidswhether the spheroid is a disc
outwardNormal(sp, point), outwardNormals(sp, points)spheroidsthe outward normal at the given surface points