[petsc-users] DMPlex with AMR

Yann Jobic yann.jobic at univ-amu.fr
Sun Nov 5 13:37:29 CST 2017


Thanks for the fast answer !

Le 05/11/2017 à 20:06, Matthew Knepley a écrit :
> On Sun, Nov 5, 2017 at 2:04 PM, Matthew Knepley <knepley at gmail.com 
> <mailto:knepley at gmail.com>> wrote:
>
>     On Sun, Nov 5, 2017 at 1:45 PM, Yann Jobic <yann.jobic at univ-amu.fr
>     <mailto:yann.jobic at univ-amu.fr>> wrote:
>
>         Dear PETSc expert,
>
>         I first correctly solve the advection/diffusion equation, with
>         the advection/diffusion of a gaussian, in a rotate field.
>         I'm using finit element, with PetscFE and the velocity field
>         is in an auxillary one, in order to correctly set the residual
>         and the jacobian.
>
>         Then, i would like to use p4est, with AMR. To do that, I
>         re-use the example :
>         "petsc/examples/src/dm/impls/forest/examples/tests/ex2.c"
>         I create a "base" DM, which has everything : PetscFE, PetscDS,
>         the boundaries, ... Then, i correctly adapt the mesh, by using :
>         ierr = DMForestTemplate(base,comm,&postForest);CHKERRQ(ierr);
>         ierr =
>         DMForestSetAdaptivityLabel(postForest,adaptLabel);CHKERRQ(ierr);
>
>         My problem is that nothing happens when i'm solving the
>         system, i.e. my initial solution does not move, or diffuse.
>
>         That would mean that i didn't correctly transfer the problem
>         definition. I tried to attach everything to the adapted mesh,
>         without succes.
>
>         What is the correct way to transfer the problem definition
>         (PetscFE and PetscDS) from one DM to another ?
>
>
>     One way to do it is just
>
>      DMGetDS(dm, &prob);
>      DMSetDS(newdm, prob);
>
I'm doing it in the attached code, without succes.
>
>
>     I think I have this working automatically now in
>
>       knepley/feature-adaptor-plex
>
>     Check out the test in SNES ex12
>
>       make -f ./gmakefile test
>     globsearch="snes_tutorials-runex12_quad_q1_adapt_0"
>     EXTRA_OPTIONS="-dm_adapt_view hdf5:$PWD/adapt.h5"
>       ./bin/petsc_gen_xdmf.py adapt.h5
>
>     and then look at adapt.xmf in Paraview. This also works if you try
>     it with simplicial meshes and Pragmatic, see tri_p1_adapt_1.
>
>
> I just looked at your code. That is not going to adapt I think because 
> there is nothing in TS to do it automatically yet. You can see it done 
> by hand
> in TS ex11. I am slowly marching through getting all this stuff hooked 
> up. I will get to TS hopefully by the end of the year.
Yes i also looked at it . But i have the same problem using Vectagger 
and refinebox. I just wanted a smaller example to reproduce it.
The thing here is that i just want to use the adapted mesh from the 
initial condition, and then fixe it for the rest of the simulation, even 
if the gaussian is moving (as a first step).
It should be easier, but i still didn't succed.
Do you think i have another problem ?

Thanks,

Yann

>
>   Thanks,
>
>      Matt
>
>       Thanks,
>
>           Matt
>
>         Many thanks in advance,
>
>         Regards,
>
>         Yann
>

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


More information about the petsc-users mailing list