Variational formulations in C++

Finite Element Embedded Library in C++

Feel++ is a C++ library for partial differential equation solves using generalized Galerkin methods such as the finite element method, the h/p finite element method, the spectral element method or the reduced basis method.

Feel++ is currently used in various projects hosted by Cemosis. This includes

  • Fluid structure interaction with application to blood flows
  • High field magnets simulation
  • Optical tomography
  • Aerodynamics and aerothermal flows
  • Scalable preconditioners

Quick-start Laplacian: Solve for \(-\Delta u = 1 \mbox{ in } \Omega=[0,1]^2, u = 0 \mbox{ on }\partial \Omega\)

#include <feel/feel.hpp>

int main(int argc, char**argv )
     using namespace Feel;

     Environment env( _argc=argc, _argv=argv,
                                   _author="Feel++ Consortium",

    auto mesh = loadMesh(_mesh=new Mesh<Simplex<2>>);
    auto Vh = Pch<2>( mesh );
    auto u = Vh->element();
    auto v = Vh->element();

    auto l = form1( _test=Vh );
    l = integrate(_range=elements(mesh),

    auto a = form2( _trial=Vh, _test=Vh);
    a = integrate(_range=elements(mesh),
                  _expr=gradt(u)*trans(grad(v)) );
    a+=on(_range=boundaryfaces(mesh), _rhs=l, _element=u, _expr=cst(0.) );

    auto e = exporter( _mesh=mesh );
    e->add( "u", u );