<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Folks,<br>
<br>
I am adding some pointers to scatter contexts within the internal
"data" struct for DMShell, e.g. the 'gtol' and 'ltog' members in<br>
<br>
typedef struct {<br>
Vec Xglobal;<br>
Vec Xlocal;<br>
Mat A;<br>
VecScatter *gtol;<br>
VecScatter *ltog;<br>
} DM_Shell;<br>
<br>
First question: When in DMCreate_Shell we do<br>
<br>
ierr = PetscNewLog(dm,DM_Shell,&shell);CHKERRQ(ierr);<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
will this guarantee that gtol and ltog are set to NULL, or do I need
to explicitly set these somewhere? I see that the allocated memory
is zeroed but I'm not sure how NULL might actually be represented in
memory.<br>
<br>
I have also added some new functions like
DMShellDefaultGlobalToLocalBegin()/End(), and in DMCreate_Shell I do
<br>
<br>
dm->ops->globaltolocalbegin =
DMShellDefaultGlobalToLocalBegin;<br>
dm->ops->globaltolocalend =
DMShellDefaultGlobalToLocalEnd;<br>
<br>
The user can set different routines via
DMShellSetGlobalToLocalBegin()/End(), but if the user only sets the
gtol and ltog scatter contexts, then the default routines will
perform the appropriate scatter operations.<br>
<br>
Second question: What is the proper "PETSc way" to throw an error if
gtol is NULL and tell the user that
DMShellDefaultGlobalToLocalBegin() cannot be used without first
setting the scatter context via DMShellSetGlobalToLocalVecScatter()?<br>
<br>
Thanks,<br>
Richard<br>
<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Richard Tran Mills, Ph.D.
Computational Earth Scientist | Joint Assistant Professor
Hydrogeochemical Dynamics Team | EECS and Earth & Planetary Sciences
Oak Ridge National Laboratory | University of Tennessee, Knoxville
E-mail: <a class="moz-txt-link-abbreviated" href="mailto:rmills@ornl.gov">rmills@ornl.gov</a> V: 865-241-3198 <a class="moz-txt-link-freetext" href="http://climate.ornl.gov/~rmills">http://climate.ornl.gov/~rmills</a>
</pre>
</body>
</html>