[Trilinos-Users] Epetra_CrsMatrix constructor

John Mitchell jamitch at sandia.gov
Mon Mar 15 16:23:41 MDT 2010


Hi,

I'm working on assembly of a matrix for use in a "LinearProblem".

I have a set of N points with 3 degrees of freedom per point.

int numPoints = N;
int ndf = 3;
int * globalIds = myIds();
Epetra_Comm comm = myCommunicator();
Epetra_BlockMap myMap(-1,numPoints, globalIds, ndf, 0,comm);

I have successfully used the above map to create Epetra_Vectors and do 
parallel calculations and assemblies.

Now I want to create an Epetra_CrsMatrix.  However, I do not find any 
constructors with "Epetra_BlockMap"  -- there are only constructors with 
Epetra_Map?

Does that mean I have to create another map that has 3 times the number 
of entries in it?  Or is there some other approach?  I do notice that 
there is a constructor using Epetra_CrsGraph.  Is that the route that I 
need to take?

As with the Epetra_Vector, it would be really nice to simply use the 
Epetra_BlockMap for Epetra_CrsMatrix since it has all the information 
embedded in it.  But if the Epetra_CrsGraph works that is fine too as it 
uses the identical constructor except that it take an Epetra_BlockMap.

Thanks,
John







More information about the Trilinos-Users mailing list