[Trilinos-Users] Re: More Complicated Use of Export (sorry for double post...)

David Neckels dneckels at ucar.edu
Mon Dec 10 10:17:37 MST 2007

Hi Davood (David?),

I am a only a trilinos user, but have recently been through this exact 
situation and might be able to help:

1) Create an Epetra map that partitions your dofs among the processors 
(don't include the shared nodes).

2) Create an Epetra_FECrsMatrix using this map. Also, create an 
Epetra_FEVector for your RHS with this map.

3) Call InsertGlobalValues to build the sparsity pattern of your matrix. 
Feel free to include any non-local (shared) dofs both

as rows and columns here. Make sure your InsertGlobalValues signature 
matches one from the FECrsMatrix, not the base class CrsMatrix.

4) During assembly, call SumIntoGlobalValues using both shared and local 
dofs. Again, make sure you are calling one of the functions from the 
derived FECrsMatrix, not the base class (else things will fail). Also 
use SumIntoGlobalValues for the RHS vector.

5) call matrix->GlobalAssemble(), rhs->GlobalAssemble(). These functions 
share the data and perform the communications that you were attempting, 

6) Done.

-David Neckels.

trilinos-users-request at software.sandia.gov wrote:

> Send Trilinos-Users mailing list submissions to
>     trilinos-users at software.sandia.gov
> To subscribe or unsubscribe via the World Wide Web, visit
>     http://software.sandia.gov/mailman/listinfo/trilinos-users
> or, via email, send a message with subject or body 'help' to
>     trilinos-users-request at software.sandia.gov
> You can reach the person managing the list at
>     trilinos-users-owner at software.sandia.gov
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Trilinos-Users digest..."
> Today's Topics:
>    1. More Complicated Use of Export (Davood Ansari)
> ----------------------------------------------------------------------
> Message: 1
> Date: Sun, 9 Dec 2007 14:16:57 +0800
> From: "Davood Ansari" <david.ansari at gmail.com>
> Subject: [Trilinos-Users] More Complicated Use of Export
> To: trilinos-users at software.sandia.gov
> Message-ID:
>     <dc22725d0712082216u20f2a5c1v2375357fd639f706 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> Hi
> I am new to Trilinos.
> I am assembling a FEM CRS matrix in Epetra.
> I have divided the matrix in row section by the number of available
> processors.
> Now when each process starts the Assembly of the global matrix it come to
> the point where is has to update a row of the global matrix which does 
> not
> to
> the process itself. Thus it cannot be added to that portion of the global
> matrix
> using matrix attribute methods etc. Rather I think I have to send this 
> row
> of
> the matrix to the appropriate process to be assembled there. This 
> involves
> in
> rather complicated MPI communications. What I am wondering is that there
> should
> be some kind of Export (Import) functionality for Epetra_Crs_Matrix to
> handle
> the situation. Please advise !
> Davood
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> http://software.sandia.gov/mailman/private/trilinos-users/attachments/20071209/31bdd092/attachment-0001.html 
> ------------------------------
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
> End of Trilinos-Users Digest, Vol 28, Issue 5
> *********************************************

More information about the Trilinos-Users mailing list