[petsc-users] Adaptivity Options in ex11.c

Matthew Knepley knepley at gmail.com
Mon Apr 13 09:45:09 CDT 2020


On Mon, Apr 13, 2020 at 9:47 AM MUKKUND SUNJII <mukkundsunjii at gmail.com>
wrote:

> Greetings,
>
> I have been trying to add on to the functionality of the adaptive grid
> solver featured in the ts/tutorials/ex11.c.
>
> I noticed that there is not an option to set the initial, minimum or
> maximum refinement levels in the adaptToleranceFVM() function where the
> grid adaption operation takes place. When I use the function
> DMForestSetMaximumRefinement(…), I am returned with the error saying that
> the 'DM has already been set up'.
>

1) The initial refinement comes from the initial mesh you make

2) Do you call DMForestSetMinimumRefinement() before DMSetUp()?

  Thanks,

     Matt


> As a result, I looked into the DMForest tests and tutorials. I found that
> in dm/impls/forest/tests/ex2.c, various DMForests functions are being used.
> Nevertheless, the flow of operations of the grid adaption process is a bit
> different. In the test file, three DM objects are used :* Base DM -
> PreForest DM - PostForest DM*. Parameters such as the initial, and
> minimum refinement levels are assigned to the PreForest DM before it is set
> up. But in adaptToleranceFVM()  in ex11.c, only 2 DM objects are used and
> hence these parameters cannot be assigned (i.e., the objects used are
> *plex* and *adaptedDM*).
>
> I tried to replicate the *Base DM - PreForest DM - PostForest DM *structure
> in adaptToleranceFVM() . However, I am returned with a multitude of
> errors. I do not include the error statements as I suspect that there is
> a fundamental problem with my adaption routine and a specific error won’t
> indicate the bigger problem.
>
> In order to not be verbose in the email, I have included the GitHub link
> of the code that I have been working on. You can find the
> adaptToleranceFVM() in lines 1542 to 1739. I’d very much appreciate any
> feedback or suggestions on this segment.
>
> *Github Link : *
> https://github.com/mukkund1996/petsc/blob/cbcf8824f12d1159c0f5dc84d028a4869a2a0594/amr/ex11_adapt_param.c#L1542
>
> Thank you in advanced.
>
> Regards,
>
> Mukkund Sunjii
>
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200413/96eb051b/attachment.html>


More information about the petsc-users mailing list