[petsc-dev] MatSetDA -> MatSetDM

Lisandro Dalcin dalcinl at gmail.com
Thu Mar 17 07:19:23 CDT 2011


On 16 March 2011 23:27, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>
>   No. Then we need VecGetComm(), KSPGetComm(), MonkeyGetComm() and it never ends
>

Yes, I know...

>   Perhaps
>
>   PetscErrorCode PetscObjectGetComm_(PetscObject,MPI_Comm*);
>   #define PetscObjectGetComm(A,B) PetscObjectGetComm_((PetscObject)A,B)
>
>   to hide the uglyness?
>

The problem with this is that you effectively loose type checking...
You can PetscObjectGetComm() with whatever crap, and you do not notice
until runtime.

>   In fact, XXXXSetOptionsPrefix() could be all wrapped up in PetscObjectSetOptionsPrefix(). Heck even XXXSetFromOptions() and XXXSetUp() could be wrapped in PetscObjectSetFromOptions(), PetscObjectSetUp() but that may be going too far :-)
>

Well, you have a very valid point, but as I said, PetscObjectXXX()
calls are nasty to use and you loose type checking... What about
providing XXSetup(), XXXGetComm(), XXXSetFromOptions(), and any other
important enough as STATIC_INLINE functions being a thin wrapper to
the corresponding PetscObjectXXX() ?


-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169



More information about the petsc-dev mailing list