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'. 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
