Mathematics
MMJMesh.Mathematics.AbstractMapping
— TypeAbstractMapping{DT,CT,D}
Abstract type for mappings from a domain type DT
to a codomain type CT
. The third parameter D
is a set of DT
s and specifies the actual domain, use Any
if all elements of DT
are in the domain. TODO: Use DomainSets.Full
MMJMesh.Mathematics.AffineMapping
— TypeAffineMapping(A, b)
Creates the affine map A*x + b
.
MMJMesh.Mathematics.ConstantMapping
— TypeConstant mapping.
MMJMesh.Mathematics.DerivativeAtLF
— TypeDerivativeAtLF(x)
The linear form $b$ with $b(f) = f'(x)$ for a specified position $x$.
MMJMesh.Mathematics.FiniteElement
— TypeFiniteElement(K, P, N)
Construct a finite element $(K, \mathcal{P}, \mathcal{N})$ according to Ciarlet's definition. Parameters are
the domain
K
,the space
P
of functions defined onK
,a vector of linear forms
N
,a
cache
holding computed objects such as a nodal basis.
MMJMesh.Mathematics.FunctionRToR
— TypeFunction $R \to R$.
MMJMesh.Mathematics.FunctionRnToR
— TypeFunction $R^n \to R$ of several real variables.
MMJMesh.Mathematics.FunctionSpace
— TypeFunctionSpace
General concept of a space containing functions which map domain type DT
to codomain type CT
.
MMJMesh.Mathematics.FunctionToR
— TypeFunction to $R$.
MMJMesh.Mathematics.Identity
— TypeIdentity function.
MMJMesh.Mathematics.InR
— TypeElement of the real numbers
MMJMesh.Mathematics.InR2
— TypeElement of the set of pairs of real numbers
MMJMesh.Mathematics.InR3
— TypeElement of the set of triples of real numbers
MMJMesh.Mathematics.InRmxn
— TypeElement of the set of $n \times m$-matrices of real numbers
MMJMesh.Mathematics.InR²
— TypeElement of the set of pairs of real numbers
MMJMesh.Mathematics.InR³
— TypeElement of the set of triples of real numbers
MMJMesh.Mathematics.InRᵐˣⁿ
— TypeElement of the set of $n \times m$-matrices of real numbers
MMJMesh.Mathematics.InRⁿ
— TypeElement of the set of $n$-tuples of real numbers
MMJMesh.Mathematics.Interpolation
— TypeInterpolation(h::MappingToRn, C)
The interpolating mapping $m: R^n \to Y$
$m(x) = \sum_{i=1}^m h_i(x) C_i$
with interpolation functions $h_i : R^n \to R$ and coefficients $C_i \in Y$ where $Y$ can be numbers or vectors.
MMJMesh.Mathematics.MappingFromComponents
— TypeMappingFromComponents(c1, c2, ..., cn)
Construct a mapping $X \to Z$ from Mappings $c_k: X \to Y, k = 1, \dots, n$ such that $Z = Y^n$.
MMJMesh.Mathematics.MappingFromR
— TypeMappings from the real numbers.
MMJMesh.Mathematics.MappingFromRn
— TypeMappings from $R^n$.
MMJMesh.Mathematics.MappingRnToRm
— TypeVector valued mapping ''R^n \to R^m'' with $n,m > 1$ of several real variables.
MMJMesh.Mathematics.One
— TypeNeutral element w.r.t. multiplication.
MMJMesh.Mathematics.P
— TypeP{N,K}
FunctionSpace of N
-variate polynomials where the largest sum of exponents is not larger than K
.
MMJMesh.Mathematics.PDerivativeAtLF
— TypePDerivativeAtLF(x, n)
Evaluates the partial derivative at x
in directions n
of a function $f : \mathbb{R}^n \to \mathbb{R}$. The i-th entry of n
specifies the order of the partial derivative in direction i
. For instance, [1, 2]
refers to the partial derivative $f_{xyy}(\mathbf{x})$.
MMJMesh.Mathematics.ParametricCurve
— TypeParametric curve$R \to R^n$.
MMJMesh.Mathematics.PiecewiseFunction
— TypePiecewiseFunction(breakpoints, functions)
Constructs a piecewise function.
MMJMesh.Mathematics.Polynomial
— TypePolynomial([a0, a1, a2, ...], d=R)
Construct polynomial a0 + a1 x + a2 x^2 + ...
defined on domain d
.
MMJMesh.Mathematics.PolynomialSpace
— TypePolynomialSpace{N,K}
FunctionSpace of possibly multivarite polynomials of N
variables and maximum exponent K
.
MMJMesh.Mathematics.Q
— TypeQ{N,K}
FunctionSpace of N
-variate polynomials where the largest exponent is smaller equal K
.
MMJMesh.Mathematics.Q23R
— TypeQ23R{K}
Reduced polynomial space Q{2,3,K}
for nonconforming Kirchhoff rectangle.
MMJMesh.Mathematics.S
— TypeS{N, K}
FunctionSpace of serendipity polynomials. Only defined for n=2 and k=2,3.
MMJMesh.Mathematics.ValueAtLF
— TypeValueAtLF(x)
The linear form $b$ with $b(f) = f(x)$ for a specified position $x$.
MMJMesh.Mathematics.VectorField
— TypeVector field ''R^n \to R^n'' with `n >
1`.
MMJMesh.Mathematics.Zero
— TypeNeutral element w.r.t. addition.
Base.div
— Methoddiv(v)
Shorthand notation for divergence(v)
Base.intersect
— MethodBase.intersect(s, x)
Base.intersect(x, s)
s ∩ x
x ∩ s
Select all values from the vector x
which are in the interval s
.
MMJMesh.Mathematics.H
— FunctionH(f)
returns the Hessian of function f
MMJMesh.Mathematics._antiderivative
— Method_antiderivative(::FunctionRToR) -> FunctionRToR
Fallback for function types which do not provide higher order antiderivatives.
MMJMesh.Mathematics._combineforms
— Method_combineforms(points, genforms)
Helper function to construct linear forms.
MMJMesh.Mathematics._derivative
— Method_derivative(f::FunctionRnToR{N}, n::Integer)
Default implementation of n
-th order derivative of multivariate function f
. Currently implemented for
n = 1
: Returns the gradient functionn = 2
: Returns the Hessian function
MMJMesh.Mathematics._derivativeat
— Method_derivativeat(f::FunctionRnToR{N,D}, x::InRⁿ{N}, ns::AbstractArray{<:Integer})
Default implementation for the evaluation of the ns
partial derivative of f
at x
. Note that this is an inefficient implementation which computes the derivative function first.
MMJMesh.Mathematics._derivativeat
— Method_derivativeat(f::FunctionRnToR{N}, x::InRⁿ{N}, n::Integer)
Default implementation for the evaluation n
-th order derivative of multivariate function f
at position x
. Currently implemented for
n = 1
: Returns the gradient off
atx
n = 2
: Returns the Hessian off
atx
MMJMesh.Mathematics._dimension
— Method_dimension(s::Type{<:PolynomialSpace})
Fallback implemenentation to determine the dimension of space s. Useful for testing.
MMJMesh.Mathematics._factorialpower
— Method_factorialpower(m, n)
Return the product ``m (m - 1) ... (m - n)
MMJMesh.Mathematics._makebreakpoints
— Method_makebreakpoints(pts, I)
Make breakpoints from Interval I
and all points from pts
which are in I
.
MMJMesh.Mathematics._nn
— Method_nn(n, indices...)
Converts sequence of variable indices to vector of length n
indicating orders of partial derivatives. For instance, calling _nn(2, 1, 2, 1, 1)
representing $w_{xyxx}$ returns [3, 1]
which corresponds to $w_{xxxy}$.
MMJMesh.Mathematics.affinefunction
— Methodaffinefunction(I₁::Interval, I₂::Interval)
Affine function $f: I_1 \to I_2$ with $f(I_1) = I_2$.
MMJMesh.Mathematics.antiderivative
— Functionantiderivative(f::FunctionRToR, n=1) -> FunctionRToR
An n
-th antiderivative of the function f
.
MMJMesh.Mathematics.basis
— Methodbasis(s::FunctionSpace{DT,CT}, d) -> Vector{<:AbstractMapping{DT,CT}}
Generate a basis for function space s
defined on d
.
MMJMesh.Mathematics.codomaintype
— MethodType of elements in the codomain of the mapping.
MMJMesh.Mathematics.codomaintype
— MethodType of elements in the codomain of the mapping.
MMJMesh.Mathematics.degree
— Functiondegree(f)
degree(f, i)
Polynomial degree of f. Returns the
number -1 if
f
` is the zero functionlargest exponent if
f
is a polynomiallargest sum of exponents if
f
is a multivariate polynomialInf
in all other cases
For a multivariate mapping f
, the invocation degree(f, i)
returns the polynomial degree in the i-th parameter.
MMJMesh.Mathematics.derivative
— Functionderivative(m::AbstractMapping{DT, CT}, n::Integer = 1) -> AbstractMapping{DT, dt(DT, CT, n)}
derivative(m::AbstractMapping{DT, CT}, ns::AbstractArray{Integer}) -> AbstractMapping{DT, CT}
The (generalized)
n
-th derivative ofm
.The (generalized)
ns
-th partial derivative ofm
.
MMJMesh.Mathematics.derivativeat
— Functionderivativeat(m::AbstractMapping{DT, CT}, x::DT, n::Integer = 1) -> dt(DT, CT, n)
derivativeat(m::AbstractMapping{DT, CT}, x::DT, ns::AbstractArray{Integer}) -> CT
Evaluates the (generalized)
n
-th derivative atx
wheredt(DT, CT, n)
is the derivative type.Evaluates the (generalized)
ns
-th partial derivative atx
. For instancederivativeat(f, x, [2, 1])
computes $f_{xxy}(x, y)$.
MMJMesh.Mathematics.derivativetype
— Methodderivativetype(m, n)
derivativetype(DT, CT, n)
Type of the n
-th order derivative for the mapping m or domain type DT
and codomain type CT
. For instance, the second derivative of a function R2 to R is a 2x2 matrix.
MMJMesh.Mathematics.divergence
— Methoddivergence(v::VectorField)
Divergence of the vector field v
.
MMJMesh.Mathematics.divergenceat
— Methoddivergenceat(v::VectorField, x::InRⁿ)
Evaluates the divergence of the vector field v
at point x
.
MMJMesh.Mathematics.domain
— MethodDomain of the mapping.
MMJMesh.Mathematics.domaintype
— MethodType of elements in the domain of the mapping.
MMJMesh.Mathematics.domaintype
— MethodType of elements in the domain of the mapping.
MMJMesh.Mathematics.gradient
— FunctionGradient of function f
MMJMesh.Mathematics.hatfunctions
— Methodhatfunctions(x::AbstractVector{<:Real})
Given an ascending node vector $x_1, x_2, \dots, x_{N_N}$, returns the 1D piecewise affine finite element basis functions $\varphi_1, \dots, \varphi_{N_N}$ with $\varphi_i(x_j) = \delta_{ij}$ for $i,j = 1, \dots, N_N$.
MMJMesh.Mathematics.hermiteelement
— Methodhermiteelement(K; conforming=true)
Hermite type finite element. Generates the Bogner-Fox-Schmit element (Braess, p. 72) if K
is a rectangle and conforming
is true.
MMJMesh.Mathematics.hessian
— FunctionHessian of function f
MMJMesh.Mathematics.integrate
— Methodintegrate(f::FunctionRToR, I::Interval) -> Float64
The integral of the function f
over the interval I
.
MMJMesh.Mathematics.interpolate
— Methodinterpolate(x::AbstractVector{<:Real}, y::AbstractVector{<:Real}; order=1)
Construct a function which interpolates the points $(x_1, y_1), (x_2, y_2), \dots, (x_n, y_n)$. The entries in x
have to be in ascending order and x
and y
need to have the same length.
MMJMesh.Mathematics.jacobian
— Methodjacobian(u::MappingRnToRm)
Jacobian of the mapping u
.
MMJMesh.Mathematics.jacobianat
— Methodjacobianat(u::MappingRnToRm, x::InRⁿ)
Evaluates the jacobian of the mapping u
at point x
.
MMJMesh.Mathematics.lagrangeelement
— Methodlagrangeelement(K, k)
Lagrange type finite element.
MMJMesh.Mathematics.lagrangepolynomials
— Functionlagrangepolynomials(x, D=R)
Lagrange polynomials for nodes $x_0, \dots, x_k$ defined on the domain D
.
MMJMesh.Mathematics.laplacian
— FunctionLaplacian of function f
MMJMesh.Mathematics.linesegment
— Methodlinesegment(p1, p2)
Returns the line segment from p1
to p2
as parametric curve.
MMJMesh.Mathematics.mmonomials
— Functionmmonomials(n::Integer, p::Integer, dom=R^n, predicate=(...) -> true; type=Float64)
Generate multivariate momonials of n
components up to degree p
. Optionally, a domain, a predicate and a coefficient type can be specified
MMJMesh.Mathematics.monomials
— Functionmonomials(p, D=R)
Monomials of degree $p_1, \dots, p_n$ defined on the domain D
.
MMJMesh.Mathematics.nodalbasis
— Methodnodalbasis(e)
nodalbasis(t, d)
Generate a nodal basis for element e
defined on d
. This default implementation might be overridden by specific element types. Option to specify domain only useful for symbolic domains.
MMJMesh.Mathematics.parameter
— FunctionAn independent variable of a function.
MMJMesh.Mathematics.points
— Functionpoints(K, on, n=0)
Pick certain points from domain K
at locations on
which can take the following values
:corners
– Returns points on corners of the domain:sides
– Givesn
points equidistantly distributed on each side:interior
– Generatesn
byn
points in the interior
MMJMesh.Mathematics.pois
— Methodpois(m::MappingFromR) -> Float64[]
Return the points of interest of the mapping m
.
MMJMesh.Mathematics.polynomialinterpolation
— Methodpolynomialinterpolation(points)
polynomialinterpolation(p1, p2, p3, ...)
polynomialinterpolation([p1, p2, p3, ...])
Constructs a polynomial parametric curve interpolating the specified points. The curve is defined on the unit interval [-1, 1].
MMJMesh.Mathematics.roots
— Functionroots(m::MappingFromR, I::Union{Nothing,Interval}=nothing) -> Float64[]
Return the roots of the mapping m
either in I
or the domain of m
.
MMJMesh.Mathematics.serendipityelement
— Methodserendipityelement(K, k)
Serendipity element (currently only for rectangles and $k=1,2$).
MMJMesh.Mathematics.valueat
— Functionvalueat(m::AbstractMapping{DT, CT}, x::DT) -> CT
Evaluate the mapping m
at x
.
MMJMesh.Mathematics.Δ
— FunctionΔ(f)
returns the Laplacian of function f
MMJMesh.Mathematics.∇
— Function∇(f)
returns the gradient of function f
MMJMesh.dimension
— Methoddimension