about accessing 'comm' and 'type_name' and others from PetscObject in new code

Barry Smith bsmith at mcs.anl.gov
Thu Aug 7 14:26:15 CDT 2008


     Guilty. I have changed them all the use the PetscObject cast you  
prefer.

    Barry

As to the macros: no, never, not in a million years :-)



On Aug 7, 2008, at 2:05 PM, Lisandro Dalcin wrote:

> I've noticed that recent commits are now accessing PetscObject
> internals like this
>
> obj->hdr.comm
> obj->hdr.type_name
>
> I would really prefer to not do that, and instead use the more verbose
>
> ((PetscObject)obj)->comm
> ((PetscObject)obj)->type_name
>
> If this is really disgusting, perhaps we should define and use some
> (private?) macros like below. By far, 'comm', 'type_name', and
> 'prefix' are the more commonly accessed members when implementeing
> Vec, Mat, KSP, PC, etc.
>
> PetscCOMM(obj)
> PetscTYPE(obj)
> PetscPREFIX(obj)
>
>
>
> -- 
> Lisandro Dalcín
> ---------------
> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> Tel/Fax: +54-(0)342-451.1594
>




More information about the petsc-dev mailing list