[petsc-dev] MatSetDA -> MatSetDM

Jed Brown jed at 59A2.org
Thu Mar 17 07:35:49 CDT 2011


On Thu, Mar 17, 2011 at 13:19, Lisandro Dalcin <dalcinl at gmail.com> wrote:

> 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() ?
>

It's a documentation problem as much as anything, technically these wrappers
are one-liners to create (caps because it's a compile-time definition).

petscsys.h:

#define PETSC_OBJECT_FORWARD_DEFINE1(type,method,arg1type) \
  PETSC_STATIC_INLINE PetscErrorCode type ## method (type obj,arg1type arg1)
{ \
    PetscErrorCode ierr; \
    PetscFunctionBegin; \
    PetscValidHeaderSpecific(obj,type ## _CLASSID,1); \
    ierr = PetscObject ## method ((PetscObject)obj,arg1);CHKERRQ(ierr); \
    PetscFunctionReturn(0);
  }

petscdm.h:

PETSC_OBJECT_FORWARD_DEFINE1(DM,GetComm,MPI_Comm*)


I don't have a strong opinion about whether or not to have these wrappers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110317/1c7a9b5a/attachment.html>


More information about the petsc-dev mailing list