[petsc-users] DMCreateGlobalVector in Fortran with petsc 3.8

Matthew Knepley knepley at gmail.com
Mon Nov 6 10:00:07 CST 2017


On Mon, Nov 6, 2017 at 9:25 AM, Chi huijun <qhjun at live.com> wrote:

> Hi. I have one questions.
>
>
>
> I use DMCreateGlobalVector to creat a global vec by this
>
>>
> DM::datotv
>
> Vec:ptotveq
>
>>
> call DMDACreate1d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,globalnode*cdofn,1,1
> ,PETSC_NULL_INTEGER,datotv,ierr)
>
> call DMCreateGlobalVector(datotv,ptotveq,ierr)
>
>
>
> it gives the wrong code
>
>
>
> [0]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [0]PETSC ERROR: Null argument, when expecting valid pointer
> [0]PETSC ERROR: Null Object: Parameter # 2
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.8.1, unknown
> [0]PETSC ERROR: /mnt/NFSwork/GeHoMadrid_Petsc/EXEC/GeHoMadrid on a
> arch-linux2-c-debug named linux-2euo by hstarlinux Mon Nov  6 22:21:50 2017
> [0]PETSC ERROR: Configure options --download-fblaslapack --download-metis
> --download-mpich --download-mumps --download-parmetis --download-scalapack
> PETSC_ARCH=arch-linux2-c-debug
> [0]PETSC ERROR: #1 VecSetLocalToGlobalMapping() line 78 in
> /home/hstarlinux/work/petsc/src/vec/vec/interface/vector.c
> [0]PETSC ERROR: #2 DMCreateGlobalVector_DA() line 41 in
> /home/hstarlinux/work/petsc/src/dm/impls/da/dadist.c
> [0]PETSC ERROR: #3 DMCreateGlobalVector() line 844 in
> /home/hstarlinux/work/petsc/src/dm/interface/dm.c
>
>
>
> The code run well with PETSc 3.6
>

You are missing DMSetUp().


> I haven’t find the Fortran example code of DMCreateGlobalVector. So how to
> use it correctly in fortran?
>

Here is one


https://bitbucket.org/petsc/petsc/src/dc424cfae46ffd055acbb99fbc61fc85fc92f9ad/src/snes/examples/tutorials/ex5f90.F90?at=master&fileviewer=file-view-default

  Thanks,

    Matt


>
>
> Thank you.
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171106/65280df5/attachment.html>


More information about the petsc-users mailing list