Ok, but from a PETSc user perspective, what is the difference between create and get?
When should I use get and when should I use create? Can I call create several times to create several vectors? Is it the same as creating one and then duplicating? Can I call get several times to get several vectors? Is it the same as getting one and then duplicating? If I replace all gets with creates, or all creates with gets in my code, what will change? On Wed, Feb 4, 2015 at 5:16 AM, Jed Brown <[email protected]> wrote: > bichinhoverde <[email protected]> writes: > > > Hi. I have some questions. > > > > What is the difference between DMCreateGlobalVector and DMGetGlobalVector > > (and the local counterparts)? > > Create creates a vector that the caller owns. Get merely gets access to > a vector from a managed pool (creating it if necessary), to be returned > via DMRestoreGlobalVector(). > > > What happens when one calls SNESSolve with NULL for the solution vector, > as > > in src/snes/examples/tutorials/ex7.c:158? SNESSolve(snes,NULL,NULL); > > A vector is created automatically. You can get access to it with > SNESGetSolution. >
