PetscTryMethod#

Queries an object for a method added with PetscObjectComposeFunction(), if it exists then calls it.

Synopsis#

#include "petsc/private/petscimpl.h"
PetscTryMethod(PetscObject obj,const char *name,(arg_types),(arg_value))

Input Parameters#

  • obj - the object

  • name - the name of the method, for example, “KSPGMRESSetRestart_C” for the function KSPGMRESSetRestart()

  • arg_types - the argument types for the method, for example, (KSP,PetscInt)

  • args - the arguments for the method, for example, (ksp,restart))

Notes#

The object is always the implicit first argument of the method and is not listed in arg_types or args

This does not return an error code, it is a macro that returns with an error code on error.

Use PetscUseTypeMethod() or PetscTryTypeMethod() to call functions that are included in the objects function table, the ops array in the object.

See Also#

PetscUseMethod(), PetscCall(), PetscUseTypeMethod(), PetscTryTypeMethod(), PetscCheck()

Level#

developer

Location#

include/petsc/private/petscimpl.h


Edit on GitLab

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages