:orphan:
# PetscViewerMathematicaOpen
Communicates with Mathemtica using MathLink. 
## Synopsis
```
PetscErrorCode PetscViewerMathematicaOpen(MPI_Comm comm, int port, const char machine[], const char mode[], PetscViewer *v)
```
Collective


## Input Parameters

- ***comm    -*** The MPI communicator
- ***port    -*** [optional] The port to connect on, or PETSC_DECIDE
- ***machine -*** [optional] The machine to run Mathematica on, or NULL
- ***mode    -*** [optional] The connection mode, or NULL



## Output Parameter

- ***viewer  -*** The Mathematica viewer



## Options Database Keys

- ***-viewer_math_linkhost <machine> -*** The host machine for the kernel
- ***-viewer_math_linkname <name>    -*** The full link name for the connection
- ***-viewer_math_linkport <port>    -*** The port for the connection
- ***-viewer_math_mode <mode>        -*** The mode, e.g. Launch, Connect
- ***-viewer_math_type <type>        -*** The plot type, e.g. Triangulation, Vector
- ***-viewer_math_graphics <output>  -*** The output type, e.g. Motif, PS, PSFile





## Note
Most users should employ the following commands to access the
Mathematica viewers
```none
    PetscViewerMathematicaOpen(MPI_Comm comm, int port, char *machine, char *mode, PetscViewer &viewer)
    MatView(Mat matrix, PetscViewer viewer)

                or

    PetscViewerMathematicaOpen(MPI_Comm comm, int port, char *machine, char *mode, PetscViewer &viewer)
    VecView(Vec vector, PetscViewer viewer)
```



## See Also
 `PETSCVIEWERMATHEMATICA`, `MatView()`, `VecView()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/mathematica/mathematica.c.html#PetscViewerMathematicaOpen">src/sys/classes/viewer/impls/mathematica/mathematica.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex15.c.html">src/vec/vec/tutorials/ex15.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/impls/mathematica/mathematica.c)


[Index of all Viewer routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
