vmatlab.c (1ed6e3ff8437baa411029a28c2b08f047df9ad9a) vmatlab.c (f13dfd9ea68e0ddeee984e65c377a1819eab8a8a)
1#include <petsc/private/viewerimpl.h> /*I "petscviewer.h" I*/
2#include <mat.h> /*I "petscmat.h" I*/
1#include <petsc/private/viewerimpl.h>
2#include <mat.h>
3
4typedef struct {
5 MATFile *ep;
6 PetscMPIInt rank;
7 PetscFileMode btype;
8} PetscViewer_Matlab;
9
10/*@C

--- 51 unchanged lines hidden (view full) ---

62 PetscViewerMatlabGetArray - Gets a variable from a `PETSCVIEWERMATLAB` viewer into an array
63
64 Not Collective; only processor zero reads in the array
65
66 Input Parameters:
67+ mfile - the MATLAB file viewer
68. m - the first dimensions of `array`
69. n - the second dimensions of `array`
3
4typedef struct {
5 MATFile *ep;
6 PetscMPIInt rank;
7 PetscFileMode btype;
8} PetscViewer_Matlab;
9
10/*@C

--- 51 unchanged lines hidden (view full) ---

62 PetscViewerMatlabGetArray - Gets a variable from a `PETSCVIEWERMATLAB` viewer into an array
63
64 Not Collective; only processor zero reads in the array
65
66 Input Parameters:
67+ mfile - the MATLAB file viewer
68. m - the first dimensions of `array`
69. n - the second dimensions of `array`
70. array - the array (represented in one dimension)
70. array - the array (represented in one dimension), must of be length `m` * `n`
71- name - the MATLAB name of `array`
72
73 Level: advanced
74
75 Note:
76 Only reads in `array` values on processor 0.
77
78.seealso: `PETSCVIEWERMATLAB`, `PetscViewerMatlabPutArray()`

--- 111 unchanged lines hidden (view full) ---

190
191 PetscCall(PetscObjectComposeFunction((PetscObject)viewer, "PetscViewerFileSetName_C", PetscViewerFileSetName_Matlab));
192 PetscCall(PetscObjectComposeFunction((PetscObject)viewer, "PetscViewerFileSetMode_C", PetscViewerFileSetMode_Matlab));
193
194 viewer->ops->destroy = PetscViewerDestroy_Matlab;
195 PetscFunctionReturn(PETSC_SUCCESS);
196}
197
71- name - the MATLAB name of `array`
72
73 Level: advanced
74
75 Note:
76 Only reads in `array` values on processor 0.
77
78.seealso: `PETSCVIEWERMATLAB`, `PetscViewerMatlabPutArray()`

--- 111 unchanged lines hidden (view full) ---

190
191 PetscCall(PetscObjectComposeFunction((PetscObject)viewer, "PetscViewerFileSetName_C", PetscViewerFileSetName_Matlab));
192 PetscCall(PetscObjectComposeFunction((PetscObject)viewer, "PetscViewerFileSetMode_C", PetscViewerFileSetMode_Matlab));
193
194 viewer->ops->destroy = PetscViewerDestroy_Matlab;
195 PetscFunctionReturn(PETSC_SUCCESS);
196}
197
198/*@
198/*@C
199 PetscViewerMatlabOpen - Opens a MATLAB .mat file for output
200
201 Collective
202
203 Input Parameters:
204+ comm - MPI communicator
205. name - name of file
206- type - type of file

--- 127 unchanged lines hidden ---
199 PetscViewerMatlabOpen - Opens a MATLAB .mat file for output
200
201 Collective
202
203 Input Parameters:
204+ comm - MPI communicator
205. name - name of file
206- type - type of file

--- 127 unchanged lines hidden ---