Ignore:
Timestamp:
08/28/18 09:45:51 (7 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 23187

Location:
issm/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • issm/trunk/src

  • issm/trunk/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.js

    r22758 r23189  
    66 * Usage:
    77 *      var data_mesh=InterpFromGridToMesh(xIn,yIn,dataIn,xMeshIn,yMeshIn,defaultValue,interpType);\
    8  * 
     8 *
    99 *      xIn,yIn                                         : coordinates of matrix data. (x and y must be in increasing order)
    1010 *      dataIn                                          : matrix holding the data to be interpolated onto the mesh
     
    5151        var yMesh                       = {};
    5252        //}}}
    53        
     53
    5454
    5555        /*
     
    5757        */
    5858        //{{{
    59        
     59
    6060        /*
    6161                Input
     
    6868        dxHeap.set(new Uint8Array(dx.buffer));
    6969        x                       = dxHeap.byteOffset;
    70        
     70
    7171        dy                      = new Float64Array(yIn);
    7272        ny                      = dy.length * dy.BYTES_PER_ELEMENT;
     
    7575        dyHeap.set(new Uint8Array(dy.buffer));
    7676        y                       = dyHeap.byteOffset;
    77        
     77
    7878        ddata           = new Float64Array(dataIn);
    7979        ndata           = ddata.length * ddata.BYTES_PER_ELEMENT;
     
    8282        ddataHeap.set(new Uint8Array(ddata.buffer));
    8383        data            = ddataHeap.byteOffset;
    84        
     84
    8585        dxMesh          = new Float64Array(xMeshIn);
    8686        nxMesh          = dxMesh.length * dxMesh.BYTES_PER_ELEMENT;
     
    8989        dxMeshHeap.set(new Uint8Array(dxMesh.buffer));
    9090        xMesh           = dxMeshHeap.byteOffset;
    91        
     91
    9292        dyMesh          = new Float64Array(yMeshIn);
    9393        nyMesh          = dyMesh.length * dyMesh.BYTES_PER_ELEMENT;
     
    9696        dyMeshHeap.set(new Uint8Array(dyMesh.buffer));
    9797        yMesh           = dyMeshHeap.byteOffset;
    98        
     98
    9999        nods            = xMeshIn.length;
    100100        meshNumRows     = xMeshIn.length;
    101        
    102        
     101
     102
    103103        /*
    104104                Retrieve interpolation type
     
    111111        }
    112112        //}}}
    113        
     113
    114114        /*
    115115                Output
     
    117117        pdataMesh = Module._malloc(4);
    118118        //}}}
    119        
     119
    120120        //}}}
    121        
    122        
     121
     122
    123123        /*
    124124                Declare InterpFromGridToMesh module
     
    126126        //{{{
    127127        InterpFromGridToMeshModule = Module.cwrap(
    128                 'InterpFromGridToMeshModule', 
    129                 'number', 
     128                'InterpFromGridToMeshModule',
     129                'number',
    130130                [
    131131                        'number', // output : pdataMesh
     
    144144        );
    145145        //}}}
    146        
    147        
     146
     147
    148148        /*
    149149                Call InterpFromGridToMesh module
     
    151151        //{{{
    152152        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,
    160160                nods,
    161161                dataNumRowsIn,
     
    165165        );
    166166        //}}}
    167        
    168        
     167
     168
    169169        /*
    170170                Dynamic copying from heap
     
    174174        dataMesh        = Module.HEAPF64.slice(dataMeshPtr / 8, dataMeshPtr / 8 + nods);
    175175        //}}}
    176        
    177        
     176
     177
    178178        /*
    179179                Free resources
     
    182182        Module._free(pdataMesh);
    183183        //}}}
    184        
    185        
     184
     185
    186186        return dataMesh;
    187187}
Note: See TracChangeset for help on using the changeset viewer.