Changeset 14304
- Timestamp:
- 02/04/13 07:33:56 (12 years ago)
- Location:
- issm/trunk-jpl/src/wrappers/InternalFront
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/wrappers/InternalFront/InternalFront.cpp ¶
r13250 r14304 14 14 bool* elementonwater=NULL; 15 15 int* elements=NULL; 16 int* connectivity=NULL;17 16 int* elementconnectivity=NULL; 18 17 int* front=NULL; … … 20 19 bool found; 21 20 int numberofelements,numberofsegments; 22 int N,M;23 21 int i,j,ii,jj,id; 22 int dummy; 24 23 25 24 /*Boot module: */ 26 25 MODULEBOOT(); 27 26 28 /*checks on arguments on the matlab side: */29 C heckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InternalFrontUsage);27 /*checks on arguments: */ 28 CHECKARGUMENTS(NLHS,NRHS,&InternalFrontUsage); 30 29 31 /*Fetch required fields*/ 32 FetchData(&numberofelements,mxGetAssignedField(MODEL,0,"numberofelements")); 33 if(numberofelements<=0) _error_("No elements found in the model"); 34 FetchData(&elements,&M,&N,mxGetAssignedField(MODEL,0,"elements")); 35 if(M!=numberofelements || N!=3) _error_("Field 'elements' should be of size [md.numberofelements 3]"); 36 FetchData(&elementonwater,&M,&N,mxGetAssignedField(MODEL,0,"elementonwater")); 37 if(M!=numberofelements || N!=1) _error_("Field 'elementonwater' should be of size [md.numberofelements 1]"); 38 FetchData(&elementconnectivity,&M,&N,mxGetAssignedField(MODEL,0,"elementconnectivity")); 39 if(M!=numberofelements || N!=3) _error_("Field 'elementconnectivity' should be of size [md.numberofelements 3]"); 30 /*Fetch inputs: */ 31 FetchData(&elements,&numberofelements,&dummy,ELEMENTS); 32 FetchData(&elementonwater,&dummy,&dummy,ELEMENTONWATER); 33 FetchData(&elementconnectivity,&dummy,&dummy,ELEMENTCONNECTIVITY); 40 34 41 35 /*Allocate and initialize all variables*/ -
TabularUnified issm/trunk-jpl/src/wrappers/InternalFront/InternalFront.h ¶
r13749 r14304 27 27 #ifdef _HAVE_MATLAB_MODULES_ 28 28 /* serial input macros: */ 29 #define MODEL prhs[0] 29 #define ELEMENTS prhs[0] 30 #define ELEMENTONWATER prhs[1] 31 #define ELEMENTCONNECTIVITY prhs[2] 30 32 /* serial output macros: */ 31 33 #define FRONT (mxArray**)&plhs[0] … … 34 36 #ifdef _HAVE_PYTHON_MODULES_ 35 37 /* serial input macros: */ 36 #define MODEL PyTuple_GetItem(args,0) 38 #define ELEMENTS PyTuple_GetItem(args,0) 39 #define ELEMENTONWATER PyTuple_GetItem(args,1) 40 #define ELEMENTCONNECTIVITY PyTuple_GetItem(args,2) 37 41 /* serial output macros: */ 38 42 #define FRONT output,0] … … 43 47 #define NLHS 1 44 48 #undef NRHS 45 #define NRHS 149 #define NRHS 3 46 50 47 51 #endif
Note:
See TracChangeset
for help on using the changeset viewer.