- Timestamp:
- 08/28/18 09:45:51 (7 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 22823-22871,22873-22887,22894-22903,22905-23090,23092-23185,23187
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.js
r22758 r23189 6 6 * Usage: 7 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 … … 51 51 var yMesh = {}; 52 52 //}}} 53 53 54 54 55 55 /* … … 57 57 */ 58 58 //{{{ 59 59 60 60 /* 61 61 Input … … 68 68 dxHeap.set(new Uint8Array(dx.buffer)); 69 69 x = dxHeap.byteOffset; 70 70 71 71 dy = new Float64Array(yIn); 72 72 ny = dy.length * dy.BYTES_PER_ELEMENT; … … 75 75 dyHeap.set(new Uint8Array(dy.buffer)); 76 76 y = dyHeap.byteOffset; 77 77 78 78 ddata = new Float64Array(dataIn); 79 79 ndata = ddata.length * ddata.BYTES_PER_ELEMENT; … … 82 82 ddataHeap.set(new Uint8Array(ddata.buffer)); 83 83 data = ddataHeap.byteOffset; 84 84 85 85 dxMesh = new Float64Array(xMeshIn); 86 86 nxMesh = dxMesh.length * dxMesh.BYTES_PER_ELEMENT; … … 89 89 dxMeshHeap.set(new Uint8Array(dxMesh.buffer)); 90 90 xMesh = dxMeshHeap.byteOffset; 91 91 92 92 dyMesh = new Float64Array(yMeshIn); 93 93 nyMesh = dyMesh.length * dyMesh.BYTES_PER_ELEMENT; … … 96 96 dyMeshHeap.set(new Uint8Array(dyMesh.buffer)); 97 97 yMesh = dyMeshHeap.byteOffset; 98 98 99 99 nods = xMeshIn.length; 100 100 meshNumRows = xMeshIn.length; 101 102 101 102 103 103 /* 104 104 Retrieve interpolation type … … 111 111 } 112 112 //}}} 113 113 114 114 /* 115 115 Output … … 117 117 pdataMesh = Module._malloc(4); 118 118 //}}} 119 119 120 120 //}}} 121 122 121 122 123 123 /* 124 124 Declare InterpFromGridToMesh module … … 126 126 //{{{ 127 127 InterpFromGridToMeshModule = Module.cwrap( 128 'InterpFromGridToMeshModule', 129 'number', 128 'InterpFromGridToMeshModule', 129 'number', 130 130 [ 131 131 'number', // output : pdataMesh … … 144 144 ); 145 145 //}}} 146 147 146 147 148 148 /* 149 149 Call InterpFromGridToMesh module … … 151 151 //{{{ 152 152 InterpFromGridToMeshModule( 153 pdataMesh, 154 x, 155 y, 156 data, 157 xMesh, 158 yMesh, 159 defaultValue, 153 pdataMesh, 154 x, 155 y, 156 data, 157 xMesh, 158 yMesh, 159 defaultValue, 160 160 nods, 161 161 dataNumRowsIn, … … 165 165 ); 166 166 //}}} 167 168 167 168 169 169 /* 170 170 Dynamic copying from heap … … 174 174 dataMesh = Module.HEAPF64.slice(dataMeshPtr / 8, dataMeshPtr / 8 + nods); 175 175 //}}} 176 177 176 177 178 178 /* 179 179 Free resources … … 182 182 Module._free(pdataMesh); 183 183 //}}} 184 185 184 185 186 186 return dataMesh; 187 187 }
Note:
See TracChangeset
for help on using the changeset viewer.