<div dir="ltr">On Fri, Feb 22, 2013 at 3:57 PM, Zhenglun (Alan) Wei <span dir="ltr"><<a href="mailto:zhenglun.wei@gmail.com" target="_blank">zhenglun.wei@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Dear all,<br>
I hope you're having a nice day.<br>
I wonder if anyone could point out a example for me about the<br>
DMDASetCoordinates(). I found this<br>
(<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/da/dacorn.c.html#DMDASetCoordinates" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/da/dacorn.c.html#DMDASetCoordinates</a>)<br>
online; however it does not really demonstrate how to create the<br>
'coordinate vector - c'.<br>
Also, I found that in the petsc sub-folder:<br>
/petsc-dev/src/dm/impls/patch has a patch.c, which I suppose that it<br>
does a local refinement for mesh. Does this a mature model that we can<br>
use or just a testing code?<br></blockquote><div><br></div><div style>Look at KSP ex49. In the routine DMDACoordViewGnuplot2d() it reads out the coordinates.</div><div style>You could just as easily set them in this fashion.</div>
<div style><br></div><div style>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
thanks,<br>
Alan<br>
<br>
On 11/7/2012 6:55 PM, Barry Smith wrote:<br>
> On Nov 7, 2012, at 6:50 PM, Alan <<a href="mailto:zhenglun.wei@gmail.com">zhenglun.wei@gmail.com</a>> wrote:<br>
><br>
>> Dear folks,<br>
>> I hope you're having a nice day.<br>
>> I'm testing the Poisson solver in /src/ksp/ksp/examples/tutorials/ex45.<br>
>> It uses the 'DMDACreate3d' to generate a Cartisian structured grid and<br>
>> solve it with uniform grid size. However, I attempt to modify it to<br>
>> obtain solution with a Cartsian structured grid and non-uniform grid (It<br>
>> is not unstructured local refined mesh). Should I still use the<br>
>> 'DMDACreate3d' and implement different grid size in 'ComputeMatrix' and<br>
>> 'ComputeRHS'? In other words, does 'DMDACreate3d' itself include any<br>
>> mesh size information?<br>
>    You can use DMDASetCoordinates() and DMDAGetCoordinates() (called DMSetCoordinates() and DMGetCoordinates() in petsc-dev) to keep track of the coordinates but you are responsible for generating the correctly scaled entries in the matrix etc.<br>

><br>
>    Barry<br>
><br>
>> thanks,<br>
>> Alan<br>
<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
</div></div>