xref: /petsc/src/sys/classes/viewer/impls/mathematica/mathematica.h (revision 9371c9d470a9602b6d10a8bf50c9b2280a79e45a)
1 /*
2    This is the definition of the Mathematica viewer structure.
3 */
4 
5 #include <petsc/private/viewerimpl.h> /*I  "petscsys.h"  I*/
6 #if defined(PETSC_HAVE_MATHEMATICA)
7 #include <mathlink.h>
8 #endif
9 
10 typedef enum {
11   MATHEMATICA_LINK_CREATE,
12   MATHEMATICA_LINK_CONNECT,
13   MATHEMATICA_LINK_LAUNCH
14 } LinkMode;
15 
16 typedef struct {
17 #if defined(PETSC_HAVE_MATHEMATICA)
18   MLINK link; /* The link to Mathematica */
19 #endif
20   char       *linkname; /* The name to link to Mathematica on (usually a port) */
21   char       *linkhost; /* The host to link to Mathematica on */
22   LinkMode    linkmode; /* The link mode */
23   const char *objName;  /* The name for the next object passed to Mathematica */
24 } PetscViewer_Mathematica;
25 
26 PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetFromOptions(PetscViewer);
27 PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetLinkName(PetscViewer, const char *);
28 PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetLinkPort(PetscViewer, int);
29 PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetLinkHost(PetscViewer, const char *);
30 PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetLinkMode(PetscViewer, LinkMode);
31