Logo
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ on Travis-CI Feel++ on Twitter Feel++ on YouTube Feel++ community
 All Classes Files Functions Variables Typedefs Pages
Loading a Mesh

The next step is to load a mesh. The source code is available in mymesh.cpp.

Step by step explanations

Loading a Mesh in 2D
The laodMesh function has a "_name" option set by default as the default value of the "--gmsh.filename" option.
// create a mesh with GMSH using Feel++ geometry tool
auto mesh = loadMesh(_mesh=new Mesh<Simplex<2>>);
Loading2DMeshExport Exporting the Mesh for visualisation
// export results for post processing
auto e = exporter( _mesh=mesh );
e->addRegions();
e->save();

Some results

Complete code

#include <feel/feelfilters/loadmesh.hpp>
#include <feel/feelfilters/exporter.hpp>
using namespace Feel;
int main( int argc, char** argv )
{
// initialize Feel++ Environment
Environment env( _argc=argc, _argv=argv,
_about=about( _name="mymesh" ,
_author="Feel++ Consortium",
_email="feelpp-devel@feelpp.org" ) );
// create a mesh with GMSH using Feel++ geometry tool
auto mesh = loadMesh(_mesh=new Mesh<Simplex<2>>);
#if 0
// export results for post processing
auto e = exporter( _mesh=mesh );
e->addRegions();
e->save();
#endif
} // main