Galeri Logo

Galeri: Finite Element and Matrix Generation Package

The Trilinos package Galeri contains a suite of utilities and classes to generate a variety of (distributed) linear systems. Galeri's functionalities are very close to that of the MATLAB's gallery() function.

Several well-know finite element and finite difference matrices can be generated using only a few simple code lines. For a quick overview of Galeri, see here. You can also give a look to the example below, which generates a matrix corresponding to a nx * ny Cartesian grid, divided across mx * my processors (so that Comm.NumProc() = mx * my).:

int main(int argv, char* argc[])
{
#ifdef HAVE_MPI
  MPI_Init(&argv, &argc);
  Epetra_MpiComm Comm(MPI_COMM_WORLD);
#else
  Epetra_SerialComm Comm;
#endif

  Teuchos::ParameterList GaleriList;
  GaleriList.set("nx", 10 * Comm.NumProc());
  GaleriList.set("ny", 10);

  GaleriList.set("mx", Comm.NumProc());
  GaleriList.set("my", 1);

  Epetra_Map* Map = CreateMap("Cartesian2D", Comm, GaleriList);
  Epetra_RowMatrix* Matrix = CreateCrsMatrix("Laplace2D", Map, GaleriList);
  ...
#ifdef HAVE_MPI
  MPI_Finalize();
#endif
}
And that's it! (The code snippet above only misses the header files; see the examples in the distribution for a compilable code.) A list of supported matrices is reported here. The supported Epetra_Map's are instead here.

Galeri also contains a nice and simple finite element code, to be used for scalar and vector elliptic-type equations using Galerkin and SUPG discretization techniques, on both 2D and 3D unstructured grids, composed by triangles, quads, tetrahedra and hexahedra.

Galeri's technical documentation is maintained using Doxygen; click here to access the latest Doxygen documentation.