[Trilinos-Users] Epetra_CrsMatrix constructor

John Mitchell jamitch at sandia.gov
Mon Mar 15 17:43:19 MDT 2010


After more thought, I have come to realize that this may be even more 
complex when I go to populate the matrix.

First, I need to have separate RowMap and ColMap for construction of the 
Epetra_CrsMatrix since rows will be based upon owned points and columns 
will be based upon owned and shared.

Then, when I go to populate the matrix for a row, I would have to supply 
a 3x3 matrix since I have 3 dofs per element in my maps.

Any thoughts/feedback would be appreciated.  Thanks,
John

John Mitchell wrote:
> 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
>
>
>
>
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
>   



More information about the Trilinos-Users mailing list