NESSie
NESSie.ecNESSie.σNESSie._closest_element_idNESSie._cosNESSie._dotNESSie._etolNESSie._generate_sphereNESSie._molpotentialNESSie._molpotential_dnNESSie._normNESSie._pluseye!NESSie._reverseindexNESSie._seekNESSie._signNESSie.cathetusNESSie.ddotNESSie.distanceNESSie.isdegenerateNESSie.potprefactorNESSie.propsNESSie.vertexnormalsNESSie.yukawa
Constants
NESSie._etol — Function_etol(::Float64)
_etol(::Type{Float64})
_etol(::Float32)
_etol(::Type{Float32})Common tolerance values internally used by NESSie.
Return type
T
NESSie.σ — ConstantGeometric quantity $σ(ξ)$
\[σ(ξ) = \lim_{ε→0} \frac{1}{4πε²} ∫_{r ∈ Ω:|r-ξ|=ε} dΓᵣ = \frac{1}{2}\]
for almost all $ξ ∈ Γ$ (cf. [Ste03]).
NESSie.ec — Constant$10^{10}$ times the elementary charge (for $Å → m$ conversion)
Unit
$C$
NESSie.potprefactor — Functionpotprefactor(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
NESSie.yukawa — Functionyukawa(opt::Option{T})Exponent $1/Λ$ for the fundamental solution of the yukawa operator
\[Λ := λ\sqrt{\frac{ε_∞}{ε_Σ}}\]
Return type
T
Potentials
NESSie._molpotential — Function_molpotential(ξ::Vector{T}, charges::AbstractVector{Charge{T}})
_molpotential(Ξ::AbstractVector{Vector{T}}, charges::AbstractVector{Charge{T}})Computes and returns the molecular potential(s) of the given system of point charges in a structureless medium for the given observation point(s) ξ (Ξ):
\[φ_{mol}(ξ) = \frac{1}{4π ε_0 ε_Ω} \sum_i \frac{qᵢ}{|rᵢ-ξ|}\]
Supported keyword arguments
tolerance::T = 1e-10minimum distance assumed between any observation point and point charge. Closer distances are replaced by this value.
Return type
T or Vector{T}
Aliases
_molpotential(model::Model{T, Triangle{T}})Computes the molecular potentials for the given surface model, using each triangle center as observation point.
NESSie._molpotential_dn — Function_molpotential_dn(ξ::Vector{T}, charges::AbstractVector{Charge{T}})
_molpotential_dn(Ξ::AbstractVector{Vector{T}}, charges::AbstractVector{Charge{T}})Computes and returns the normal derivative(s) of the molecular potential(s) of the given system of point charges in a structureless medium for the given observation point(s) ξ (Ξ):
\[∂ₙφ_{mol}(ξ) = -\frac{1}{4π ε_0 ε_Ω} \sum_i \frac{qᵢ}{|rᵢ-ξ|³} (rᵢ-ξ) ⋅ n\]
Supported keyword arguments
tolerance::T = 1e-10minimum distance cubed assumed between any observation point and point charge. Smaller values are replaced by this.
Return type
T or Vector{T}
Aliases
_molpotential_dn(model::Model{T, Triangle{T}})Computes the molecular potentials for the given surface model, using each triangle center as observation point.
Utility functions
NESSie._closest_element_id — Function_closest_element_id(ξ::Vector{T}, model::Model{T, Triangle{T}})Returns the index of the element in the given model with the closest centroid to ξ.
Return type
Int
NESSie._cos — Function_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
NESSie._dot — Function_dot(
u::AbstractVector{T},
v::AbstractVector{T}
)Fast dot product for 3-element vectors.
Return type
T
NESSie._generate_sphere — Function_generate_sphere(::Type{T}, center::Vector{Real}, radius::Real)Generates a surface model for a sphere of the given radius at the given center point through Gmsh.jl.
Supported keyword arguments
lc_min::Real = 0.1corresponds to Gmsh's "Mesh.CharacteristicLengthMin"lc_max::Real = 0.1corresponds to Gmsh's "Mesh.CharacteristicLengthMax"
Return type
NESSie._norm — Function_norm(u::AbstractVector{T})Fast Euclidean norm for 3-element vectors.
Return type
T
NESSie._pluseye! — Function_pluseye!(
m::AbstractMatrix{T},
α::T=one(T)
)Adds α to all diagonal elements of matrix m.
Return type
AbstractMatrix{T}
Example
julia> m = 2 * ones(2, 2)
2×2 Matrix{Float64}:
2.0 2.0
2.0 2.0
julia> _pluseye!(m)
2×2 Matrix{Float64}:
3.0 2.0
2.0 3.0
julia> _pluseye!(m, 2.0)
2×2 Matrix{Float64}:
5.0 2.0
2.0 5.0NESSie._reverseindex — Function_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
IdDict
NESSie._seek — Function_seek(
fh ::IOStream,
prefix ::AbstractString,
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
skipthelineIf true, said line will also be skipped
Return type
Nothing
NESSie._sign — Function_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
NESSie.cathetus — Functioncathetus(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
NESSie.ddot — Functionddot(
u::AbstractVector{T},
v::AbstractVector{T},
n::AbstractVector{T}
)Devectorized computation of (u-v)⋅n.
Return type
T
NESSie.distance — Functiondistance(
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
NESSie.isdegenerate — Functionisdegenerate(elem::Triangle{T})Tests whether the given triangle is degenerate.
Return type
Bool
NESSie.props — Functionprops(
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.
Return type
NESSie.vertexnormals — Functionvertexnormals(model::Model{T, Triangle{T}})Returns a vector containing the normal vectors of the given model's vertices.
Return type
Vector{Vector{T}}