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