NESSie

Constants

NESSie._etolFunction
_etol(::Float64)
_etol(::Type{Float64})
_etol(::Float32)
_etol(::Type{Float32})

Common tolerance values internally used by NESSie.

Return type

T

source
NESSie.σConstant

Geometric quantity $σ(ξ)$

\[σ(ξ) = \lim_{ε→0} \frac{1}{4πε²} ∫_{r ∈ Ω:|r-ξ|=ε} dΓᵣ = \frac{1}{2}\]

for almost all $ξ ∈ Γ$ (cf. [Ste03]).

source
NESSie.ecConstant

$10^{10}$ times the elementary charge (for $Å → m$ conversion)

Unit

$C$

source
NESSie.potprefactorFunction
potprefactor(T::Type{Float64} = Float64)
potprefactor(T::Type{Float32})

Common prefactor for all potentials $φ_Ω$ and $φ_Σ$:

\[\frac{1.602 ⋅ 10^{-19}}{10^{-10} ⋅ 4π ⋅ ε₀} ≈ 1.145 ⋅ 4π\]

Return type

T

source
NESSie.yukawaFunction
yukawa(opt::Option{T})

Exponent $1/Λ$ for the fundamental solution of the yukawa operator

\[Λ := λ\sqrt{\frac{ε_∞}{ε_Σ}}\]

Return type

T

source

Utility functions

NESSie._cosFunction
_cos(
    u    ::AbstractVector{T},
    v    ::AbstractVector{T},
    unorm::T=_norm(u),
    vnorm::T=_norm(v)
)

Computes the cosine of the angle between the given vectors u and v with lengths unorm and vnorm, respectively.

Return type

T

source
NESSie._dotFunction
_dot(
    u::AbstractVector{T},
    v::AbstractVector{T}
)

Fast dot product for 3-element vectors.

Return type

T

source
NESSie._normFunction
_norm(u::AbstractVector{T})

Fast Euclidean norm for 3-element vectors.

Return type

T

source
NESSie._seekFunction
_seek(
    fh         ::IOStream,
    prefix     ::String,
    skiptheline::Bool = true
)

Fast-forwards an IOStream to the next line starting with the given prefix. In case there is no such line, the stream handle will be set to EOF.

Arguments

  • skiptheline If true, said line will also be skipped

Return type

Void

source
NESSie._signFunction
_sign(
    u::AbstractVector{T},
    v::AbstractVector{T},
    n::AbstractVector{T}
)

Determines whether the normal vector of the plane specified by the vectors u and v has the same orientation as the given normal vector n. Returns $1$ if both normals have the same orientation, $0$ if at least one of the vectors is zero, and $-1$ otherwise.

Return type

T

source
NESSie.cathetusFunction
cathetus(hyp::T, cosθ::T)

Computes the cathetus $c₁$ of a triangle given the hypotenuse $h$ and the cosine of the exterior angle $θ$ between the hypotenuse and the other cathetus $c₂$.

\[c₂ = h ⋅ \cos(θ) \\ h² = c₁² + c₂² \\ ⇔ c₁ = \sqrt{h² ⋅ (1 - \cos²(θ))}\]

Return type

T

source
NESSie.ddotFunction
ddot(
    u::AbstractVector{T},
    v::AbstractVector{T},
    n::AbstractVector{T}
)

Devectorized computation of (u-v)⋅n.

Return type

T

source
NESSie.distanceFunction
distance(
    q   ::AbstractVector{T},
    elem::Triangle{T}
)

Calculates the (positive or negative) distance from the given point q to the plane the given triangle elem is located in. Negative distances correspond to point locations on the 'inside' wrt. to the element's (outward-facing) normal vector.

Return type

T

source
NESSie.eye!Function
eye!(
    m::AbstractMatrix{T},
    α::Number=one(T)
)

Initializes the given matrix m with αI, with I being an identity matrix with the same dimensions as m.

Return type

Void

Example

julia> m = 2 * ones(2, 2)
2×2 Matrix{Float64}:
 2.0  2.0
 2.0  2.0

julia> eye!(m); m
2×2 Matrix{Float64}:
 1.0  0.0
 0.0  1.0

julia> eye!(m, 2); m
2×2 Matrix{Float64}:
 2.0  0.0
 0.0  2.0
source
NESSie.isdegenerateFunction
isdegenerate(elem::Triangle{T})

Tests whether the given triangle is degenerate.

Return type

Bool

source
NESSie.pluseye!Function
pluseye!(
    m::AbstractMatrix{T},
    α::Number=one(T)
)

Adds α to all diagonal elements of matrix m.

Return type

Void

Example

julia> m = 2 * ones(2, 2)
2×2 Matrix{Float64}:
 2.0  2.0
 2.0  2.0

julia> pluseye!(m); m
2×2 Matrix{Float64}:
 3.0  2.0
 2.0  3.0

julia> pluseye!(m, 2); m
2×2 Matrix{Float64}:
 5.0  2.0
 2.0  5.0
source
NESSie.propsFunction
props(
    elem::Triangle{T}
)

Computes the given triangle's properties, that is, centroid, normal, distance to origin, and area. Returns the completely initialized Triangle as a copy.

Warning

The given triangle remains unchanged!

Return type

Triangle

source
NESSie.reverseindexFunction
reverseindex(v::AbstractVector{T})

Creates a reverse index for the given vector v, that is, a dictionary linking the object IDs of the vector elements to the corresponding position in the vector.

Return type

Dict{UInt, UInt}

source
NESSie.unpackFunction
unpack(data::Vector{Vector{T}})

Unpacks the given vector of vectors into a single vector.

Return type

Vector{T}

Example

julia> unpack([[1, 2], [3]])
3-element Vector{Int64}:
 1
 2
 3
source
NESSie.vertexnormalsFunction
vertexnormals(model::Model{T, Triangle{T}})

Returns a vector containing the normal vectors of the given model's triangles.

Return type

Vector{Vector{T}}

source