xref: /petsc/include/petscmatlab.h (revision ac09b9214d23ea9ad238aa607de9fa447fd4e91b)
1de580fa9SBarry Smith /*
2e3c5b3baSBarry Smith     Defines an interface to the MATLAB Engine from PETSc
3de580fa9SBarry Smith */
426bd1501SBarry Smith #if !defined(PETSCMATLAB_H)
526bd1501SBarry Smith #define PETSCMATLAB_H
6de580fa9SBarry Smith 
7*ac09b921SBarry Smith /* SUBMANSEC = Sys */
8*ac09b921SBarry Smith 
9014dd563SJed Brown PETSC_EXTERN PetscClassId MATLABENGINE_CLASSID;
10de580fa9SBarry Smith 
11de580fa9SBarry Smith /*S
12e3c5b3baSBarry Smith      PetscMatlabEngine - Object used to communicate with MATLAB
13de580fa9SBarry Smith 
14de580fa9SBarry Smith    Level: intermediate
15de580fa9SBarry Smith 
16ddcfb6fcSBarry Smith    Note: Mats transfered between PETSc and MATLAB and vis versa are transposed in the other space
17ddcfb6fcSBarry Smith          (this is because MATLAB uses compressed column format and PETSc uses compressed row format)
18ddcfb6fcSBarry Smith 
19db781477SPatrick Sanan .seealso: `PetscMatlabEngineCreate()`, `PetscMatlabEngineDestroy()`, `PetscMatlabEngineEvaluate()`,
20db781477SPatrick Sanan           `PetscMatlabEngineGetOutput()`, `PetscMatlabEnginePut()`, `PetscMatlabEngineGet()`,
21db781477SPatrick Sanan           `PetscMatlabEnginePrintOutput()`, `PetscMatlabEnginePutArray()`, `PetscMatlabEngineGetArray()`,
22db781477SPatrick Sanan           `PETSC_MATLAB_ENGINE_()`, `PETSC_MATLAB_ENGINE_SELF`, `PETSC_MATLAB_ENGINE_WORLD`
23de580fa9SBarry Smith S*/
24de580fa9SBarry Smith typedef struct _p_PetscMatlabEngine* PetscMatlabEngine;
25de580fa9SBarry Smith 
26014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscMatlabEngineCreate(MPI_Comm,const char[],PetscMatlabEngine*);
27014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscMatlabEngineDestroy(PetscMatlabEngine*);
28014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscMatlabEngineEvaluate(PetscMatlabEngine,const char[],...);
29014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscMatlabEngineGetOutput(PetscMatlabEngine,char **);
30014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscMatlabEnginePrintOutput(PetscMatlabEngine,FILE*);
31014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscMatlabEnginePut(PetscMatlabEngine,PetscObject);
32014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscMatlabEngineGet(PetscMatlabEngine,PetscObject);
33014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscMatlabEnginePutArray(PetscMatlabEngine,int,int,const PetscScalar*,const char[]);
34014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscMatlabEngineGetArray(PetscMatlabEngine,int,int,PetscScalar*,const char[]);
35de580fa9SBarry Smith 
36014dd563SJed Brown PETSC_EXTERN PetscMatlabEngine  PETSC_MATLAB_ENGINE_(MPI_Comm);
37de580fa9SBarry Smith 
38de580fa9SBarry Smith /*MC
39de580fa9SBarry Smith   PETSC_MATLAB_ENGINE_WORLD - same as PETSC_MATLAB_ENGINE_(PETSC_COMM_WORLD)
40de580fa9SBarry Smith 
41de580fa9SBarry Smith   Level: developer
42de580fa9SBarry Smith M*/
43de580fa9SBarry Smith #define PETSC_MATLAB_ENGINE_WORLD PETSC_MATLAB_ENGINE_(PETSC_COMM_WORLD)
44de580fa9SBarry Smith 
45de580fa9SBarry Smith /*MC
46de580fa9SBarry Smith   PETSC_MATLAB_ENGINE_SELF - same as PETSC_MATLAB_ENGINE_(PETSC_COMM_SELF)
47de580fa9SBarry Smith 
48de580fa9SBarry Smith   Level: developer
49de580fa9SBarry Smith M*/
50de580fa9SBarry Smith #define PETSC_MATLAB_ENGINE_SELF  PETSC_MATLAB_ENGINE_(PETSC_COMM_SELF)
51de580fa9SBarry Smith 
52de580fa9SBarry Smith #endif
53