[petsc-users] DMSNESSet<Function,Jacobian>

Dharmendar Reddy dharmareddy84 at gmail.com
Mon Apr 1 18:16:04 CDT 2013


Hello,
        I am confused about the usage of SNESSetFunction,
DMSNESSetFunction, DMSNESSetFunctionLocal and the corresponding Jacobin
routines.

At present my code is set up as follows.

I initiate SNES with getFunction and getJacobain routines required as per
SNESSet<Function,Jacobian>. I pass a user context  which has the mesh  and
field layout information. I assemble the residual function and Jacobin
element wise using the information from user context. My code at this point
is serial, so i run the element loop from 1 to numberofTotalElements.

Now i want to switch to using DMPlex. How should i change the interface to
my code.

If i set the dm for snes using SNESSetDM, i can see that the DM can be
accessed via SNESGetDM inside getFunction and getJacobian, then i get the
elementStartID and elementEndID to run the loop for assmbler. But now i
will have to assemble to local vector into global vector right ?

Looks like the DMSNESSetFunctionLocal will assemble the local
vector into global vector. The function provided to this should just
evaluate the local vector. Did i understand this right ?

I am confused about passing the DM in DMSNESSet<Function,Jacobian>. When
the DM can be accessed via SNESGetDM, why do we pass it again explicitly ?
-- 
-----------------------------------------------------
Dharmendar Reddy Palle
Graduate Student
Microelectronics Research center,
University of Texas at Austin,
10100 Burnet Road, Bldg. 160
MER 2.608F, TX 78758-4445
e-mail: dharmareddy84 at gmail.com
Phone: +1-512-350-9082
United States of America.
Homepage: https://webspace.utexas.edu/~dpr342
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130401/820d95f1/attachment.html>


More information about the petsc-users mailing list