[petsc-users] Interaction between multiple DMDA grid
Barry Smith
bsmith at mcs.anl.gov
Wed Dec 28 19:37:51 CST 2016
Sadly this type of situation is not as easy to handle as one would hope. What you suggest is possible, there are basically two different approaches
1) have both DA live on all processes
2) Create a subcommunicator for DAtop and its complement for DAcavity.
In either case I would suggest using the "ghost" boundary conditions for the top of the DAcavity and the bottom of the DAtop and use two VecScatters to communicate from/to them and the regular parts of the domain. Then essentially ghost point updates are done with DAGlobalToLocal() on each DA and the VecScatters. For parts of DATop that are not above the DACavity you would just ignore the "extra" ghost locations.
I would start by figuring out how to do this and not yet worry about Jacobians etc. Just be able to go from global to local on the composite grid vector to the local vectors. Use a very small number of points and run starting on one process. I would use 1) not 2) since it is simpler to understand.
Good luck,
Barry
> On Dec 28, 2016, at 3:49 PM, Somdeb Bandopadhyay <sb020287 at gmail.com> wrote:
>
> Hi all,
> I am trying to modify a single block incompressible solver for flow over open cavity. One way I could do it, is to set part of the domain as flagged and apply velocity field=0 all over it. But it does not seem to be appropriate way (I am wasting alot of grid, just to have a small cavity). So I was wondering, is there any example to interact between two DMDA grids? I am using petsc to solve the poisson equation so if I can just create two set of grid (say DA_grid1 and DA_grid2) and have a interface between them, my problem would be alot more easier.
>
> Thanks a lot in advance.
>
> Somdeb
More information about the petsc-users
mailing list