On Fri, Nov 11, 2011 at 6:06 PM, xiaohl <span dir="ltr">&lt;<a href="mailto:xiaohl@ices.utexas.edu">xiaohl@ices.utexas.edu</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hi<br>
<br>
I am going to use user defined context for this function call<br>
DMDASetLocalFunction(da,(<u></u>DMDALocalFunction1) FormFunctionLocal);<br>
<br>
But How can I pass the &quot;ctx&quot; to the function FormFunctionLocal;<br>
<br>
PetscErrorCode FormFunctionLocal(<u></u>DMDALocalInfo *info, PetscScalar ***u,<br>
                                 PetscScalar ***f, void * ctx){<br>
}<br>
<br>
I look at the example<br>
/petsc-3.2-p2/src/snes/<u></u>examples/tutorials/ex19.c.html<br>
<br>
I think you intialize the &quot;user&quot; context  by<br>
DMMGCreate(comm,nlevels,&amp;user,<u></u>&amp;dmmg);<br>
for DMMG<br>
<br>
Do you have the similar routine for DMDA?<br></blockquote><div><br></div><div>If you use SNES, then you can pass it as the last argument to</div><div><br></div><div>  <a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/docs/manualpages/SNES/SNESSetFunction.html">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/docs/manualpages/SNES/SNESSetFunction.html</a></div>
<div><br></div><div>If you use SNESetDM() which sets this automatically, then it will use the one given to</div><div><br></div><div>  <a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/docs/manualpages/DM/DMSetApplicationContext.html">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/docs/manualpages/DM/DMSetApplicationContext.html</a></div>
<div><br></div><div>Barry: Where should this be documented?</div><div><br></div><div>    Matt</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hailong<br>
<br>
On Wed, 2 Nov 2011 15:53:27 -0500, Barry Smith &lt;<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Nov 2, 2011, at 3:42 PM, Matthew Knepley wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, Nov 2, 2011 at 8:38 PM, xiaohl &lt;<a href="mailto:xiaohl@ices.utexas.edu" target="_blank">xiaohl@ices.utexas.edu</a>&gt; wrote:<br>
Hi<br>
<br>
I am going to implement cell center difference method for<br>
u = - K grad p<br>
div u = f<br>
where p is the pressure , u is the velocity, f is the source term.<br>
<br>
my goal is to assemble the matrix and test the performance of different linear solvers in parallel.<br>
<br>
my question is how can I read the input file for K where K is n*n tensor.<br>
<br>
MatLoad()<br>
</blockquote>
<br>
   Hm, I think you should use a DMDA with n*n size dof and then use<br>
VecLoad() to load the entries of K.<br>
<br>
   Barry<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
second one is that do you have any similar examples?<br>
<br>
Nothing with the mixed-discretization of the Laplacian.<br>
<br>
   Matt<br>
<br>
Hailong<br>
<br>
<br>
<br>
--<br>
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</blockquote></blockquote>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>