Gridap.Polynomials
Gridap.Polynomials — ModuleThis module provides a collection of multivariate polynomial bases.
The exported names are:
Gridap.Polynomials.MonomialBasis — Typestruct MonomialBasis{D,T} <: AbstractVector{Monomial}Type representing a basis of multivariate scalar-valued, vector-valued, or tensor-valued, iso- or aniso-tropic monomials. The fields of this struct are not public. This type fully implements the Field interface, with up to second order derivatives.
Gridap.Polynomials.MonomialBasis — MethodMonomialBasis{D}(::Type{T}, order::Int [, filter::Function]) where {D,T}Returns an instance of MonomialBasis representing a multivariate polynomial basis in D dimensions, of polynomial degree order, whose value is represented by the type T. The type T is typically <:Number, e.g., Float64 for scalar-valued functions and VectorValue{D,Float64} for vector-valued ones.
Filter function
The filter function is used to select which terms of the tensor product space of order order in D dimensions are to be used. If the filter is not provided, the full tensor-product space is used by default leading to a multivariate polynomial space of type Q. The signature of the filter function is
(e,order) -> Boolwhere e is a tuple of D integers containing the exponents of a multivariate monomial. The following filters are used to select well known polynomial spaces
- Q space:
(e,order) -> true - P space:
(e,order) -> sum(e) <= order - "Serendipity" space:
(e,order) -> sum( [ i for i in e if i>1 ] ) <= order
Gridap.Polynomials.MonomialBasis — MethodMonomialBasis{D}(::Type{T}, orders::Tuple [, filter::Function]) where {D,T}This version of the constructor allows to pass a tuple orders containing the polynomial order to be used in each of the D dimensions in order to construct an anisotropic tensor-product space.
Gridap.Polynomials.PCurlGradMonomialBasis — Typestruct PCurlGradMonomialBasis{...} <: AbstractArray{Monomial}
This type implements a multivariate vector-valued polynomial basis spanning the space needed for Raviart-Thomas reference elements on simplices. The type parameters and fields of this struct are not public. This type fully implements the Field interface, with up to first order derivatives.
Gridap.Polynomials.PCurlGradMonomialBasis — MethodPCurlGradMonomialBasis{D}(::Type{T},order::Int) where {D,T}
Returns a PCurlGradMonomialBasis object. D is the dimension of the coordinate space and T is the type of the components in the vector-value. The order argument has the following meaning: the divergence of the functions in this basis is in the P space of degree order.
Gridap.Polynomials.QCurlGradMonomialBasis — Typestruct QCurlGradMonomialBasis{...} <: AbstractArray{Monomial}This type implements a multivariate vector-valued polynomial basis spanning the space needed for Raviart-Thomas reference elements on n-cubes. The type parameters and fields of this struct are not public. This type fully implements the Field interface, with up to first order derivatives.
Gridap.Polynomials.QCurlGradMonomialBasis — MethodQCurlGradMonomialBasis{D}(::Type{T},order::Int) where {D,T}Returns a QCurlGradMonomialBasis object. D is the dimension of the coordinate space and T is the type of the components in the vector-value. The order argument has the following meaning: the divergence of the functions in this basis is in the Q space of degree order.
Gridap.Polynomials.QGradMonomialBasis — Typestruct QGradMonomialBasis{...} <: AbstractVector{Monomial}This type implements a multivariate vector-valued polynomial basis spanning the space needed for Nedelec reference elements on n-cubes. The type parameters and fields of this struct are not public. This type fully implements the Field interface, with up to first order derivatives.
Gridap.Polynomials.QGradMonomialBasis — MethodQGradMonomialBasis{D}(::Type{T},order::Int) where {D,T}Returns a QGradMonomialBasis object. D is the dimension of the coordinate space and T is the type of the components in the vector-value. The order argument has the following meaning: the curl of the functions in this basis is in the Q space of degree order.
Gridap.Arrays.return_type — MethodGridap.Polynomials.get_exponents — Methodget_exponents(b::MonomialBasis)Get a vector of tuples with the exponents of all the terms in the monomial basis.
Examples
using Gridap.Polynomials
b = MonomialBasis{2}(Float64,2)
exponents = get_exponents(b)
println(exponents)
# output
Tuple{Int,Int}[(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2, 2)]Gridap.Polynomials.get_order — Methodget_order(b::ModalC0Basis)Gridap.Polynomials.get_order — Methodget_order(b::MonomialBasis)Gridap.Polynomials.get_orders — Methodget_orders(b::ModalC0Basis)Gridap.Polynomials.get_orders — Methodget_orders(b::MonomialBasis)Gridap.Polynomials.num_terms — Methodnum_terms(f::PCurlGradMonomialBasis{D,T}) where {D,T}Gridap.Polynomials.num_terms — Methodnum_terms(f::QCurlGradMonomialBasis{D,T}) where {D,T}Gridap.Polynomials.num_terms — Methodnum_terms(f::QGradMonomialBasis{D,T}) where {D,T}