[petsc-dev] Microsoft doesn't like

Jed Brown jed at jedbrown.org
Mon Mar 10 15:29:28 CDT 2014


Barry Smith <bsmith at mcs.anl.gov> writes:

> /home/sbalay/petsc.clone-2/bin/win32fe/win32fe cl -o ex7.o -c -DMPICH_SKIP_MPICXX -MT -GR -EHsc -Z7 -Zm200  -TP    -I/home/sbalay/petsc.clone-2/include -I/home/sbalay/petsc.clone-2/arch-mswin-cxx-cmplx/include -I/cygdrive/c/Program\ Files/MPICH2/include    `pwd`/ex7.c
> ex7.c
> C:\cygwin\home\sbalay\PETSC~2.CLO\src\snes\examples\TUTORI~1\ex7.c(297) : error C2440: 'initializing' : cannot convert from 'const double' to 'Field'
>         No constructor could take the source type, or constructor overload resolution was ambiguous
> C:\cygwin\home\sbalay\PETSC~2.CLO\src\snes\examples\TUTORI~1\ex7.c(297) : error C2440: 'initializing' : cannot convert from 'const double' to 'Field'
>         No constructor could take the source type, or constructor overload resolution was ambiguous
>
> typedef struct {
>   PetscScalar u;
>   PetscScalar v;
>   PetscScalar p;
> } Field;
>
>
> PetscErrorCode constantResidual(PetscReal lambda, PetscBool isLower, int i, int j, PetscReal hx, PetscReal hy, Field r[])
> {
>   Field       rLocal[3] = {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}};

(u,v,p) but you only initialize two fields?

>   PetscScalar phi[3]    = {0.0, 0.0, 0.0};
>   PetscReal   xI = i*hx, yI = j*hy, hxhy = hx*hy;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140310/7b774e73/attachment.sig>


More information about the petsc-dev mailing list