[Trilinos-Users] Epetra_CrsMatrix-aztecOO: repeated indeces

Michael A Heroux maherou at sandia.gov
Mon Oct 3 10:07:14 MDT 2005


Simone,

When you specify the column map argument to the Epetra_CrsMatrix
constructor, it acts as a filter, ignoring matrix entries that are inserted
but not listed in the map on the calling processor.  This is why you are
missing off-block values in B.  Generally speaking it is good to let the
matrix object figure out the column map on it own.  You can do this by
constructing the matrix as:

Epetra_CrsMatrix A(Copy,MapA,3);

You will still want to export A to B, but once again, don't specify the
column map of B.  

As an alternative, you could look at using the FECrsMatrix class, since it
is more efficient at supporting this type of matrix construction.

Mike

> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov 
> [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf 
> Of Simone Deparis
> Sent: Monday, October 03, 2005 10:29 AM
> To: trilinos-users at software.sandia.gov
> Subject: [Trilinos-Users] Epetra_CrsMatrix-aztecOO: repeated indeces
> 
> Hi,
> I have
> 
>   Epetra_CrsMatrix  A(Copy,MapA,MapA,3)
>   FillComplete(MapV,MapV);
> 
>   Epetra_FEVector x(MapV);
>   Epetra_FEVector y(MapV);
> 
> mapA has repeated indeces {0 1 2}, {2 3 4} mapV has no 
> reapeated indeces {0 1 2}, {3 4}
> 
> I would like to use aztecOO to solve Ax=y,
> 
>   Epetra_LinearProblem Problem(&A,&x,&b);
>   AztecOO Solver(Problem);
> 
> but I get the following error
> (probably because of the repeating indeces in MapA):
> 
> AZ_extract_comm_info: Received elements must be stored after
>                    all 3 local elements
> 
> I then tried to copy A to B, a matrix without repeated 
> indeces, using the exporter,
> 
>   Epetra_CrsMatrix  B(Copy,MapV,MapBcol,3)
>   Comm.Barrier();
>   B.Export(A,*(A.Exporter()),Add);
>   Comm.Barrier();
> 
> mapBcol: each processor has all the column {0 1 2 3 4 5}, {0 
> 1 2 3 4 5} The problem here is that "off-block" values are lost:
> 
> >> full(A)
> 
> ans =
> 
>      2    -2     0     0     0
>     -1     2    -2     0     0
>      0    -1     6    -4     0
>      0     0    -2     4    -4
>      0     0     0    -2     4
> 
> >> full(B)
> 
> ans =
> 
>      2    -2     0     0     0
>     -1     2    -2     0     0
>      0    -1     6     0     0
>      0     0     0     4    -4
>      0     0     0    -2     4
> 
> 
> Somebody as a suggestion, please?
> Thank you
> Simone
> 
> 
> 
> _______________________________________________
> 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