Feel++

Feel++
Informations
Environnement Linux, Mac OS X.
Type Calcul numérique
Licence LGPL/GPL
Site web www.feelpp.org

Feel++ est un langage dédié (DSEL) à la résolution d'équations différentielles partielles à l'aide de méthodes de Galerkine généralisées ,,, (i.e. fem, hp/fem, méthodes spectrales) écrit en C++.

Histoire

Exemple

Voici un exemple de programme pour résoudre un laplacien avec le choix d'une condition de type dirichlet homogène sur un carré unité (voir Manuel en ligne Feel++).

#include <feel/feel.hpp>
using namespace Feel;

int main(int argc, char**argv )
{
    Environment env( _argc=argc, _argv=argv,
                     _desc=feel_options(),
                     _about=about(_name="mylaplacian",
                                  _author="Feel++ Consortium",
                                  _email="feelpp-devel at feelpp.org"));
    // create mesh
    auto mesh = unitSquare();

    // function space
    auto Vh = Pch<1>( mesh );
    auto u = Vh->element();
    auto v = Vh->element();

    // left hand side
    auto a = form2( _trial=Vh, _test=Vh );
    a = integrate(_range=elements(mesh), _expr=gradt(u)*trans(grad(v)) );

    // right hand side
    auto l = form1( _test=Vh );
    l = integrate(_range=elements(mesh), _expr=id(v));

    // boundary condition
    a+=on(_range=boundaryfaces(mesh), _rhs=l, _element=u, _expr=constant(0.) );

    // solve the equation a(u,v) = l(v)
    a.solve(_rhs=l,_solution=u);

    // export results
    auto e = exporter( _mesh=mesh );
    e->add( "u", u );
    e->save();
}

Voir aussi

Articles connexes