-
Notifications
You must be signed in to change notification settings - Fork 27
/
ChargeDensities.jl
37 lines (27 loc) · 1.26 KB
/
ChargeDensities.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
abstract type AbstractChargeDensity{T <: SSDFloat} end
Struct defining the charge density inside a [`Passive`](@ref).
For each charge density, there should be a method [`get_charge_density`](@ref)
which returns the charge density in SI units (C/m³) at a given point `pt`.
## Examples
* [`ConstantChargeDensity`](@ref)
* [`LinearChargeDensity`](@ref)
* [`CylindricalChargeDensity`](@ref)
"""
abstract type AbstractChargeDensity{T <: SSDFloat} end
@inline function ChargeDensity(T::DataType, dict::Union{Dict{String, Any}, Dict{Any, Any}}, input_units::NamedTuple)
return ChargeDensity(T, Val{Symbol(dict["name"])}(), dict, input_units)
end
"""
get_charge_density(cd::AbstractChargeDensity, pt::AbstractCoordinatePoint)
Returns the charge density at a given point, `pt`, based on the charge density model `cd`.
## Arguments
* `cd::AbstractChargeDensity`: The [`AbstractChargeDensity`](@ref) defining the charge density inside a [`Passive`](@ref).
* `pt::AbstractCoordinatePoint`: The point at which `cd` is to be evaluated.
!!! note
The value returned by `get_charge_density` is in units of C/m³ (SI units).
"""
function get_charge_density end
include("ConstantChargeDensity.jl")
include("LinearChargeDensity.jl")
include("CylindricalChargeDensity.jl")