DMCompositeSetCoupling#
Sets user provided routines that compute the coupling between the separate components DM in a DMCOMPOSITE to build the correct matrix nonzero structure.
Synopsis#
#include "petscdmcomposite.h"
PetscErrorCode DMCompositeSetCoupling(DM dm, PetscErrorCode (*FormCoupleLocations)(DM, Mat, PetscInt *, PetscInt *, PetscInt, PetscInt, PetscInt, PetscInt))
Logically Collective; No Fortran Support
Input Parameters#
dm - the composite object
FormCoupleLocations - routine to set the nonzero locations in the matrix
Notes#
See DMSetApplicationContext() and DMGetApplicationContext() for how to get user information into
this routine
The provided function should have a signature matching
where
dm - the composite object
J - the constructed matrix, or
NULL. If provided, the function should fill the existing nonzero pattern with zeros (onlydmandrstartare valid in this case).dnz - array counting the number of on-diagonal non-zero entries per row, where on-diagonal means that this process owns both the row and column
onz - array counting the number of off-diagonal non-zero entries per row, where off-diagonal means that this process owns the row
rstart - offset into
*nzarrays, for local row indexr, updateonz[r - rstart]ordnz[r - rstart]nrows - number of owned global rows
start - the first owned global index
end - the last owned global index + 1
If J is not NULL, then the only other valid parameter is rstart
The user coupling function has a weird and poorly documented interface and is not tested, it should be removed
See Also#
Level#
advanced
Location#
Index of all DMComposite routines
Table of Contents for all manual pages
Index of all manual pages