[petsc-users] VecSetBlockSize with release 3.3

Matthew Knepley knepley at gmail.com
Fri Dec 21 06:52:04 CST 2012


On Fri, Dec 21, 2012 at 7:04 AM, Aldo Bonfiglioli
<aldo.bonfiglioli at unibas.it> wrote:
> Dear all,
> I am in the process of upgrading from 3.2  to 3.3.
>
> I am a little bit puzzled by the following change:
>> VecSetBlockSize() cannot be called after VecCreateSeq() or
>> VecCreateMPI() and must be called before VecSetUp() or
>> VecSetFromOptions() or before either VecSetType() or VecSetSizes()
> With the earlier release I used to do the following:
>
>          CALL VecCreateSeq(PETSC_COMM_SELF,NPOIN*NOFVAR,DT,IFAIL)
> C
> C
>           IF(NOFVAR.GT.1) CALL VecSetBlockSize(DT,NOFVAR,IFAIL)
>
> with 3.3 it looks like the following is required :
>
>
>           CALL VecCreate(PETSC_COMM_SELF,DT,IFAIL)
>           CALL VecSetType(DT,VECSEQ,IFAIL)
>           CALL VecSetBlockSize(DT,NOFVAR,IFAIL)
>           CALL VecSetSizes(DT,NPOIN*NOFVAR,PETSC_DECIDE,IFAIL)
>
> Is there a simpler (i.e. less library calls) way to achieve the same result?

No, there is a complicated set of dependencies here for setup. We discussed this
and could not find an easier way to do it.

Personally, I would never call SetType() in my code, only
VecSetFromOptions(). Also,
we call thee functions very rarely, since we almost always use VecDuplicate(),
DMGetGlobal/LocalVector(), etc.

   Matt

> Regards,
> Aldo
> --
> Dr. Aldo Bonfiglioli
> Associate professor of Fluid Flow Machinery
> Scuola di Ingegneria
> Universita' della Basilicata
> V.le dell'Ateneo lucano, 10 85100 Potenza ITALY
> tel:+39.0971.205203 fax:+39.0971.205215
>
>
> Publications list <http://publicationslist.org/aldo.bonfiglioli>



--
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


More information about the petsc-users mailing list