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