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