[petsc-users] Non-uniform Cartisian Grid
Zhenglun (Alan) Wei
zhenglun.wei at gmail.com
Fri Feb 22 14:57:28 CST 2013
Dear all,
I hope you're having a nice day.
I wonder if anyone could point out a example for me about the
DMDASetCoordinates(). I found this
(http://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/da/dacorn.c.html#DMDASetCoordinates)
online; however it does not really demonstrate how to create the
'coordinate vector - c'.
Also, I found that in the petsc sub-folder:
/petsc-dev/src/dm/impls/patch has a patch.c, which I suppose that it
does a local refinement for mesh. Does this a mature model that we can
use or just a testing code?
thanks,
Alan
On 11/7/2012 6:55 PM, Barry Smith wrote:
> On Nov 7, 2012, at 6:50 PM, Alan <zhenglun.wei at gmail.com> wrote:
>
>> Dear folks,
>> I hope you're having a nice day.
>> I'm testing the Poisson solver in /src/ksp/ksp/examples/tutorials/ex45.
>> It uses the 'DMDACreate3d' to generate a Cartisian structured grid and
>> solve it with uniform grid size. However, I attempt to modify it to
>> obtain solution with a Cartsian structured grid and non-uniform grid (It
>> is not unstructured local refined mesh). Should I still use the
>> 'DMDACreate3d' and implement different grid size in 'ComputeMatrix' and
>> 'ComputeRHS'? In other words, does 'DMDACreate3d' itself include any
>> mesh size information?
> 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.
>
> Barry
>
>> thanks,
>> Alan
More information about the petsc-users
mailing list