Changeset 24304


Ignore:
Timestamp:
10/31/19 12:37:11 (5 years ago)
Author:
jdquinn
Message:

BUG: Completed update to JavaScript wrappers; now successfully pulling and compiling with latest version of Emscripten (yay!)

Location:
issm/trunk-jpl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/jenkins/linux64_ross_javascript

    r23166 r24304  
    55
    66#ISSM CONFIGURATION
    7 ISSM_CONFIG='--prefix="$ISSM_DIR" \
     7ISSM_CONFIG='\
     8    --prefix="${ISSM_DIR}" \
    89    --disable-shared \
    910    --with-javascript \
    10     --with-triangle-dir="$ISSM_DIR/externalpackages/triangle/install-javascript" \
    11     --with-gsl-dir="$ISSM_DIR/externalpackages/gsl/install-javascript" \
    1211    --without-Love \
    1312    --without-kml \
    1413    --without-kriging \
    15     --with-cxxoptflags="-O2" \
    16     CXXFLAGS="-O2" \
    17     CFLAGS="-O2"'
     14    --with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install-javascript" \
     15    --with-gsl-dir="$ISSM_DIR/externalpackages/gsl/install-javascript"\
     16'
    1817
    1918#PYTHON and MATLAB testing
     
    2120PYTHON_TEST=0
    2221JAVASCRIPT_TEST=1
     22
     23# Environment
     24#export EMCC_DEBUG=1 # Uncomment to enable debugging
     25export EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0" # Required after v1.38.14
    2326
    2427#-----------------------------------#
  • issm/trunk-jpl/src/wrappers/BamgMesher/BamgMesher.h

    r24011 r24304  
    2222#include "../bindings.h"
    2323
    24 #undef __FUNCT__ 
     24#undef __FUNCT__
    2525#define __FUNCT__  "BamgMesher"
    2626
     
    4949#define BAMGMESHIN VerticesSize_mesh_in, Vertices_mesh_in, EdgesSize_mesh_in, Edges_mesh_in, TrianglesSize_mesh_in, Triangles_mesh_in, CrackedEdgesSize_mesh_in, CrackedEdges_mesh_in, VerticesOnGeomEdgeSize_mesh_in, VerticesOnGeomEdge_mesh_in, VerticesOnGeomVertexSize_mesh_in, VerticesOnGeomVertex_mesh_in, EdgesOnGeomEdgeSize_mesh_in, EdgesOnGeomEdge_mesh_in, IssmSegmentsSize_mesh_in, IssmSegments_mesh_in
    5050#define BAMGGEOMIN VerticesSize_geom_in, Vertices_geom_in, EdgesSize_geom_in, Edges_geom_in, CornersSize_geom_in, Corners_geom_in, RequiredVerticesSize_geom_in, RequiredVertices_geom_in, RequiredEdgesSize_geom_in, RequiredEdges_geom_in, CrackedEdgesSize_geom_in, CrackedEdges_geom_in, SubDomainsSize_geom_in, SubDomains_geom_in
    51 #define BAMGOPTIONS anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, hminVerticesSize, hminVertices, hmaxVerticesSize, hmaxVertices, hVerticesSize, hVertices, metricSize, metric, fieldSize, field, errSize, err
     51#define BAMGOPTIONS anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, hminVerticesSize, hminVertices, hmaxVerticesSize, hmaxVertices, hVerticesLength, hVertices, metricSize, metric, fieldSize, field, errSize, err
    5252/* serial output macros: */
    5353#define BAMGMESHOUT VerticesSize_mesh_out, Vertices_mesh_out, EdgesSize_mesh_out, Edges_mesh_out, TrianglesSize_mesh_out, Triangles_mesh_out, IssmEdgesSize_mesh_out, IssmEdges_mesh_out, IssmSegmentsSize_mesh_out, IssmSegments_mesh_out, VerticesOnGeomVertexSize_mesh_out, VerticesOnGeomVertex_mesh_out, VerticesOnGeomEdgeSize_mesh_out, VerticesOnGeomEdge_mesh_out, EdgesOnGeomEdgeSize_mesh_out, EdgesOnGeomEdge_mesh_out, SubDomainsSize_mesh_out, SubDomains_mesh_out, SubDomainsFromGeomSize_mesh_out, SubDomainsFromGeom_mesh_out, ElementConnectivitySize_mesh_out, ElementConnectivity_mesh_out, NodalConnectivitySize_mesh_out, NodalConnectivity_mesh_out, NodalElementConnectivitySize_mesh_out, NodalElementConnectivity_mesh_out, CrackedVerticesSize_mesh_out, CrackedVertices_mesh_out, CrackedEdgesSize_mesh_out, CrackedEdges_mesh_out, PreviousNumberingSize_mesh_out, PreviousNumbering_mesh_out
    5454#define BAMGGEOMOUT VerticesSize_geom_out, Vertices_geom_out, EdgesSize_geom_out, Edges_geom_out, CornersSize_geom_out, Corners_geom_out, RequiredVerticesSize_geom_out, RequiredVertices_geom_out, RequiredEdgesSize_geom_out, RequiredEdges_geom_out, CrackedEdgesSize_geom_out, CrackedEdges_geom_out, SubDomainsSize_geom_out, SubDomains_geom_out
    55 #define WRAPPER(modulename) extern "C" { int  BamgMesherModule(int** VerticesSize_mesh_out, double** Vertices_mesh_out, int** EdgesSize_mesh_out, double** Edges_mesh_out, int** TrianglesSize_mesh_out, double** Triangles_mesh_out, int** IssmEdgesSize_mesh_out, double** IssmEdges_mesh_out, int** IssmSegmentsSize_mesh_out, double** IssmSegments_mesh_out, int** VerticesOnGeomVertexSize_mesh_out, double** VerticesOnGeomVertex_mesh_out, int** VerticesOnGeomEdgeSize_mesh_out, double** VerticesOnGeomEdge_mesh_out, int** EdgesOnGeomEdgeSize_mesh_out, double** EdgesOnGeomEdge_mesh_out, int** SubDomainsSize_mesh_out, double** SubDomains_mesh_out, int** SubDomainsFromGeomSize_mesh_out, double** SubDomainsFromGeom_mesh_out, int** ElementConnectivitySize_mesh_out, double** ElementConnectivity_mesh_out, int** NodalConnectivitySize_mesh_out, double** NodalConnectivity_mesh_out, int** NodalElementConnectivitySize_mesh_out, double** NodalElementConnectivity_mesh_out, int** CrackedVerticesSize_mesh_out, double** CrackedVertices_mesh_out, int** CrackedEdgesSize_mesh_out, double** CrackedEdges_mesh_out, int** PreviousNumberingSize_mesh_out, double** PreviousNumbering_mesh_out, int** VerticesSize_geom_out, double** Vertices_geom_out, int** EdgesSize_geom_out, double** Edges_geom_out, int** CornersSize_geom_out, double** Corners_geom_out, int** RequiredVerticesSize_geom_out, double** RequiredVertices_geom_out, int** RequiredEdgesSize_geom_out, double** RequiredEdges_geom_out, int** CrackedEdgesSize_geom_out, double** CrackedEdges_geom_out, int** SubDomainsSize_geom_out, double** SubDomains_geom_out, int* VerticesSize_mesh_in, double* Vertices_mesh_in, int* EdgesSize_mesh_in, double* Edges_mesh_in, int* TrianglesSize_mesh_in, double* Triangles_mesh_in, int* CrackedEdgesSize_mesh_in, double* CrackedEdges_mesh_in, int* VerticesOnGeomEdgeSize_mesh_in, double* VerticesOnGeomEdge_mesh_in, int* VerticesOnGeomVertexSize_mesh_in, double* VerticesOnGeomVertex_mesh_in, int* EdgesOnGeomEdgeSize_mesh_in, double* EdgesOnGeomEdge_mesh_in, int* IssmSegmentsSize_mesh_in, double* IssmSegments_mesh_in, int* VerticesSize_geom_in, double* Vertices_geom_in, int* EdgesSize_geom_in, double* Edges_geom_in, int* CornersSize_geom_in, double* Corners_geom_in, int* RequiredVerticesSize_geom_in, double* RequiredVertices_geom_in, int* RequiredEdgesSize_geom_in, double* RequiredEdges_geom_in, int* CrackedEdgesSize_geom_in, double* CrackedEdges_geom_in, int* SubDomainsSize_geom_in, double* SubDomains_geom_in, double anisomax, double cutoff, double coeff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int* hVerticesSize, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err)
     55#define WRAPPER(modulename) extern "C" { int  BamgMesherModule(int** VerticesSize_mesh_out, double** Vertices_mesh_out, int** EdgesSize_mesh_out, double** Edges_mesh_out, int** TrianglesSize_mesh_out, double** Triangles_mesh_out, int** IssmEdgesSize_mesh_out, double** IssmEdges_mesh_out, int** IssmSegmentsSize_mesh_out, double** IssmSegments_mesh_out, int** VerticesOnGeomVertexSize_mesh_out, double** VerticesOnGeomVertex_mesh_out, int** VerticesOnGeomEdgeSize_mesh_out, double** VerticesOnGeomEdge_mesh_out, int** EdgesOnGeomEdgeSize_mesh_out, double** EdgesOnGeomEdge_mesh_out, int** SubDomainsSize_mesh_out, double** SubDomains_mesh_out, int** SubDomainsFromGeomSize_mesh_out, double** SubDomainsFromGeom_mesh_out, int** ElementConnectivitySize_mesh_out, double** ElementConnectivity_mesh_out, int** NodalConnectivitySize_mesh_out, double** NodalConnectivity_mesh_out, int** NodalElementConnectivitySize_mesh_out, double** NodalElementConnectivity_mesh_out, int** CrackedVerticesSize_mesh_out, double** CrackedVertices_mesh_out, int** CrackedEdgesSize_mesh_out, double** CrackedEdges_mesh_out, int** PreviousNumberingSize_mesh_out, double** PreviousNumbering_mesh_out, int** VerticesSize_geom_out, double** Vertices_geom_out, int** EdgesSize_geom_out, double** Edges_geom_out, int** CornersSize_geom_out, double** Corners_geom_out, int** RequiredVerticesSize_geom_out, double** RequiredVertices_geom_out, int** RequiredEdgesSize_geom_out, double** RequiredEdges_geom_out, int** CrackedEdgesSize_geom_out, double** CrackedEdges_geom_out, int** SubDomainsSize_geom_out, double** SubDomains_geom_out, int* VerticesSize_mesh_in, double* Vertices_mesh_in, int* EdgesSize_mesh_in, double* Edges_mesh_in, int* TrianglesSize_mesh_in, double* Triangles_mesh_in, int* CrackedEdgesSize_mesh_in, double* CrackedEdges_mesh_in, int* VerticesOnGeomEdgeSize_mesh_in, double* VerticesOnGeomEdge_mesh_in, int* VerticesOnGeomVertexSize_mesh_in, double* VerticesOnGeomVertex_mesh_in, int* EdgesOnGeomEdgeSize_mesh_in, double* EdgesOnGeomEdge_mesh_in, int* IssmSegmentsSize_mesh_in, double* IssmSegments_mesh_in, int* VerticesSize_geom_in, double* Vertices_geom_in, int* EdgesSize_geom_in, double* Edges_geom_in, int* CornersSize_geom_in, double* Corners_geom_in, int* RequiredVerticesSize_geom_in, double* RequiredVertices_geom_in, int* RequiredEdgesSize_geom_in, double* RequiredEdges_geom_in, int* CrackedEdgesSize_geom_in, double* CrackedEdges_geom_in, int* SubDomainsSize_geom_in, double* SubDomains_geom_in, double anisomax, double cutoff, double coeff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int hVerticesLength, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err)
    5656
    5757#endif
  • issm/trunk-jpl/src/wrappers/BamgMesher/BamgMesher.js

    r22906 r24304  
    11function doublesToHeap(array) {
    2         var doubleArray = new Float64Array(array);
     2    var doubleArray = new Float64Array(array);
    33    var numBytes = doubleArray.length * doubleArray.BYTES_PER_ELEMENT;
    4         var doubleArrayPtr = Module._malloc(numBytes);
     4    var doubleArrayPtr = Module._malloc(numBytes);
    55    var doubleArrayHeap = new Uint8Array(Module.HEAPU8.buffer, doubleArrayPtr, numBytes);
    6         doubleArrayHeap.set(new Uint8Array(doubleArray.buffer));
     6    doubleArrayHeap.set(new Uint8Array(doubleArray.buffer));
    77    return doubleArrayHeap.byteOffset;
    88}
    99function intsToHeap(array) {
    10         var intArray = new Int32Array(array);
     10    var intArray = new Int32Array(array);
    1111    var numBytes = intArray.length * intArray.BYTES_PER_ELEMENT;
    12         var intArrayPtr = Module._malloc(numBytes);
     12    var intArrayPtr = Module._malloc(numBytes);
    1313    var intArrayHeap = new Uint8Array(Module.HEAPU8.buffer, intArrayPtr, numBytes);
    14         intArrayHeap.set(new Uint8Array(intArray.buffer));
     14    intArrayHeap.set(new Uint8Array(intArray.buffer));
    1515    return intArrayHeap.byteOffset;
    1616}
    1717function heapToDoubles(pptr, size) {
    18         var ptr = Module.getValue(pptr,'i32');
    19         var array = Module.HEAPF64.slice(ptr / 8, ptr / 8 + size[0] * size[1]);
    20         return ListToMatrix(array, size[1]);
     18    var ptr = Module.getValue(pptr,'i32');
     19    var array = Module.HEAPF64.slice(ptr / 8, ptr / 8 + size[0] * size[1]);
     20    return ListToMatrix(array, size[1]);
    2121}
    2222function heapToInts(pptr, nods) {
    23         var ptr = Module.getValue(pptr,'i32');
    24         return Module.HEAPU32.slice(ptr / 4, ptr / 4 + nods);
     23    var ptr = Module.getValue(pptr,'i32');
     24    return Module.HEAPU32.slice(ptr / 4, ptr / 4 + nods);
    2525}
    2626function size2d(array) {
     
    4040function BamgMesher(bamgmesh_in, bamggeom_in, bamgopts) {
    4141/*
    42            usage: var array = Triangle(domain,rifts,area);
    43               where: array is made of [index,x,y,segments,segmentmarkers]
    44                   and index,x,y defines a triangulation, segments is an array made
    45               of exterior segments to the mesh domain outline, segmentmarkers is an array
    46                   flagging each segment, domain a js array defining the domain outline  (sames for
    47                   rifts) and area is the maximum area desired for any element of the resulting mesh.
    48 
    49                   Ok, for now, we are not dealing with rifts. Also, the domain is made of only one
    50                   profile, this to avoid passing a double** pointer to js.
     42       usage: var array = Triangle(domain,rifts,area);
     43          where: array is made of [index,x,y,segments,segmentmarkers]
     44          and index,x,y defines a triangulation, segments is an array made
     45          of exterior segments to the mesh domain outline, segmentmarkers is an array
     46          flagging each segment, domain a js array defining the domain outline  (sames for
     47          rifts) and area is the maximum area desired for any element of the resulting mesh.
     48
     49          Ok, for now, we are not dealing with rifts. Also, the domain is made of only one
     50          profile, this to avoid passing a double** pointer to js.
    5151*/
    5252
    53         //Dynamic allocations: {{{
    54         //Retrieve domain arrays, and allocate on Module heap:
     53    //Dynamic allocations: {{{
     54    //Retrieve domain arrays, and allocate on Module heap:
    5555    //For each property, calculate the size and fill with 0 if the 2nd dimension is undefined, then use the int size array to init the double array.
    56         //input
     56    //input
    5757    var pVerticesSize_mesh_in               = intsToHeap(size2d(bamgmesh_in.Vertices));
    5858    var pVertices_mesh_in                   = doublesToHeap(Array.prototype.concat.apply([], bamgmesh_in.Vertices));
     
    110110    var phmaxVerticesSize                   = intsToHeap(size2d(bamgopts.hmaxVertices));
    111111    var phmaxVertices                       = doublesToHeap(Array.prototype.concat.apply([], bamgopts.hmaxVertices));
    112     var phVerticesSize                      = intsToHeap(size2d(bamgopts.hVertices));
     112    var hVerticesLength                     = bamgopts.hVerticesLength;
    113113    var phVertices                          = doublesToHeap(Array.prototype.concat.apply([], bamgopts.hVertices));
    114114    var pmetricSize                         = intsToHeap(size2d(bamgopts.metric));
     
    118118    var perrSize                            = intsToHeap(size2d([[bamgopts.err]]));
    119119    var perr                                = doublesToHeap(Array.prototype.concat.apply([], [[bamgopts.err]]));
    120        
    121         //output
    122     var pVerticesSize_mesh_out                  = Module._malloc(4); 
    123     var pVertices_mesh_out                      = Module._malloc(4); 
    124     var pEdgesSize_mesh_out                     = Module._malloc(4); 
    125     var pEdges_mesh_out                         = Module._malloc(4); 
    126     var pTrianglesSize_mesh_out                 = Module._malloc(4); 
    127     var pTriangles_mesh_out                     = Module._malloc(4); 
    128     var pIssmEdgesSize_mesh_out                 = Module._malloc(4); 
    129     var pIssmEdges_mesh_out                     = Module._malloc(4); 
    130     var pIssmSegmentsSize_mesh_out              = Module._malloc(4); 
    131     var pIssmSegments_mesh_out                  = Module._malloc(4); 
    132     var pVerticesOnGeomVertexSize_mesh_out      = Module._malloc(4); 
    133     var pVerticesOnGeomVertex_mesh_out          = Module._malloc(4); 
    134     var pVerticesOnGeomEdgeSize_mesh_out        = Module._malloc(4); 
    135     var pVerticesOnGeomEdge_mesh_out            = Module._malloc(4); 
    136     var pEdgesOnGeomEdgeSize_mesh_out           = Module._malloc(4); 
    137     var pEdgesOnGeomEdge_mesh_out               = Module._malloc(4); 
    138     var pSubDomainsSize_mesh_out                = Module._malloc(4); 
    139     var pSubDomains_mesh_out                    = Module._malloc(4); 
    140     var pSubDomainsFromGeomSize_mesh_out        = Module._malloc(4); 
    141     var pSubDomainsFromGeom_mesh_out            = Module._malloc(4); 
    142     var pElementConnectivitySize_mesh_out       = Module._malloc(4); 
    143     var pElementConnectivity_mesh_out           = Module._malloc(4); 
    144     var pNodalConnectivitySize_mesh_out         = Module._malloc(4); 
    145     var pNodalConnectivity_mesh_out             = Module._malloc(4); 
    146     var pNodalElementConnectivitySize_mesh_out  = Module._malloc(4); 
    147     var pNodalElementConnectivity_mesh_out      = Module._malloc(4); 
    148     var pCrackedVerticesSize_mesh_out           = Module._malloc(4); 
    149     var pCrackedVertices_mesh_out               = Module._malloc(4); 
    150     var pCrackedEdgesSize_mesh_out              = Module._malloc(4); 
    151     var pCrackedEdges_mesh_out                  = Module._malloc(4); 
    152     var pPreviousNumberingSize_mesh_out         = Module._malloc(4); 
    153     var pPreviousNumbering_mesh_out             = Module._malloc(4); 
    154 
    155     var pVerticesSize_geom_out                  = Module._malloc(4); 
     120
     121    //output
     122    var pVerticesSize_mesh_out                  = Module._malloc(4);
     123    var pVertices_mesh_out                      = Module._malloc(4);
     124    var pEdgesSize_mesh_out                     = Module._malloc(4);
     125    var pEdges_mesh_out                         = Module._malloc(4);
     126    var pTrianglesSize_mesh_out                 = Module._malloc(4);
     127    var pTriangles_mesh_out                     = Module._malloc(4);
     128    var pIssmEdgesSize_mesh_out                 = Module._malloc(4);
     129    var pIssmEdges_mesh_out                     = Module._malloc(4);
     130    var pIssmSegmentsSize_mesh_out              = Module._malloc(4);
     131    var pIssmSegments_mesh_out                  = Module._malloc(4);
     132    var pVerticesOnGeomVertexSize_mesh_out      = Module._malloc(4);
     133    var pVerticesOnGeomVertex_mesh_out          = Module._malloc(4);
     134    var pVerticesOnGeomEdgeSize_mesh_out        = Module._malloc(4);
     135    var pVerticesOnGeomEdge_mesh_out            = Module._malloc(4);
     136    var pEdgesOnGeomEdgeSize_mesh_out           = Module._malloc(4);
     137    var pEdgesOnGeomEdge_mesh_out               = Module._malloc(4);
     138    var pSubDomainsSize_mesh_out                = Module._malloc(4);
     139    var pSubDomains_mesh_out                    = Module._malloc(4);
     140    var pSubDomainsFromGeomSize_mesh_out        = Module._malloc(4);
     141    var pSubDomainsFromGeom_mesh_out            = Module._malloc(4);
     142    var pElementConnectivitySize_mesh_out       = Module._malloc(4);
     143    var pElementConnectivity_mesh_out           = Module._malloc(4);
     144    var pNodalConnectivitySize_mesh_out         = Module._malloc(4);
     145    var pNodalConnectivity_mesh_out             = Module._malloc(4);
     146    var pNodalElementConnectivitySize_mesh_out  = Module._malloc(4);
     147    var pNodalElementConnectivity_mesh_out      = Module._malloc(4);
     148    var pCrackedVerticesSize_mesh_out           = Module._malloc(4);
     149    var pCrackedVertices_mesh_out               = Module._malloc(4);
     150    var pCrackedEdgesSize_mesh_out              = Module._malloc(4);
     151    var pCrackedEdges_mesh_out                  = Module._malloc(4);
     152    var pPreviousNumberingSize_mesh_out         = Module._malloc(4);
     153    var pPreviousNumbering_mesh_out             = Module._malloc(4);
     154
     155    var pVerticesSize_geom_out                  = Module._malloc(4);
    156156    var pVertices_geom_out                      = Module._malloc(4);
    157     var pEdgesSize_geom_out                     = Module._malloc(4); 
    158     var pEdges_geom_out                         = Module._malloc(4); 
    159     var pCornersSize_geom_out                   = Module._malloc(4); 
    160     var pCorners_geom_out                       = Module._malloc(4); 
    161     var pRequiredVerticesSize_geom_out          = Module._malloc(4); 
    162     var pRequiredVertices_geom_out              = Module._malloc(4); 
    163     var pRequiredEdgesSize_geom_out             = Module._malloc(4); 
    164     var pRequiredEdges_geom_out                 = Module._malloc(4); 
    165     var pCrackedEdgesSize_geom_out              = Module._malloc(4); 
    166     var pCrackedEdges_geom_out                  = Module._malloc(4); 
    167     var pSubDomainsSize_geom_out                = Module._malloc(4); 
    168     var pSubDomains_geom_out                    = Module._malloc(4); 
    169         //}}}
    170 
    171         //Declare BamgMesher module:
    172         BamgMesherModule = Module.cwrap('BamgMesherModule', 'number',[
     157    var pEdgesSize_geom_out                     = Module._malloc(4);
     158    var pEdges_geom_out                         = Module._malloc(4);
     159    var pCornersSize_geom_out                   = Module._malloc(4);
     160    var pCorners_geom_out                       = Module._malloc(4);
     161    var pRequiredVerticesSize_geom_out          = Module._malloc(4);
     162    var pRequiredVertices_geom_out              = Module._malloc(4);
     163    var pRequiredEdgesSize_geom_out             = Module._malloc(4);
     164    var pRequiredEdges_geom_out                 = Module._malloc(4);
     165    var pCrackedEdgesSize_geom_out              = Module._malloc(4);
     166    var pCrackedEdges_geom_out                  = Module._malloc(4);
     167    var pSubDomainsSize_geom_out                = Module._malloc(4);
     168    var pSubDomains_geom_out                    = Module._malloc(4);
     169    //}}}
     170
     171    //Declare BamgMesher module:
     172    BamgMesherModule = Module.cwrap('BamgMesherModule', 'number',[
    173173        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
    174         'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 
    175         'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 
    176         'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 
     174        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
     175        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
     176        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
    177177        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number']);
    178        
    179         //Call BamgMesher module:
    180 
    181         BamgMesherModule(
     178
     179    //Call BamgMesher module:
     180
     181    BamgMesherModule(
    182182        pVerticesSize_mesh_out, pVertices_mesh_out, pEdgesSize_mesh_out, pEdges_mesh_out, pTrianglesSize_mesh_out, pTriangles_mesh_out, pIssmEdgesSize_mesh_out, pIssmEdges_mesh_out, pIssmSegmentsSize_mesh_out, pIssmSegments_mesh_out, pVerticesOnGeomVertexSize_mesh_out, pVerticesOnGeomVertex_mesh_out, pVerticesOnGeomEdgeSize_mesh_out, pVerticesOnGeomEdge_mesh_out, pEdgesOnGeomEdgeSize_mesh_out, pEdgesOnGeomEdge_mesh_out, pSubDomainsSize_mesh_out, pSubDomains_mesh_out, pSubDomainsFromGeomSize_mesh_out, pSubDomainsFromGeom_mesh_out, pElementConnectivitySize_mesh_out, pElementConnectivity_mesh_out, pNodalConnectivitySize_mesh_out, pNodalConnectivity_mesh_out, pNodalElementConnectivitySize_mesh_out, pNodalElementConnectivity_mesh_out, pCrackedVerticesSize_mesh_out, pCrackedVertices_mesh_out, pCrackedEdgesSize_mesh_out, pCrackedEdges_mesh_out, pPreviousNumberingSize_mesh_out, pPreviousNumbering_mesh_out,
    183         pVerticesSize_geom_out, pVertices_geom_out, pEdgesSize_geom_out, pEdges_geom_out, pCornersSize_geom_out, pCorners_geom_out, pRequiredVerticesSize_geom_out, pRequiredVertices_geom_out, pRequiredEdgesSize_geom_out, pRequiredEdges_geom_out, pCrackedEdgesSize_geom_out, pCrackedEdges_geom_out, pSubDomainsSize_geom_out, pSubDomains_geom_out, 
    184         pVerticesSize_mesh_in, pVertices_mesh_in, pEdgesSize_mesh_in, pEdges_mesh_in, pTrianglesSize_mesh_in, pTriangles_mesh_in, pCrackedEdgesSize_mesh_in, pCrackedEdges_mesh_in, pVerticesOnGeomEdgeSize_mesh_in, pVerticesOnGeomEdge_mesh_in, pVerticesOnGeomVertexSize_mesh_in, pVerticesOnGeomVertex_mesh_in, pEdgesOnGeomEdgeSize_mesh_in, pEdgesOnGeomEdge_mesh_in, pIssmSegmentsSize_mesh_in, pIssmSegments_mesh_in, 
    185         pVerticesSize_geom_in, pVertices_geom_in, pEdgesSize_geom_in, pEdges_geom_in, pCornersSize_geom_in, pCorners_geom_in, pRequiredVerticesSize_geom_in, pRequiredVertices_geom_in, pRequiredEdgesSize_geom_in, pRequiredEdges_geom_in, pCrackedEdgesSize_geom_in, pCrackedEdges_geom_in, pSubDomainsSize_geom_in, pSubDomains_geom_in, 
    186         anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, phminVerticesSize, phminVertices, phmaxVerticesSize, phmaxVertices, phVerticesSize, phVertices, pmetricSize, pmetric, pfieldSize, pfield, perrSize, perr);
    187        
    188         /*Dynamic copying from heap: {{{*/
    189         //recover mesh:
     183        pVerticesSize_geom_out, pVertices_geom_out, pEdgesSize_geom_out, pEdges_geom_out, pCornersSize_geom_out, pCorners_geom_out, pRequiredVerticesSize_geom_out, pRequiredVertices_geom_out, pRequiredEdgesSize_geom_out, pRequiredEdges_geom_out, pCrackedEdgesSize_geom_out, pCrackedEdges_geom_out, pSubDomainsSize_geom_out, pSubDomains_geom_out,
     184        pVerticesSize_mesh_in, pVertices_mesh_in, pEdgesSize_mesh_in, pEdges_mesh_in, pTrianglesSize_mesh_in, pTriangles_mesh_in, pCrackedEdgesSize_mesh_in, pCrackedEdges_mesh_in, pVerticesOnGeomEdgeSize_mesh_in, pVerticesOnGeomEdge_mesh_in, pVerticesOnGeomVertexSize_mesh_in, pVerticesOnGeomVertex_mesh_in, pEdgesOnGeomEdgeSize_mesh_in, pEdgesOnGeomEdge_mesh_in, pIssmSegmentsSize_mesh_in, pIssmSegments_mesh_in,
     185        pVerticesSize_geom_in, pVertices_geom_in, pEdgesSize_geom_in, pEdges_geom_in, pCornersSize_geom_in, pCorners_geom_in, pRequiredVerticesSize_geom_in, pRequiredVertices_geom_in, pRequiredEdgesSize_geom_in, pRequiredEdges_geom_in, pCrackedEdgesSize_geom_in, pCrackedEdges_geom_in, pSubDomainsSize_geom_in, pSubDomains_geom_in,
     186        anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, phminVerticesSize, phminVertices, phmaxVerticesSize, phmaxVertices, hVerticesLength, phVertices, pmetricSize, pmetric, pfieldSize, pfield, perrSize, perr);
     187
     188    /*Dynamic copying from heap: {{{*/
     189    //recover mesh:
    190190    var bamgmeshout = new bamgmesh();
    191191    var bamggeomout = new bamggeom();
    192192
    193         bamgmeshout.VerticesSize                   = heapToInts(pVerticesSize_mesh_out, 2);
     193    bamgmeshout.VerticesSize                   = heapToInts(pVerticesSize_mesh_out, 2);
    194194    bamgmeshout.Vertices                       = heapToDoubles(pVertices_mesh_out, bamgmeshout.VerticesSize);
    195         bamgmeshout.EdgesSize                      = heapToInts(pEdgesSize_mesh_out, 2);
     195    bamgmeshout.EdgesSize                      = heapToInts(pEdgesSize_mesh_out, 2);
    196196    bamgmeshout.Edges                          = heapToDoubles(pEdges_mesh_out, bamgmeshout.EdgesSize);
    197         bamgmeshout.TrianglesSize                  = heapToInts(pTrianglesSize_mesh_out, 2);
     197    bamgmeshout.TrianglesSize                  = heapToInts(pTrianglesSize_mesh_out, 2);
    198198    bamgmeshout.Triangles                      = heapToDoubles(pTriangles_mesh_out, bamgmeshout.TrianglesSize);
    199         bamgmeshout.IssmEdgesSize                  = heapToInts(pIssmEdgesSize_mesh_out, 2);
     199    bamgmeshout.IssmEdgesSize                  = heapToInts(pIssmEdgesSize_mesh_out, 2);
    200200    bamgmeshout.IssmEdges                      = heapToDoubles(pIssmEdges_mesh_out, bamgmeshout.IssmEdgesSize);
    201         bamgmeshout.IssmSegmentsSize               = heapToInts(pIssmSegmentsSize_mesh_out, 2);
     201    bamgmeshout.IssmSegmentsSize               = heapToInts(pIssmSegmentsSize_mesh_out, 2);
    202202    bamgmeshout.IssmSegments                   = heapToDoubles(pIssmSegments_mesh_out, bamgmeshout.IssmSegmentsSize);
    203         bamgmeshout.VerticesOnGeomVertexSize       = heapToInts(pVerticesOnGeomVertexSize_mesh_out, 2);
     203    bamgmeshout.VerticesOnGeomVertexSize       = heapToInts(pVerticesOnGeomVertexSize_mesh_out, 2);
    204204    bamgmeshout.VerticesOnGeomVertex           = heapToDoubles(pVerticesOnGeomVertex_mesh_out, bamgmeshout.VerticesOnGeomVertexSize);
    205         bamgmeshout.VerticesOnGeomEdgeSize         = heapToInts(pVerticesOnGeomEdgeSize_mesh_out, 2);
     205    bamgmeshout.VerticesOnGeomEdgeSize         = heapToInts(pVerticesOnGeomEdgeSize_mesh_out, 2);
    206206    bamgmeshout.VerticesOnGeomEdge             = heapToDoubles(pVerticesOnGeomEdge_mesh_out, bamgmeshout.VerticesOnGeomEdgeSize);
    207         bamgmeshout.EdgesOnGeomEdgeSize            = heapToInts(pEdgesOnGeomEdgeSize_mesh_out, 2);
     207    bamgmeshout.EdgesOnGeomEdgeSize            = heapToInts(pEdgesOnGeomEdgeSize_mesh_out, 2);
    208208    bamgmeshout.EdgesOnGeomEdge                = heapToDoubles(pEdgesOnGeomEdge_mesh_out, bamgmeshout.EdgesOnGeomEdgeSize);
    209         bamgmeshout.SubDomainsSize                 = heapToInts(pSubDomainsSize_mesh_out, 2);
     209    bamgmeshout.SubDomainsSize                 = heapToInts(pSubDomainsSize_mesh_out, 2);
    210210    bamgmeshout.SubDomains                     = heapToDoubles(pSubDomains_mesh_out, bamgmeshout.SubDomainsSize);
    211         bamgmeshout.SubDomainsFromGeomSize         = heapToInts(pSubDomainsFromGeomSize_mesh_out, 2);
     211    bamgmeshout.SubDomainsFromGeomSize         = heapToInts(pSubDomainsFromGeomSize_mesh_out, 2);
    212212    bamgmeshout.SubDomainsFromGeom             = heapToDoubles(pSubDomainsFromGeom_mesh_out, bamgmeshout.SubDomainsFromGeomSize);
    213         bamgmeshout.ElementConnectivitySize        = heapToInts(pElementConnectivitySize_mesh_out, 2);
     213    bamgmeshout.ElementConnectivitySize        = heapToInts(pElementConnectivitySize_mesh_out, 2);
    214214    bamgmeshout.ElementConnectivity            = heapToDoubles(pElementConnectivity_mesh_out, bamgmeshout.ElementConnectivitySize);
    215         bamgmeshout.NodalConnectivitySize          = heapToInts(pNodalConnectivitySize_mesh_out, 2);
     215    bamgmeshout.NodalConnectivitySize          = heapToInts(pNodalConnectivitySize_mesh_out, 2);
    216216    bamgmeshout.NodalConnectivity              = heapToDoubles(pNodalConnectivity_mesh_out, bamgmeshout.NodalConnectivitySize);
    217         bamgmeshout.NodalElementConnectivitySize   = heapToInts(pNodalElementConnectivitySize_mesh_out, 2);
     217    bamgmeshout.NodalElementConnectivitySize   = heapToInts(pNodalElementConnectivitySize_mesh_out, 2);
    218218    bamgmeshout.NodalElementConnectivity       = heapToDoubles(pNodalElementConnectivity_mesh_out, bamgmeshout.NodalElementConnectivitySize);
    219         bamgmeshout.CrackedVerticesSize            = heapToInts(pCrackedVerticesSize_mesh_out, 2);
     219    bamgmeshout.CrackedVerticesSize            = heapToInts(pCrackedVerticesSize_mesh_out, 2);
    220220    bamgmeshout.CrackedVertices                = heapToDoubles(pCrackedVertices_mesh_out, bamgmeshout.CrackedVerticesSize);
    221         bamgmeshout.CrackedEdgesSize               = heapToInts(pCrackedEdgesSize_mesh_out, 2);
     221    bamgmeshout.CrackedEdgesSize               = heapToInts(pCrackedEdgesSize_mesh_out, 2);
    222222    bamgmeshout.CrackedEdges                   = heapToDoubles(pCrackedEdges_mesh_out, bamgmeshout.CrackedEdgesSize);
    223223    bamgmeshout.PreviousNumberingSize          = heapToInts(pPreviousNumberingSize_mesh_out, 2);
     
    238238    bamggeomout.SubDomainsSize                 = heapToInts(pSubDomainsSize_geom_out, 2);
    239239    bamggeomout.SubDomains                     = heapToDoubles(pSubDomains_geom_out, bamggeomout.SubDomainsSize);
    240         /*}}}*/
    241 
    242         var return_array=[bamgmeshout, bamggeomout];
    243 
    244         /*Free ressources: */
    245     Module._free(pVerticesSize_mesh_out); 
    246     Module._free(pVertices_mesh_out); 
    247     Module._free(pEdgesSize_mesh_out); 
    248     Module._free(pEdges_mesh_out); 
    249     Module._free(pTrianglesSize_mesh_out); 
    250     Module._free(pTriangles_mesh_out); 
    251     Module._free(pIssmEdgesSize_mesh_out); 
    252     Module._free(pIssmEdges_mesh_out); 
    253     Module._free(pIssmSegmentsSize_mesh_out); 
    254     Module._free(pIssmSegments_mesh_out); 
    255     Module._free(pVerticesOnGeomVertexSize_mesh_out); 
    256     Module._free(pVerticesOnGeomVertex_mesh_out); 
    257     Module._free(pVerticesOnGeomEdgeSize_mesh_out); 
    258     Module._free(pVerticesOnGeomEdge_mesh_out); 
    259     Module._free(pEdgesOnGeomEdgeSize_mesh_out); 
    260     Module._free(pEdgesOnGeomEdge_mesh_out); 
    261     Module._free(pSubDomainsSize_mesh_out); 
    262     Module._free(pSubDomains_mesh_out); 
    263     Module._free(pSubDomainsFromGeomSize_mesh_out); 
    264     Module._free(pSubDomainsFromGeom_mesh_out); 
    265     Module._free(pElementConnectivitySize_mesh_out); 
    266     Module._free(pElementConnectivity_mesh_out); 
    267     Module._free(pNodalConnectivitySize_mesh_out); 
    268     Module._free(pNodalConnectivity_mesh_out); 
    269     Module._free(pNodalElementConnectivitySize_mesh_out); 
    270     Module._free(pNodalElementConnectivity_mesh_out); 
    271     Module._free(pCrackedVerticesSize_mesh_out); 
    272     Module._free(pCrackedVertices_mesh_out); 
    273     Module._free(pCrackedEdgesSize_mesh_out); 
    274     Module._free(pCrackedEdges_mesh_out); 
    275     Module._free(pPreviousNumberingSize_mesh_out); 
    276     Module._free(pPreviousNumbering_mesh_out); 
     240    /*}}}*/
     241
     242    var return_array=[bamgmeshout, bamggeomout];
     243
     244    /*Free ressources: */
     245    Module._free(pVerticesSize_mesh_out);
     246    Module._free(pVertices_mesh_out);
     247    Module._free(pEdgesSize_mesh_out);
     248    Module._free(pEdges_mesh_out);
     249    Module._free(pTrianglesSize_mesh_out);
     250    Module._free(pTriangles_mesh_out);
     251    Module._free(pIssmEdgesSize_mesh_out);
     252    Module._free(pIssmEdges_mesh_out);
     253    Module._free(pIssmSegmentsSize_mesh_out);
     254    Module._free(pIssmSegments_mesh_out);
     255    Module._free(pVerticesOnGeomVertexSize_mesh_out);
     256    Module._free(pVerticesOnGeomVertex_mesh_out);
     257    Module._free(pVerticesOnGeomEdgeSize_mesh_out);
     258    Module._free(pVerticesOnGeomEdge_mesh_out);
     259    Module._free(pEdgesOnGeomEdgeSize_mesh_out);
     260    Module._free(pEdgesOnGeomEdge_mesh_out);
     261    Module._free(pSubDomainsSize_mesh_out);
     262    Module._free(pSubDomains_mesh_out);
     263    Module._free(pSubDomainsFromGeomSize_mesh_out);
     264    Module._free(pSubDomainsFromGeom_mesh_out);
     265    Module._free(pElementConnectivitySize_mesh_out);
     266    Module._free(pElementConnectivity_mesh_out);
     267    Module._free(pNodalConnectivitySize_mesh_out);
     268    Module._free(pNodalConnectivity_mesh_out);
     269    Module._free(pNodalElementConnectivitySize_mesh_out);
     270    Module._free(pNodalElementConnectivity_mesh_out);
     271    Module._free(pCrackedVerticesSize_mesh_out);
     272    Module._free(pCrackedVertices_mesh_out);
     273    Module._free(pCrackedEdgesSize_mesh_out);
     274    Module._free(pCrackedEdges_mesh_out);
     275    Module._free(pPreviousNumberingSize_mesh_out);
     276    Module._free(pPreviousNumbering_mesh_out);
    277277
    278278    Module._free(pVerticesSize_geom_out);
     
    327327    Module._free(phmaxVerticesSize);
    328328    Module._free(phmaxVertices);
    329     Module._free(phVerticesSize);
    330329    Module._free(phVertices);
    331330    Module._free(pmetricSize);
     
    336335    Module._free(perr);
    337336
    338         return return_array;
    339 }
     337    return return_array;
     338}
  • issm/trunk-jpl/src/wrappers/javascript/io/FetchJavascriptData.cpp

    r24301 r24304  
    1515/*FUNCTION FetchData(char** pstring, char* string){{{*/
    1616void FetchData(char** pstring, char* stringin){
    17 
    18         char* string=xNew<char>(strlen(stringin)+1);
    19         xMemCpy<char>(string,stringin,strlen(stringin)+1);
     17        char* string=NULL;
     18
     19        string=xNew<char>(strlen(stringin)+1); xMemCpy<char>(string,stringin,strlen(stringin)+1);
    2020
    2121        *pstring=string;
    2222}
    2323/*}}}*/
    24 /*FUNCTION FetchData(int* pinteger,int integer){{{*/
    25 void FetchData(int* pinteger,int integer){
    26 
    27         *pinteger = integer;
    28 }
    29 /*}}}*/
    30 /*FUNCTION FetchData(double* pscalar,double scalar){{{*/
    31 void FetchData(double* pscalar,double scalar){
    32 
    33         *pscalar = scalar;
     24/*FUNCTION FetchData(int* pinteger, int integer){{{*/
     25void FetchData(int* pinteger, int integer){
     26        *pinteger=integer;
     27}
     28/*}}}*/
     29/*FUNCTION FetchData(double* pscalar, double scalar){{{*/
     30void FetchData(double* pscalar, double scalar){
     31        *pscalar=scalar;
    3432}
    3533/*}}}*/
    3634/*FUNCTION FetchData(double **pvector, double* vectorin, int nods){{{*/
    3735void FetchData(double** pvector, double* vectorin, int nods){
    38 
    3936        double* vector=NULL;
    4037
     
    4643/*FUNCTION FetchData(double **pvector, int* pnods, double* vectorin, int nods){{{*/
    4744void FetchData(double** pvector, int* pnods, double* vectorin, int nods){
    48 
    4945        double* vector=NULL;
    5046
     
    5753/*FUNCTION FetchData(double **pmatrix, int* pM, int* pN, int* matrix, int M, int N){{{*/
    5854void FetchData(double **pmatrix, int* pM, int* pN, int* matrixin, int M, int N){
    59 
    6055        double*  outmatrix=NULL;
    61         int      outmatrix_rows,outmatrix_cols;
     56        int      outmatrix_rows, outmatrix_cols;
    6257
    6358        if(M == 0 || N == 0){
     
    7166                outmatrix_cols=N;
    7267                outmatrix=xNew<IssmPDouble>(M*N);
    73                 for(int i=0;i<M*N;i++)outmatrix[i]=(IssmPDouble)matrixin[i];
     68                for(int i=0;i<M*N;i++){outmatrix[i]=(IssmPDouble)matrixin[i];}
    7469        }
    7570
    7671        /*Assign output pointers:*/
    7772        *pmatrix=outmatrix;
    78         if (pM)*pM=outmatrix_rows;
    79         if (pN)*pN=outmatrix_cols;
     73        if (pM){*pM=outmatrix_rows;}
     74        if (pN){*pN=outmatrix_cols;}
    8075}
    8176/*}}}*/
    8277/*FUNCTION FetchData(double **pmatrix, int* pM, int* pN, double* matrix, int M, int N){{{*/
    8378void FetchData(double **pmatrix, int* pM, int* pN, double* matrixin, int M, int N){
    84 
    8579        double*  outmatrix=NULL;
    86         int      outmatrix_rows,outmatrix_cols;
     80        int      outmatrix_rows, outmatrix_cols;
    8781
    8882        if(M == 0 || N == 0){
     
    10094        /*Assign output pointers:*/
    10195        *pmatrix=outmatrix;
    102         if (pM)*pM=outmatrix_rows;
    103         if (pN)*pN=outmatrix_cols;
     96        if (pM){*pM=outmatrix_rows;}
     97        if (pN){*pN=outmatrix_cols;}
    10498}
    10599/*}}}*/
    106100/*FUNCTION FetchData(int **pmatrix, int* pM, int* pN, int* matrix, int M, int N){{{*/
    107101void FetchData(int **pmatrix, int* pM, int* pN, int* matrixin, int M, int N){
    108 
    109102        int*     outmatrix=NULL;
    110         int      outmatrix_rows,outmatrix_cols;
     103        int      outmatrix_rows, outmatrix_cols;
    111104
    112105        if(M == 0 || N == 0){
     
    124117        /*Assign output pointers:*/
    125118        *pmatrix=outmatrix;
    126         if (pM)*pM=outmatrix_rows;
    127         if (pN)*pN=outmatrix_cols;
     119        if (pM){*pM=outmatrix_rows;}
     120        if (pN){*pN=outmatrix_cols;}
    128121}
    129122/*}}}*/
    130123/*ISSM objects*/
    131 /*FUNCTION FetchData(Contours** pcontours,double* x, double* y, int nods){{{*/
    132 void FetchData(Contours** pcontours,double* x, double* y, int nods){
    133 
    134         int             numcontours,index,test1,test2;
     124/*FUNCTION FetchData(Contours** pcontours, double* x, double* y, int nods){{{*/
     125void FetchData(Contours** pcontours, double* x, double* y, int nods){
     126        int             numcontours, index, test1, test2;
    135127        char            *contourname = NULL;
    136128        Contours        *contours    = NULL;
     
    141133
    142134        if (nods){
    143 
    144135                contouri=new Contour<double>();
    145136                contouri->nods=nods;
    146137                contouri->x=xNew<IssmPDouble>(nods); xMemCpy<IssmPDouble>(contouri->x,x,nods);
    147138                contouri->y=xNew<IssmPDouble>(nods); xMemCpy<IssmPDouble>(contouri->y,y,nods);
    148 
    149139                contours->AddObject(contouri);
    150140        }
     
    157147
    158148        /*Initialize output*/
    159         BamgGeom* bamggeom = new BamgGeom();
     149        BamgGeom* bamggeom=new BamgGeom();
    160150
    161151        /*Fetch all fields*/
     
    169159
    170160        /*Assign output pointers:*/
    171         *pbamggeom = bamggeom;
     161        *pbamggeom=bamggeom;
    172162}
    173163/*}}}*/
     
    176166
    177167        /*Initialize output*/
    178         BamgMesh* bamgmesh = new BamgMesh();
     168        BamgMesh* bamgmesh=new BamgMesh();
    179169
    180170        /*Fetch all fields*/
     
    189179
    190180        /*Assign output pointers:*/
    191         *pbamgmesh = bamgmesh;
     181        *pbamgmesh=bamgmesh;
    192182}
    193183/*}}}*/
     
    232222
    233223        /*Assign output pointers:*/
    234         *pbamgopts              = bamgopts;
    235 }
    236 /*}}}*/
    237 /*FUNCTION FetchData(Options** poptions,int NRHS, int nrhs, const char* optionname, double optionvalue){{{*/
    238 void FetchData(Options** poptions,int NRHS, int nrhs, const char* optionname, double optionvalue){
     224        *pbamgopts=bamgopts;
     225}
     226/*}}}*/
     227/*FUNCTION FetchData(Options** poptions, int NRHS, int nrhs, const char* optionname, double optionvalue){{{*/
     228void FetchData(Options** poptions, int NRHS, int nrhs, const char* optionname, double optionvalue){
    239229
    240230        /*Initialize output*/
     
    242232
    243233        /*check and parse the name  */
    244         GenericOption<double> *odouble = new GenericOption<double>();
     234        GenericOption<double> *odouble=new GenericOption<double>();
    245235        odouble=new GenericOption<double>();
    246         odouble->name =xNew<char>(strlen(optionname)+1);
     236        odouble->name=xNew<char>(strlen(optionname)+1);
    247237        memcpy(odouble->name,optionname,(strlen(optionname)+1)*sizeof(char));
    248238        odouble->value=optionvalue;
Note: See TracChangeset for help on using the changeset viewer.