[petsc-users] MatFDColoringSetUp with Periodic BC

Bernigaud Pierre pierre.bernigaud at onera.fr
Wed Feb 15 03:56:40 CST 2023


Barry,

Thanks for this quick answer.

Best,
Pierre

Le 14/02/2023 à 21:35, Barry Smith a écrit :
>
>   I have created an MR that documents this and moved the error 
> checking to a more appropriate location 
> https://gitlab.com/petsc/petsc/-/merge_requests/6070
>
>
>> On Feb 14, 2023, at 4:33 AM, Pierre Bernigaud 
>> <pierre.bernigaud at onera.fr> wrote:
>>
>> Dear all,
>>
>> I hope this email finds you well.
>> We are currently working on a solver which is employing DMDA with 
>> SNES. The jacobian is computed via FDColoring, ie:
>>
>> call DMDACreate1D(PETSC_COMM_WORLD, DM_BOUNDARY_GHOSTED, NY, NC, NGc, 
>> PETSC_NULL_INTEGER, dmF, ierr)
>>
>> ! ----- Some steps ...
>>
>> call DMCreateColoring(dmF, IS_COLORING_GLOBAL, iscoloring, ierr)
>> call MatFDColoringCreate(Jac,iscoloring, matfdcoloring, ierr)
>> call MatFDColoringSetFunction(matfdcoloring, FormFunction, CTX, ierr)
>> call MatFDColoringSetUp(Jac ,iscoloring,matfdcoloring, ierr)
>> call SNESSetJacobian(snes, Jac, Jac, SNESComputeJacobianDefaultColor, 
>> matfdcoloring, ierr)
>>
>> Everything is running smoothly.
>> Recently, we modified the boundary conditions such as to use periodic 
>> BC:
>>
>> call DMDACreate1D(PETSC_COMM_WORLD, DM_BOUNDARY_PERIODIC, NY, NC, 
>> NGc, PETSC_NULL_INTEGER, dmF, ierr)
>>
>> We then encountered frequent crashes when calling MatFDColoringSetUp, 
>> depending on the number of cells NY. After looking for an solution, I 
>> found this old thread: 
>> https://lists.mcs.anl.gov/pipermail/petsc-users/2013-May/017449.html
>> It appears that when using periodic BC, FDColoring can only be used 
>> if the number of cells is divisible by 2*NGc+1. Even though this is 
>> only a slight annoyance, I was wondering if you were working on this 
>> matter / if you had a quick fix at hand? At any rate, I think it 
>> would be nice if a warning was displayed in the FDColoring 
>> documentation?
>>
>> Respectfully,
>> Pierre Bernigaud
>>
>
-- 
*Pierre Bernigaud*
Doctorant
Département multi-physique pour l’énergétique
Modélisation Propulsion Fusée
Tél: +33 1 80 38 62 33


ONERA - The French Aerospace Lab - Centre de Palaiseau
6, Chemin de la Vauve aux Granges - 91123 PALAISEAU
Coordonnées GPS : 48.715169, 2.232833

Nous suivre sur : www.onera.fr <https://www.onera.fr> | Twitter 
<http://www.twitter.com/@onera_fr> | LinkedIn 
<http://www.linkedin.com/company/onera> | Facebook 
<http://www.facebook.fr/thefrenchaerospacelab> | Instagram 
<https://www.instagram.com/onera_the_french_aerospace_lab>


Avertissement/disclaimer https://www.onera.fr/en/emails-terms


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230215/ffb07a4f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: faohmnjfdoleeodh.gif
Type: image/gif
Size: 1041 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230215/ffb07a4f/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecmmhhmnlejemldm.png
Type: image/png
Size: 16755 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230215/ffb07a4f/attachment-0001.png>


More information about the petsc-users mailing list