[Trilinos-Users] Trilinos-Users Digest, Vol 38, Issue 20

Riccardo Rossi rrossi at cimne.upc.edu
Mon Oct 27 02:07:09 MDT 2008


Dear Kevin,

thank you for your explanation. The Pointer you gave me was fairly
understandable and it represents exactly the sort of things i need to
do. I think i can use the approach you propose as it is.

I have however another question (hopefully the last) before diving into
the implementation of my interface:

imagine i define all of my vectors as having the overlapping. Am i
correct when i say that in any case the Assembly would be performed
correctly? 

If so wouldn't be easier for me to define a single map with overlapping
so that even "ghost" elements have a local copy?

i understand this is not the most general approach however the thing i
am trying to do is simply

build and solve a system 
A dx = rhs

and then on each node, having dx known update my database.

Would this approach have a performance penalty over what you propose?



thanks a lot 
Riccardo



On Sun, 2008-10-26 at 12:00 -0600,
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. optimal choice of maps for finite elements	assembly and
>       update (rrossi at cimne.upc.edu)
>    2. Re: optimal choice of maps for finite elements assembly and
>       update (Kevin Long)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sun, 26 Oct 2008 16:38:30 +0100 (CET)
> From: rrossi at cimne.upc.edu
> Subject: [Trilinos-Users] optimal choice of maps for finite elements
> 	assembly and update
> To: trilinos-users at software.sandia.gov
> Message-ID:
> 	<47237.87.221.119.84.1225035510.squirrel at webmail.cimne.upc.es>
> Content-Type: text/plain; charset=iso-8859-1
> 
> Dear All
> 
> I am trying to link my finite element code to the Trilinos and i would
> like to get some hint from the experts ? on a quite standard subject:
> 
> Let?s take a simple example with 6 nodes and two processors
> 
> Nodes 1 2 3 are ?owned? by processor 1 ? but node 1 also has a copy of 4
> Nodes 4 5 6 are ?owned? by processor 2 ? but node 1 also has a copy of 3
> 
> 
> In our internal database nodes 3 and 4 exist in both domains. We wish of
> course that the nodal database is exactly replicated on the two nodes.
> 
> 
> Let?s suppose now I would like to define a map prior to assembling our
> Finite Element problem:
> 
> We have two obvious options:
> 
> OPTION1
> We define a linear map so that  the first processor owns exclusively 1 2 3
> and the second 4 5 6
> 
> OPTION 2
> We define a map so that
> Node 1 &#61664; has nodes 1 2 3 4
> Node 2 &#61664; has nodes 3 4 5 6
> 
> my problem is the following:
> 
> ---- if I decide to use OPTION 1 at the moment of updating I need to
> gather the value of 4 to do the update of node 1 and of 3 to do the update
> of node 2 ? how do I do this? I expect to use the ?ExtractCopy? but having
> a look to the documentation it looks like it is not possible to get a non
> local entry by its GID? how should I do this? Shall I define an extra map
> and use the export operator?
> 
> ---- OPTION 2 on the other hand would make the update trivial for me (I
> would have a local copy of all of the entries I need) ? however ? can I
> trust that the assembly and linear system solution will be done correctly?
> 
> 
> 
> I am sure that those questions were asked once and again but I could
> figure out a clear answer through the didasko examples nor through the
> user manual?
> If someone could give me a short answer?or even a pointer to the correct
> documentation it would be of great help
> 
> Thanks in advance
> Riccardo
> 
> 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Sun, 26 Oct 2008 12:05:47 -0500
> From: "Kevin Long" <kevin.long at ttu.edu>
> Subject: Re: [Trilinos-Users] optimal choice of maps for finite
> 	elements assembly and update
> To: trilinos-users at software.sandia.gov
> Cc: "rrossi at cimne.upc.edu" <rrossi at cimne.upc.edu>
> Message-ID: <200810261205.47419.kevin.long at ttu.edu>
> Content-Type: text/plain; charset=windows-1252
> 
> 
> Riccardo,
> 
> This is a good question whose solution needs to be documented better. Epetra 
> handles it in a way that is very clean and clever, but not obvious. 
> 
> What you do is build *two* Epetra maps, one like your option 1, the other like 
> your option 2. In the context of matrices, these two maps are distinguished 
> explicitly: there are a pair of maps (called range/domain maps)  each 
> containing only locally owned dofs (your option 1), and another pair (called 
> row/column maps) containing both local and ghost dofs (your option 2). If you 
> build an Epetra CRS or VBR matrix, the FillComplete() function will build the 
> second map pair (row/column) for you automatically. 
> 
> So as far as matrices go, you basically do your option 1 and then option 2 
> will be taken care of automatically. Vectors take a little more work. 
> Suppose you have a vector containing only locally owned rows, i.e., without 
> ghosts. In a nonlinear problem, you'll need to access the ghost rows when 
> evaluating coefficients. You can get them by explicitly doing an import from 
> the option 2 map. 
> 
> I'm not sure where to send you for an example; the examples I know of in 
> packages/Sundance/src-solvers are probably pretty obscure as the Epetra code 
> is wrapped in a representation-independent interface. If you want to look 
> there, though, there are examples of dealing with ghosts and imports in 
> packages/Sundance/src-solvers/Concrete/TSFEpetraGhostImporter.cpp
> and 
> packages/Sundance/src-solvers/Concrete/TSFEpetraGhostView.cpp.
> Note that these are internal source files rather than examples, so they may 
> not be easy to figure out, but it's better than nothing. 
> 
> Hope that helps. I'm sure Mike H or someone can point you to a more 
> appropriate example in Epetra. 
> 
> Regards,
> 
> Kevin
> 
> On Sunday 26 October 2008 10:38:30 am rrossi at cimne.upc.edu wrote:
> > Dear All
> >
> > I am trying to link my finite element code to the Trilinos and i would
> > like to get some hint from the experts ? on a quite standard subject:
> >
> > Let?s take a simple example with 6 nodes and two processors
> >
> > Nodes 1 2 3 are ?owned? by processor 1 ? but node 1 also has a copy of 4
> > Nodes 4 5 6 are ?owned? by processor 2 ? but node 1 also has a copy of 3
> >
> >
> > In our internal database nodes 3 and 4 exist in both domains. We wish of
> > course that the nodal database is exactly replicated on the two nodes.
> >
> >
> > Let?s suppose now I would like to define a map prior to assembling our
> > Finite Element problem:
> >
> > We have two obvious options:
> >
> > OPTION1
> > We define a linear map so that  the first processor owns exclusively 1 2 3
> > and the second 4 5 6
> >
> > OPTION 2
> > We define a map so that
> > Node 1 &#61664; has nodes 1 2 3 4
> > Node 2 &#61664; has nodes 3 4 5 6
> >
> > my problem is the following:
> >
> > ---- if I decide to use OPTION 1 at the moment of updating I need to
> > gather the value of 4 to do the update of node 1 and of 3 to do the update
> > of node 2 ? how do I do this? I expect to use the ?ExtractCopy? but having
> > a look to the documentation it looks like it is not possible to get a non
> > local entry by its GID? how should I do this? Shall I define an extra map
> > and use the export operator?
> >
> > ---- OPTION 2 on the other hand would make the update trivial for me (I
> > would have a local copy of all of the entries I need) ? however ? can I
> > trust that the assembly and linear system solution will be done correctly?
> >
> >
> >
> > I am sure that those questions were asked once and again but I could
> > figure out a clear answer through the didasko examples nor through the
> > user manual?
> > If someone could give me a short answer?or even a pointer to the correct
> > documentation it would be of great help
> >
> > Thanks 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