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
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
Therefore it needs to be changed so that it is defined on new
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())))
quadrilateral_element is defined on UFCQuadrilateral and can be easily used by FFC to generate C++ code for assembling matrices.