Actual source code: petscmatlab.h
1: /*
2: Defines an interface to the MATLAB Engine from PETSc
3: */
4: #pragma once
6: /* MANSEC = Sys */
7: /* SUBMANSEC = Matlab */
9: PETSC_EXTERN PetscClassId MATLABENGINE_CLASSID;
11: /*S
12: PetscMatlabEngine - Object used to communicate with MATLAB
14: Level: intermediate
16: Notes:
17: `Mat`s transferred between PETSc and MATLAB and vis versa are transposed in the other space
18: (this is because MATLAB uses compressed column format and PETSc uses compressed row format)
20: One must `./configure` PETSc with `--with-matlab [-with-matlab-dir=matlab_root_directory]` to
21: use this capability
23: .seealso: `PetscMatlabEngineCreate()`, `PetscMatlabEngineDestroy()`, `PetscMatlabEngineEvaluate()`,
24: `PetscMatlabEngineGetOutput()`, `PetscMatlabEnginePut()`, `PetscMatlabEngineGet()`,
25: `PetscMatlabEnginePrintOutput()`, `PetscMatlabEnginePutArray()`, `PetscMatlabEngineGetArray()`,
26: `PETSC_MATLAB_ENGINE_()`, `PETSC_MATLAB_ENGINE_SELF`, `PETSC_MATLAB_ENGINE_WORLD`
27: S*/
28: typedef struct _p_PetscMatlabEngine *PetscMatlabEngine;
30: PETSC_EXTERN PetscErrorCode PetscMatlabEngineCreate(MPI_Comm, const char[], PetscMatlabEngine *);
31: PETSC_EXTERN PetscErrorCode PetscMatlabEngineDestroy(PetscMatlabEngine *);
32: PETSC_EXTERN PetscErrorCode PetscMatlabEngineEvaluate(PetscMatlabEngine, const char[], ...);
33: PETSC_EXTERN PetscErrorCode PetscMatlabEngineGetOutput(PetscMatlabEngine, const char **);
34: PETSC_EXTERN PetscErrorCode PetscMatlabEnginePrintOutput(PetscMatlabEngine, FILE *);
35: PETSC_EXTERN PetscErrorCode PetscMatlabEnginePut(PetscMatlabEngine, PetscObject);
36: PETSC_EXTERN PetscErrorCode PetscMatlabEngineGet(PetscMatlabEngine, PetscObject);
37: PETSC_EXTERN PetscErrorCode PetscMatlabEnginePutArray(PetscMatlabEngine, int, int, const PetscScalar *, const char[]);
38: PETSC_EXTERN PetscErrorCode PetscMatlabEngineGetArray(PetscMatlabEngine, int, int, PetscScalar *, const char[]);
40: PETSC_EXTERN PetscMatlabEngine PETSC_MATLAB_ENGINE_(MPI_Comm);
42: /*MC
43: PETSC_MATLAB_ENGINE_WORLD - same as PETSC_MATLAB_ENGINE_(PETSC_COMM_WORLD)
45: Level: intermediate
47: .seealso: `PetscMatlabEngine`, `PETSC_MATLAB_ENGINE_()`, `PETSC_MATLAB_ENGINE_SELF`
48: M*/
49: #define PETSC_MATLAB_ENGINE_WORLD PETSC_MATLAB_ENGINE_(PETSC_COMM_WORLD)
51: /*MC
52: PETSC_MATLAB_ENGINE_SELF - same as PETSC_MATLAB_ENGINE_(PETSC_COMM_SELF)
54: Level: intermediate
56: .seealso: `PetscMatlabEngine`, `PETSC_MATLAB_ENGINE_()`, `PETSC_MATLAB_ENGINE_WORLD`
57: M*/
58: #define PETSC_MATLAB_ENGINE_SELF PETSC_MATLAB_ENGINE_(PETSC_COMM_SELF)