[petsc-users] DASetCoordinates

Jed Brown jed at 59A2.org
Wed Oct 6 16:24:42 CDT 2010


On Wed, Oct 6, 2010 at 23:19, Randall Mackie <rlmackie862 at gmail.com> wrote:

> void PETSC_STDCALL dasetcoords_(DMMG **dmmg, PetscErrorCode *ierr)
>

This is a pointer-pointer, due to the way Fortran passes parameters.


> {
>  PetscInt i, nlev;
>
>  nlev = DMMGGetLevels(*dmmg);
>

It has to be dereferenced once to get the thing we usually work with in C.


>  printf("The number of levels is %d \n",nlev);
>
>  for (i=0; i < nlev; i++){
>
>   DA da = (DA)dmmg[i]->dm;
>

You can write DA da = (DA) (*dmmg)[i]->dm;

Jed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101006/0d5e977a/attachment.htm>


More information about the petsc-users mailing list