[petsc-users] PCASMSetLocalSubdomains Question

Matthew Knepley knepley at gmail.com
Thu Mar 10 15:16:19 CST 2011


On Thu, Mar 10, 2011 at 2:44 PM, Gaetan Kenway <kenway at utias.utoronto.ca>wrote:

> Hello
>
> I am trying to setup a Additive Schwartz Preconditioner using multiple
> blocks on each processor. My code is a 3D Multiblock CFD code and what I am
> trying to do is to put each CFD block into its own subdomain, even if there
> are more than 1 block on each processor. The PETSc help on this function
> wasn't helpful nor was the one example.
>
> I don't understand the difference between "is" and "is_local". Are you
> supposed to set 1 or both or neither?
>

If you want multiple blocks/process AND you want to be able to do RASM, then
you need to specify both

  1) the overlapping blocks

  2) the non-overlapping parts

You need 2), because I have no idea how to calculate 2) given only 1). We
could have an alternative interface that
took 2) and an overlap, and figured it out, however currently that only
works for 1 block/process, and specfiying
both 1) and 2) is more general (I needed it for a specific PC).


> As an example what I'm currently doing, for a given processor I want to
> split into ndom subdomains I don the following
>
>
> PetscFortranAddr,dimension(:),allocatable :: is_local
>
> allocate(is_local(ndom))
> do nn=1,ndom ! Loop over block on this processor
>     ! create the index set for this domain -> Indicies contains the global
> indices for the the current subdomain -> Code not shown
>
>     call
> ISCreateGeneral(PETSC_COMM_WORLD,nindices,indices,is_local(nn),PETScIerr)
> asdf
>
>  call PCASMSetLocalSubdomains(pc,ndom,PETSC_NULL_OBJECT,is_local,PETScIerr)
>
>
> This dies with error code 85:  Argument is null that should not be
>

This should work. Something is wrong with the Fortran translation. Are you
using 3.1 or dev? It looks correct in dev.

   Matt


> The traceback I get is:
>
> [0]PETSC ERROR: ---------------------  Stack Frames
> ------------------------------------
> [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not
> available,
> [0]PETSC ERROR:       INSTEAD the line number of the start of the function
> [0]PETSC ERROR:       is given.
> [0]PETSC ERROR: [0] PetscObjectReference line 112 src/sys/objects/inherit.c
> [0]PETSC ERROR: [0] PCASMSetLocalSubdomains_ASM line 525
> src/ksp/pc/impls/asm/asm.c
> [0]PETSC ERROR: [0] PCASMSetLocalSubdomains line 699
> src/ksp/pc/impls/asm/asm.c
>
> I'm trying to use this with a block AIJ Matrix. Does the setlocalsubdomains
> work with block AIJ Matrices?
>
> Thank you,
>
> Gaetan
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110310/5222c184/attachment.htm>


More information about the petsc-users mailing list