Spaces

Bramble.BrambleGridSpaceFunctionType
struct BrambleGridSpaceFunction{S,T} 
	f_tuple::FunctionWrapper{T, Tuple{VectorElement{S,T}}}
end

Structure to wrap around functions defined on gridspaces to make them more type agnostic. It uses FunctionWrappers to provide functions calculated on VectorElement.

source
Bramble.GridSpaceType
struct GridSpace{MType,D,T}
	mesh::MType
	innerh_weights::Vector{T}
	innerplus_weights::NTuple{D,Vector{T}}}
	cache::SpaceCacheType
end

Structure for a gridspace defined on a mesh.

The vector innerh_weights has the weights for the standard discrete $L^2$ inner product on the space of grid functions defined as follows

  • 1D case

\[(u_h, v_h)_h = \sum_{i=1}^{N_x} |\square_{i}| u_h(x_i) v_h(x_i)\]

  • 2D case

\[(u_h, v_h)_h = \sum_{i=1}^{N_x}\sum_{j=1}^{N_y} |\square_{i,j}| u_h(x_i,y_j) v_h(x_i,y_j)\]

  • 3D case

\[(u_h, v_h)_h = \sum_{i=1}^{N_x}\sum_{j=1}^{N_y}\sum_{l=1}^{N_z} |\square_{i,j,l}| u_h(x_i,y_j,z_l) v_h(x_i,y_j,z_l).\]

Here, $|\cdot|$ denotes the measure of the set and all details on the definition of $\square_{i}$, $\square_{i,j}$ and $\square_{i,j,l}$ can be found in functions cell_measure (for the 1-dimensional case) and cell_measure (for the n-dimensional cases).

The tuple of vectors innerplus_weights has the weights for the modified discrete $L^2$ inner product on the space of grid functions, for each component (x, y, z).

  • 1D case

\[(u_h, v_h)_+ = \sum_{i=1}^{N_x} h_{i} u_h(x_i) v_h(x_i)\]

  • 2D case

\[(u_h, v_h)_{+x} = \sum_{i=1}^{N_x}\sum_{j=1}^{N_y} h_{x,i} h_{y,j+1/2} u_h(x_i,y_j) v_h(x_i,y_j)\]

\[(u_h, v_h)_{+y} = \sum_{i=1}^{N_x}\sum_{j=1}^{N_y} h_{x,i} h_{y,j+1/2} u_h(x_i,y_j) v_h(x_i,y_j)\]

  • 3D case

\[(u_h, v_h)_{+x} = \sum_{i=1}^{N_x}\sum_{j=1}^{N_y}\sum_{l=1}^{N_z} h_{x,i} h_{y,j+1/2} h_{z,l+1/2} u_h(x_i,y_j,z_l) v_h(x_i,y_j,z_l)\]

\[(u_h, v_h)_{+y} = \sum_{i=1}^{N_x}\sum_{j=1}^{N_y}\sum_{l=1}^{N_z} h_{x,i+1/2} h_{y,j} h_{z,l+1/2} u_h(x_i,y_j,z_l) v_h(x_i,y_j,z_l)\]

\[(u_h, v_h)_{+z} = \sum_{i=1}^{N_x}\sum_{j=1}^{N_y}\sum_{l=1}^{N_z} h_{x,i+1/2} h_{y,j+1/2} h_{z,l} u_h(x_i,y_j,z_l) v_h(x_i,y_j,z_l).\]

source
Bramble.MatrixElementType
MatrixElement{S, T}

A MatrixElement is a container with a sparse matrix where each entry is a T. the container also has a space S to retain the information to which this special element belongs to. Its purpose is to represent discretization matrices from finite difference methods.

source
Bramble.VectorElementType
struct VectorElement{S,T}
	space::S
	values::Vector{T}
end

Vector element of space S with coefficients of type T.

source
Base.eltypeMethod
eltype(Wₕ::SpaceType)
eltype(::Type{<:SpaceType{MType}})

Returns the element type of the mesh associated with GridSpace Wₕ. If the input argument is a type derived from SpaceType then the function returns the element type of the MeshType associated with it.

source
Bramble.__innerplus_weights!Method
__innerplus_weights!(v, innerplus_per_component)

Builds the weights for the modified discrete $L^2$ inner product on the space of grid functions GridSpace. The result is stored in vector v.

source
Bramble._innerplus_mean_weights!Method
_innerplus_mean_weights!(u::Vector{T}, Ωₕ::MeshType, component::Int = 1)

Builds a set of weights based on the half spacings, associated with the component-th direction, for the modified discrete $L^2$ inner product on the space of grid functions, following the order of the points. The values are stored in vector u. for each component.

source
Bramble._innerplus_weights!Method
_innerplus_weights!(u::Vector{T}, Ωₕ::MeshType, component::Int = 1)

Builds a set of weights based on the spacings, associated with the component-th direction, for the modified discrete $L^2$ inner product on the space of grid functions, following the order of the points provided by indices(Ωₕ). The values are stored in vector u.

source
Bramble.build_innerh_weights!Method
build_innerh_weights!(u, Ωₕ::MeshType)

Builds the weights for the standard discrete $L^2$ inner product, $inner_h(\cdot, \cdot)$, on the space of grid functions, following the order of the points provided by indices(Ωₕ). The values are stored in vector u.

source
Base.:*Method
*(uₕ::VectorElement, vₕ::VectorElement)

Returns a new VectorElement with coefficients given by the elementwise evaluation of uₕ*vₕ.

source
Base.:*Method
*(uₕ::VectorElement, α::Number)

Returns a new VectorElement with coefficients given by the elementwise evaluation ofuₕ*α.

source
Base.:*Method
*(α::Number, uₕ::VectorElement)

Returns a new VectorElement with coefficients given by the elementwise evaluation ofα*uₕ.

source
Base.:+Method
+(uₕ::VectorElement, vₕ::VectorElement)

Returns a new VectorElement with coefficients given by the elementwise evaluation of uₕ+vₕ.

source
Base.:+Method
+(uₕ::VectorElement, α::Number)

Returns a new VectorElement with coefficients given by the elementwise evaluation ofuₕ+α.

source
Base.:+Method
+(α::Number, uₕ::VectorElement)

Returns a new VectorElement with coefficients given by the elementwise evaluation ofα+uₕ.

source
Base.:-Method
-(uₕ::VectorElement, vₕ::VectorElement)

Returns a new VectorElement with coefficients given by the elementwise evaluation of uₕ-vₕ.

source
Base.:-Method
-(uₕ::VectorElement, α::Number)

Returns a new VectorElement with coefficients given by the elementwise evaluation ofuₕ-α.

source
Base.:-Method
-(α::Number, uₕ::VectorElement)

Returns a new VectorElement with coefficients given by the elementwise evaluation ofα-uₕ.

source
Base.:/Method
/(uₕ::VectorElement, vₕ::VectorElement)

Returns a new VectorElement with coefficients given by the elementwise evaluation of uₕ/vₕ.

source
Base.:/Method
/(uₕ::VectorElement, α::Number)

Returns a new VectorElement with coefficients given by the elementwise evaluation ofuₕ/α.

source
Base.:/Method
/(α::Number, uₕ::VectorElement)

Returns a new VectorElement with coefficients given by the elementwise evaluation ofα/uₕ.

source
Base.:^Method
^(uₕ::VectorElement, vₕ::VectorElement)

Returns a new VectorElement with coefficients given by the elementwise evaluation of uₕ^vₕ.

source
Base.:^Method
^(uₕ::VectorElement, α::Number)

Returns a new VectorElement with coefficients given by the elementwise evaluation ofuₕ^α.

source
Base.:^Method
^(α::Number, uₕ::VectorElement)

Returns a new VectorElement with coefficients given by the elementwise evaluation ofα^uₕ.

source
Base.copyto!Method
copyto!(uₕ::VectorElement, vₕ::VectorElement)
copyto!(uₕ::VectorElement, v::AbstractVector)
copyto!(uₕ::VectorElement, α::Number)

Copies the coefficients of VectorElement vₕ into VectorElement uₕ. The second argument can also be a regular Vector or a Number`.

source
Base.eltypeMethod
eltype(uₕ::VectorElement{S,T})
eltype(::Type{<:VectorElement{S,T}})

Returns the element type of a VectorElement uₕ, T`.

source
Bramble.__integrand1dMethod
__integrand1d(y, t, p)

Implements the integrand function needed in the calculation of avgₕ. In this function, y denotes the return values, t denotes the integration variable and p denotes the parameters (integrand function f, points x, spacing h and indices idxs).

For efficiency, each integral in avgₕ is rewritten as an integral over [0,1] following

\[\int_{a}^{b} f(x) dx = (b-a) \int_{0}^{1} f(a + t (b-a)) dt\]

source
Bramble.__integrandndMethod
__integrandnd(y, t, p)

Implements the integrand function needed in the calculation of avgₕ. In this function, y denotes the return values, t denotes the integration variable and p denotes the parameters (integrand function f, points x, measures meas and indices idxs).

For efficiency, each integral is calculated on $[0,1]^D$, where $D$ is the dimension of the integration domain. This is done through a similar change of variable as in __integrand1d(y, t, p).

source
Base.:*Method
*(Uₕ::MatrixElement, vₕ::VectorElement)

Returns a new MatrixElement calculated by multiplying each coefficient of VectorElement vₕ with the corresponding column of Uₕ.

source
Base.:*Method
*(Uₕ::MatrixElement, α::Number)

Returns a new MatrixElement with coefficients given by the elementwise evaluation ofUₕ*α.

source
Base.:*Method
*(uₕ::VectorElement, Vₕ::MatrixElement)

Returns a new MatrixElement calculated by multiplying each coefficient of VectorElement uₕ with the corresponding row of Vₕ.

source
Base.:*Method
*(α::Number, Uₕ::MatrixElement)

Returns a new MatrixElement with coefficients given by the elementwise evaluation ofα*Uₕ.

source
Base.:+Method
+(Uₕ::MatrixElement, α::Number)

Returns a new MatrixElement with coefficients given by the elementwise evaluation ofUₕ+α.

source
Base.:+Method
+(α::Number, Uₕ::MatrixElement)

Returns a new MatrixElement with coefficients given by the elementwise evaluation ofα+Uₕ.

source
Base.:-Method
-(Uₕ::MatrixElement, α::Number)

Returns a new MatrixElement with coefficients given by the elementwise evaluation ofUₕ-α.

source
Base.:-Method
-(α::Number, Uₕ::MatrixElement)

Returns a new MatrixElement with coefficients given by the elementwise evaluation ofα-Uₕ.

source
Base.:/Method
/(Uₕ::MatrixElement, α::Number)

Returns a new MatrixElement with coefficients given by the elementwise evaluation ofUₕ/α.

source
Base.:/Method
/(α::Number, Uₕ::MatrixElement)

Returns a new MatrixElement with coefficients given by the elementwise evaluation ofα/Uₕ.

source
Base.:^Method
^(Uₕ::MatrixElement, α::Number)

Returns a new MatrixElement with coefficients given by the elementwise evaluation ofUₕ^α.

source
Base.:^Method
^(α::Number, Uₕ::MatrixElement)

Returns a new MatrixElement with coefficients given by the elementwise evaluation ofα^Uₕ.

source
Bramble._backward_differencex!Method
_backward_differencex!(out, in, dims::NTuple{1,Int})

In-place computation of the backward difference in the x direction of vector in for a 1-dimensional element. The result is stored in out. Allows for in and out to be the same vector.

source
Bramble._backward_differencex!Method
_backward_differencex!(out, in, dims::NTuple{D,Int}, ::Val{D})

In-place computation of the backward difference in the x direction of vector in for a D-dimensional ($D>1$) element. The result is stored in out. Allows for in and out to be the same vector.

source
Bramble._backward_differencey!Method
_backward_differencey!(out, in, dims::NTuple{3,Int})

In-place computation of the backward difference in the y direction of vector in for a 3-dimensional element. The result is stored in out. Allows for in and out to be the same vector.

source
Bramble._backward_differencey!Method
_backward_differencey!(out, in, dims::NTuple{2,Int})

In-place computation of the difference in the y direction of vector in for a 2-dimensional element. The result is stored in out. Allows for in and out to be the same vector.

source
Bramble._backward_differencez!Method
_backward_differencez!(out, in, dims::NTuple{3,Int})

In-place computation of the backward difference in the z direction of vector in for a 3-dimensional element. The result is stored in out. Allows for in and out to be the same vector.

source
Bramble._backward_finite_differencex!Method
_backward_finite_differencex!(out, in, hx, dims::NTuple{1,Int})

In-place computation of the backward finite difference in the x direction of vector in for a 1-dimensional element. The spacings are encoded in hx. The result is stored in out. Allows for in and out to be the same vector.

source
Bramble._backward_finite_differencex!Method
_backward_finite_differencex!(out, in, hx, dims::NTuple{D,Int})

In-place computation of the backward finite difference in the x direction of vector in for a D-dimensional element. The spacings are encoded in hx. The result is stored in out. Allows for in and out to be the same vector.

source
Bramble._backward_finite_differencey!Method
_backward_finite_differencey!(out, in, hy, dims::NTuple{3,Int})

In-place computation of the backward finite difference in the y direction of vector in for a 3-dimensional element. The spacings are encoded in hy. The result is stored in out. Allows for in and out to be the same vector.

source
Bramble._backward_finite_differencey!Method
_backward_finite_differencey!(out, in, hy, dims::NTuple{2,Int})

In-place computation of the backward finite difference in the y direction of vector in for a 2-dimensional element. The spacings are encoded in hy. The result is stored in out. Allows for in and out to be the same vector.

source
Bramble._backward_finite_differencez!Method
_backward_finite_differencez!(out, in, hz, dims::NTuple{3,Int})

In-place computation of the backward finite difference in the z direction of vector in for a 3-dimensional element. The spacings are encoded in hz. The result is stored in out. Allows for in and out to be the same vector.

source