[petsc-users] Suggestions for code with dof >> 1 ?

Christophe Ortiz christophe.ortiz at ciemat.es
Tue Oct 15 07:29:22 CDT 2013


Hi all,

I'm still working on my code with dof>>1 and I came to the point where I
want to use DMDASetBlcokFills to set the pattern of each block (see ex10.c
from advection-diffusion).

I have a doubt...
Let's imagine I have a system of 2 diffusion equations (dof=2) with one
coupling, both with Dirichlet boundary conditions:

u_t - D u_xx = -k*u*v        u(x=0,t)=u(x=L,t)=0
v_t - D v_xx = -k*u*v         v(x=0,t)=v(x=L,t)=0

If I write everything under IFunction, then the IJacobian is:

       1        0          |
       0        1          |

-D/dx^2   0           | a+2D/dx^2+kv       +ku  | -D/dx^2     0
    0        -D/dx^2  |         +kv                  +ku  |      0
-D/dx^2


The first block on top represents Dirichlet boundary conditions. The three
other blocks are for interior nodes.

My question is on how to set dfill matrix. For boundary conditions, the
diagonal block does not have the same pattern as the one for interior node.
We see that for node i=0, components are just coupled with themselves while
for the interior diagonal block, they are coupled one with each other.
Then, how to set dfill ? Should it be

{1,   0,
 0,    1 }

or

{ 1,   1,
  1,    1}   ?

BTW, does DMDASetBlockFills help during solving or is it just for managing
memory ?

Christophe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131015/f8209855/attachment.html>


More information about the petsc-users mailing list