References

WavePropBase.ENTITIESConstant
const ENTITIES

Global dictionary storing the used entity tags (the value) for a given dimension (the key).

source
WavePropBase.STypeType
const SType{T} = Union{T,Type{T}}

Union type of T and its data type Type{T}. Used to simplify methods defined on singleton types where both foo(::T) and foo(::Type{T}) are required.

source
WavePropBase.TAGSConstant
const TAGS::Dict{Int,Vector{Int}}

Global dictionary storing the used entity tags (the value) for a given dimension (the key).

source
WavePropBase.etype_to_vtk_cell_typeConstant
const etype_to_vtk_cell_type

Dictionary mapping internal element types to a tuple containing: - the corresponding WriteVTK cell types (following the convention chosen by VTK, see below); - the indices in the elements column that defines the element. This is because we want to support the export of more than just the flat elements available in the VTK specification, hence which may require a conversion of some sort.

See VTK specification [Fig. 2] on http://www.vtk.org/VTK/img/file-formats.pdf

  • VTK_VERTEX (=1)
  • VTKPOLYVERTEX (=2)
  • VTK_LINE (=3)
  • VTKPOLYLINE (=4)
  • VTK_TRIANGLE (=5)
  • VTKTRIANGLESTRIP (=6)
  • VTK_POLYGON (=7)
  • VTK_PIXEL (=8)
  • VTK_QUAD (=9)
  • VTK_TETRA (=10)
  • VTK_VOXEL (=11)
  • VTK_HEXAHEDRON (=12)
  • VTK_WEDGE (=13)
  • VTK_PYRAMID (=14)
source
WavePropBase.AbstractElementType
abstract type AbstractElement{D,T}

Elements given by a fixed interpolation schemes mapping points on the the domain D<:AbstractReferenceShape (of singleton type) to a value of type T.

Instances el of AbstractElement are expected to implement:

  • el(x̂): evaluate the interpolation scheme at the (reference) coordinate x̂ ∈ D.
  • jacobian(el,x̂) : evaluate the jacobian matrix of the interpolation at the (reference) coordinate x ∈ D.
Note

For performance reasons, both el(x̂) and jacobian(el,x̂) should take as input a StaticVector and output a static vector or static array.

source
WavePropBase.AbstractHyperRectangleType
abstract type AbstractHyperRectangle{N,T} <: AbstractElement{ReferenceHyperCube{N},SVector{N,T}}

Axis-aligned hyperrectangle in N dimensions with coordinates of type SVector{N,T}.

source
WavePropBase.AbstractPDEType
abstract type AbstractPDE{N}

A partial differential equation in dimension N. AbstractPDE types are used to define AbstractPDEKernels.

source
WavePropBase.AbstractQuadratureRuleType
abstract type AbstractQuadratureRule{D}

A quadrature rule for integrating a function over the domain D.

Calling q() returns the nodes x and weights w for performing integration over domain(q).

Calling q(el) returns the nodes and weights for integrating over el.

source
WavePropBase.AbstractSplitterType
abstract type AbstractSplitter

An AbstractSplitter is used to split a ClusterTree. The interface requires the following methods:

  • should_split(clt,splitter) : return a Bool determining if the ClusterTree should be further divided
  • split!(clt,splitter) : perform the splitting of the ClusterTree handling the necessary data sorting.

See GeometricSplitter for an example of an implementation.

source
WavePropBase.AdjointDoubleLayerKernelType
struct AdjointDoubleLayerKernel{T,Op} <: AbstractPDEKernel{T,Op}

Given an operator Op, construct its free-space adjoint double-layer kernel. This corresponds to the transpose(γ₁,ₓ[G]), where G is the SingleLayerKernel. For operators such as Laplace or Helmholtz, this is simply the normal derivative of the fundamental solution respect to the target variable.

source
WavePropBase.CardinalitySplitterType
struct CardinalitySplitter <: AbstractSplitter

Used to split a ClusterTree along the largest dimension if length(tree)>nmax. The split is performed so the data is evenly distributed amongst all children.

See also: AbstractSplitter

source
WavePropBase.ClusterTreeType
mutable struct ClusterTree{T,S,D}

Tree structure used to cluster elements of type V = eltype(T) into containers of type S. The method center(::V)::SVector is required for the clustering algorithms. An additional data field of type D can be associated with each node to store node-specific information (it defaults to D=Nothing).

Fields:

  • _elements::T : vector containing the sorted elements.
  • container::S : container for the elements in the current node.
  • index_range::UnitRange{Int} : indices of elements contained in the current node.
  • loc2glob::Vector{Int} : permutation from the local indexing system to the original (global) indexing system used as input in the construction of the tree.
  • children::Vector{ClusterTree{N,T,D}}
  • parent::ClusterTree{N,T,D}
  • data::D : generic data field of type D.
source
WavePropBase.ClusterTreeMethod
ClusterTree(elements,splitter;[copy_elements=true])
ClusterTree{D}(points,splitter;[copy_elements=true])

Construct a ClusterTree from the given elements using the splitting strategy encoded in splitter. If copy_elements is set to false, the elements argument are directly stored in the ClusterTree and are permuted during the tree construction.

source
WavePropBase.ComplexPoint2DType
const ComplexPoint2D
const ComplexPoint2D(x1, x2)
const ComplexPoint2D(x::NTuple{2, ComplexF64})

A complex 2D point, stored in a StaticArray. ComplexPoint2D = SVector{2, ComplexF64}.

source
WavePropBase.ComplexPoint3DType
const ComplexPoint3D
const ComplexPoint3D(x1, x2, x3)
const ComplexPoint3D(x::NTuple{3, ComplexF64})

A complex 3D point, stored in a StaticArray. ComplexPoint3D = SVector{3, ComplexF64}.

source
WavePropBase.DoubleLayerKernelType
struct DoubleLayerKernel{T,Op} <: AbstractPDEKernel{T,Op}

Given an operator Op, construct its free-space double-layer kernel. This corresponds to the γ₁ trace of the SingleLayerKernel. For operators such as Laplace or Helmholtz, this is simply the normal derivative of the fundamental solution respect to the source variable.

source
WavePropBase.DuffyType
struct Duffy <: AbstractSingularityHandler{RefereceTriangle}

Change of variables mapping the ReferenceSquare to the RefereceTriangle with the property that the jacobian vanishes at the (1,0) vertex of the triangle.

Useful for integrating functions with a singularity on the (1,0) edge of the reference triangle.

source
WavePropBase.ElastostaticType
struct Elastostatic{N,T} <: AbstractPDE{N}

Elastostatic equation in N dimensions: μΔu + (μ+λ)∇(∇⋅u) = 0. Note that the displacement u is a vector of length N since this is a vectorial problem.

source
WavePropBase.ElementIteratorType
struct ElementIterator{E,M}

Return an iterator for all elements of type E on a mesh of type M.

Besides the methods listed in the iterator iterface of Julia, some functions also require the getindex(iter,i::Int) method for accessing the i-th element directly.

source
WavePropBase.ElementaryEntityType
struct ElementaryEntity <: AbstractEntity

The most basic representation of an AbstractEntity.

Fields:

  • dim::UInt8: the geometrical dimension of the entity (e.g. line has dim=1, surface has dim=2, etc)
  • tag::Int64: an integer tag associated to the entity
  • boundary::Vector{AbstractEntity}: the entities of dimension dim-1 forming the entity's boundary
source
WavePropBase.FejerType
struct Fejer{N}

N-point Fejer's first quadrature rule for integrating a function over [0,1]. Exactly integrates all polynomials of degree ≤ N-1.

import WavePropBase as WPB

q = WPB.Fejer(;order=10)

WPB.integrate(cos,q) ≈ sin(1) - sin(0)

# output

true
source
WavePropBase.GaussType
struct Gauss{D,N} <: AbstractQuadratureRule{D}

Tabulated N-point symmetric Gauss quadrature rule for integration over D.

source
WavePropBase.GaussLegendreType
struct GaussLegendre{N}

N-point Gauss-Legendre quadrature rule for integrating a function over [0,1]. Exactly integrates all polynomials of degree ≤ 2N-1.

source
WavePropBase.GenericMeshType
struct GenericMesh{N,T} <: AbstractMesh{N,T}

Data structure representing a generic mesh in an ambient space of dimension N, with data of type T.

source
WavePropBase.HyperCubeType
struct HyperCube{N,T}

Axis-aligned hypercube in N dimensions given by low_corner::SVector{N,T} and side::T.

source
WavePropBase.HyperRectangleType
struct HyperRectangle{N,T}

Axis-aligned hyperrectangle in N dimensions given by low_corner::SVector{N,T} and high_corner::SVector{N,T}.

source
WavePropBase.HyperSingularKernelType
struct HyperSingularKernel{T,Op} <: AbstractPDEKernel{T,Op}

Given an operator Op, construct its free-space hypersingular kernel. This corresponds to the transpose(γ₁,ₓγ₁[G]), where G is the SingleLayerKernel. For operators such as Laplace or Helmholtz, this is simply the normal derivative of the fundamental solution respect to the target variable of the DoubleLayerKernel.

source
WavePropBase.IMTType
struct IMT{A,P} <: AbstractSingularityHandler{ReferenceLine}

One-dimensional change of variables mapping [0,1] -> [0,1] with the property that all derivatives vanish at the point x=0.

See Davis and Rabinowitz.

source
WavePropBase.IntegralOperatorType
struct IntegralOperator{T} <: AbstractMatrix{T}

A discrete linear integral operator given by

\[I[u](x) = \int_{\Gamma\_s} K(x,y)u(y) ds_y, x \in \Gamma_{t}\]

where $\Gamma_s$ and $\Gamma_t$ are the source and target domains, respectively.

source
WavePropBase.IntegralPotentialType
struct IntegralPotential

Represent a potential given by a kernel and a source_mesh over which integration is performed.

IntegralPotentials are created using IntegralPotential(kernel, source_mesh).

Evaluating an integral potential requires a density σ (defined over the quadrature nodes of the source mesh) and a point x at which to evaluate the integral

\[\int_{\Gamma} K(oldsymbol{x},oldsymbol{y})\sigma(y) ds_y, x \not \in \Gamma\]

source
WavePropBase.KressType
struct Kress{P} <: AbstractSingularityHandler{ReferenceLine}

Change of variables mapping [0,1] to [0,1] with the property that the first P-1 derivatives of the transformation vanish at x=0.

source
WavePropBase.KressPType
struct KressP{P} <: AbstractSingularityHandler{ReferenceLine}

Like Kress, this change of variables maps the interval [0,1] onto itself, but the first P derivatives of the transformation vanish at both endpoints.

This change of variables can be used to periodize integrals in the following sense. Suppose we wish to compute the integral of f(x) from 0 to 1 where f is not a1-periodic function. If ϕ is an object of type KressP, then using it as a change of variables in the integration yields a similar integral from 0 to 1 (the interval 0≤0≤1 is mappend onto itself), but with integrand given by g(x) = f(ϕ(x))ϕ'(x). Since ϕ' vanishes (together with P of its derivatives), the function g(x) is now periodic (up to derivatives of order up to P) at the endpoints. Thus quadrature rules designed for periodic functions like the TrapezoidalOpen can be used to obtain high order convergence of g, which in turn yields a modified quadrature rule when viewed as a quadrature rule for f.

source
WavePropBase.LagrangeElementType
struct LagrangeElement{D,Np,T} <: AbstractElement{D,T}

Standard element over D <: AbstractReferenceShape commonly used in finite element methods. The underlying polynomial space is PolynomialSpace{D,K}, and its interpolant maps the Np reference_nodes in D to Np values of type T stored in the field vals.

source
WavePropBase.NystromMeshType
struct NystromMesh{N,T} <: AbstractMesh{N,T}

A mesh data structure for solving boundary integral equation using Nyström methods.

A NystromMesh can be constructed from a mesh::AbstractMesh and a dictionary etype2qrule mapping element types in mesh (the keys) to an appropriate quadrature rule for integration over elements of that type (the value).

The degrees of freedom in a NystromMesh are associated to nodal values at the quadrature nodes, and are represented using QuadratureNodes.

source
WavePropBase.NystromMeshMethod
NystromMesh(Ω;meshsize,qorder)

Create a NystromMesh with elements of size meshsize and quadrature order qorder.

A mesh is first generated using meshgen, and then a NystromMesh is created on top of it with the quadrature information.

source
WavePropBase.NystromMeshMethod
NystromMesh(msh::AbstractMesh,e2qrule::Dict)
NystromMesh(msh::AbstractMesh;qorder)

Construct a NystromMesh with the quadrature q = e2qrule[E] applied to each element type E in msh. If an order keyword is passed, a default quadrature of the desired order is used for each element type.

source
WavePropBase.Point1DType
const Point1D
const Point1D(x1)

A point in 1D space, stored in a StaticArray. Point1D = SVector{1, Float64}.

source
WavePropBase.Point2DType
const Point2D
const Point2D(x1, x2)
const Point2D(x::NTuple{2, Float64})

A point in 2D space, stored in a StaticArray. Point2D = SVector{2, Float64}.

source
WavePropBase.Point3DType
const Point3D
const Point3D(x1, x2, x3)
const Point3D(x::NTuple{3, Float64})

A point in 3D space, stored in a StaticArray. Point3D = SVector{3, Float64}.

source
WavePropBase.PointEntityType
PointEntity{N,T} <: AbstractEntity

Zero-dimension geometrical entity. As a subtype of [AbstractEntity],(@ref) the (dim,tag) of all created point entities get added to the global ENTITIES. Intended usage is to build higher dimensionsional entities, and not to represent regular points such as grid points.

source
WavePropBase.PolynomialSpaceType
struct PolynomialSpace{D,K} <: AbstractPolynomialSpace{D}

The space of all polynomials of degree ≤K, commonly referred to as ℙₖ.

The type parameter D, of singleton type, is used to determine the reference domain of the polynomial basis. In particular, when D is a hypercube in d dimensions, the precise definition is ℙₖ = span{𝐱ᶿ : 0≤max(θ)≤ K}; when D is a d-dimensional simplex, the space is ℙₖ = span{𝐱ᶿ : 0≤sum(θ)≤ K}, where θ ∈ 𝐍ᵈ is a multi-index.

See also: monomial_basis, lagrange_basis

source
WavePropBase.PseudoBlockMatrixType
struct PseudoBlockMatrix{T<:SMatrix,S} <: AbstractMatrix{T}

A struct which behaves identically to a Matrix{T}, but with the underlying data stored as a Matrix{S}, where S::Number = eltype(T). This allows for the use of blas routines under-the-hood, while providing a convenient interface for handling matrices over tensors.

source
WavePropBase.QuadratureNodeType
QuadratureNode{N,T<:Real}

A point in ℝᴺ with a weight for performing numerical integration.

A QuadratureNode can optionally store a normal vector and a curvature scalar, given by the divergence of the normal vector.

source
WavePropBase.ReferenceHyperCubeType
struct ReferenceHyperCube{N}

Singleton type representing the axis-aligned hypercube in N dimensions with the lower corner at the origin and the upper-corner at (1,1,…,1).

source
WavePropBase.SingleLayerKernelType
struct SingleLayerKernel{T,Op} <: AbstractPDEKernel{T,Op}

The free-space single-layer kernel (i.e. the fundamental solution) of an OP <: AbstractPDE.

source
WavePropBase.SubMeshType
struct SubMesh{N,T} <: AbstractMesh{N,T}

Create a view of a parent mesh over a given domain.

A submesh implements the interface for AbstractMesh; therefore you can iterate over elements of the submesh just like you would with a mesh.

source
WavePropBase.TensorLagInterpType
struct TensorLagInterp{N,Td,T}

Generic Lagrange interpolation over an N-dimensional tensor grid. The implementation uses a multidimensional generalization of the barycentric formula.

The main constructor takes an SVector{N,Vector{Td}} containig the N one-dimensional nodes and an Array{N,T} of the function vals at the tensor product grid formed by the one-dimensional nodes.

Examples:

using WavePropBase: TensorLagInterp
nx = 10
ny = 12
x   = [0.5+0.5cos((2k-1)*π/2nx) for k in 1:nx] # Chebyshev nodes
y   = [0.5+0.5cos((2k-1)*π/2ny) for k in 1:ny] # Chebyshev nodes
f   = (x) -> cos(x[1]*x[2])
vals = [f((x,y)) for x in x, y in y]
p   = TensorLagInterp(vals,(x,y))
p((0.1,0.2)) ≈ f((0.1,0.2))

# output
true
source
WavePropBase.TensorProductQuadratureType
TensorProductQuadrature{N,Q}

A tensor-product of one-dimension quadrature rules. Integrates over [0,1]^N.

Examples

qx = Fejer(10)
qy = TrapezoidalOpen(15)
q  = TensorProductQuadrature(qx,qy)
source
WavePropBase.TensorProductSingularityHandlerType
struct TensorProductSingularityHandler{S} <: AbstractSingularityHandler{ReferenceSquare}

A tensor product of two one-dimensional AbstractSingularityHandlers for performing integration over the ReferenceSquare.

source
WavePropBase.TrapezoidalType
struct Trapezoidal{N} <: AbstractQuadratureRule{ReferenceLine}

Closed N-point trapezoidal rule for integrating a function over the interval [0,1].

Examples:

q    = Trapezoidal(10)
f(x) = exp(x)*cos(x)
integrate(f,q)
source
WavePropBase.TriangularMeshType
struct TriangularMesh{N,T} <: AbstractMesh{N,T}

A simple mesh structure containing only (flat) triangles in N dimensions. The underlying data type is given by T, which defaults to Float64.

TriangularMeshes are presented as a collection of nodes and a connectivity matrix of size 3 × Nt, where Nt is the number of triangles in the mesh.

source
WavePropBase.UniformCartesianMeshType
struct UniformCartesianMesh{N,T} <: AbstractMesh{N,T}

An N-dimensional cartesian grid given as the tensor-product of N one-dimensional LinRange{T} grids.

Iterating over a UniformCartesianMesh generates the elements which compose the mesh; i.e. the HyperRectangle cells.

source
WavePropBase.UniformCartesianMeshMethod
UniformCartesianMesh(domain::HyperRectangle,sz::NTuple)
UniformCartesianMesh(domain::HyperRectangle;step::NTuple)

Construct a uniform UniformCartesianMesh with sz[d] elements along dimension d. If the kwarg step is passed, construct a UniformCartesianMesh with elements of approximate size step.

source
WavePropBase.YukawaType
struct Yukawa{N,T}

Yukawa equation in N dimensions: Δu - λ²u = 0.

This is the same as the Helmholtz equation with k = iλ, but more efficient functions are used to compute the kernels of the integral operators when λ is real (the default).

source
Base.:==Method
==(Ω1::AbstractEntity,Ω2::AbstractEntity)

Two entities are considered equal geometric_dimension(Ω1)==geometric_dimension(Ω2) and abs(tag(Ω1))=abs(tag(Ω2)). For ElementaryEntity of co-dimension one, the sign of tag(Ω) is used to determine the orientation of the normal vector.

Notice that this implies dim and tag of an elementary entity should uniquely define it (up to the sign of tag), and therefore global variables like TAGS are needed to make sure newly created AbstractEntity have a new (dim,tag) identifier.

source
Base.:==Method
===(Ω1::Domain,Ω2::Domain)

Two Domains are equal if all their entities are equal (regardless of order).

source
Base.inMethod
in(ω::ElementaryEntity,Ω::Domain)

Check whether an ElementaryEntity belongs to a Domain by recursively checking whether it belongs to its boundary.

source
Base.iterateFunction
iterate(Ω::Domain)

Iterating over a domain means iterating over its entities.

source
Base.keysMethod

Return all tags of the elementary entities in the domain Ω corresponding to the dimension d.

source
Base.keysMethod

Return all tags of the elementary entities in the domain Ω corresponding to the dimensions contained in dims.

source
Base.lengthMethod
length(Ω:::Domain)

The length of a domain corresponds to the number of elementary entities that make it.

source
Base.parentMethod
parent(t::AbstractTree)

The node's parent. If t is a root, then parent(t)==t.

source
Base.splitMethod
split(rec::AbstractHyperRectangle,[axis]::Int,[place])

Split a hyperrectangle in two along the axis direction at the position place. Returns a tuple with the two resulting hyperrectangles.

When no place is given, defaults to splitting in the middle of the axis.

When no axis and no place is given, defaults to splitting along the largest axis.

source
WavePropBase._basis_vdimMethod
_basis_vdim(ℒ::AbstractPDE,ℙₖ::PolynomialSpace)

Return a set of polynomial pₙ such that ℒ[pₙ] gives the monomial basis for ℙₖ.

source
WavePropBase._binary_split!Method
_binary_split!(cluster::ClusterTree,dir,pos;parentcluster=cluster)
_binary_split!(cluster::ClusterTree,f;parentcluster=cluster)

Split a ClusterTree into two, sorting all elements in the process. For each resulting child assign child.parent=parentcluster.

Passing a dir and pos arguments splits the container of node along direction dir at position pos, then sorts all points into the resulting left/right nodes.

If passed a predicate f, each point is sorted according to whether f(x) returns true (point sorted on the left node) or false (point sorted on the right node). At the end a minimal HyperRectangle containing all left/right points is created.

source
WavePropBase._meshgenMethod
_meshgen(f,d,sz)

Create a UniformCartesianMeshofdpush-forward map. The cartesian mesh has sizesz`, and is uniform in parameter space.

source
WavePropBase._normalMethod
_normal(jac::SMatrix{M,N})

Given a an M by N matrix representing the jacobian of a codimension one object, compute the normal vector.

source
WavePropBase._vtk_cellsFunction
_vtk_cells(mesh::GenericMesh, E::DataType)
_vtk_cells(mesh::GenericMesh, Ω::Domain)

Creates the vector of all elements contained in the mesh in the format required by WriteVTK for a particular element type E<:AbstractElement or a Domain instance.

source
WavePropBase.ambient_dimensionMethod
ambient_dimension(x)

Dimension of the ambient space where x lives. For geometrical objects this can differ from its geometric_dimension; for example a triangle in ℝ³ has ambient dimension 3 but geometric dimension 2, while a curve in ℝ³ has ambient dimension 3 but geometric dimension 1.

source
WavePropBase.assertequaldimMethod
assertequaldim(Ω1::Domain,Ω2::Domain)

Check that two domains have same dimension.

If one of the domain (or both) are empty, the assertion is assumed to be true.

source
WavePropBase.cart2polMethod
cart2pol(x,y)

Map cartesian coordinates x,y to polar coordinates r,θ. The convention followed is that -π ≤ θ ≤ π.

source
WavePropBase.cart2sphMethod
cart2sph(x,y,z)

Map cartesian coordinates x,y,z to spherical ones r, θ, φ representing the radius, elevation, and azimuthal angle respectively. The convention followed is that 0 ≤ θ ≤ π and -π < φ ≤ π.

source
WavePropBase.cheb2nodesMethod
cheb2nodes(n,a,b)

Return the n Chebyshev points of the second kind on the interval [a,b]. The nodes are nested in the following sense: cheb2nodes(n,a,b) == cheb2nodes(2n-1,a,b)[1:2:end].

source
WavePropBase.coordsMethod
coords(x)

Return an SVector with the cartesian coordinates associated to a geometrical object x.

source
WavePropBase.curvatureMethod
curvature(el, x̂)

The curvature of el at the parametric coordinate , given by the following formula

\[\kappa = \nabla\cdot\frac{\nabla p}{|\nabla p|} = \frac{\Delta p}{|\nabla p|} + \frac{\nabla^\perp p\nabla^2 p\nabla p}{|\nabla p|^3}\]

source
WavePropBase.depthFunction
depth(tree::AbstractTree,acc=0)

Recursive function to compute the depth of node in a a tree-like structure.

Overload this function if your structure has a more efficient way to compute depth (e.g. if it stores it in a field).

source
WavePropBase.dim_correctionMethod
dim_correction(pde,X,Y,S,D[;location,p,derivative,tol])

Given a pde and a (possibly innacurate) discretizations of its single and double-layer operators S and D with domain Y and range X, compute corrections δS and δD such that S + δS and D + δD are more accurate approximations of the underlying integral operators.

The following optional keyword arguments are available:

  • p::DimParameters: parameters associated with the density interpolation method
  • derivative: if true, compute the correction to the adjoint double-layer and hypersingular operators instead. In this case, S and D should contain a discretization of adjoint double-layer and hypersingular operators, respectively.
  • tol: distance beyond which interactions are considered sufficiently far so that no correction is needed.
source
WavePropBase.dimensionMethod
dimension(space)

The length of a basis for space; i.e. the number of linearly independent elements required to span space.

source
WavePropBase.distanceMethod
distance(x::SVector,r::HyperRectangle)

The (minimal) Euclidean distance between the point x and any point y ∈ r.

source
WavePropBase.dom2eltMethod
dom2elt(m::GenericMesh,Ω,E)

Compute the element indices idxs of the elements of type E composing Ω, so that m[E][idxs] gives all the elements of type E meshing Ω.

source
WavePropBase.dom2eltMethod
dom2elt(m::GenericMesh,Ω)

Return a Dict with keys being the element types of m, and values being the indices of the elements in Ω of that type.

source
WavePropBase.dom2eltMethod
dom2elt(m::SubMesh,[E])

A dictionary with keys being the element types of m, and values being the element indices in the parent mesh. If a type E is given, return the values associated with that key.

source
WavePropBase.filter_treeFunction
filter_tree(f,tree,isterminal=true)

Return a vector containing all the nodes of tree such that filter(node)==true. The argument isterminal can be used to control whether to continue the search on children of nodes for which f(node)==true.

source
WavePropBase.geometric_dimensionMethod
geometric_dimension(x::AbstractEntity)
geometric_dimension(Ω::Domain)

Number of degrees of freedom necessary to locally represent the geometrical object. For example, lines have geometric dimension of 1 (whether in ℝ² or in ℝ³), while surfaces have geometric dimension of 2.

When the argument is a Domain, return the largest geometric dimension encoutered.

source
WavePropBase.increment_indexFunction
increment_index(I::CartesianIndex,k[,n=1])

Increment I by n along the dimension k. This is equivalent to I += n*eₖ, where eₖ is a vector with with 1 at the k-th coordinate and zeros elsewhere.

source
WavePropBase.integrateMethod
integrate(f,q::AbstractQuadrature)
integrate(f,x,w)

Integrate the function f using the quadrature rule q. This is simply sum(f.(x) .* w), where x and w are the quadrature nodes and weights, respectively.

source
WavePropBase.integrateMethod
integrate(f,msh::NystromMesh)

Compute ∑ᵢ f(qᵢ)wᵢ, where the qᵢ are the qnodess of msh, and wᵢ are the qweights.

Note that you must define f(::QuadratureNode): use coords(q) and normal(q) if you need to access the coordinate or normal vector at que quadrature node.

source
WavePropBase.jacobianMethod
jacobian(f,x)

Given a (possibly vector-valued) functor f : 𝐑ᵐ → 𝐅ⁿ, return the n × m matrix Aᵢⱼ = ∂fᵢ/∂xⱼ. By default a finite-difference approximation is performed, but you should overload this method for specific f if better performance and/or precision is required.

Note: both x and f(x) are expected to be of SVector type.

source
WavePropBase.keyMethod
key(e::AbstractEntity)

The (dim,tag) pair used as a key to identify geometrical entities.

source
WavePropBase.lagrange_basisMethod
lagrange_basis(nodes,[sp::AbstractPolynomialSpace])

Return the set of n polynomials in sp taking the value of 1 on node i and 0 on nodes j ≂̸ i for 1 ≤ i ≤ n. For N-dimensional tensor-product nodes represented in the form of an SVector{N,Vector{T}}, the argument sp may be ommited.

Danger

It is assumed that the value of a function on nodes uniquely determine a polynomial in sp.

source
WavePropBase.loc2globMethod
loc2glob(clt::ClusterTree)

The permutation from the (local) indexing system of the elements of the clt to the (global) indexes used upon the construction of the tree.

source
WavePropBase.matrix_to_blockmatrixMethod
matrix_to_blockmatrix(A::Matrix,B)

Convert a Matrix{T} to a Matrix{B}, where B<:Type{SMatrix}. The element type of B must match that of A, and the size of A must be divisible by the size of B along each dimension.

source
WavePropBase.meshgenMethod
meshgen(Ω::Domain,num_elements)
meshgen(Ω::Domain;meshsize)

Generate a GenericMesh for the domain Ω with num_elements per entity. To specify a different number of elements per entity, num_elements should be a vector with as many elements as there are entities in Ω. Alternatively, a meshsize can be passed.

Requires the entities forming Ω to be ParametricEntity.

Warning

The quality of the generated mesh created usign meshgen depends on the quality of the underlying parametrization. For complex surfaces, you are better off using a proper mesher such as gmsh.

source
WavePropBase.near_interaction_listMethod
near_interaction_list(X,Y::AbstractMesh; tol)

For each element el of type E in Y, return the indices of the points in X which are closer than tol to the center of el.

This function returns a dictionary where e.g. dict[E][5] --> Vector{Int} gives the indices of points in X which are closer than tol to the center of the fifth element of type E.

source
WavePropBase.nearest_point_to_elementMethod
nearest_point_to_element(X::NystroMesh,Y::NystromMesh; tol)

For each element el, return a list with the indices of all points in X for which el is the nearest element. Ignore indices for which the distance exceeds tol.

source
WavePropBase.new_tagMethod
new_tag(dim)

Generate a unique tag for an AbstractEntity of dimension dim.

The implementation consists of adding one to the maximum value of TAGS[dim]

See also: TAGS.

source
WavePropBase.normalMethod
normal(el,x̂)

The unit normal vector at coordinate , guaranteed to be orthogonal to all columns of jacobian(el,x).

source
WavePropBase.partition_by_depthMethod
partition_by_depth(tree)

Given a tree, return a partition vector whose i-th entry stores all the nodes in tree with depth=i-1. Empty nodes are not added to the partition.

source
WavePropBase.pdeMethod
pde(K::AbstractPDEKernel)

Return the underlying AbstractPDE when K correspond to the kernel related to the underlying Greens function of a PDE.

source
WavePropBase.quadgenMethod
quadgen(el,q::AbstractQuadratureRule)

Return a set of points and weights for integrating over el based on the quadrature rule q.

source
WavePropBase.reference_nodesMethod
reference_nodes(el::LagrangeElement)

Return the reference nodes on domain(el) used for the polynomial interpolation. The function values on these nodes completely determines the interpolating polynomial.

We use the same convention as gmsh for defining the reference nodes and their order (see node ordering on gmsh documentation).

source
WavePropBase.return_typeMethod
return_type(f[,args...])

The type returned by f(args...), where args is a tuple of types. Falls back to Base.promote_op by default.

A functors of type T with a knonw return type should extend return_type(::T,args...) to avoid relying on promote_op.

source
WavePropBase.sectionMethod
section(rec::HyperRectangle{D},ax)

Return the dimension D-1 HyperRectangle obtained by deleting the coordinates at the ax dimension.

source
WavePropBase.should_splitMethod
should_split(clt::ClusterTree, depth, splitter::AbstractSplitter)

Determine whether or not a ClusterTree should be further divided.

source
WavePropBase.sort_by_typeMethod
sort_by_type(v)

Sort the elements of v into vectors vi according to their type. Return a Dict{DataType,Vector} mapping each type to a vector of that type.

Examples

v = [1,"a",3,"b"]
dict = sort_by_type(v)
source
WavePropBase.sort_in_cartesian_meshMethod
sort_in_cartesian_mesh(X,msh)

Given a collection of points X and a mesh msh, return a dictionary mapping the keys of the mesh elements, given as a CartesianIndex, to the indices of points inside that element.

source
WavePropBase.sph2cartMethod
sph2cart(x,y,z)

Map spherical coordinates r,θ,φ representing the radius, elevation, and azimuthal angle respectively, to cartesian ones x, y, z .

source
WavePropBase.split!Method
split!(clt::ClusterTree,splitter::AbstractSplitter)

Divide clt using the strategy implemented by splitter. This function is reponsible of assigning the children and parent fields, as well as of permuting the data of clt.

source
WavePropBase.vector_to_blockvectorMethod
vector_to_blockvector(A::Vector,B)

Convert a Vector{T} to a Vector{B}, where B<:Type{SVector}. The element type of B must match that of A, and the size of A must be divisible by the size of B along each dimension.

source
WavePropBase.vtk_mesh_fileMethod
vtk_mesh_file(mesh::GenericMesh[, Ω::Domain], name::String)

Creates a VTK file (.vtu) with name name containing the mesh information. It is possible to export only a Domain (i.e. only a part of the mesh).

Note that all the heavy lifting is done by the package WriteVTK. We refer to its documentation for more information.

Warning: the output is not an actual file (on disk). To save it, simply write:

vtk_mesh_file(mesh, "my_mesh") |> vtk_save

To add some data (scalar or vector values at the mesh nodes or mesh cells) for visualization purposes, you can do for instance:

vtkfile = vtk_mesh_file(mesh, name)
vtkfile["my_point_data", VTKPointData()] = pdata
vtkfile["my_cell_data", VTKCellData()] = cdata
vtk_save(vtkfile)

It is possible also to export a partition Ωs::Vector{Domain} using Multiblock files (.vtm), for instance like so

vtmfile = vtk_multiblock(name)
for (Ω, pdata) in zip(Ωs, pdatas)
    vtkfile = vtk_mesh_file(mesh, Ω, name)
    vtkfile["my_point_data", VTKPointData()] = pdata
end
vtk_save(vtmfile)

To save a sequence of solutions (time steps, iterations), simply append the number of the element to the file name. Paraview will recognize the sequence automatically.

source
WavePropBase.@interfaceMacro
@interface f [n=1]

Declare that the function f is an interface function. The call f(args...) resolves to M.f(args...) where M is parent module of the args[n] object.

The somewhat contrived example below illustrates how this can be used to have a generic method defined in module A applied to a type defined on module B which is independent of A but which implements the interface function f:

module A
    using WavePropBase: @interface
    @interface foo
    # a method which works on any type `x` implementing the `foo` function
    do_work(x) = 2*foo(x)
end

module B
    struct Foo end
    foo(x::Foo) = 1
end

using .A
using .B
foo = B.Foo()
A.do_work(foo)

# output

2

Note that if in the example above module A implements a generic version of foo, the call A.do_work(foo) would use that method instead based on the dispatch rules.

source