13.07.2015 Views

Part II Implementation - FEniCS Project

Part II Implementation - FEniCS Project

Part II Implementation - FEniCS Project

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FIAT: Numerical Construction of Finite Element Basis FunctionsMore generally in FIAT, a set of polynomials {p i } will need to be evaulatedsimultaneously, such as evaluating all of the members of a finite element basis.The coefficients of the set of polynomials may be stored in the rows of a matrixC, so thatC ij = R(p i ) j .Tabulating this entire set of polynomials at a point x is simply obtained bymatrix-vector multiplication. Let Φ i be as in (15.1). Then,p i (x) = C ij Φ j .The basis functions are typically needed at a set of points, such as those of aquadrature rule. Let {x j } now be a collection of points in K and letΦ ij = φ i (x j ),where the rows of Φ run over the basis functions and the columns over the collectionof points. As before, the set of polynomials may be tabulated at all thepoints byp i (x j ) = C ik Φ kj ,which is just the matrix product CΦ and may may be efficiently carried out by alibrary operation, such as the numpy.dot wrapper to level 3 BLAS.Finite element computation also requires the evaluation of derivatives ofpolynomials. In a symbolic context, differentiation presents no particular difficulty,but working in a numerical context requires some special care.For some differential operator D, the derivatives Dφ i are computed at apointx, any polynomial p = R(p) i φ i may be differentiated at x byDp(x) = R(p) i (Dφ i ),which is exactly analagous to (15.2). By analogy, sets of polynomials may bedifferentiated at sets of points just like evaluation.TheformulaeinAlgorithm5andtheirtetrahedralcounterpartarefairly easyto differentiate, but derivatives may also be obtained through automatic differentiation.Some experimental support for this using the AD tools in ScientificPython has been developed in an unreleased version of FIAT.The released version of FIAT currently evaluates derivatives in terms of linearoperators,whichallowsthecoordinatesingularityinthestandardrecurrencerelations to be avoided. For each Cartesian partial derivative ∂∂x k, a matrix D k iscalculated such that ( ∂pR = D∂xijR(p)k)ik j .Then, derivatives of sets of polynomials may be tabulated by premultiplying thecoefficient matrix C with such a D k matrix.118

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!