Utilities

Creating an Epetra_VbrMatrix

An Epetra_CrsMatrix can be "extended" to form an Epetra_VbrMatrix. This may be useful to test a package using a block matrix. Let CrsMatrix be an already filled Epetra_CrsMatrix*, and NumPDEs the dimension of each block in the resulting VBR matrix. The creation of the Epetra_VbrMatrix is performed by the following code:
#include "Galeri_Utils.h"
...
Epetra_VbrMatrix* VbrMatrix = 0;
VbrMatrix = Galeri.Create(CrsMatrix, NumDPEs);

Creating the Coordinates of a Cartesian Grid

Given a Cartesian grid, it is possible to create an Epetra_MultiVector, containing the coordinates of each node. Simply do:
#include "Galeri_Utils.h"
...
string CoordType = "2D";
Epetra_Map* Map; // already created
Teuchos::ParameterList List;
List.set("nx", 10);
List.set("ny", 10);
List.set("lx", 1.0); // length of X-axis
List.set("ly", 1.0); // length of Y-axis

Epetra_MultiVector* Coord = 0;
Coord = Galeri.CreateCartesianCoordinates(CoordType, Map, List);
Other valid values for CoordType are "1D" and "3D".
Generated on Wed May 12 21:50:01 2010 for Galeri by  doxygen 1.4.7