[petsc-dev] Setup subsnes in nasm.c

Barry Smith bsmith at mcs.anl.gov
Sun May 29 13:50:13 CDT 2016


> On May 29, 2016, at 1:43 PM, Lulu Liu <lulu.liu at kaust.edu.sa> wrote:
> 
> 
> 
> On Fri, May 27, 2016 at 5:50 PM, Matthew Knepley <knepley at gmail.com> wrote:
> On Fri, May 27, 2016 at 10:39 AM, Lulu Liu <lulu.liu at kaust.edu.sa> wrote:
> 
> I am trying to solve a nonlinear problem using NASM, and see the code in  petsc/src/snes/impls/nasm/nasm.c. However, I feel confused about how subsnes for each subdomain gets its own function, and I can not find anything like SNESSetFunction(subsnes,......). Could you show me which line subsnes gets its own function in nasm.c? 
> 
> The function is coming from the DM. The subDMs get the same SNESDM structures as the original DM, and then
> SNESSetDM() is called on them.
>  
> In addition, I would like to set up something using SNESNASMSetSubdomains_NASM (). Is there any example showing how to set subsnes, iscatter, oscatter,gscatter? Thanks!
> 
> Unfortunately there are no examples. I am not a big fan of this interface which is only really intelligible for Cartesian grids.
> I am going to try and rework it this fall.
> 
> 
> Does the current interface (nasm.c) work for unstructured grids?

  You can use SNESNASMSetSubdomains to work with any "grid" you want. You provide the the local function yourself directly to each subsnes with SNESSetFunction() and SNESSetJacobian() just as if it were the only SNES you had. 




> 
>  
> 
>   Thanks,
> 
>      Matt
>  
> PetscErrorCode SNESNASMSetSubdomains_NASM(SNES snes,PetscInt n,SNES subsnes[],VecScatter iscatter[],VecScatter oscatter[],VecScatter gscatter[])
> 
> 
> This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.
> 
> 
> 
> -- 
> 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
> 
> 
> 
> 
> 
> This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.




More information about the petsc-dev mailing list