[petsc-users] Passing DMMG struct.
Chris Bording
chris.bording at gmail.com
Mon Nov 22 17:02:18 CST 2010
I made the change in the function so I now get this error
PetscErrorCode ComputeRho(DMMG *dmmg, Vec rho)
{
DA distA = (DA)dmmg->dm;
In function ‘PetscErrorCode Myfunc(_n_DMMG**, _p_Vec*)’:
error: request for member ‘dm’ in ‘* dmmg’, which is of non-class type
‘_n_DMMG*’
It looks like I have a null pointer to _n_DMMG** instead of _n_DMMG*
Chris
On Mon, Nov 22, 2010 at 1:34 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> On Nov 22, 2010, at 3:23 PM, Chris Bording wrote:
>
> > Hi I am trying to pass the DMMG struct to a function similar to what is
> in the examples.
> >
> > extern PetscErrorCode Myfunc(DMMG,Vec);
> >
> >
> > int main(int argc,char **argv)
> > {
> > DMMG *dmmg;
> ^^^^^^ Note this
> > ...Vec b;
> >
> > Myfunc(dmmg,b)
> > }
> >
> > PetscErrorCode Myfunc(DMMG *dmmg, Vec b)
> ^^^ add this
>
> > {
> > DA da = (DA)dmmg->dm;
> > .....
> > }
> >
> > error: cannot convert ‘_n_DMMG**’ to ‘_n_DMMG*’ for argument ‘1’ to
> ‘PetscErrorCode Myfunc(_n_DMMG*, _p_Vec*)
> >
> > So how do I pass a DMMG defined structure into my function?
> >
> >
> >
> > Thanks
> > Chris
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101122/149ef9e0/attachment.htm>
More information about the petsc-users
mailing list