Re: [petsc-users] MatFDColoringSetUp with Periodic BC

2023-02-15 Thread Bernigaud Pierre

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 
 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  | Twitter 
 | LinkedIn 
 | Facebook 
 | Instagram 




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




Re: [petsc-users] MatFDColoringSetUp with Periodic BC

2023-02-14 Thread Barry Smith

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



[petsc-users] MatFDColoringSetUp with Periodic BC

2023-02-14 Thread Pierre Bernigaud

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