[petsc-users] Basic question about local submatrix from DMComposite
zakaryah
zakaryah at gmail.com
Mon Sep 17 11:12:29 CDT 2018
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.
I suspect that this has a simple solution - hopefully someone has some
hints. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180917/263f9c02/attachment.html>
More information about the petsc-users
mailing list