[petsc-users] Solving Poisson equation with multigrid

Jed Brown jedbrown at mcs.anl.gov
Fri May 17 19:33:31 CDT 2013


Michele Rosso <mrosso at uci.edu> writes:

> I run with
>
> -pc_type gamg  -options_left
>
> and I get the error:
>
> [0]PETSC ERROR: --------------------- Error Message 
> ------------------------------------
> [0]PETSC ERROR: No support for this operation for this object type!
> [0]PETSC ERROR: For coloring efficiency ensure number of grid points in 
> X is divisible
>                   by 2*stencil_width + 1
> !
> [0]PETSC ERROR: 
> ------------------------------------------------------------------------
> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 3, Wed Aug 29 
> 11:26:24 CDT 2012
> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> [0]PETSC ERROR: See docs/index.html for manual pages.
> [0]PETSC ERROR: 
> ------------------------------------------------------------------------
> [0]PETSC ERROR: ./hit on a  named nid22318 by Unknown Fri May 17 
> 19:21:25 2013
> [0]PETSC ERROR: Libraries linked from
> [0]PETSC ERROR: Configure run at
> [0]PETSC ERROR: Configure options
> [0]PETSC ERROR: 
> ------------------------------------------------------------------------
> [0]PETSC ERROR: DMCreateColoring_DA_3d_MPIAIJ() line 288 in 
> src/dm/impls/da/fdda.c

You didn't provide a Jacobian.  A finite difference Jacobian is mostly
used for initial development.  For more general problems, either
assemble the Jacobian or choose a compatible grid.

Note: this message is a consequence of using periodic boundary
conditions.  Someone cut a corner a long time ago when implementing
coloring for periodic and nobody has needed this enough to remove the
assumption.  A dimension of 255 would also be divisible by 3, if it
helps you.

  if (bx == DMDA_BOUNDARY_PERIODIC && (m % col)) SETERRQ(PetscObjectComm((PetscObject)da),PETSC_ERR_SUP,"For coloring efficiency ensure number of grid points in X is divisible\n\
                                                         by 2*stencil_width + 1\n");

> [0]PETSC ERROR: DMCreateColoring_DA() line 172 in src/dm/impls/da/fdda.c
> [0]PETSC ERROR: DMCreateColoring() line 709 in src/dm/interface/dm.c
> [0]PETSC ERROR: DMComputeJacobian() line 2206 in src/dm/interface/dm.c
> [0]PETSC ERROR: KSPSetUp() line 228 in src/ksp/ksp/interface/itfunc.c

Looks like you cut the error message off short.

> The code is calling
>
> KSPSetFromOptions()
>
>
> On 05/17/2013 05:10 PM, Jed Brown wrote:
>> Please always use "reply-all" so that your messages go to the list.
>> This is standard mailing list etiquette.  It is important to preserve
>> threading for people who find this discussion later and so that we do
>> not waste our time re-answering the same questions that have already
>> been answered in private side-conversations.  You'll likely get an
>> answer faster that way too.
>>
>> Michele Rosso <mrosso at uci.edu> writes:
>>
>>> If you are referring to -pc_type gamg, I tried it, but I got the same
>>> error message
>>> (For coloring efficiency ensure number of grid points in X is divisible
>>> by 2*stencil_width + 1)
>> The option could not have been used.  Always send the ENTIRE error
>> message.  Is the code calling KSPSetFromOptions()?  Run with
>> -options_left to see if any options did not get used.
>>
>>> On 05/17/2013 04:49 PM, Jed Brown wrote:
>>>> Read my first message
>>>>
>>>> On May 17, 2013 6:47 PM, "Michele Rosso" <mrosso at uci.edu
>>>> <mailto:mrosso at uci.edu>> wrote:
>>>>
>>>>      Ok, I will give a try to AMG then. What is it exactly?
>>>>      Thank you!
>>>>
>>>>      On 05/17/2013 04:25 PM, Jed Brown wrote:
>>>>>      Michele Rosso<mrosso at uci.edu>  <mailto:mrosso at uci.edu>  writes:
>>>>>
>>>>>>      So should I always use an odd number of grid points?
>>>>>>      There is no way around this?
>>>>>      If you want to use regular geometric coarsening, then yes.  That *is*
>>>>>      regular node-centered coarsening.  Just consider the base case of one
>>>>>      element:
>>>>>
>>>>>
>>>>>         o ------- o
>>>>>
>>>>>      Split that in two:
>>>>>
>>>>>         o -- o -- o
>>>>>
>>>>>      Look, an odd number of vertices, and as we keep refining, it will stay
>>>>>      odd.
>>>>>
>>>>>      You can use AMG or write your own interpolation if you want irregular coarsening.
>>>>>


More information about the petsc-users mailing list