Changeset 22673
- Timestamp:
- 04/04/18 10:45:49 (7 years ago)
- Location:
- issm/trunk-jpl/src/wrappers/InterpFromGridToMesh
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.h ¶
r14996 r22673 51 51 #endif 52 52 53 #ifdef _HAVE_JAVASCRIPT_MODULES_ 54 /* serial input macros: */ 55 #define XHANDLE xIn,nodsIn,1 56 #define YHANDLE yIn,nodsIn,1 57 #define DATAHANDLE dataIn,nodsIn,1 58 #define XMESHHANDLE xMeshIn,nodsIn,1 59 #define YMESHHANDLE yMeshIn,nodsIn,1 60 #define DEFAULTHANDLE defaultValueIn 61 #define INTERPENUM interpTypeIn 62 /* serial output macros: */ 63 #define DATAMESH pdataMesh,NULL 64 #define WRAPPER(modulename) extern "C" { int InterpFromGridToMeshModule(double** pdataMesh, double* xIn, double* yIn, double* dataIn, double* xMeshIn, double* yMeshIn, double defaultValue, int nodsIn, char* interpTypeIn) 65 #endif 66 53 67 /* serial arg counts: */ 54 68 #undef NLHS -
TabularUnified issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.js ¶
r22663 r22673 5 5 * 6 6 * Usage: 7 * var data_mesh=InterpFromGridToMesh(xIn,yIn,dataIn,xMeshIn,yMeshIn,defaultValue );\7 * var data_mesh=InterpFromGridToMesh(xIn,yIn,dataIn,xMeshIn,yMeshIn,defaultValue,interpType);\ 8 8 * 9 9 * xIn,yIn : coordinates of matrix data. (x and y must be in increasing order) 10 10 * dataIn : matrix holding the data to be interpolated onto the mesh 11 11 * xMeshIn,yMeshIn : coordinates of the points onto which we interpolate 12 * defaultValue (optional) : default value if no data is found (holes) 12 * defaultValue : default value if no data is found (holes) 13 * interpType (optional) : interpolation type 13 14 * dataMesh : array of mesh interpolated data 14 15 */ 15 function InterpFromGridToMesh(xIn,yIn,dataIn,xMeshIn,yMeshIn,defaultValue In) {16 function InterpFromGridToMesh(xIn,yIn,dataIn,xMeshIn,yMeshIn,defaultValue) { 16 17 /* 17 18 Variables … … 24 25 var ddataHeap = {}; 25 26 var ddataPtr = {}; 26 var defaultValue = 0; // Default value for defaultValue :)27 27 var dx = {}; 28 28 var dxHeap = {}; … … 37 37 var dyMeshPtr = {}; 38 38 var dyPtr = {}; 39 var interpType = ''; 39 40 var ndata = {}; 40 41 var nods = 0; … … 50 51 //}}} 51 52 52 53 /* 54 Retrieve default value 55 */ 56 //{{{ 57 if (arguments.length === 6) { 58 var defaultValue = arguments[5]; 59 } 60 //}}} 61 62 53 63 54 /* 64 55 Dynamic allocations … … 109 100 110 101 /* 102 Retrieve interpolation type 103 */ 104 //{{{ 105 if (arguments.length === 7) { 106 interpType = arguments[6]; 107 } else { 108 interpType = 'bilinear'; 109 } 110 //}}} 111 112 /* 111 113 Output 112 114 */ 113 dataMeshPtr= Module._malloc(4);115 pdataMesh = Module._malloc(4); 114 116 //}}} 115 117 … … 125 127 'number', 126 128 [ 127 'number', 128 'number', 129 'number', 130 'number', 131 'number', 132 'number', 133 'number' 129 'number', // output : pdataMesh 130 'number', // input : x 131 'number', // input : y 132 'number', // input : data 133 'number', // input : xMesh 134 'number', // input : yMesh 135 'number', // input : defaultValue 136 'number', // input : nods 137 'string', // input : interpType 134 138 ] 135 139 ); … … 141 145 */ 142 146 //{{{ 143 InterpFromGrid 2MeshModule(144 dataMeshPtr,147 InterpFromGridToMeshModule( 148 pdataMesh, 145 149 x, 146 150 y, … … 148 152 xMesh, 149 153 yMesh, 150 nods, 151 defaultValue 154 defaultValue, 155 nods, 156 interpType 152 157 ); 153 158 //}}}
Note:
See TracChangeset
for help on using the changeset viewer.