Changeset 4166 for issm/trunk/src/c/io
- Timestamp:
- 06/23/10 12:23:55 (15 years ago)
- Location:
- issm/trunk/src/c/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/io/WriteData.cpp
r3961 r4166 97 97 *pdataref=dataref; 98 98 99 }100 /*}}}*/101 /*FUNCTION WriteData(mxArray** pdataref,DofVec* dofvec){{{1*/102 void WriteData(mxArray** pdataref,DofVec* dofvec){103 104 mxArray* mxvector=NULL;105 mxArray* structdataref=NULL;106 mxArray* dataref=NULL;107 108 int nfields=4;109 const char* fnames[nfields];110 mwSize onebyone[2] = {1,1};111 mwSize ndim=2;112 113 fnames[0] = "name";114 fnames[1] = "numdofs";115 fnames[2] = "numentries";116 fnames[3] = "vector";117 118 if(dofvec){119 120 /*call toolkit routine: */121 if(dofvec->vector)PetscVectorToMatlabVector(&mxvector,dofvec->vector);122 else mxvector=mxCreateDoubleMatrix(0,0,mxREAL);123 124 /*use the mxvector to create a dofvec object: */125 structdataref=mxCreateStructArray( ndim,onebyone,nfields,fnames);126 127 mxSetField( structdataref, 0, "name",mxCreateString(dofvec->name));128 mxSetField( structdataref, 0, "numdofs",mxCreateDoubleScalar(dofvec->numdofs));129 mxSetField( structdataref, 0, "numentries",mxCreateDoubleScalar(dofvec->numentries));130 mxSetField( structdataref, 0, "vector",mxvector);131 132 133 /*transform structure into dofvec class: */134 mexCallMATLAB( 1, &dataref, 1, &structdataref, "dofvec");135 }136 else{137 dataref = mxCreateDoubleMatrix(0,0,mxREAL);138 }139 *pdataref=dataref;140 99 } 141 100 /*}}}*/ -
issm/trunk/src/c/io/io.h
r3961 r4166 25 25 void WriteData(mxArray** pdataref,double scalar); 26 26 void WriteData(mxArray** pdataref,char* string); 27 void WriteData(mxArray** pdataref,DofVec* vector);28 27 void WriteData(mxArray** pdataref,BamgMesh* bm); 29 28 void WriteData(mxArray** pdataref,BamgGeom* bg);
Note:
See TracChangeset
for help on using the changeset viewer.