Changeset 19768
- Timestamp:
- 11/19/15 20:01:24 (9 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/array/arrayoperations.js
r19753 r19768 21 21 return sum; 22 22 } //}}} 23 function ArrayXPY(){ //{{{ 24 if (arguments.length<2)throw Error("ArrayXPY error message: sum has to be for at least two arrays!"); 25 26 //check internal consistency of arrays provided!: 27 var firstarray=arguments[0]; 28 var firstsize=firstarray.length; 29 30 for(var a=1;a<arguments.length;a++){ 31 var array=arguments[a]; 32 if(array.length!=firstsize)throw Error("ArrayXPY error message: arrays provided as arguments are not of the same length!"); 33 } 34 35 //do the sum: 36 var sum=NewArrayFill(firstsize,0); 37 for(var a=0;a<arguments.length;a++){ 38 var array=arguments[a]; 39 for(var i=0;i<array.length;i++){ 40 sum[i]+=array[i]; 41 } 42 } 43 return sum; 44 45 } //}}} 46 function ArrayOr(){ //{{{ 47 if (arguments.length<2)throw Error("ArrayOr error message: sum has to be for at least two arrays!"); 48 49 //check internal consistency of arrays provided!: 50 var firstarray=arguments[0]; 51 var firstsize=firstarray.length; 52 53 for(var a=1;a<arguments.length;a++){ 54 var array=arguments[a]; 55 if(array.length!=firstsize)throw Error("ArrayOr error message: arrays provided as arguments are not of the same length!"); 56 } 57 58 //do the or: 59 var or=NewArrayFill(firstsize,0); 60 for(var a=0;a<arguments.length;a++){ 61 var array=arguments[a]; 62 for(var i=0;i<array.length;i++){ 63 or[i] = or[i] | array[i]; 64 } 65 } 66 return or; 67 68 } //}}} 23 69 function ArrayMin2D(array){ //{{{ 24 70 … … 99 145 return 0; 100 146 } //}}} 147 function ArrayAnyEqual(array,value) { //{{{ 148 149 for(var i=0;i<array.length;i++){ 150 if (array[i]==value)return 1; 151 } 152 return 0; 153 } //}}} 101 154 function ArrayAnyBelowOrEqual(array,value) { //{{{ 102 155 … … 110 163 for(var i=0;i<array.length;i++){ 111 164 if (array[i]<value)return 1; 165 } 166 return 0; 167 } //}}} 168 function ArrayAnyAboveOrEqual(array,value) { //{{{ 169 170 for(var i=0;i<array.length;i++){ 171 if (array[i]>=value)return 1; 172 } 173 return 0; 174 } //}}} 175 function ArrayAnyAboveStrict(array,value) { //{{{ 176 177 for(var i=0;i<array.length;i++){ 178 if (array[i]>value)return 1; 112 179 } 113 180 return 0; -
issm/trunk-jpl/src/wrappers/EnumToString/EnumToString.h
r15106 r19768 40 40 #endif 41 41 42 #ifdef _HAVE_JAVASCRIPT_MODULES_ 43 /* serial input macros: */ 44 #define ENUMIN enumin 45 /* serial output macros: */ 46 #define NAME pstring 47 #define WRAPPER(modulename) extern "C" { int EnumToStringModule(char** pstring, int enumin) 48 #endif 49 50 42 51 /* serial arg counts: */ 43 52 #undef NLHS -
issm/trunk-jpl/src/wrappers/StringToEnum/StringToEnum.h
r15106 r19768 40 40 #endif 41 41 42 #ifdef _HAVE_JAVASCRIPT_MODULES_ 43 /* serial input macros: */ 44 #define NAME string 45 /* serial output macros: */ 46 #define ENUMOUT penum 47 #define WRAPPER(modulename) extern "C" { int StringToEnumModule(double* penum, char* string) 48 #endif 49 42 50 /* serial arg counts: */ 43 51 #undef NLHS -
issm/trunk-jpl/src/wrappers/javascript/Makefile.am
r19753 r19768 12 12 ../ElementConnectivity/ElementConnectivity.js\ 13 13 ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.js\ 14 ../IssmConfig/IssmConfig.js 14 ../IssmConfig/IssmConfig.js\ 15 ../EnumToString/EnumToString.js\ 16 ../StringToEnum/StringToEnum.js 15 17 16 18 #javascript io{{{ … … 79 81 ../ElementConnectivity/ElementConnectivity.cpp\ 80 82 ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp\ 81 ../IssmConfig/IssmConfig.cpp 83 ../IssmConfig/IssmConfig.cpp\ 84 ../EnumToString/EnumToString.cpp\ 85 ../StringToEnum/StringToEnum.cpp 82 86 83 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=187 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','_EnumToStringModule','_StringToEnumModule']" -s DISABLE_EXCEPTION_CATCHING=0 -s ALLOW_MEMORY_GROWTH=1 84 88 IssmModule_LDADD = ${deps} $(TRIANGLELIB) 85 89 #}}} -
issm/trunk-jpl/src/wrappers/javascript/io/FetchJavascriptData.cpp
r19753 r19768 22 22 } 23 23 /*}}}*/ 24 /*FUNCTION FetchData(int* pinteger,int integer){{{*/ 25 void FetchData(int* pinteger,int integer){ 26 27 *pinteger = integer; 28 } 29 /*}}}*/ 24 30 /*FUNCTION FetchData(double* pscalar,double scalar){{{*/ 25 31 void FetchData(double* pscalar,double scalar){ 26 32 27 33 *pscalar = scalar; 28 }29 /*}}}*/30 /*FUNCTION FetchData(double* pscalar,double scalar){{{*/31 void FetchData(int* pinteger,int integer){32 33 *pinteger = integer;34 34 } 35 35 /*}}}*/ -
issm/trunk-jpl/src/wrappers/javascript/io/javascriptio.h
r19753 r19768 36 36 void FetchData(Contours** pcontours,double* x, double* y, int nods); 37 37 void FetchData(Options** poptions,int NRHS, int nrhs, const char* optionname, double optionvalue); 38 void FetchData(int* pinteger,int integer); 38 39 39 40 /*Print*/ -
issm/trunk-jpl/test/Exp/Square.js
r19702 r19768 3 3 // Points Count Value 4 4 var square={} 5 square["nods"]=5; 5 square[0]={}; 6 square[0]["nods"]=5; 6 7 // X pos Y pos 7 square[ "x"]=[0,1000000,1000000,0,0];8 square[ "y"]=[0, 0, 1000000, 1000000, 0];8 square[0]["x"]=[0,1000000,1000000,0,0]; 9 square[0]["y"]=[0, 0, 1000000, 1000000, 0]; -
issm/trunk-jpl/test/Par/SquareShelfConstrained.js
r19753 r19768 52 52 //Numerical parameters 53 53 md.stressbalance.viscosity_overshoot=0.0; 54 return;55 54 md.masstransport.stabilization=1; 56 55 md.thermal.stabilization=1; 57 md.verbose= verbose(0);56 md.verbose=new verbose(0); 58 57 md.settings.waitonlock=30; 59 58 md.stressbalance.restol=0.05; … … 65 64 66 65 //Deal with boundary conditions: 67 md=SetIceShelfBC(md);66 SetIceShelfBC(md); 68 67 69 68 //Change name so that no tests have the same name 70 //A=dbstack; 71 //if (length(A)>2), md.miscellaneous.name=A(3).file(1:end-2); end 72 69 md.miscellaneous.name='test101'; 73 70 }
Note:
See TracChangeset
for help on using the changeset viewer.