1de580fa9SBarry Smith /* 2e3c5b3baSBarry Smith Defines an interface to the MATLAB Engine from PETSc 3de580fa9SBarry Smith */ 4*6524c165SJacob Faibussowitsch #ifndef PETSCMATLAB_H 526bd1501SBarry Smith #define PETSCMATLAB_H 6de580fa9SBarry Smith 7ac09b921SBarry Smith /* SUBMANSEC = Sys */ 8ac09b921SBarry 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 4187497f52SBarry Smith Level: intermediate 4287497f52SBarry Smith 4387497f52SBarry Smith .seealso: `PetscMatlabEngine`, `PETSC_MATLAB_ENGINE_()`, `PETSC_MATLAB_ENGINE_SELF` 44de580fa9SBarry Smith M*/ 45de580fa9SBarry Smith #define PETSC_MATLAB_ENGINE_WORLD PETSC_MATLAB_ENGINE_(PETSC_COMM_WORLD) 46de580fa9SBarry Smith 47de580fa9SBarry Smith /*MC 48de580fa9SBarry Smith PETSC_MATLAB_ENGINE_SELF - same as PETSC_MATLAB_ENGINE_(PETSC_COMM_SELF) 49de580fa9SBarry Smith 5087497f52SBarry Smith Level: intermediate 5187497f52SBarry Smith 5287497f52SBarry Smith .seealso: `PetscMatlabEngine`, `PETSC_MATLAB_ENGINE_()`, `PETSC_MATLAB_ENGINE_WORLD` 53de580fa9SBarry Smith M*/ 54de580fa9SBarry Smith #define PETSC_MATLAB_ENGINE_SELF PETSC_MATLAB_ENGINE_(PETSC_COMM_SELF) 55de580fa9SBarry Smith 56de580fa9SBarry Smith #endif 57