[Trilinos-Users] Replacing maps in Epetra CRS Matrix

Pavel Jiránek pavel.jiranek at gmail.com
Wed Oct 2 05:26:51 MDT 2013


Dear Mike,

Thanks for the quick answer and confirmation that it should work.

Please see the attached file for an example I've made to test the map
replacement (compiled with gcc 4.7 and -std=c++11). Everything works fine
except that the range map after calling all the available replacement
methods is still same as the original (nonlinear) row map.

Actually I cannot see how the range map could be updated by any of the
Replace{RowMap,ColMap,DomainMapAndImporter} methods. What I mean is that
assuming the row and range maps need not to be necessarily same (as
specified by the FillComplete's second argument), I cannot see how the 3
replacement routines could deduce which map to actually use as the
replacement of the row map. Shouldn't there be another replacer similar to
ReplaceDomainMapAndImporter to achieve this?

Best regards,

Pavel

P.S.: I actually do not need this feature anymore but I guess it would be a
good idea anyway :-)



On Tue, Oct 1, 2013 at 11:52 PM, Heroux, Michael A <maherou at sandia.gov>wrote:

>  Hi Pavel,
>
>  If you have a simple example routine, please send it.  What you describe
> should work.
>
>  Thanks.
>
>  Mike
>
>  ------------------------------
> *From:* trilinos-users-bounces at software.sandia.gov [
> trilinos-users-bounces at software.sandia.gov] on behalf of Pavel Jiránek [
> pavel.jiranek at gmail.com]
> *Sent:* Tuesday, October 01, 2013 4:46 AM
> *To:* trilinos-users at software.sandia.gov
> *Subject:* [EXTERNAL] [Trilinos-Users] Replacing maps in Epetra CRS Matrix
>
>   Hello,
>
>  I have a distributed CRS matrix (call it A) with a given row map. For
> some reason, I would need to make a permutation of the global IDs so that
> the row map is linear, if possible without a need to create another matrix
> and fill it again using different (linear) row map.
>
>  What I do at the moment is:
> 1) Create a linear row map of the same local dimension as the row map of A.
> 2) Make an int vector view to its GIDs (on the row map of A).
> 3) Make an int vector on the col map of A and import the vector from the
> previous step.
> 4) Create a col map deduced from the imported GIDs.
>
>  Then I call ReplaceRowMap(), ReplaceColMap(), and
> ReplaceDomainMapAndImporter() on A. I suppose that this is correct (no
> error happens) but still, the matrix still has an incorrect range map
> equivalent to the old (nonlinear) row map. Is there any way to replace also
> that one?
>
>  Thanks in advance for any feedback.
>
>  Regards,
>
>  Pavel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20131002/0ee80cd3/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_linear_map.cpp
Type: text/x-c++src
Size: 4345 bytes
Desc: not available
Url : https://software.sandia.gov/pipermail/trilinos-users/attachments/20131002/0ee80cd3/attachment.bin 


More information about the Trilinos-Users mailing list