petsc-3.3-p7 2013-05-11

PetscShellSetURL

set a backend implementing PetscShell functionality from the URL string.

Synopsis

PetscErrorCode  PetscShellSetURL(PetscShell shell, const char url[])
Logically collective on PetscShell.

Input paramters

shell - - a PetscShell object
url - - URL string

Notes: URL can point to a backend -- a .so file or a .py file. A .so URL must have the form [<path>/<lib>.a:]<name> or [<path>/<lib>.so:]<name>, and the .a or the .so file must contain symbols for function 'void <name>Call(const char[])' or symbols 'void <name><Message>(void)' for any <message> that PetscShell is expected to understand. When PetscShellCall() is invoked with <message>, a symbol for 'void name<Message>(void)' is sought and called, if found. If not, a symbol for 'void <name>Call(const char[])' is sought and called with <message> as the argument. If neither symbol is found, an error occurs. A .py URL must have the form <path>/<module>.py:<name>, and the .py file must define a class <name> that implements 'call(str)' or '<message>()' methods, as above. If no URL has been set, shell attempts to respond to the message using function '<message>', and, failing that, using function 'call' with argument <message>; the functions are retrieved from shell using PetscObjectQueryFunction(). If neither '<message>' nor 'call' have been previusly composed with shell (see PetscObjectComposeFunction()), an error occurs.

.

See Also

PetscShellGetURL(), PetscObjectCompose(), PetscObjectQuery(), PetscObjectComposeFunction(), PetscShellCall()

Level:intermediate
Location:
src/sys/shell/interface/sysshell.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages