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