<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Nov 5, 2017 at 2:04 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Sun, Nov 5, 2017 at 1:45 PM, Yann Jobic <span dir="ltr"><<a href="mailto:yann.jobic@univ-amu.fr" target="_blank">yann.jobic@univ-amu.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear PETSc expert,<br>
<br>
I first correctly solve the advection/diffusion equation, with the advection/diffusion of a gaussian, in a rotate field.<br>
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.<br>
<br>
Then, i would like to use p4est, with AMR. To do that, I re-use the example : "petsc/examples/src/dm/impls/f<wbr>orest/examples/tests/ex2.c"<br>
I create a "base" DM, which has everything : PetscFE, PetscDS, the boundaries, ... Then, i correctly adapt the mesh, by using :<br>
ierr = DMForestTemplate(base,comm,&po<wbr>stForest);CHKERRQ(ierr);<br>
ierr = DMForestSetAdaptivityLabel(pos<wbr>tForest,adaptLabel);CHKERRQ(ie<wbr>rr);<br>
<br>
My problem is that nothing happens when i'm solving the system, i.e. my initial solution does not move, or diffuse.<br>
<br>
That would mean that i didn't correctly transfer the problem definition. I tried to attach everything to the adapted mesh, without succes.<br>
<br>
What is the correct way to transfer the problem definition (PetscFE and PetscDS) from one DM to another ?<br></blockquote><div><br></div></span><div>One way to do it is just</div><div><br></div><div> DMGetDS(dm, &prob);</div><div> DMSetDS(newdm, prob);</div><div><br></div><div>I think I have this working automatically now in</div><div><br></div><div>  knepley/feature-adaptor-plex</div><div><br></div><div>Check out the test in SNES ex12</div><div><br></div><div>  make -f ./gmakefile test globsearch="snes_tutorials-<wbr>runex12_quad_q1_adapt_0" EXTRA_OPTIONS="-dm_adapt_view hdf5:$PWD/adapt.h5"</div><div>  ./bin/petsc_gen_xdmf.py adapt.h5</div><div><br></div><div>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.</div></div></div></div></blockquote><div><br></div><div>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</div><div>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.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>  Thanks,</div><div><br></div><div>      Matt</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Many thanks in advance,<br>
<br>
Regards,<br>
<br>
Yann<br>
<br>
</blockquote></span></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_5683279604326278996gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~<wbr>knepley/</a><br></div></div></div></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>