[petsc-users] Basic question about local submatrix from DMComposite
zakaryah
zakaryah at gmail.com
Mon Sep 17 15:48:32 CDT 2018
That worked - thanks Matt
On Mon, Sep 17, 2018 at 1:19 PM Matthew Knepley <knepley at gmail.com> wrote:
> On Mon, Sep 17, 2018 at 12:12 PM zakaryah <zakaryah at gmail.com> wrote:
>
>> I'm still working on implementing a homotopy solver for systems of
>> nonlinear equations. It seems that everything is working in serial, but
>> I'm having at least one issue in parallel.
>>
>> To form the (n+1) x (n+1) Jacobian, I use MatGetLocalSubMatrix, with the
>> ISs from the DMComposite. One of the submatrices is (globally) 1 x n. I
>> need to set one of its values, at global column j, to a particular value.
>> My current attempt to do this involves getting the local to global
>> mappings, with DMCompositeGetISLocalToGlobalMappings, then using
>> ISGlobalToLocalMappingsApply with global index j. If the processor has a
>> locally mapped index, I call MatSetValuesLocal at the local index.
>>
>> So far, this works, in that it seems the value is set at the appropriate
>> point. My issue is that I must use ADD_VALUES, due to the nature of the
>> algorithm for the other submatrices. Therefore, I need a way to ensure
>> that the correct value is set. For example, if two processors map to the
>> same global index, then I need a way to check this and use local values
>> such that the sum is the correct global value.
>>
>
> This sounds wrong. I think you should fix the algorithm to use INSERT,
> which is what you really want. You can usually partition it into
> and ADD phase, then call Assembly with FLUSH, and then an INSERT phase.
>
> Thanks,
>
> Matt
>
>
>> I suspect that this has a simple solution - hopefully someone has some
>> hints. Thanks!
>>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> <http://www.cse.buffalo.edu/~knepley/>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180917/471e1448/attachment.html>
More information about the petsc-users
mailing list