semi coarsening with DA's

Barry Smith bsmith at mcs.anl.gov
Thu Jul 17 08:26:10 CDT 2008


On Jul 17, 2008, at 8:16 AM, Matthew Knepley wrote:

> On Thu, Jul 17, 2008 at 8:03 AM, Barry Smith <bsmith at mcs.anl.gov>  
> wrote:
>>
>> On Jul 16, 2008, at 10:16 PM, Dave May wrote:
>>
>>> Hello,
>>>   Does anyone know the best way to perform semi coarsening using  
>>> DA's?
>>> I was trying to use the following grid sequence
>>> level [2]: 20 x 20
>>> level [1]: 11 x 11
>>> level [0]: 6 x 6
>>> where the numbers M x N corresponds to the number of nodes in the  
>>> x and y
>>> direction respectively.
>>> However I was unable to generate the interpolation operator using
>>> DAGetInterpolation(DA dac,DA daf,Mat *A,Vec *scale)
>>> Doing so caused the following error
>>> [0]PETSC ERROR: Arguments are incompatible!
>>> [0]PETSC ERROR: Ratio between levels: (mx - 1)/(Mx - 1) must be  
>>> integer:
>>> mx 20 Mx 11!
>>
>> In this case mx = 21, Mx = 11 gives (21 - 1)/(11-1) = 2 works.
>>>
>>>
>>> Is there a more general way to construct the interpolation operator
>>> within petsc for this type of grid sequence?
>>
>> What I usually do is start with a coarse DA, then use DARefine() to
>> generate the finer
>> ones, this makes sure the interpolation will work. You can use
>> DASetRefinementFactor()
>> to control which directions get refined.
>
> DAve's question is different. He is trying to use DA for doing  
> staggered methods
> for Stokes where both A and B^T B are solved with MG, meaning that  
> he cannot
> adjust grid sizes like that. Is there a way to specify coarse grids
> himself, but have
> PETSc calculate the interpolation operators automatically?

   Not if they don't satisfy the (mx - 1)/(Mx - 1) = integer rule. It  
just doesn't make sense.

   Note that if a staggered grid with like velocities and pressures  
then you need to use
2 DA's one for the velocity (vertex centered) that uses the (mx - 1) 
(Mx - 1) rule and one for
pressures that uses the mx/Mx = integer rule.  (You cannot "hack" and  
use the same DA
for all the variables and "ignore" some of the pressure points).


    Barry




> I would
> look, but I am
> on travel :)
>
>  Matt
>
>>  Barry
>>
>>>
>>>
>>> Thanks,
>>> Dave.
> -- 
> 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
>




More information about the petsc-users mailing list