[Trilinos-Users] [EXTERNAL] Re: Epetra_Map

Littlewood, David John djlittl at sandia.gov
Mon Dec 9 09:21:00 MST 2013


Mike,

Wanted to chime in here because I've had the same question as Luca.
Everything you said makes sense, but it's still not clear why the
constructor for Epetra_CrsMatrix takes an Epetra_Map.  It seems like it
should take an Epetra_BlockMap.

The fact that it takes an Epetra_Map has caused some minor grief for me,
since I generally use Epetra_BlockMap to create vectors which I'd then
like to multiply with an Epetra_FECrsMatrix.  This doesn't work without
some data juggling, because I created the matrix using an Epetra_Map (as
required by the constructor) and thus it is incompatible with my vectors
(created with Epetra_BlockMap, element size = 3).

Dave


On 12/6/13 11:25 PM, "Heroux, Mike" <MHeroux at csbsju.edu> wrote:

>Luca,
>
>As you pointed out, Epetra_Map "isa" Epetra_BlockMap, with a block size
>of 1.  If you are only using a block size of 1, then you should just use
>Epetra_Map.  Doing this should make your code much simpler.  So when you
>are working with Epetra_CrsGraph, just use an Epetra_Map.
>
>In general Epetra_Map (and Epetra_BlockMap, and similar classes in Tpetra
>and soon Kokkos) encodes a description of the dimensions and distribution
>of data objects.  By encoding this information into a separate class, we
>can create many data objects using the same map and know that they are
>compatible by construction.  We can also use maps to create
>redistributions of data objects, and a few other things.
>
>In straightforward use cases, the map may seem like unnecessary overhead,
>but even in these cases, the maps are being used by underlying
>functionality to improve correct and efficient behavior.
>
>Epetra_CrsGraph uses Epetra_BlockMap because it serves as the graph class
>for both Epetra_Map and Epetra_BlockMap based object.  For example,
>Epetra_CrsMatrix and Epetra_VbrMatrix both use Epetra_CrsGraph.
>
>I hope this helps.
>
>Mike
>
>On Dec 7, 2013, at 1:20 AM, "Bertagna, Luca"
><lbertag at emory.edu<mailto:lbertag at emory.edu>> wrote:
>
>
>Hello,
>
>I've been using the epetra package for a while, but I still don't
>understand what's the point of Epetra_Map. I understand it's a map where
>the element size is equal to 1, but I don't get why Epetra_CrsMatrix uses
>it when Epetra_CrsGraph does not. Calling the method FillComplete in
>CrsMatrix is always a pain, cause I need to cast the BlockMap of the
>graph into a Map. I guess my question is, if the underlying graph does
>not use Epetra_Map but uses Epetra_BlockMap instead, why can't
>Epetra_CrsMatrix just use Epetra_BlockMap as well?
>
>Thanks
>
>
>Luca Bertagna
>Math&CS, Emory University, Atlanta
>www.mathcs.emory.edu/~lbertag<http://www.mathcs.emory.edu/~lbertag>
>_______________________________________________
>Trilinos-Users mailing list
>Trilinos-Users at software.sandia.gov<mailto:Trilinos-Users at software.sandia.g
>ov>
>http://software.sandia.gov/mailman/listinfo/trilinos-users
>
>_______________________________________________
>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