Changeset 19753 for issm/trunk-jpl/src
- Timestamp:
- 11/18/15 14:53:42 (9 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 21 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/array/arrayoperations.js
r19736 r19753 74 74 return notarray; 75 75 } //}}} 76 function ArrayPow(array,coefficient) { //{{{ 77 78 var powarray=array; 79 for (i=0;i<array.length;i++)powarray[i]=Math.pow(array[i],coefficient); 80 return powarray; 81 } //}}} 82 function ArraySqrt(array) { //{{{ 83 84 var sqrtarray=array; 85 for (i=0;i<array.length;i++)sqrtarray[i]=Math.sqrt(array[i]); 86 return sqrtarray; 87 } //}}} 88 function ArrayMag(array1,array2) { //{{{ 89 90 var arraymag=NewArrayFill(array1.length,0); 91 for (var i=0;i<array1.length;i++)arraymag[i]=Math.sqrt(Math.pow(array1[i],2)+Math.pow(array2[i],2)); 92 return arraymag; 93 } //}}} 76 94 function ArrayAnyNaN(array) { //{{{ 77 95 78 96 for(var i=0;i<array.length;i++){ 79 97 if (isNaN(array[i])) return 1; 98 } 99 return 0; 100 } //}}} 101 function ArrayAnyBelowOrEqual(array,value) { //{{{ 102 103 for(var i=0;i<array.length;i++){ 104 if (array[i]<=value)return 1; 105 } 106 return 0; 107 } //}}} 108 function ArrayAnyBelowStrict(array,value) { //{{{ 109 110 for(var i=0;i<array.length;i++){ 111 if (array[i]<value)return 1; 80 112 } 81 113 return 0; -
issm/trunk-jpl/src/m/classes/model.js
r19719 r19753 52 52 this.constants = new constants(); 53 53 this.geometry = new geometry(); 54 // this.initialization = initialization(); 55 // this.smb = SMBforcing(); 56 // this.basalforcings = basalforcings(); 57 // this.friction = friction(); 58 // this.rifts = rifts(); 59 // this.timestepping = timestepping(); 60 // this.groundingline = groundingline(); 61 // this.materials = matice(); 62 // this.damage = damage(); 63 // this.flowequation = flowequation(); 64 // this.debug = debug(); 65 // this.verbose = verbose(); 66 // this.settings = settings(); 67 // this.toolkits = toolkits(); 68 // this.cluster = generic(); 69 // this.balancethickness = balancethickness(); 70 // this.stressbalance = stressbalance(); 71 // this.hydrology = hydrologyshreve(); 72 // this.masstransport = masstransport(); 73 // this.thermal = thermal(); 74 // this.steadystate = steadystate(); 75 // this.transient = transient(); 76 // this.calving = calving(); 77 // this.gia = gia(); 78 // this.autodiff = autodiff(); 79 // this.flaim = flaim(); 80 // this.inversion = inversion(); 81 // this.qmu = qmu(); 82 // this.radaroverlay = radaroverlay(); 83 // this.results = struct(); 84 // this.outputdefinition = outputdefinition(); 85 // this.miscellaneous = miscellaneous(); 86 // this.private = private(); 54 this.initialization = new initialization(); 55 this.smb = new SMBforcing(); 56 this.basalforcings = new basalforcings(); 57 this.friction = new friction(); 58 this.rifts = new rifts(); 59 this.timestepping = new timestepping(); 60 this.groundingline = new groundingline(); 61 this.materials = new matice(); 62 this.damage = new damage(); 63 this.flowequation = new flowequation(); 64 this.debug = new debug(); 65 this.verbose = new verbose(); 66 this.settings = new settings(); 67 this.toolkits = new toolkits(); 68 this.toolkits.disp(); 69 this.cluster = new generic(); 70 this.balancethickness = new balancethickness(); 71 this.stressbalance = new stressbalance(); 72 this.hydrology = new hydrologyshreve(); 73 this.masstransport = new masstransport(); 74 this.thermal = new thermal(); 75 this.steadystate = new steadystate(); 76 this.transient = new transient(); 77 this.calving = new calving(); 78 this.gia = new gia(); 79 this.autodiff = new autodiff(); 80 this.flaim = new flaim(); 81 this.inversion = new inversion(); 82 this.qmu = new qmu(); 83 this.radaroverlay = new radaroverlay(); 84 this.results = []; 85 this.outputdefinition = new outputdefinition(); 86 this.miscellaneous = new miscellaneous(); 87 this.private = new private(); 87 88 } //}}} 88 89 //properties -
issm/trunk-jpl/src/m/classes/pairoptions.js
r19721 r19753 265 265 266 266 //properties 267 list = [];267 this.list = []; 268 268 this.constructor(args); 269 269 } -
issm/trunk-jpl/src/m/classes/plotoptions.js
r19721 r19753 159 159 //properties 160 160 // {{{ 161 numberofplots = 0;162 figurenumber = 1;163 list = [];161 this.numberofplots = 0; 162 this.figurenumber = 1; 163 this.list = []; 164 164 this.constructor(args); 165 165 //}}} -
issm/trunk-jpl/src/m/miscellaneous/fielddisplay.js
r19721 r19753 21 21 } 22 22 else{ 23 console.log(offset) 24 console.log(name) 25 console.log(field) 26 //displayunit(offset,name,"""" + field """",comment), 23 displayunit(offset,name,"'"+field+"'",comment); 27 24 } 28 25 } … … 82 79 else{ 83 80 if (typeof(comment) == "string"){ 84 console.log(sprintf("%s%-23s: %-15s -- %s",offset,name,characterization,comment)); 81 //console.log(sprintf("%s%-23s: %-15s -- %s",offset,name,characterization,comment)); 82 console.log(sprintf("%s%s: %-15s -- %s",offset,name,characterization,comment)); 85 83 } 86 84 else{ -
issm/trunk-jpl/src/wrappers/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
r14996 r19753 55 55 #endif 56 56 57 #ifdef _HAVE_JAVASCRIPT_MODULES_ 58 /* serial input macros: */ 59 #define INDEX indexin,nelin,3 60 #define X xin,nodsin 61 #define Y yin,nodsin 62 #define DATA datain,nodsin,1 63 #define XINTERP x_interpin, nods_interpin 64 #define YINTERP y_interpin, nods_interpin 65 #define ARGUMENTS "default_value",default_value 66 /* serial output macros: */ 67 #define DATAINTERP pdata_interp,NULL,NULL 68 #define WRAPPER(modulename) extern "C" { int InterpFromMeshToMesh2dModule(double** pdata_interp,int* indexin,double* xin,double* yin,double* datain,double* x_interpin,double* y_interpin,int nelin,int nodsin,int nods_interpin,double default_value) 69 #define nrhs 6 70 #endif 71 57 72 /* serial arg counts: */ 58 73 #undef NLHS -
issm/trunk-jpl/src/wrappers/IssmConfig/IssmConfig.h
r15905 r19753 31 31 /* serial output macros: */ 32 32 #define VALUE (mxArray**)&plhs[0] 33 #define SVALUE (mxArray**)&plhs[0] 33 34 #endif 34 35 … … 38 39 /* serial output macros: */ 39 40 #define VALUE output,0 41 #define SVALUE output,0 42 #endif 43 44 45 #ifdef _HAVE_JAVASCRIPT_MODULES_ 46 /* serial input macros: */ 47 #define NAME string 48 /* serial output macros: */ 49 #define VALUE pvalue 50 #define SVALUE psvalue 51 #define WRAPPER(modulename) extern "C" { int IssmConfigModule(double* pvalue, char** psvalue, char* string) 40 52 #endif 41 53 -
issm/trunk-jpl/src/wrappers/javascript/Makefile.am
r19739 r19753 10 10 bin_SCRIPTS += ../TriMesh/TriMesh.js \ 11 11 ../NodeConnectivity/NodeConnectivity.js\ 12 ../ElementConnectivity/ElementConnectivity.js 12 ../ElementConnectivity/ElementConnectivity.js\ 13 ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.js\ 14 ../IssmConfig/IssmConfig.js 13 15 14 16 #javascript io{{{ … … 75 77 IssmModule_SOURCES = ../TriMesh/TriMesh.cpp \ 76 78 ../NodeConnectivity/NodeConnectivity.cpp\ 77 ../ElementConnectivity/ElementConnectivity.cpp 79 ../ElementConnectivity/ElementConnectivity.cpp\ 80 ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\ 81 ../IssmConfig/IssmConfig.cpp 78 82 79 IssmModule_CXXFLAGS= -fPIC -D_DO_NOT_LOAD_GLOBALS_ --memory-init-file 0 $(AM_CXXFLAGS) $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS) -s EXPORTED_FUNCTIONS="['_TriMeshModule','_NodeConnectivityModule','_ElementConnectivityModule' ]" -s DISABLE_EXCEPTION_CATCHING=0 -s ALLOW_MEMORY_GROWTH=183 IssmModule_CXXFLAGS= -fPIC -D_DO_NOT_LOAD_GLOBALS_ --memory-init-file 0 $(AM_CXXFLAGS) $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS) -s EXPORTED_FUNCTIONS="['_TriMeshModule','_NodeConnectivityModule','_ElementConnectivityModule','_InterpFromMeshToMesh2dModule','_IssmConfigModule']" -s DISABLE_EXCEPTION_CATCHING=0 -s ALLOW_MEMORY_GROWTH=1 80 84 IssmModule_LDADD = ${deps} $(TRIANGLELIB) 81 85 #}}} -
issm/trunk-jpl/src/wrappers/javascript/io/FetchJavascriptData.cpp
r19711 r19753 13 13 14 14 /*Primitive data types*/ 15 /*FUNCTION FetchData(char** pstring, char* string){{{*/ 16 void FetchData(char** pstring, char* stringin){ 17 18 char* string=xNew<char>(strlen(stringin)+1); 19 xMemCpy<char>(string,stringin,strlen(stringin)+1); 20 21 *pstring=string; 22 } 23 /*}}}*/ 15 24 /*FUNCTION FetchData(double* pscalar,double scalar){{{*/ 16 25 void FetchData(double* pscalar,double scalar){ … … 35 44 } 36 45 /*}}}*/ 46 /*FUNCTION FetchData(double **pvector, int* pnods, double* vectorin, int nods){{{*/ 47 void FetchData(double** pvector, int* pnods, double* vectorin, int nods){ 48 49 double* vector=NULL; 50 51 vector=xNew<IssmPDouble>(nods); xMemCpy<IssmPDouble>(vector,vectorin,nods); 52 53 *pvector=vector; 54 *pnods=nods; 55 } 56 /*}}}*/ 37 57 /*FUNCTION FetchData(double **pmatrix, int* pM, int* pN, int* matrix, int M, int N){{{*/ 38 58 void FetchData(double **pmatrix, int* pM, int* pN, int* matrixin, int M, int N){ … … 44 64 matrix=xNew<IssmPDouble>(M*N); 45 65 for(int i=0;i<M*N;i++)matrix[i]=(IssmPDouble)matrixin[i]; 66 if (pM)*pM=M; 67 if (pN)*pN=N; 68 *pmatrix=matrix; 69 } 70 } 71 /*}}}*/ 72 /*FUNCTION FetchData(double **pmatrix, int* pM, int* pN, double* matrix, int M, int N){{{*/ 73 void FetchData(double **pmatrix, int* pM, int* pN, double* matrixin, int M, int N){ 74 75 double* matrix=NULL; 76 77 if(pmatrix && matrixin){ 78 79 matrix=xNew<IssmPDouble>(M*N); 80 for(int i=0;i<M*N;i++)matrix[i]=matrixin[i]; 46 81 if (pM)*pM=M; 47 82 if (pN)*pN=N; … … 89 124 } 90 125 /*}}}*/ 126 /*FUNCTION FetchData(Options** poptions,int NRHS, int nrhs, const char* optionname, double optionvalue){{{*/ 127 void FetchData(Options** poptions,int NRHS, int nrhs, const char* optionname, double optionvalue){ 128 129 /*Initialize output*/ 130 Options* options=new Options(); 131 132 GenericOption<double> *odouble = NULL; 133 134 /*check and parse the name */ 135 odouble=new GenericOption<double>(); 136 odouble->name =xNew<char>(strlen(optionname)+1); 137 memcpy(odouble->name,optionname,(strlen(optionname)+1)*sizeof(char)); 138 odouble->value=optionvalue; 139 odouble->numel=1; 140 odouble->ndims=1; 141 odouble->size=NULL; 142 143 options->AddOption((Option*)odouble); 144 145 /*Assign output pointers:*/ 146 *poptions=options; 147 } 148 /*}}}*/ -
issm/trunk-jpl/src/wrappers/javascript/io/WriteJavascriptData.cpp
r19711 r19753 40 40 } 41 41 /*}}}*/ 42 /*FUNCTION WriteData(IssmPDouble** pmatrix, int* pM, IssmPDouble* pN, , int* matrix, int M,int N){{{*/ 43 void WriteData(IssmPDouble** pmatrix,int* pM, int* pN, IssmPDouble* matrix, int M, int N){ 44 45 if(pmatrix && matrix){ 46 47 /*Copy matrix: */ 48 IssmPDouble* dmatrix = xNew<IssmPDouble>(M*N); 49 for (int i=0;i<M*N;i++)dmatrix[i]=matrix[i]; 50 *pmatrix=dmatrix; 51 if(pM)*pM=M; 52 if(pN)*pN=N; 53 } 54 } 55 /*}}}*/ 42 56 /*FUNCTION WriteData(IssmPDouble** px, int* pnods, double* vector, int M){{{*/ 43 57 void WriteData(IssmPDouble** px, int* pnods, double* vector, int M){ … … 64 78 } 65 79 /*}}}*/ 80 /*FUNCTION WriteData(IssmPDouble* pdouble, IssmPDouble double){{{*/ 81 void WriteData(IssmPDouble* pdouble, IssmPDouble doublein){ 66 82 67 /*ISSM objects*/ 83 *pdouble=doublein; 84 } 85 /*}}}*/ 86 /*FUNCTION WriteData(char** pstring, char* string){{{*/ 87 void WriteData(char** pstring, char* stringin){ 68 88 69 /*Toolkit*/ 89 char* string=xNew<char>(strlen(stringin)+1); 90 xMemCpy<char>(string,stringin,strlen(stringin)+1); 91 92 *pstring=string; 93 } 94 /*}}}*/ -
issm/trunk-jpl/src/wrappers/javascript/io/javascriptio.h
r19711 r19753 20 20 void WriteData(IssmPDouble** pmatrix,int* pnel, int* matrix, int M,int N); 21 21 void WriteData(IssmPDouble** pmatrix,int* pM, int* pN, int* matrix, int M, int N); 22 void WriteData(IssmPDouble** pmatrix,int* pM, int* pN, IssmPDouble* matrix, int M, int N); 22 23 void WriteData(IssmPDouble** px, int* pnods, int* vector, int M); 23 24 void WriteData(IssmPDouble** px, int* pnods, double* vector, int M); 25 void WriteData(char** pstring, char* stringin); 26 void WriteData(IssmPDouble* pdouble, IssmPDouble doublein); 24 27 28 void FetchData(char** pstring, char* stringin); 25 29 void FetchData(double* pscalar,double scalar); 26 30 void FetchData(int* pinteger,int integer); 27 31 void FetchData(double** pvector, double* vectorin, int nods); 32 void FetchData(double** pvector, int* pnods, double* vectorin, int nods); 28 33 void FetchData(double **pmatrix, int* pM, int* pN, int* matrixin, int M, int N); 34 void FetchData(double **pmatrix, int* pM, int* pN, double* matrixin, int M, int N); 29 35 void FetchData(int **pmatrix, int* pM, int* pN, int* matrixin, int M, int N); 30 36 void FetchData(Contours** pcontours,double* x, double* y, int nods); 37 void FetchData(Options** poptions,int NRHS, int nrhs, const char* optionname, double optionvalue); 31 38 32 39 /*Print*/
Note:
See TracChangeset
for help on using the changeset viewer.