[Trilinos-Users] Replacing maps in Epetra CRS Matrix

Heroux, Michael A maherou at sandia.gov
Wed Oct 9 16:48:22 MDT 2013


Pavel,

I think I have figured out the problem.  You really need one more method to complete the transformation you want: ReplaceRangeMap().

I have added this function to my local clone and tested your driver with it.  Initial results look good.

Because this is a change to Epetra, I have to do a lot of testing to make sure I didn't break anything that depends on it, before checking in the change.  However, I have attached a patch file  with the diffs.  I don't think there have been any changes to these files since the previous release, so you should be able to drop them into your copy.

Let me know if this works, or if you have problems.

Thanks.

Mike

From: Pavel Jiránek <pavel.jiranek at gmail.com<mailto:pavel.jiranek at gmail.com>>
Date: Wednesday, October 2, 2013 6:26 AM
To: Michael A Heroux <maherou at sandia.gov<mailto:maherou at sandia.gov>>
Cc: "trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>" <trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>>
Subject: [EXTERNAL] Re: [Trilinos-Users] Replacing maps in Epetra CRS Matrix

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<mailto: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<mailto:trilinos-users-bounces at software.sandia.gov> [trilinos-users-bounces at software.sandia.gov<mailto:trilinos-users-bounces at software.sandia.gov>] on behalf of Pavel Jiránek [pavel.jiranek at gmail.com<mailto:pavel.jiranek at gmail.com>]
Sent: Tuesday, October 01, 2013 4:46 AM
To: trilinos-users at software.sandia.gov<mailto: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/20131009/e7ca9428/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patchfile
Type: application/octet-stream
Size: 3519 bytes
Desc: patchfile
Url : https://software.sandia.gov/pipermail/trilinos-users/attachments/20131009/e7ca9428/attachment.obj 


More information about the Trilinos-Users mailing list