[petsc-users] solving stokes-like equation in 3D staggered grid in irregular domain with petscsection

Bishesh Khanal bisheshkh at gmail.com
Tue Nov 12 09:14:30 CST 2013


Dear all,
I have an implementation of stokes flow equation in cuboid using a
staggered grid with DMDA. Now I want to solve a problem in a slightly
different (but more difficult) situation where I think PetscSection might
be useful although I have not used PetscSection that much and I understand
that some of its aspects is still under development in petsc.
I'm ok to work with the dev version of petsc if what I want to do using
petscsection is plausible.

Here is my problem description:

I have a 3D binary image that partitions a cuboid into domain A and domain
B by tagging each cell as 0 or 1. The shape of A and therefore B can be
fairly arbitrary. I want to solve the following sets of equations:

A. In A:
div(mu(grad(u))) - grad(p) = f1   , where f1 depends on the position x.
div(u)                                   = f2   , where f2 is non-zero and
depends on the position x.
---------------------------------------
B. In B:
div(mu(grad(u)) = f3,    where f3 depends on the position x.
-----------------------------------------
u = constant on the cuboid boundaries. (Dirichlet boundaries)
p = constant on domain B (if needed as boundary condition for domain A)
-------------------------------------------

Now, I was thinking of creating a single matrix M that contains the
operators for both A and B domains, and solve a linear system MX = R, where
X and R are the solution and Rhs vectors of roughly the sizes 4*nA + 3*nB
where,   nA => no. of cells in A, nB => no. of cells in B.

Some questions:

1. Would PetscSection be useful in this case due to the arbitrary shape of
domain A and because of different number of dofs in domain A and domain B ?
Is there a simple example that uses petscsection for the staggered grid
case ? I would like to be able to implement staggered grid without the use
of ghost/fictitious cells.

2. Is it a good idea to create a single matrix corresponding to both the
domains A and B (particularly in view of the difficulty it might bring in
solving with some preconditioners using schur fieldsplit) ?

3. I'm trying to put both domains in a single matrix to avoid the
difficulty I would have if I want to consider only the domain A. In this
case I would need a traction free boundary condition on the irregular
boundary of domain A, and it seems a bit too challenging for me to
incorporate it with the staggered grid. If there is an idea to implement
this and if you think this could be more suitable than the approach in 2
above, I would like to learn about that too!

Thanks,
Bishesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131112/c3b433fc/attachment.html>


More information about the petsc-users mailing list