FIAT package¶
Submodules¶
FIAT.P0 module¶
- class FIAT.P0.P0(ref_el)[source]¶
Bases:
CiarletElement
FIAT.argyris module¶
- class FIAT.argyris.Argyris(ref_el, degree)[source]¶
Bases:
CiarletElement
The Argyris finite element.
- class FIAT.argyris.QuinticArgyris(ref_el)[source]¶
Bases:
CiarletElement
The Argyris finite element.
FIAT.arnold_winther module¶
Implementation of the Arnold-Winther finite elements.
- class FIAT.arnold_winther.ArnoldWinther(cell, degree)[source]¶
Bases:
CiarletElement
The definition of the conforming Arnold-Winther element.
- class FIAT.arnold_winther.ArnoldWintherNC(cell, degree)[source]¶
Bases:
CiarletElement
The definition of the nonconforming Arnold-Winther element.
FIAT.barycentric_interpolation module¶
- FIAT.barycentric_interpolation.barycentric_interpolation(xsrc, xdst, order=0)[source]¶
Return tabulations of a 1D Lagrange nodal basis via the second barycentric interpolation formula
See Berrut and Trefethen (2004) https://doi.org/10.1137/S0036144502417715 Eq. (4.2) & (9.4)
- Parameters
xsrc – a
numpy.array
with the nodes defining the Lagrange polynomial basisxdst – a
numpy.array
with the interpolation pointsorder – the integer order of differentiation
- Returns
dict of tabulations up to the given order (in the same format as
tabulate()
)
FIAT.bell module¶
- class FIAT.bell.Bell(ref_el)[source]¶
Bases:
CiarletElement
The Bell finite element.
FIAT.bernstein module¶
- class FIAT.bernstein.Bernstein(ref_el, degree)[source]¶
Bases:
FiniteElement
A finite element with Bernstein polynomials as basis functions.
- tabulate(order, points, entity=None)[source]¶
Return tabulated values of derivatives up to given order of basis functions at given points.
- Parameters
order – The maximum order of derivative.
points – An iterable of points.
entity – Optional (dimension, entity number) pair indicating which topological entity of the reference element to tabulate on. If
None
, default cell-wise tabulation is performed.
- class FIAT.bernstein.BernsteinDualSet(ref_el, degree)[source]¶
Bases:
DualSet
The dual basis for Bernstein elements.
- FIAT.bernstein.bernstein_Dx(points, ks, order, R2B)[source]¶
Evaluates Bernstein polynomials or its derivatives according to reference coordinates.
- Parameters
points – array of points in BARYCENTRIC COORDINATES
ks – exponents defining the Bernstein polynomial
alpha – derivative order (returns all derivatives of this specified order)
R2B – linear mapping from reference to barycentric coordinates
- Returns
dictionary mapping from derivative tuples to arrays of Bernstein polynomial values at given points.
- FIAT.bernstein.bernstein_db(points, ks, alpha=None)[source]¶
Evaluates Bernstein polynomials or its derivative at barycentric points.
- Parameters
points – array of points in barycentric coordinates
ks – exponents defining the Bernstein polynomial
alpha – derivative tuple
- Returns
array of Bernstein polynomial values at given points.
FIAT.brezzi_douglas_fortin_marini module¶
- class FIAT.brezzi_douglas_fortin_marini.BrezziDouglasFortinMarini(ref_el, degree)[source]¶
Bases:
CiarletElement
The BDFM element
FIAT.brezzi_douglas_marini module¶
- class FIAT.brezzi_douglas_marini.BDMDualSet(ref_el, degree, variant, quad_deg)[source]¶
Bases:
DualSet
- class FIAT.brezzi_douglas_marini.BrezziDouglasMarini(ref_el, k, variant=None)[source]¶
Bases:
CiarletElement
The BDM element
- Parameters
ref_el – The reference element.
k – The degree.
variant – optional variant specifying the types of nodes.
variant can be chosen from [“point”, “integral”, “integral(quadrature_degree)”] “point” -> dofs are evaluated by point evaluation. Note that this variant has suboptimal convergence order in the H(div)-norm “integral” -> dofs are evaluated by quadrature rule. The quadrature degree is chosen to integrate polynomials of degree 5*k so that most expressions will be interpolated exactly. This is important when you want to have (nearly) divergence-preserving interpolation. “integral(quadrature_degree)” -> dofs are evaluated by quadrature rule of degree quadrature_degree
FIAT.bubble module¶
- class FIAT.bubble.Bubble(ref_el, degree)[source]¶
Bases:
CodimBubble
The bubble finite element: the dofs of the Lagrange FE in the interior of the cell
- class FIAT.bubble.CodimBubble(ref_el, degree, codim)[source]¶
Bases:
RestrictedElement
Bubbles of a certain codimension.
- class FIAT.bubble.FacetBubble(ref_el, degree)[source]¶
Bases:
CodimBubble
The facet bubble finite element: the dofs of the Lagrange FE in the interior of the facets
FIAT.check_format_variant module¶
FIAT.crouzeix_raviart module¶
- class FIAT.crouzeix_raviart.CrouzeixRaviart(cell, degree)[source]¶
Bases:
CiarletElement
The Crouzeix-Raviart finite element:
K: Triangle/Tetrahedron Polynomial space: P_1 Dual basis: Evaluation at facet midpoints
FIAT.discontinuous module¶
- class FIAT.discontinuous.DiscontinuousElement(element)[source]¶
Bases:
CiarletElement
A copy of an existing element where all dofs are associated with the cell
- get_nodal_basis()[source]¶
Return the nodal basis, encoded as a PolynomialSet object, for the finite element.
- mapping()[source]¶
Return a list of appropriate mappings from the reference element to a physical element for each basis function of the finite element.
FIAT.discontinuous_lagrange module¶
- class FIAT.discontinuous_lagrange.DiscontinuousLagrangeDualSet(ref_el, degree)[source]¶
Bases:
DualSet
The dual basis for Lagrange elements. This class works for simplices of any dimension. Nodes are point evaluation at equispaced points. This is the discontinuous version where all nodes are topologically associated with the cell itself
- class FIAT.discontinuous_lagrange.HigherOrderDiscontinuousLagrange(ref_el, degree)[source]¶
Bases:
CiarletElement
The discontinuous Lagrange finite element. It is what it is.
FIAT.discontinuous_pc module¶
- class FIAT.discontinuous_pc.DPC0(ref_el)[source]¶
Bases:
CiarletElement
- class FIAT.discontinuous_pc.DPCDualSet(ref_el, flat_el, degree)[source]¶
Bases:
DualSet
The dual basis for DPC elements. This class works for hypercubes of any dimension. Nodes are point evaluation at equispaced points. This is the discontinuous version where all nodes are topologically associated with the cell itself
- class FIAT.discontinuous_pc.HigherOrderDPC(ref_el, degree)[source]¶
Bases:
CiarletElement
The DPC finite element. It is what it is.
FIAT.discontinuous_raviart_thomas module¶
- class FIAT.discontinuous_raviart_thomas.DRTDualSet(ref_el, degree)[source]¶
Bases:
DualSet
Dual basis for Raviart-Thomas elements consisting of point evaluation of normals on facets of codimension 1 and internal moments against polynomials. This is the discontinuous version where all nodes are topologically associated with the cell itself
- class FIAT.discontinuous_raviart_thomas.DiscontinuousRaviartThomas(ref_el, q)[source]¶
Bases:
CiarletElement
The discontinuous Raviart-Thomas finite element
FIAT.discontinuous_taylor module¶
- class FIAT.discontinuous_taylor.DiscontinuousTaylorDualSet(ref_el, degree)[source]¶
Bases:
DualSet
The dual basis for Taylor elements. This class works for intervals. Nodes are function and derivative evaluation at the midpoint.
- class FIAT.discontinuous_taylor.HigherOrderDiscontinuousTaylor(ref_el, degree)[source]¶
Bases:
CiarletElement
The discontinuous Taylor finite element. Use a Taylor basis for DG.
FIAT.dual_set module¶
- class FIAT.dual_set.DualSet(nodes, ref_el, entity_ids)[source]¶
Bases:
object
- to_riesz(poly_set)[source]¶
This method gives the action of the entire dual set on each member of the expansion set underlying poly_set. Then, applying the linear functionals of the dual set to an arbitrary polynomial in poly_set is accomplished by (generalized) matrix multiplication.
For scalar-valued spaces, this produces a matrix :math:R_{i, j} such that :math:ell_i(f) = sum_{j} a_j ell_i(phi_j) for :math:f=sum_{j} a_j phi_j.
More generally, it will have shape concatenating the number of functionals in the dual set, the value shape of functions it takes, and the number of members of the expansion set.
FIAT.enriched module¶
- class FIAT.enriched.EnrichedElement(*elements)[source]¶
Bases:
FiniteElement
Class implementing a finite element that combined the degrees of freedom of two existing finite elements.
This is an implementation which does not care about orthogonality of primal and dual basis.
- get_nodal_basis()[source]¶
Return the nodal basis, encoded as a PolynomialSet object, for the finite element.
FIAT.expansions module¶
Principal orthogonal expansion functions as defined by Karniadakis and Sherwin. These are parametrized over a reference element so as to allow users to get coordinates that they want.
- class FIAT.expansions.LineExpansionSet(ref_el)[source]¶
Bases:
object
Evaluates the Legendre basis on a line reference element.
- class FIAT.expansions.PointExpansionSet(ref_el)[source]¶
Bases:
object
Evaluates the point basis on a point reference element.
- class FIAT.expansions.TetrahedronExpansionSet(ref_el)[source]¶
Bases:
object
Collapsed orthonormal polynomial expanion on a tetrahedron.
- class FIAT.expansions.TriangleExpansionSet(ref_el)[source]¶
Bases:
object
Evaluates the orthonormal Dubiner basis on a triangular reference element.
- FIAT.expansions.get_expansion_set(ref_el)[source]¶
Returns an ExpansionSet instance appopriate for the given reference element.
FIAT.finite_element module¶
- class FIAT.finite_element.CiarletElement(poly_set, dual, order, formdegree=None, mapping='affine', ref_el=None)[source]¶
Bases:
FiniteElement
Class implementing Ciarlet’s abstraction of a finite element being a domain, function space, and set of nodes.
Elements derived from this class are nodal finite elements, with a nodal basis generated from polynomials encoded in a PolynomialSet.
- get_nodal_basis()[source]¶
Return the nodal basis, encoded as a PolynomialSet object, for the finite element.
- static is_nodal()[source]¶
True if primal and dual bases are orthogonal. If false, dual basis is not implemented or is undefined.
All implementations/subclasses are nodal including this one.
- tabulate(order, points, entity=None)[source]¶
Return tabulated values of derivatives up to given order of basis functions at given points.
- Parameters
order – The maximum order of derivative.
points – An iterable of points.
entity – Optional (dimension, entity number) pair indicating which topological entity of the reference element to tabulate on. If
None
, default cell-wise tabulation is performed.
- class FIAT.finite_element.FiniteElement(ref_el, dual, order, formdegree=None, mapping='affine')[source]¶
Bases:
object
Class implementing a basic abstraction template for general finite element families. Finite elements which inherit from this class are non-nodal unless they are CiarletElement subclasses.
- entity_closure_dofs()[source]¶
Return the map of topological entities to degrees of freedom on the closure of those entities for the finite element.
- entity_dofs()[source]¶
Return the map of topological entities to degrees of freedom for the finite element.
- static is_nodal()[source]¶
True if primal and dual bases are orthogonal. If false, dual basis is not implemented or is undefined.
Subclasses may not necessarily be nodal, unless it is a CiarletElement.
- mapping()[source]¶
Return a list of appropriate mappings from the reference element to a physical element for each basis function of the finite element.
- tabulate(order, points, entity=None)[source]¶
Return tabulated values of derivatives up to given order of basis functions at given points.
- Parameters
order – The maximum order of derivative.
points – An iterable of points.
entity – Optional (dimension, entity number) pair indicating which topological entity of the reference element to tabulate on. If
None
, default cell-wise tabulation is performed.
FIAT.functional module¶
- class FIAT.functional.ComponentPointEvaluation(ref_el, comp, shp, x)[source]¶
Bases:
Functional
Class representing point evaluation of a particular component of a vector function at a particular point x.
- class FIAT.functional.FrobeniusIntegralMoment(ref_el, Q, f_at_qpts)[source]¶
Bases:
Functional
- class FIAT.functional.Functional(ref_el, target_shape, pt_dict, deriv_dict, functional_type)[source]¶
Bases:
object
Abstract class representing a linear functional. All FIAT functionals are discrete in the sense that they are written as a weighted sum of (derivatives of components of) their argument evaluated at particular points.
- Parameters
ref_el – a
Cell
target_shape – a tuple indicating the value shape of functions on the functional operates (e.g. if the function eats 2-vectors then target_shape is (2,) and if it eats scalars then target_shape is ()
pt_dict – A dict mapping points to lists of information about how the functional is evaluated. Each entry in the list takes the form of a tuple (wt, comp) so that (at least if the deriv_dict argument is empty), the functional takes the form \(\ell(f) = \sum_{q=1}^{N_q} \sum_{k=1}^{K_q} w^q_k f_{c_k}(x_q)\) where \(f_{c_k}\) indicates a particular vector or tensor component
deriv_dict – A dict that is similar to pt_dict, although the entries of each list are tuples (wt, alpha, comp) with alpha a tuple of nonnegative integers corresponding to the order of partial differentiation in each spatial direction.
functional_type – a string labeling the kind of functional this is.
- evaluate(f)[source]¶
Obsolete and broken functional evaluation.
To evaluate the functional, call it on the target function:
functional(function)
- get_point_dict()[source]¶
Returns the functional information, which is a dictionary mapping each point in the support of the functional to a list of pairs containing the weight and component.
- get_type_tag()[source]¶
Returns the type of function (e.g. point evaluation or normal component, which is probably handy for clients of FIAT
- to_riesz(poly_set)[source]¶
Constructs an array representation of the functional so that the functional may be applied to a function expressed in in terms of the expansion set underlying poly_set by means of contracting coefficients.
That is, poly_set will have members all expressed in the form \(p = \sum_{i} \alpha^i \phi_i\) where \(\{\phi_i\}_{i}\) is some orthonormal expansion set and \(\alpha^i\) are coefficients. Note: the orthonormal expansion set is always scalar-valued but if the members of poly_set are vector or tensor valued the \(\alpha^i\) will be scalars or vectors.
This function constructs a tensor \(R\) such that the contraction of \(R\) with the array of coefficients \(\alpha\) produces the effect of \(\ell(f)\)
In the case of scalar-value functions, \(R\) is just a vector of the same length as the expansion set, and \(R_i = \ell(\phi_i)\). For vector-valued spaces, \(R_{ij}\) will be \(\ell(e^i \phi_j)\) where \(e^i\) is the canonical unit vector nonzero only in one entry \(i\).
- class FIAT.functional.IntegralLegendreBidirectionalMoment(cell, s1, s2, entity, mom_deg, comp_deg, nm='')[source]¶
Bases:
Functional
Moment of dot(s1, dot(tau, s2)) against Legendre on entity, multiplied by the size of the reference facet
- class FIAT.functional.IntegralLegendreDirectionalMoment(cell, s, entity, mom_deg, comp_deg, nm='')[source]¶
Bases:
Functional
Moment of v.s against a Legendre polynomial over an edge
- class FIAT.functional.IntegralLegendreNormalMoment(cell, entity, mom_deg, comp_deg)[source]¶
Bases:
IntegralLegendreDirectionalMoment
Moment of v.n against a Legendre polynomial over an edge
- class FIAT.functional.IntegralLegendreNormalNormalMoment(cell, entity, mom_deg, comp_deg)[source]¶
Bases:
IntegralLegendreBidirectionalMoment
Moment of dot(n, dot(tau, n)) against Legendre on entity.
- class FIAT.functional.IntegralLegendreNormalTangentialMoment(cell, entity, mom_deg, comp_deg)[source]¶
Bases:
IntegralLegendreBidirectionalMoment
Moment of dot(n, dot(tau, t)) against Legendre on entity.
- class FIAT.functional.IntegralLegendreTangentialMoment(cell, entity, mom_deg, comp_deg)[source]¶
Bases:
IntegralLegendreDirectionalMoment
Moment of v.t against a Legendre polynomial over an edge
- class FIAT.functional.IntegralMoment(ref_el, Q, f_at_qpts, comp=(), shp=())[source]¶
Bases:
Functional
Functional representing integral of the input against some tabulated function f.
- Parameters
ref_el – a
Cell
.Q – a
QuadratureRule
.f_at_qpts – an array tabulating the function f at the quadrature points.
comp – Optional argument indicating that only a particular component of the input function should be integrated against f
shp – Optional argument giving the value shape of input functions.
- class FIAT.functional.IntegralMomentOfDivergence(ref_el, Q, f_at_qpts)[source]¶
Bases:
Functional
Functional representing integral of the divergence of the input against some tabulated function f.
- class FIAT.functional.IntegralMomentOfEdgeTangentEvaluation(ref_el, Q, P_at_qpts, edge)[source]¶
Bases:
Functional
int_e vcdot t p ds
p in Polynomials
- Parameters
ref_el – reference element for which e is a dim-1 entity
Q – quadrature rule on the face
P_at_qpts – polynomials evaluated at quad points
edge – which edge.
- class FIAT.functional.IntegralMomentOfFaceTangentEvaluation(ref_el, Q, P_at_qpts, facet)[source]¶
Bases:
Functional
int_F v times n cdot p ds
p in Polynomials
- Parameters
ref_el – reference element for which F is a codim-1 entity
Q – quadrature rule on the face
P_at_qpts – polynomials evaluated at quad points
facet – which facet.
- class FIAT.functional.IntegralMomentOfNormalDerivative(ref_el, facet_no, Q, f_at_qpts)[source]¶
Bases:
Functional
Functional giving normal derivative integrated against some function on a facet.
- class FIAT.functional.IntegralMomentOfNormalEvaluation(ref_el, Q, P_at_qpts, facet)[source]¶
Bases:
Functional
int_F vcdot n p ds p in Polynomials :arg ref_el: reference element for which F is a codim-1 entity :arg Q: quadrature rule on the face :arg P_at_qpts: polynomials evaluated at quad points :arg facet: which facet.
- class FIAT.functional.IntegralMomentOfNormalNormalEvaluation(ref_el, Q, P_at_qpts, facet)[source]¶
Bases:
Functional
int_F (n^T tau n) p ds p in Polynomials :arg ref_el: reference element for which F is a codim-1 entity :arg Q: quadrature rule on the face :arg P_at_qpts: polynomials evaluated at quad points :arg facet: which facet.
- class FIAT.functional.IntegralMomentOfScaledNormalEvaluation(ref_el, Q, P_at_qpts, facet)[source]¶
Bases:
Functional
int_F vcdot n p ds
p in Polynomials
- Parameters
ref_el – reference element for which F is a codim-1 entity
Q – quadrature rule on the face
P_at_qpts – polynomials evaluated at quad points
facet – which facet.
- class FIAT.functional.IntegralMomentOfTangentialEvaluation(ref_el, Q, P_at_qpts, facet)[source]¶
Bases:
Functional
int_F vcdot n p ds p in Polynomials :arg ref_el: reference element for which F is a codim-1 entity :arg Q: quadrature rule on the face :arg P_at_qpts: polynomials evaluated at quad points :arg facet: which facet.
- class FIAT.functional.IntegralMomentOfTensorDivergence(ref_el, Q, f_at_qpts)[source]¶
Bases:
Functional
Like IntegralMomentOfDivergence, but on symmetric tensors.
- class FIAT.functional.MonkIntegralMoment(ref_el, Q, P_at_qpts, facet)[source]¶
Bases:
Functional
face nodes are int_F vcdot p dA where p in P_{q-2}(f)^3 with p cdot n = 0 (cmp. Peter Monk - Finite Element Methods for Maxwell’s equations p. 129) Note that we don’t scale by the area of the facet
- Parameters
ref_el – reference element for which F is a codim-1 entity
Q – quadrature rule on the face
P_at_qpts – polynomials evaluated at quad points
facet – which facet.
- class FIAT.functional.PointDerivative(ref_el, x, alpha)[source]¶
Bases:
Functional
Class representing point partial differentiation of scalar functions at a particular point x.
- class FIAT.functional.PointEdgeTangentEvaluation(ref_el, edge_no, pt)[source]¶
Bases:
Functional
Implements the evaluation of the tangential component of a vector at a point on a facet of dimension 1.
- class FIAT.functional.PointEvaluation(ref_el, x)[source]¶
Bases:
Functional
Class representing point evaluation of scalar functions at a particular point x.
- class FIAT.functional.PointFaceTangentEvaluation(ref_el, face_no, tno, pt)[source]¶
Bases:
Functional
Implements the evaluation of a tangential component of a vector at a point on a facet of codimension 1.
- class FIAT.functional.PointNormalDerivative(ref_el, facet_no, pt)[source]¶
Bases:
Functional
Represents d/dn at a point on a facet.
- class FIAT.functional.PointNormalEvaluation(ref_el, facet_no, pt)[source]¶
Bases:
Functional
Implements the evaluation of the normal component of a vector at a point on a facet of codimension 1.
- class FIAT.functional.PointNormalSecondDerivative(ref_el, facet_no, pt)[source]¶
Bases:
Functional
Represents d^/dn^2 at a point on a facet.
- class FIAT.functional.PointScaledNormalEvaluation(ref_el, facet_no, pt)[source]¶
Bases:
Functional
Implements the evaluation of the normal component of a vector at a point on a facet of codimension 1, where the normal is scaled by the volume of that facet.
- class FIAT.functional.PointwiseInnerProductEvaluation(ref_el, v, w, p)[source]¶
Bases:
Functional
This is a functional on symmetric 2-tensor fields. Let u be such a field, p be a point, and v,w be vectors. This implements the evaluation v^T u(p) w.
Clearly v^iu_{ij}w^j = u_{ij}v^iw^j. Thus the value can be computed from the Frobenius inner product of u with wv^T. This gives the correct weights.
- class FIAT.functional.TensorBidirectionalMomentInnerProductEvaluation(ref_el, v, w, Q, f_at_qpts, comp_deg)[source]¶
Bases:
Functional
This is a functional on symmetric 2-tensor fields. Let u be such a field, f a function tabulated at points, and v,w be vectors. This implements the evaluation int v^T u(x) w f(x).
Clearly v^iu_{ij}w^j = u_{ij}v^iw^j. Thus the value can be computed from the Frobenius inner product of u with wv^T. This gives the correct weights.
FIAT.gauss_legendre module¶
- class FIAT.gauss_legendre.GaussLegendre(ref_el, degree)[source]¶
Bases:
CiarletElement
1D discontinuous element with nodes at the Gauss-Legendre points.
- tabulate(order, points, entity=None)[source]¶
Return tabulated values of derivatives up to given order of basis functions at given points.
- Parameters
order – The maximum order of derivative.
points – An iterable of points.
entity – Optional (dimension, entity number) pair indicating which topological entity of the reference element to tabulate on. If
None
, default cell-wise tabulation is performed.
FIAT.gauss_lobatto_legendre module¶
- class FIAT.gauss_lobatto_legendre.GaussLobattoLegendre(ref_el, degree)[source]¶
Bases:
CiarletElement
1D continuous element with nodes at the Gauss-Lobatto points.
- tabulate(order, points, entity=None)[source]¶
Return tabulated values of derivatives up to given order of basis functions at given points.
- Parameters
order – The maximum order of derivative.
points – An iterable of points.
entity – Optional (dimension, entity number) pair indicating which topological entity of the reference element to tabulate on. If
None
, default cell-wise tabulation is performed.
FIAT.gauss_radau module¶
- class FIAT.gauss_radau.GaussRadau(ref_el, degree)[source]¶
Bases:
CiarletElement
1D discontinuous element with nodes at the Gauss-Radau points.
FIAT.hdiv_trace module¶
- class FIAT.hdiv_trace.HDivTrace(ref_el, degree)[source]¶
Bases:
FiniteElement
Class implementing the trace of hdiv elements. This class is a stand-alone element family that produces a DG-facet field. This element is what’s produced after performing the trace operation on an existing H(Div) element.
This element is also known as the discontinuous trace field that arises in several DG formulations.
- get_nodal_basis()[source]¶
Return the nodal basis, encoded as a PolynomialSet object, for the finite element.
- static is_nodal()[source]¶
True if primal and dual bases are orthogonal. If false, dual basis is not implemented or is undefined.
Subclasses may not necessarily be nodal, unless it is a CiarletElement.
- tabulate(order, points, entity=None)[source]¶
Return tabulated values of derivatives up to a given order of basis functions at given points.
- Parameters
order – The maximum order of derivative.
points – An iterable of points.
entity – Optional (dimension, entity number) pair indicating which topological entity of the reference element to tabulate on. If
None
, tabulated values are computed by geometrically approximating which facet the points are on.
Note
Performing illegal tabulations on this element will result in either a tabulation table of numpy.nan arrays (entity=None case), or insertions of the TraceError exception class. This is due to the fact that performing cell-wise tabulations, or asking for any order of derivative evaluations, are not mathematically well-defined.
- exception FIAT.hdiv_trace.TraceError(msg)[source]¶
Bases:
Exception
Exception caused by tabulating a trace element on the interior of a cell, or the gradient of a trace element.
- FIAT.hdiv_trace.barycentric_coordinates(points, vertices)[source]¶
Computes the barycentric coordinates for a set of points relative to a simplex defined by a set of vertices.
- Parameters
points – A set of points.
vertices – A set of vertices that define the simplex.
- FIAT.hdiv_trace.construct_dg_element(ref_el, degree)[source]¶
Constructs a discontinuous galerkin element of a given degree on a particular reference cell.
- FIAT.hdiv_trace.extract_unique_facet(coordinates, tolerance=1e-10)[source]¶
Determines whether a set of points (described in its barycentric coordinates) are all on one of the facet sub-entities, and return the particular facet and whether the search has been successful.
- Parameters
coordinates – A set of points described in barycentric coordinates.
tolerance – A fixed tolerance for geometric identifications.
- FIAT.hdiv_trace.map_from_reference_facet(point, vertices)[source]¶
Evaluates the physical coordinate of a point using barycentric coordinates.
- Parameters
point – The reference points to be mapped to the facet.
vertices – The vertices defining the physical element.
- FIAT.hdiv_trace.map_to_reference_facet(points, vertices, facet)[source]¶
Given a set of points and vertices describing a facet of a simplex in n-dimensional coordinates (where the points lie on the facet), map the points to the reference simplex of dimension (n-1).
- Parameters
points – A set of points in n-D.
vertices – A set of vertices describing a facet of a simplex in n-D.
facet – Integer representing the facet number.
FIAT.hdivcurl module¶
FIAT.hellan_herrmann_johnson module¶
Implementation of the Hellan-Herrmann-Johnson finite elements.
- class FIAT.hellan_herrmann_johnson.HellanHerrmannJohnson(cell, degree)[source]¶
Bases:
CiarletElement
The definition of Hellan-Herrmann-Johnson element. It is defined only in dimension 2. It consists of piecewise polynomial symmetric-matrix-valued functions of degree r or less with normal-normal continuity.
FIAT.hermite module¶
- class FIAT.hermite.CubicHermite(ref_el, deg=3)[source]¶
Bases:
CiarletElement
The cubic Hermite finite element. It is what it is.
FIAT.jacobi module¶
Several functions related to the one-dimensional jacobi polynomials: Evaluation, evaluation of derivatives, plus computation of the roots via Newton’s method. These mainly are used in defining the expansion functions over the simplices and in defining quadrature rules over each domain.
- FIAT.jacobi.eval_jacobi(a, b, n, x)[source]¶
Evaluates the nth jacobi polynomial with weight parameters a,b at a point x. Recurrence relations implemented from the pseudocode given in Karniadakis and Sherwin, Appendix B
- FIAT.jacobi.eval_jacobi_batch(a, b, n, xs)[source]¶
Evaluates all jacobi polynomials with weights a,b up to degree n. xs is a numpy.array of points. Returns a two-dimensional array of points, where the rows correspond to the Jacobi polynomials and the columns correspond to the points.
- FIAT.jacobi.eval_jacobi_deriv(a, b, n, x)[source]¶
Evaluates the first derivative of P_{n}^{a,b} at a point x.
- FIAT.jacobi.eval_jacobi_deriv_batch(a, b, n, xs)[source]¶
Evaluates the first derivatives of all jacobi polynomials with weights a,b up to degree n. xs is a numpy.array of points. Returns a two-dimensional array of points, where the rows correspond to the Jacobi polynomials and the columns correspond to the points.
FIAT.kong_mulder_veldhuizen module¶
- class FIAT.kong_mulder_veldhuizen.KongMulderVeldhuizen(ref_el, degree)[source]¶
Bases:
CiarletElement
The “lumped” simplical finite element (NB: requires custom quad. “KMV” points to achieve a diagonal mass matrix).
References¶
Higher-order triangular and tetrahedral finite elements with mass lumping for solving the wave equation M. J. S. CHIN-JOE-KONG, W. A. MULDER and M. VAN VELDHUIZEN
HIGHER-ORDER MASS-LUMPED FINITE ELEMENTS FOR THE WAVE EQUATION W.A. MULDER
NEW HIGHER-ORDER MASS-LUMPED TETRAHEDRAL ELEMENTS S. GEEVERS, W.A. MULDER, AND J.J.W. VAN DER VEGT
FIAT.lagrange module¶
- class FIAT.lagrange.Lagrange(ref_el, degree)[source]¶
Bases:
CiarletElement
The Lagrange finite element. It is what it is.
FIAT.mardal_tai_winther module¶
Implementation of the Mardal-Tai-Winther finite elements.
- class FIAT.mardal_tai_winther.MardalTaiWinther(cell, degree=3)[source]¶
Bases:
CiarletElement
The definition of the Mardal-Tai-Winther element.
FIAT.mixed module¶
- class FIAT.mixed.MixedElement(elements, ref_el=None)[source]¶
Bases:
FiniteElement
A FIAT-like representation of a mixed element.
- Parameters
elements – An iterable of FIAT elements.
ref_el – The reference element (optional).
This object offers tabulation of the concatenated basis function tables along with an entity_dofs dict.
- mapping()[source]¶
Return a list of appropriate mappings from the reference element to a physical element for each basis function of the finite element.
FIAT.morley module¶
- class FIAT.morley.Morley(ref_el)[source]¶
Bases:
CiarletElement
The Morley finite element.
FIAT.nedelec module¶
- class FIAT.nedelec.Nedelec(ref_el, k, variant=None)[source]¶
Bases:
CiarletElement
Nedelec finite element
- Parameters
ref_el – The reference element.
k – The degree.
variant – optional variant specifying the types of nodes.
variant can be chosen from [“point”, “integral”, “integral(quadrature_degree)”] “point” -> dofs are evaluated by point evaluation. Note that this variant has suboptimal convergence order in the H(curl)-norm “integral” -> dofs are evaluated by quadrature rule. The quadrature degree is chosen to integrate polynomials of degree 5*k so that most expressions will be interpolated exactly. This is important when you want to have (nearly) curl-preserving interpolation. “integral(quadrature_degree)” -> dofs are evaluated by quadrature rule of degree quadrature_degree
- class FIAT.nedelec.NedelecDual2D(ref_el, degree, variant, quad_deg)[source]¶
Bases:
DualSet
Dual basis for first-kind Nedelec in 2D.
- class FIAT.nedelec.NedelecDual3D(ref_el, degree, variant, quad_deg)[source]¶
Bases:
DualSet
Dual basis for first-kind Nedelec in 3D.
FIAT.nedelec_second_kind module¶
- class FIAT.nedelec_second_kind.NedelecSecondKind(cell, k, variant=None)[source]¶
Bases:
CiarletElement
The H(curl) Nedelec elements of the second kind on triangles and tetrahedra: the polynomial space described by the full polynomials of degree k, with a suitable set of degrees of freedom to ensure H(curl) conformity.
- Parameters
ref_el – The reference element.
k – The degree.
variant – optional variant specifying the types of nodes.
variant can be chosen from [“point”, “integral”, “integral(quadrature_degree)”] “point” -> dofs are evaluated by point evaluation. Note that this variant has suboptimal convergence order in the H(curl)-norm “integral” -> dofs are evaluated by quadrature rule. The quadrature degree is chosen to integrate polynomials of degree 5*k so that most expressions will be interpolated exactly. This is important when you want to have (nearly) curl-preserving interpolation. “integral(quadrature_degree)” -> dofs are evaluated by quadrature rule of degree quadrature_degree
- class FIAT.nedelec_second_kind.NedelecSecondKindDual(cell, degree, variant, quad_deg)[source]¶
Bases:
DualSet
This class represents the dual basis for the Nedelec H(curl) elements of the second kind. The degrees of freedom (L) for the elements of the k’th degree are
d = 2:
vertices: None
edges: L(f) = f (x_i) * t for (k+1) points x_i on each edge
cell: L(f) = int f * g * dx for g in RT_{k-1}
d = 3:
vertices: None
edges: L(f) = f(x_i) * t for (k+1) points x_i on each edge
faces: L(f) = int_F f * g * ds for g in RT_{k-1}(F) for each face F
cell: L(f) = int f * g * dx for g in RT_{k-2}
Higher spatial dimensions are not yet implemented. (For d = 1, these elements coincide with the CG_k elements.)
FIAT.nodal_enriched module¶
- class FIAT.nodal_enriched.NodalEnrichedElement(*elements)[source]¶
Bases:
CiarletElement
NodalEnriched element is a direct sum of a sequence of finite elements. Dual basis is reorthogonalized to the primal basis for nodality.
- The following is equivalent:
the constructor is well-defined,
the resulting element is unisolvent and its basis is nodal,
the supplied elements are unisolvent with nodal basis and their primal bases are mutually linearly independent,
the supplied elements are unisolvent with nodal basis and their dual bases are mutually linearly independent.
FIAT.orthopoly module¶
orthopoly.py - A suite of functions for generating orthogonal polynomials and quadrature rules.
Copyright (c) 2014 Greg von Winckel All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Last updated on Wed Jan 1 14:29:25 MST 2014
Modified by David A. Ham (david.ham@imperial.ac.uk), 2016
- FIAT.orthopoly.gauss(alpha, beta)[source]¶
Compute the Gauss nodes and weights from the recursion coefficients associated with a set of orthogonal polynomials
Inputs: alpha - recursion coefficients beta - recursion coefficients
Outputs: x - quadrature nodes w - quadrature weights
Adapted from the MATLAB code by Walter Gautschi http://www.cs.purdue.edu/archives/2002/wxg/codes/gauss.m
- FIAT.orthopoly.jacobi(N, a, b, x, NOPT=1)[source]¶
JACOBI computes the Jacobi polynomials which are orthogonal on [-1,1] with respect to the weight w(x)=[(1-x)^a]*[(1+x)^b] and evaluate them on the given grid up to P_N(x). Setting NOPT=2 returns the L2-normalized polynomials
- FIAT.orthopoly.jacobiD(N, a, b, x, NOPT=1)[source]¶
JACOBID computes the first derivatives of the normalized Jacobi polynomials which are orthogonal on [-1,1] with respect to the weight w(x)=[(1-x)^a]*[(1+x)^b] and evaluate them on the given grid up to P_N(x). Setting NOPT=2 returns the derivatives of the L2-normalized polynomials
- FIAT.orthopoly.lobatto(alpha, beta, xl1, xl2)[source]¶
Compute the Lobatto nodes and weights with the preassigned nodea xl1,xl2
Inputs: alpha - recursion coefficients beta - recursion coefficients xl1 - assigned node location xl2 - assigned node location
Outputs: x - quadrature nodes w - quadrature weights
Based on the section 7 of the paper “Some modified matrix eigenvalue problems” by Gene Golub, SIAM Review Vol 15, No. 2, April 1973, pp.318–334
- FIAT.orthopoly.mm_log(N, a)[source]¶
MM_LOG Modified moments for a logarithmic weight function.
The call mm=MM_LOG(n,a) computes the first n modified moments of the logarithmic weight function w(t)=t^a log(1/t) on [0,1] relative to shifted Legendre polynomials.
- REFERENCE: Walter Gautschi,``On the preceding paper `A Legendre
polynomial integral’ by James L. Blue’’, Math. Comp. 33 (1979), 742-743.
Adapted from the MATLAB implementation: https://www.cs.purdue.edu/archives/2002/wxg/codes/mm_log.m
- FIAT.orthopoly.mod_chebyshev(N, mom, alpham, betam)[source]¶
Calcuate the recursion coefficients for the orthogonal polynomials which are are orthogonal with respect to a weight function which is represented in terms of its modifed moments which are obtained by integrating the monic polynomials against the weight function.
References¶
John C. Wheeler, “Modified moments and Gaussian quadratures” Rocky Mountain Journal of Mathematics, Vol. 4, Num. 2 (1974), 287–296
Walter Gautschi, “Orthogonal Polynomials (in Matlab) Journal of Computational and Applied Mathematics, Vol. 178 (2005) 215–234
Adapted from the MATLAB implementation: https://www.cs.purdue.edu/archives/2002/wxg/codes/chebyshev.m
- FIAT.orthopoly.polyval(alpha, beta, x)[source]¶
Evaluate polynomials on x given the recursion coefficients alpha and beta
- FIAT.orthopoly.rec_jaclog(N, a)[source]¶
Generate the recursion coefficients alpha_k, beta_k
P_{k+1}(x) = (x-alpha_k)*P_{k}(x) - beta_k P_{k-1}(x)
for the monic polynomials which are orthogonal on [0,1] with respect to the weight w(x)=x^a*log(1/x)
Inputs: N - polynomial order a - weight parameter
Outputs: alpha - recursion coefficients beta - recursion coefficients
Adated from the MATLAB code: https://www.cs.purdue.edu/archives/2002/wxg/codes/r_jaclog.m
- FIAT.orthopoly.rec_jacobi(N, a, b)[source]¶
Generate the recursion coefficients alpha_k, beta_k
P_{k+1}(x) = (x-alpha_k)*P_{k}(x) - beta_k P_{k-1}(x)
for the Jacobi polynomials which are orthogonal on [-1,1] with respect to the weight w(x)=[(1-x)^a]*[(1+x)^b]
Inputs: N - polynomial order a - weight parameter b - weight parameter
Outputs: alpha - recursion coefficients beta - recursion coefficients
Adapted from the MATLAB code by Dirk Laurie and Walter Gautschi http://www.cs.purdue.edu/archives/2002/wxg/codes/r_jacobi.m
- FIAT.orthopoly.rec_jacobi01(N, a, b)[source]¶
Generate the recursion coefficients alpha_k, beta_k for the Jacobi polynomials which are orthogonal on [0,1]
See rec_jacobi for the recursion coefficients on [-1,1]
Inputs: N - polynomial order a - weight parameter b - weight parameter
Outputs: alpha - recursion coefficients beta - recursion coefficients
Adapted from the MATLAB implementation: https://www.cs.purdue.edu/archives/2002/wxg/codes/r_jacobi01.m
FIAT.pointwise_dual module¶
- FIAT.pointwise_dual.compute_pointwise_dual(el, pts)[source]¶
Constructs a dual basis to the basis for el as a linear combination of a set of pointwise evaluations. This is useful when the prescribed finite element isn’t Ciarlet (e.g. the basis functions are provided explicitly as formulae). Alternately, the element’s given dual basis may involve differentiation, making run-time interpolation difficult in FIAT clients. The pointwise dual, consisting only of pointwise evaluations, will effectively replace these derivatives with (automatically determined) finite differences. This is exact on the polynomial space, but is an approximation if applied to functions outside the space.
- Parameters
el – a
FiniteElement
.pts – an iterable of points with the same length as el’s dimension. These points must be unisolvent for the polynomial space
- Returns
a :class DualSet
FIAT.polynomial_set module¶
- class FIAT.polynomial_set.ONPolynomialSet(ref_el, degree, shape=())[source]¶
Bases:
PolynomialSet
Constructs an orthonormal basis out of expansion set by having an identity matrix of coefficients. Can be used to specify ON bases for vector- and tensor-valued sets as well.
- class FIAT.polynomial_set.ONSymTensorPolynomialSet(ref_el, degree, size=None)[source]¶
Bases:
PolynomialSet
Constructs an orthonormal basis for symmetric-tensor-valued polynomials on a reference element.
- class FIAT.polynomial_set.PolynomialSet(ref_el, degree, embedded_degree, expansion_set, coeffs, dmats)[source]¶
Bases:
object
Implements a set of polynomials as linear combinations of an expansion set over a reference element. ref_el: the reference element degree: an order labeling the space embedded degree: the degree of polynomial expansion basis that
must be used to evaluate this space
- coeffs: A numpy array containing the coefficients of the expansion
basis for each member of the set. Coeffs is ordered by coeffs[i,j,k] where i is the label of the member, k is the label of the expansion function, and j is a (possibly empty) tuple giving the index for a vector- or tensor-valued function.
- FIAT.polynomial_set.mis(m, n)[source]¶
Returns all m-tuples of nonnegative integers that sum up to n.
FIAT.quadrature module¶
- class FIAT.quadrature.CollapsedQuadratureTetrahedronRule(ref_el, m)[source]¶
Bases:
QuadratureRule
Implements the collapsed quadrature rules defined in Karniadakis & Sherwin by mapping products of Gauss-Jacobi rules from the cube to the tetrahedron.
- class FIAT.quadrature.CollapsedQuadratureTriangleRule(ref_el, m)[source]¶
Bases:
QuadratureRule
Implements the collapsed quadrature rules defined in Karniadakis & Sherwin by mapping products of Gauss-Jacobi rules from the square to the triangle.
- class FIAT.quadrature.GaussJacobiQuadratureLineRule(ref_el, m)[source]¶
Bases:
QuadratureRule
Gauss-Jacobi quadature rule determined by Jacobi weights a and b using m roots of m:th order Jacobi polynomial.
- class FIAT.quadrature.GaussLegendreQuadratureLineRule(ref_el, m)[source]¶
Bases:
QuadratureRule
Produce the Gauss–Legendre quadrature rules on the interval using the implementation in numpy. This facilitates implementing discontinuous spectral elements.
The quadrature rule uses m points for a degree of precision of 2m-1.
- class FIAT.quadrature.GaussLobattoLegendreQuadratureLineRule(ref_el, m)[source]¶
Bases:
QuadratureRule
Implement the Gauss-Lobatto-Legendre quadrature rules on the interval using Greg von Winckel’s implementation. This facilitates implementing spectral elements.
The quadrature rule uses m points for a degree of precision of 2m-3.
- class FIAT.quadrature.QuadratureRule(ref_el, pts, wts)[source]¶
Bases:
object
General class that models integration over a reference element as the weighted sum of a function evaluated at a set of points.
- class FIAT.quadrature.RadauQuadratureLineRule(ref_el, m, right=True)[source]¶
Bases:
QuadratureRule
Produce the Gauss–Radau quadrature rules on the interval using an adaptation of Winkel’s Matlab code.
The quadrature rule uses m points for a degree of precision of 2m-1.
- class FIAT.quadrature.UFCTetrahedronFaceQuadratureRule(face_number, degree)[source]¶
Bases:
QuadratureRule
Highly specialized quadrature rule for the face of a tetrahedron, mapped from a reference triangle, used for higher order Nedelecs
- FIAT.quadrature.compute_gauss_jacobi_points(a, b, m)[source]¶
Computes the m roots of P_{m}^{a,b} on [-1,1] by Newton’s method. The initial guesses are the Chebyshev points. Algorithm implemented in Python from the pseudocode given by Karniadakis and Sherwin
FIAT.quadrature_element module¶
- class FIAT.quadrature_element.QuadratureElement(ref_el, points, weights=None)[source]¶
Bases:
FiniteElement
A set of quadrature points pretending to be a finite element.
- static is_nodal()[source]¶
True if primal and dual bases are orthogonal. If false, dual basis is not implemented or is undefined.
Subclasses may not necessarily be nodal, unless it is a CiarletElement.
FIAT.quadrature_schemes module¶
Quadrature schemes on cells
This module generates quadrature schemes on reference cells that integrate exactly a polynomial of a given degree using a specified scheme.
Scheme options are:
scheme=”default”
scheme=”canonical” (collapsed Gauss scheme)
Background on the schemes:
- Keast rules for tetrahedra:
Keast, P. Moderate-degree tetrahedral quadrature formulas, Computer Methods in Applied Mechanics and Engineering 55(3):339-348, 1986. http://dx.doi.org/10.1016/0045-7825(86)90059-9
- FIAT.quadrature_schemes.create_quadrature(ref_el, degree, scheme='default')[source]¶
Generate quadrature rule for given reference element that will integrate an polynomial of order ‘degree’ exactly.
For low-degree (<=6) polynomials on triangles and tetrahedra, this uses hard-coded rules, otherwise it falls back to a collapsed Gauss scheme on simplices. On tensor-product cells, it is a tensor-product quadrature rule of the subcells.
- Parameters
cell – The FIAT cell to create the quadrature for.
degree – The degree of polynomial that the rule should integrate exactly.
FIAT.raviart_thomas module¶
- class FIAT.raviart_thomas.RTDualSet(ref_el, degree, variant, quad_deg)[source]¶
Bases:
DualSet
Dual basis for Raviart-Thomas elements consisting of point evaluation of normals on facets of codimension 1 and internal moments against polynomials
- FIAT.raviart_thomas.RTSpace(ref_el, deg)[source]¶
Constructs a basis for the the Raviart-Thomas space (P_k)^d + P_k x
- class FIAT.raviart_thomas.RaviartThomas(ref_el, k, variant=None)[source]¶
Bases:
CiarletElement
The Raviart Thomas element
- Parameters
ref_el – The reference element.
k – The degree.
variant – optional variant specifying the types of nodes.
variant can be chosen from [“point”, “integral”, “integral(quadrature_degree)”] “point” -> dofs are evaluated by point evaluation. Note that this variant has suboptimal convergence order in the H(div)-norm “integral” -> dofs are evaluated by quadrature rule. The quadrature degree is chosen to integrate polynomials of degree 5*k so that most expressions will be interpolated exactly. This is important when you want to have (nearly) divergence-preserving interpolation. “integral(quadrature_degree)” -> dofs are evaluated by quadrature rule of degree quadrature_degree
FIAT.reference_element module¶
Abstract class and particular implementations of finite element reference simplex geometry/topology.
Provides an abstract base class and particular implementations for the reference simplex geometry and topology. The rest of FIAT is abstracted over this module so that different reference element geometry (e.g. a vertex at (0,0) versus at (-1,-1)) and orderings of entities have a single point of entry.
Currently implemented are UFC and Default Line, Triangle and Tetrahedron.
- class FIAT.reference_element.Cell(shape, vertices, topology)[source]¶
Bases:
object
Abstract class for a reference cell. Provides accessors for geometry (vertex coordinates) as well as topology (orderings of vertices that make up edges, facecs, etc.
- construct_subelement(dimension)[source]¶
Constructs the reference element of a cell subentity specified by subelement dimension.
- Parameters
dimension – tuple for tensor product cells, int otherwise
- get_connectivity()[source]¶
Returns a dictionary encoding the connectivity of the element.
The dictionary’s keys are the spatial dimensions pairs ((1, 0), (2, 0), (2, 1), …) and each value is a list with entities of second dimension ordered by local dim0-dim1 numbering.
- get_dimension()[source]¶
Returns the subelement dimension of the cell. For tensor product cells, this a tuple of dimensions for each cell in the product. For all other cells, this is the same as the spatial dimension.
- get_entity_transform(dim, entity_i)[source]¶
Returns a mapping of point coordinates from the entity_i-th subentity of dimension dim to the cell.
- Parameters
dim – tuple for tensor product cells, int otherwise
entity_i – entity number (integer)
- class FIAT.reference_element.DefaultLine[source]¶
Bases:
Simplex
This is the reference line with vertices (-1.0,) and (1.0,).
- class FIAT.reference_element.DefaultTetrahedron[source]¶
Bases:
Simplex
This is the reference tetrahedron with vertices (-1,-1,-1), (1,-1,-1),(-1,1,-1), and (-1,-1,1).
- class FIAT.reference_element.DefaultTriangle[source]¶
Bases:
Simplex
This is the reference triangle with vertices (-1.0,-1.0), (1.0,-1.0), and (-1.0,1.0).
- class FIAT.reference_element.IntrepidTetrahedron[source]¶
Bases:
Simplex
This is the reference tetrahedron with vertices (0,0,0), (1,0,0),(0,1,0), and (0,0,1) used in the Intrepid project.
- class FIAT.reference_element.IntrepidTriangle[source]¶
Bases:
Simplex
This is the Intrepid triangle with vertices (0,0),(1,0),(0,1)
- class FIAT.reference_element.Simplex(shape, vertices, topology)[source]¶
Bases:
Cell
Abstract class for a reference simplex.
- compute_edge_tangent(edge_i)[source]¶
Computes the nonnormalized tangent to a 1-dimensional facet. returns a single vector.
- compute_face_edge_tangents(dim, entity_id)[source]¶
Computes all the edge tangents of any k-face with k>=1. The result is a array of binom(dim+1,2) vectors. This agrees with compute_edge_tangent when dim=1.
- compute_face_tangents(face_i)[source]¶
Computes the two tangents to a face. Only implemented for a tetrahedron.
- compute_normalized_edge_tangent(edge_i)[source]¶
Computes the unit tangent vector to a 1-dimensional facet
- compute_normalized_tangents(dim, i)[source]¶
Computes tangents in any dimension based on differences between vertices and the first vertex of the i:th facet of dimension dim. Returns a (possibly empty) list. These tangents are normalized to have unit length.
- compute_reference_normal(facet_dim, facet_i)[source]¶
Returns the unit normal in infinity norm to facet_i.
- compute_scaled_normal(facet_i)[source]¶
Returns the unit normal to facet_i of scaled by the volume of that facet.
- compute_tangents(dim, i)[source]¶
Computes tangents in any dimension based on differences between vertices and the first vertex of the i:th facet of dimension dim. Returns a (possibly empty) list. These tangents are NOT normalized to have unit length.
- get_dimension()[source]¶
Returns the subelement dimension of the cell. Same as the spatial dimension.
- get_entity_transform(dim, entity)[source]¶
Returns a mapping of point coordinates from the entity-th subentity of dimension dim to the cell.
- Parameters
dim – subentity dimension (integer)
entity – entity number (integer)
- class FIAT.reference_element.TensorProductCell(*cells)[source]¶
Bases:
Cell
A cell that is the product of FIAT cells.
- compute_reference_normal(facet_dim, facet_i)[source]¶
Returns the unit normal in infinity norm to facet_i of subelement dimension facet_dim.
- construct_subelement(dimension)[source]¶
Constructs the reference element of a cell subentity specified by subelement dimension.
- Parameters
dimension – dimension in each “direction” (tuple)
- contains_point(point, epsilon=0)[source]¶
Checks if reference cell contains given point (with numerical tolerance).
- get_dimension()[source]¶
Returns the subelement dimension of the cell, a tuple of dimensions for each cell in the product.
- class FIAT.reference_element.UFCHexahedron[source]¶
Bases:
Cell
This is the reference hexahedron with vertices (0.0, 0.0, 0.0), (0.0, 0.0, 1.0), (0.0, 1.0, 0.0), (0.0, 1.0, 1.0), (1.0, 0.0, 0.0), (1.0, 0.0, 1.0), (1.0, 1.0, 0.0) and (1.0, 1.0, 1.0).
- compute_reference_normal(facet_dim, facet_i)[source]¶
Returns the unit normal in infinity norm to facet_i.
- construct_subelement(dimension)[source]¶
Constructs the reference element of a cell subentity specified by subelement dimension.
- Parameters
dimension – subentity dimension (integer)
- contains_point(point, epsilon=0)[source]¶
Checks if reference cell contains given point (with numerical tolerance).
- get_dimension()[source]¶
Returns the subelement dimension of the cell. Same as the spatial dimension.
- class FIAT.reference_element.UFCInterval[source]¶
Bases:
UFCSimplex
This is the reference interval with vertices (0.0,) and (1.0,).
- class FIAT.reference_element.UFCQuadrilateral[source]¶
Bases:
Cell
This is the reference quadrilateral with vertices (0.0, 0.0), (0.0, 1.0), (1.0, 0.0) and (1.0, 1.0).
- compute_reference_normal(facet_dim, facet_i)[source]¶
Returns the unit normal in infinity norm to facet_i.
- construct_subelement(dimension)[source]¶
Constructs the reference element of a cell subentity specified by subelement dimension.
- Parameters
dimension – subentity dimension (integer)
- contains_point(point, epsilon=0)[source]¶
Checks if reference cell contains given point (with numerical tolerance).
- get_dimension()[source]¶
Returns the subelement dimension of the cell. Same as the spatial dimension.
- class FIAT.reference_element.UFCSimplex(shape, vertices, topology)[source]¶
Bases:
Simplex
- construct_subelement(dimension)[source]¶
Constructs the reference element of a cell subentity specified by subelement dimension.
- Parameters
dimension – subentity dimension (integer)
- class FIAT.reference_element.UFCTetrahedron[source]¶
Bases:
UFCSimplex
This is the reference tetrahedron with vertices (0,0,0), (1,0,0),(0,1,0), and (0,0,1).
- class FIAT.reference_element.UFCTriangle[source]¶
Bases:
UFCSimplex
This is the reference triangle with vertices (0.0,0.0), (1.0,0.0), and (0.0,1.0).
- FIAT.reference_element.compute_unflattening_map(topology_dict)[source]¶
This function returns unflattening map for the given tensor product topology dict.
- FIAT.reference_element.default_simplex(spatial_dim)[source]¶
Factory function that maps spatial dimension to an instance of the default reference simplex of that dimension.
- FIAT.reference_element.flatten_entities(topology_dict)[source]¶
This function flattens topology dict of TensorProductCell and entity_dofs dict of TensorProductElement
- FIAT.reference_element.flatten_reference_cube(ref_el)[source]¶
This function flattens a Tensor Product hypercube to the corresponding UFC hypercube
- FIAT.reference_element.lattice_iter(start, finish, depth)[source]¶
Generator iterating over the depth-dimensional lattice of integers between start and (finish-1). This works on simplices in 1d, 2d, 3d, and beyond
- FIAT.reference_element.linalg_subspace_intersection(A, B)[source]¶
Computes the intersection of the subspaces spanned by the columns of 2-dimensional arrays A,B using the algorithm found in Golub and van Loan (3rd ed) p. 604. A should be in R^{m,p} and B should be in R^{m,q}. Returns an orthonormal basis for the intersection of the spaces, stored in the columns of the result.
- FIAT.reference_element.make_affine_mapping(xs, ys)[source]¶
Constructs (A,b) such that x –> A * x + b is the affine mapping from the simplex defined by xs to the simplex defined by ys.
- FIAT.reference_element.make_lattice(verts, n, interior=0)[source]¶
Constructs a lattice of points on the simplex defined by verts. For example, the 1:st order lattice will be just the vertices. The optional argument interior specifies how many points from the boundary to omit. For example, on a line with n = 2, and interior = 0, this function will return the vertices and midpoint, but with interior = 1, it will only return the midpoint.
- FIAT.reference_element.tuple_sum(tree)[source]¶
This function calculates the sum of elements in a tuple, it is needed to handle nested tuples in TensorProductCell. Example: tuple_sum(((1, 0), 1)) returns 2 If input argument is not the tuple, returns input.
FIAT.regge module¶
Implementation of the generalized Regge finite elements.
- class FIAT.regge.Regge(cell, degree)[source]¶
Bases:
CiarletElement
The generalized Regge elements for symmetric-matrix-valued functions. REG(r) in dimension n is the space of polynomial symmetric-matrix-valued functions of degree r or less with tangential-tangential continuity.
FIAT.restricted module¶
- class FIAT.restricted.RestrictedElement(element, indices=None, restriction_domain=None)[source]¶
Bases:
CiarletElement
Restrict given element to specified list of dofs.
FIAT.serendipity module¶
- class FIAT.serendipity.Serendipity(ref_el, degree)[source]¶
Bases:
FiniteElement
- entity_closure_dofs()[source]¶
Return the map of topological entities to degrees of freedom on the closure of those entities for the finite element.
- entity_dofs()[source]¶
Return the map of topological entities to degrees of freedom for the finite element.
- tabulate(order, points, entity=None)[source]¶
Return tabulated values of derivatives up to given order of basis functions at given points.
- Parameters
order – The maximum order of derivative.
points – An iterable of points.
entity – Optional (dimension, entity number) pair indicating which topological entity of the reference element to tabulate on. If
None
, default cell-wise tabulation is performed.
- FIAT.serendipity.unisolvent_pts_hex(K, deg)[source]¶
Gives a set of unisolvent points for the hex serendipity space of order deg. The S element is not dual to these nodes, but a dual basis can be constructed from them.
FIAT.tensor_product module¶
- class FIAT.tensor_product.FlattenedDimensions(element)[source]¶
Bases:
FiniteElement
A wrapper class that flattens entity dimensions of a FIAT element defined on a TensorProductCell to one with quadrilateral/hexahedron entities. TensorProductCell has dimension defined as a tuple of factor element dimensions (i, j) in 2D and (i, j, k) in 3D. Flattened dimension is a sum of the tuple elements.
- get_nodal_basis()[source]¶
Return the nodal basis, encoded as a PolynomialSet object, for the finite element.
- is_nodal()[source]¶
True if primal and dual bases are orthogonal. If false, dual basis is not implemented or is undefined.
Subclasses may not necessarily be nodal, unless it is a CiarletElement.
- class FIAT.tensor_product.TensorProductElement(A, B)[source]¶
Bases:
FiniteElement
Class implementing a finite element that is the tensor product of two existing finite elements.
- get_nodal_basis()[source]¶
Return the nodal basis, encoded as a PolynomialSet object, for the finite element.
- is_nodal()[source]¶
True if primal and dual bases are orthogonal. If false, dual basis is not implemented or is undefined.
Subclasses may not necessarily be nodal, unless it is a CiarletElement.
Module contents¶
FInite element Automatic Tabulator – supports constructing and evaluating arbitrary order Lagrange and many other elements. Simplices in one, two, and three dimensions are supported.