[Trilinos-Users] How to import non-local CSR matrix elements?
Williams, Alan B
william at sandia.gov
Thu Jan 6 07:44:42 MST 2011
Riccardo,
Unfortunately Epetra_FECrsMatrix only supports assembly of non-local data but not retrieval of non-local data afterwards.
But you can do an import operation on matrices that is the same as what you've done for vectors.
Alan
> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-
> users-bounces at software.sandia.gov] On Behalf Of rrossi at cimne.upc.edu
> Sent: Wednesday, January 05, 2011 4:49 PM
> To: trilinos-users at software.sandia.gov
> Subject: [Trilinos-Users] How to import non-local CSR matrix elements?
>
> Dear list,
>
> i am dealing with a somewhat non standard problem: i assembled an
> Epetra_FECrsMatrix, and i would need
>
> to get a copy of the values stored in the matrix. To explain better,
> suppose that i have the matrix
>
> 2 3 * *
>
> 4 5 6 *
>
> * * 1 *
>
> * * 2 1
>
> where the processor 1 owns the first two lines and the processor 2 owns
> the second ones
>
> i would like to be able (as process 2) to query for the values that
> correspond to a given set of indices, which are however owned by
> processor
> 1,
>
> say
>
> (1,1)
>
> (2,1)
>
> from having a look to the documentation i found that the most similar
> thing appears to be the function
>
> int ExtractGlobalRowCopy [1] (int GlobalRow, int Length, int
>
> however this is only defined for CRSMAtrix and does not allow accessing
> to non local data.
>
> For Epetra_FEVector i am currently doing the following to get a copy
> of
> both local and non local data:
> //defining the importer class
>
> Epetra_Import importer( dof_update_map, Dx.Map() );
>
> //defining a temporary vector to gather all of the values
> needed
>
> Epetra_Vector temp( importer.TargetMap() );
>
> //importing in the new temp vector the values
>
> int ierr = temp.Import(Dx,importer,Insert);
>
> if(ierr != 0) KRATOS_ERROR(std::logic_error,"Epetra
> failure
> found","");
>
>
> Is it possible to do something similar for my problem?
> Any help/pointer to the correct documentation would be very welcome
>
> thank you all in advance
> Riccardo
>
>
>
>
>
> _______________________________________________
> 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