Meet new class for FIAT!

Jul 21, 2017 00:00 · 194 words · 1 minute read

FIAT (FInite element Automatic Tabulator) is a Python package for defining and evaluating a wide range of different finite element basis functions for numerical partial differential equations.

FIAT uses a object-oriented infrastructure to define finite elements. For example, the Lagrange module contains a class Lagrange modeling the Lagrange finite element family. This class is a subclass of some FiniteElement class contained in another module.

FIAT has TensorProductElement class to define products of other elements. Lagrangian finite element defined on a quadrilateral cell is a tensor product of two Lagrange elements defined on intervals.

from FIAT.tensor_product import TensorProductElement
from FIAT.lagrange import Lagrange
from FIAT.reference_element import UFCInterval as interval
quadrilateral_element = TensorProductElement(Lagrange(interval()), Lagrange(interval()))

However, as discussed in the previous post this element has tuple structure for dimensions as it is defined on a TensorProductCell Therefore it needs to be changed so that it is defined on new UFCHexahedron and UFCQuadrilateral.

Newly implemented wrapper class FlattenedDimensions does that.

from FIAT.tensor_product import TensorProductElement, FlattenedDimensions
from FIAT.lagrange import Lagrange
from FIAT.reference_element import UFCInterval as interval
quadrilateral_element = FlattenedDimensions(TensorProductElement(Lagrange(interval()), Lagrange(interval())))

Now quadrilateral_element is defined on UFCQuadrilateral and can be easily used by FFC to generate C++ code for assembling matrices.