SyFi

From The FEniCS project

The finite element method (FEM) package SyFi is a C++ library built on top of the symbolic math library GiNaC. The name SyFi stands for Symbolic Finite Elements. The package provides polygonal domains, polynomial spaces, and degrees of freedom as symbolic expressions that are easily manipulated. This makes it easy to define finite elements and variational forms. These elements and forms are then used to generate efficient C++ code.

SyFi is similar to FFC in the sense that it has a compiler that generates UFC code based on variational forms and finite elements. It is also similar to FIAT in the sense that it implements many different finite elements.

The following example shows the computation of the element matrix for the Poisson problem in Python,

triangle = ReferenceTriangle()
fe = LagrangeFE(triangle, 3)
A = {}
for i in range(0, fe.nbf()):
  for j in range(0, fe.nbf()):
    integrand = inner(grad(fe.N(i)), grad(fe.N(j)))
    A[(i,j)] = triangle.integrate(integrand)

Authors

Martin Alnæs and Kent-Andre Mardal

License

SyFi is licensed under the GNU GPL.

Dependencies and requirements

SyFi depends on GiNaC and swiginac.

Personal tools