[petsc-dev] How to get subsnes for subproblems based field decomposition

Barry Smith bsmith at mcs.anl.gov
Fri Aug 19 13:01:35 CDT 2016


> On Aug 19, 2016, at 8:49 AM, Lulu Liu <lulu.liu at kaust.edu.sa> wrote:
> 
> Hi,
> 
> For example, I would like to solve the nonlinear driven cavity problem (ex19.c in SNES). There are four components: u,v, omega, T. 
> 
> I want to solve one equation at one time, is there any easier way to get subsnes (for subproblems) from original SNES.

   Here's the thing. If the example defines a single monolithic function that computes the unknowns entire function, in this example the function is called FormFunctionLocal() there there is no way for PETSc which is a library to "pull out of" that FormFunctionLocal() an function that computes say just the functions for u or v or omega or T. That would require compiler tools that understood the mathematics of the source code function written in C which is essentially impossible.

    The only hope to be able to build nonlinear solvers that work on "a component at a time" is if the user provides the unknowns mathematical function not as a single monolithic function but as a collection of functions one for each component. This is why there is no way to automatically generate the SubSNES's you desire. Note that for the linear case where a matrix is provided it is easy to pull out the sub-linear problems because they are just sub matrices of the original matrix.

   Barry

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