Mathematics

MMJMesh.Mathematics.AbstractMappingType
AbstractMapping{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 DTs and specifies the actual domain, use Any if all elements of DT are in the domain. TODO: Use DomainSets.Full

source
MMJMesh.Mathematics.FiniteElementType
FiniteElement(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 on K,

  • a vector of linear forms N,

  • a cache holding computed objects such as a nodal basis.

source
MMJMesh.Mathematics.InterpolationType
Interpolation(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.

source
MMJMesh.Mathematics.PType
P{N,K}

FunctionSpace of N-variate polynomials where the largest sum of exponents is not larger than K.

source
MMJMesh.Mathematics.PDerivativeAtLFType
PDerivativeAtLF(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})$.

source
Base.intersectMethod
Base.intersect(s, x)
Base.intersect(x, s)
s ∩ x
x ∩ s

Select all values from the vector x which are in the interval s.

source
MMJMesh.Mathematics._derivativeMethod
_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 function

  • n = 2: Returns the Hessian function

source
MMJMesh.Mathematics._derivativeatMethod
_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.

source
MMJMesh.Mathematics._derivativeatMethod
_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 of f at x

  • n = 2: Returns the Hessian of f at x

source
MMJMesh.Mathematics._nnMethod
_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}$.

source
MMJMesh.Mathematics.basisMethod
basis(s::FunctionSpace{DT,CT}, d) -> Vector{<:AbstractMapping{DT,CT}}

Generate a basis for function space s defined on d.

source
MMJMesh.Mathematics.degreeFunction
degree(f)
degree(f, i)

Polynomial degree of f. Returns the

  • number -1 if f` is the zero function

  • largest exponent if f is a polynomial

  • largest sum of exponents if f is a multivariate polynomial

  • Inf in all other cases

For a multivariate mapping f, the invocation degree(f, i) returns the polynomial degree in the i-th parameter.

source
MMJMesh.Mathematics.derivativeFunction
derivative(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 of m.

  • The (generalized) ns-th partial derivative of m.

source
MMJMesh.Mathematics.derivativeatFunction
derivativeat(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 at x where dt(DT, CT, n) is the derivative type.

  • Evaluates the (generalized) ns-th partial derivative at x. For instance derivativeat(f, x, [2, 1]) computes $f_{xxy}(x, y)$.

source
MMJMesh.Mathematics.derivativetypeMethod
derivativetype(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.

source
MMJMesh.Mathematics.hatfunctionsMethod
hatfunctions(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$.

source
MMJMesh.Mathematics.hermiteelementMethod
hermiteelement(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.

source
MMJMesh.Mathematics.interpolateMethod
interpolate(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.

source
MMJMesh.Mathematics.mmonomialsFunction
mmonomials(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

source
MMJMesh.Mathematics.nodalbasisMethod
nodalbasis(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.

source
MMJMesh.Mathematics.pointsFunction
points(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 – Gives n points equidistantly distributed on each side

  • :interior – Generates n by n points in the interior

source
MMJMesh.Mathematics.polynomialinterpolationMethod
polynomialinterpolation(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].

source
MMJMesh.Mathematics.rootsFunction
roots(m::MappingFromR, I::Union{Nothing,Interval}=nothing) -> Float64[]

Return the roots of the mapping m either in I or the domain of m.

source