Changeset 28008
- Timestamp:
- 11/14/23 13:46:21 (16 months ago)
- Location:
- issm/trunk-jpl/src/wrappers
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/wrappers/javascript/io/FetchJavascriptData.cpp
r24304 r28008 1 /* \file FetchData.cpp:1 /* \file FetchJavascriptData.cpp: 2 2 * \brief: general I/O interface to fetch data in javascript 3 3 */ … … 22 22 } 23 23 /*}}}*/ 24 /*FUNCTION FetchData(double* pscalar, double scalar){{{*/ 25 void FetchData(double* pscalar, double scalar){ 26 *pscalar=scalar; 27 } 28 /*}}}*/ 24 29 /*FUNCTION FetchData(int* pinteger, int integer){{{*/ 25 30 void FetchData(int* pinteger, int integer){ … … 27 32 } 28 33 /*}}}*/ 29 /*FUNCTION FetchData(double* pscalar, double scalar){{{*/30 void FetchData(double* pscalar, double scalar){31 *pscalar=scalar;32 }33 /*}}}*/34 34 /*FUNCTION FetchData(double **pvector, double* vectorin, int nods){{{*/ 35 35 void FetchData(double** pvector, double* vectorin, int nods){ … … 49 49 *pvector=vector; 50 50 *pnods=nods; 51 } 52 /*}}}*/ 53 /*FUNCTION FetchData(double **pmatrix, int* pM, int* matrix, int M, int N){{{*/ 54 void FetchData(double **pmatrix, int* pM, int* matrixin, int M, int N){ 55 double* outmatrix=NULL; 56 int outmatrix_rows; 57 58 if(M == 0 || N == 0){ 59 /*Nothing to pick up. Just initialize matrix pointer to NULL: */ 60 outmatrix_rows=0; 61 outmatrix=NULL; 62 } 63 else if (pmatrix && matrixin){ 64 outmatrix_rows=M; 65 outmatrix=xNew<IssmPDouble>(M*N); 66 for(int i=0;i<M*N;i++){outmatrix[i]=(IssmPDouble)matrixin[i];} 67 } 68 69 /*Assign output pointers:*/ 70 *pmatrix=outmatrix; 71 if (pM){*pM=outmatrix_rows;} 51 72 } 52 73 /*}}}*/ … … 62 83 outmatrix=NULL; 63 84 } 64 85 else if (pmatrix && matrixin){ 65 86 outmatrix_rows=M; 66 87 outmatrix_cols=N; … … 73 94 if (pM){*pM=outmatrix_rows;} 74 95 if (pN){*pN=outmatrix_cols;} 96 } 97 /*}}}*/ 98 /*FUNCTION FetchData(double **pmatrix, int* pM, double* matrix, int M, int N){{{*/ 99 void FetchData(double **pmatrix, int* pM, double* matrixin, int M, int N){ 100 double* outmatrix=NULL; 101 int outmatrix_rows; 102 103 if(M == 0 || N == 0){ 104 /*Nothing to pick up. Just initialize matrix pointer to NULL: */ 105 outmatrix_rows=0; 106 outmatrix=NULL; 107 } 108 else if (pmatrix && matrixin){ 109 outmatrix_rows=M; 110 outmatrix=xNew<IssmPDouble>(M*N); xMemCpy<IssmPDouble>(outmatrix,matrixin,M*N); 111 } 112 113 /*Assign output pointers:*/ 114 *pmatrix=outmatrix; 115 if (pM){*pM=outmatrix_rows;} 75 116 } 76 117 /*}}}*/ … … 86 127 outmatrix=NULL; 87 128 } 88 129 else if (pmatrix && matrixin){ 89 130 outmatrix_rows=M; 90 131 outmatrix_cols=N; … … 96 137 if (pM){*pM=outmatrix_rows;} 97 138 if (pN){*pN=outmatrix_cols;} 139 } 140 /*}}}*/ 141 /*FUNCTION FetchData(int **pmatrix, int* pM, int* matrix, int M, int N){{{*/ 142 void FetchData(int **pmatrix, int* pM, int* matrixin, int M, int N){ 143 int* outmatrix=NULL; 144 int outmatrix_rows; 145 146 if(M == 0 || N == 0){ 147 /*Nothing to pick up. Just initialize matrix pointer to NULL: */ 148 outmatrix_rows=0; 149 outmatrix=NULL; 150 } 151 else if (pmatrix && matrixin){ 152 outmatrix_rows=M; 153 outmatrix=xNew<int>(M*N); xMemCpy<int>(outmatrix,matrixin,M*N); 154 } 155 156 /*Assign output pointers:*/ 157 *pmatrix=outmatrix; 158 if (pM){*pM=outmatrix_rows;} 98 159 } 99 160 /*}}}*/ … … 109 170 outmatrix=NULL; 110 171 } 111 172 else if (pmatrix && matrixin){ 112 173 outmatrix_rows=M; 113 174 outmatrix_cols=N; … … 187 248 BamgOpts *bamgopts = new BamgOpts(); 188 249 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 250 /*Parameters*/ 251 bamgopts->anisomax = anisomax; 252 bamgopts->coeff = coeff; 253 bamgopts->cutoff = cutoff; 254 bamgopts->errg = errg; 255 bamgopts->gradation = gradation; 256 bamgopts->Hessiantype = Hessiantype; 257 bamgopts->maxnbv = maxnbv; 258 bamgopts->maxsubdiv = maxsubdiv; 259 bamgopts->Metrictype = Metrictype; 260 bamgopts->nbjacobi = nbjacobi; 261 bamgopts->nbsmooth = nbsmooth; 262 bamgopts->omega = omega; 263 bamgopts->power = power; 264 bamgopts->verbose = verbose; 265 266 /*Flags*/ 267 bamgopts->Crack = Crack; 268 bamgopts->KeepVertices = KeepVertices; 269 bamgopts->splitcorners = splitcorners; 270 271 /*Metric related*/ 272 bamgopts->hmin = hmin; 273 bamgopts->hmax = hmax; 213 274 FetchData(&bamgopts->hminVertices, &bamgopts->hminVerticesSize[0], &bamgopts->hminVerticesSize[1], hminVertices, hminVerticesSize[0], hminVerticesSize[1]); 214 275 FetchData(&bamgopts->hmaxVertices, &bamgopts->hmaxVerticesSize[0], &bamgopts->hmaxVerticesSize[1], hmaxVertices, hmaxVerticesSize[0], hmaxVerticesSize[1]); -
issm/trunk-jpl/src/wrappers/javascript/io/WriteJavascriptData.cpp
r22896 r28008 1 /* \file Write Data.c:2 * \brief: general interface for writing data1 /* \file WriteJavascriptData.cpp: 2 * \brief: general I/O interface to fetch data in javascript 3 3 */ 4 4 -
issm/trunk-jpl/src/wrappers/javascript/io/javascriptio.h
r24295 r28008 1 /*\file matlabio.h2 * \brief: I/O for ISSM in matlabmode1 /*\file javascriptio.h 2 *s\brief: I/O for ISSM in javascript mode 3 3 */ 4 4 … … 32 32 33 33 void FetchData(char** pstring, char* stringin); 34 void FetchData(double* pscalar, double scalar);34 void FetchData(double* pscalar, double scalar); 35 35 void FetchData(int* pinteger,int integer); 36 36 void FetchData(double** pvector, double* vectorin, int nods); 37 37 void FetchData(double** pvector, int* pnods, double* vectorin, int nods); 38 void FetchData(double **pmatrix, int* pM, int* pN, int* matrixin, int M, int N); 39 void FetchData(double **pmatrix, int* pM, int* pN, double* matrixin, int M, int N); 40 void FetchData(int **pmatrix, int* pM, int* pN, int* matrixin, int M, int N); 38 void FetchData(double** pmatrix, int* pM, int* matrixin, int M, int N); 39 void FetchData(double** pmatrix, int* pM, int* pN, int* matrixin, int M, int N); 40 void FetchData(double** pmatrix, int* pM, double* matrixin, int M, int N); 41 void FetchData(double** pmatrix, int* pM, int* pN, double* matrixin, int M, int N); 42 void FetchData(int** pmatrix, int* pM, int* matrixin, int M, int N); 43 void FetchData(int** pmatrix, int* pM, int* pN, int* matrixin, int M, int N); 41 44 void FetchData(Contours** pcontours,double* x, double* y, int nods); 42 45 void FetchData(BamgGeom** pbamggeom, int* VerticesSize, double* Vertices, int* EdgesSize, double* Edges, int* CornersSize, double* Corners, int* RequiredVerticesSize, double* RequiredVertices, int* RequiredEdgesSize, double* RequiredEdges, int* CrackedEdgesSize, double* CrackedEdges, int* SubDomainsSize, double* SubDomains); -
issm/trunk-jpl/src/wrappers/matlab/io/FetchMatlabData.cpp
r27707 r28008 1 /*\file Fetch Data.cpp:2 * 1 /*\file FetchMatlabData.cpp: 2 *\brief: general I/O interface to fetch data in matlab 3 3 */ 4 4 -
issm/trunk-jpl/src/wrappers/matlab/io/WriteMatlabData.cpp
r27796 r28008 1 /* \file WriteData.c:2 * \brief: general interface for writing data1 /*\file WriteMatlabData.c: 2 *\brief: general I/O interface to write data in matlab 3 3 */ 4 4 -
issm/trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp
r27528 r28008 1 /*\file Fetch Data.cpp:2 * 1 /*\file FetchPythonData.cpp: 2 *\brief: general I/O interface to fetch data in python 3 3 */ 4 4 -
issm/trunk-jpl/src/wrappers/python/io/WritePythonData.cpp
r23708 r28008 1 /* \file WriteData.c:2 * \brief: general interface for writing data1 /*\file WritePythonData.cpp: 2 *\brief: general I/O interface to write data in matlab 3 3 */ 4 4
Note:
See TracChangeset
for help on using the changeset viewer.