Changeset 21204
- Timestamp:
- 09/12/16 22:55:51 (9 years ago)
- Location:
- issm/trunk-jpl/jenkins/javascript/karma/scripts
- Files:
-
- 4 added
- 32 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/jenkins/javascript/karma/scripts/m2js.sh
r20794 r21204 9 9 echo "Exiting..." 10 10 exit 11 fi12 13 if [[ $OUTFILE == test*.js ]]; then14 sed -i '2s/^/var md = new model();\n/' $OUTFILE # initialize the model15 11 fi 16 12 … … 62 58 63 59 64 sed -i "s/\([^']\)NaN\([^']\)/\1null\2/g" $OUTFILE # NaN translates to null60 #sed -i "s/\([^']\)NaN\([^']\)/\1null\2/g" $OUTFILE # NaN translates to null 65 61 66 sed -i 's/function\s *\(.*\)\s*=\s*\(.*\)(\(.*\)/this.\2 = function(\3)/' $OUTFILE62 sed -i 's/function\s\(.*\)\s*=\s*\(.*\)(\(.*\)/this.\2 = function(\3)/' $OUTFILE 67 63 68 64 sed -i 's/(self,*\(.*\))/(\1)/' $OUTFILE … … 87 83 88 84 sed -i 's/self/this/g' $OUTFILE # self -> this 85 sed -i 's/md\.transient/md.trans/g' $OUTFILE # self -> this 89 86 90 87 sed -i 's/function(\([^ ]*\))/function(\1) {/' $OUTFILE 88 89 #sed -i 's/\(\d+\)\^\(\d+\)/Math.pow(\1,\2)/' $OUTFILE 90 sed -i 's/\([0-9]*\)\^\([0-9]*\)/Math.pow(\1,\2)/g' $OUTFILE 91 92 #if [[ $OUTFILE == test*.js ]]; then 93 sed -i '2s/^/var md = new model();\n/' $OUTFILE # initialize the model 94 #fi 91 95 92 96 #sed -i 'N;s/properties.*\n\s*\(.*\)\(\s*\)=\s*\(.*\)/this/' $OUTFILE -
issm/trunk-jpl/jenkins/javascript/karma/scripts/specs/issm.spec.js
r20767 r21204 1 //var json:any; 2 it("should load a fixture", function () { 3 jasmine.getFixtures().fixturesPath = "base/Archives/" 4 var f = readFixtures("Archive101.json"); 5 var json = JSON.parse(f); 6 expect(json).toBeDefined(); 7 //console.log(json); 8 }); 9 1 10 describe("test101", function() { 2 11 it("contains test101", function() { … … 13 22 md.verbose.solution=2; md.verbose.convergence=0; 14 23 24 console.log("MESH"); 25 console.log(md.mesh.domaintype()); 26 15 27 md=solve(md,StressbalanceSolutionEnum(),'checkconsistency','no'); 16 28 … … 19 31 }) 20 32 21 describe("test105", function() {22 it("contains test105", function() {23 // Test Name: SquareShelfConstrainedMasstransp2d24 var md = new model();25 triangle(md,square[0],150000.);26 setmask(md,'all','');27 parameterize(md);28 setflowequation(md,'SSA','all');29 // md.cluster=generic('name',oshostname(),'np',3);30 md=solve(md,MasstransportSolutionEnum());31 32 // Fields and tolerances to track changes33 field_names =['Thickness'];34 field_tolerances=[1e-13];35 field_values=[36 (md.results.MasstransportSolution[0].Thickness),37 ];38 });39 })40 41 describe("test110", function() {42 it("contains test110", function() {43 // Test Name: SquareShelfConstrainedTranSSA2d44 var md = new model();45 triangle(md,square[0],150000.);46 setmask(md,'all','');47 parameterize(md);48 setflowequation(md,'SSA','all');49 // md.cluster=generic('name',oshostname(),'np',3);50 md.trans.requested_outputs=['IceVolume'];51 52 md=solve(md,TransientSolutionEnum());53 54 // Fields and tolerances to track changes55 field_names =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Volume3'];56 field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,57 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,58 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13];59 field_values=[60 (md.results.TransientSolution[0](1).Vx),61 (md.results.TransientSolution[0](1).Vy),62 (md.results.TransientSolution[0](1).Vel),63 (md.results.TransientSolution[0](1).Pressure),64 (md.results.TransientSolution[0](1).Base),65 (md.results.TransientSolution[0](1).Surface),66 (md.results.TransientSolution[0](1).Thickness),67 (md.results.TransientSolution[0](1).IceVolume),68 (md.results.TransientSolution[0](2).Vx),69 (md.results.TransientSolution[0](2).Vy),70 (md.results.TransientSolution[0](2).Vel),71 (md.results.TransientSolution[0](2).Pressure),72 (md.results.TransientSolution[0](2).Base),73 (md.results.TransientSolution[0](2).Surface),74 (md.results.TransientSolution[0](2).Thickness),75 (md.results.TransientSolution[0](2).IceVolume),76 (md.results.TransientSolution[0](3).Vx),77 (md.results.TransientSolution[0](3).Vy),78 (md.results.TransientSolution[0](3).Vel),79 (md.results.TransientSolution[0](3).Pressure),80 (md.results.TransientSolution[0](3).Base),81 (md.results.TransientSolution[0](3).Surface),82 (md.results.TransientSolution[0](3).Thickness),83 (md.results.TransientSolution[0](3).IceVolume),84 ];85 });86 })87 88 describe("test112", function() {89 it("contains test112", function() {90 // Test Name: SquareShelfConstrainedSurfSlop2d91 var md = new model();92 triangle(md,square[0],150000.);93 setmask(md,'all','');94 parameterize(md);95 setflowequation(md,'SSA','all');96 // md.cluster=generic('name',oshostname(),'np',3);97 md=solve(md,SurfaceSlopeSolutionEnum());98 99 // Fields and tolerances to track changes100 field_names =['SurfaceSlopeX','SurfaceSlopeY'];101 field_tolerances=[1e-13,1e-13];102 field_values=[103 (md.results.SurfaceSlopeSolution[0].SurfaceSlopeX),104 (md.results.SurfaceSlopeSolution[0].SurfaceSlopeY),105 ];106 });107 })108 109 describe("test114", function() {110 it("contains test114", function() {111 // Test Name: SquareShelfConstrainedBedSlop2d112 var md = new model();113 triangle(md,square[0],150000.);114 setmask(md,'all','');115 parameterize(md);116 setflowequation(md,'SSA','all');117 // md.cluster=generic('name',oshostname(),'np',3);118 md=solve(md,BedSlopeSolutionEnum());119 120 // Fields and tolerances to track changes121 field_names =['BedSlopeX','BedSlopeY'];122 field_tolerances=[1e-13,1e-13];123 field_values=[124 (md.results.BedSlopeSolution[0].BedSlopeX),125 (md.results.BedSlopeSolution[0].BedSlopeY),126 ];127 });128 })129 130 describe("test201", function() {131 it("contains test201", function() {132 // Test Name: SquareShelfStressSSA2d133 var md = new model();134 triangle(md,square[0],150000.);135 setmask(md,'all','');136 parameterize(md);137 setflowequation(md,'SSA','all');138 // md.cluster=generic('name',oshostname(),'np',3);139 md=solve(md,StressbalanceSolutionEnum());140 141 // Fields and tolerances to track changes142 field_names =['Vx','Vy','Vel','Pressure'];143 field_tolerances=[1e-13,1e-13,1e-13,1e-13];144 field_values=[145 (md.results.StressbalanceSolution[0].Vx),146 (md.results.StressbalanceSolution[0].Vy),147 (md.results.StressbalanceSolution[0].Vel),148 (md.results.StressbalanceSolution[0].Pressure),149 ];150 });151 })152 153 describe("test208", function() {154 it("contains test208", function() {155 // Test Name: SquareShelfTranSSA2d156 var md = new model();157 triangle(md,square[0],150000.);158 setmask(md,'all','');159 parameterize(md);160 setflowequation(md,'SSA','all');161 // md.cluster=generic('name',oshostname(),'np',3);162 md.trans.requested_outputs=['default','FloatingArea','GroundedArea','TotalGroundedBmb','TotalFloatingBmb'];163 for (var i = 0; i < md.basalforcings.floatingice_melting_rate.length; ++i) {164 md.basalforcings.floatingice_melting_rate[i] = 1;165 }166 md=solve(md,TransientSolutionEnum());167 168 // Fields and tolerances to track changes169 field_names =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','TotalGroundedBmb1','TotalFloatingBmb1',170 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','TotalGroundedBmb2','TotalFloatingBmb2',171 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','TotalGroundedBmb3','TotalFloatingBmb3'];172 field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,173 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,174 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13];175 field_values=[176 (md.results.TransientSolution[0](1).Vx),177 (md.results.TransientSolution[0](1).Vy),178 (md.results.TransientSolution[0](1).Vel),179 (md.results.TransientSolution[0](1).Pressure),180 (md.results.TransientSolution[0](1).Base),181 (md.results.TransientSolution[0](1).Surface),182 (md.results.TransientSolution[0](1).Thickness),183 (md.results.TransientSolution[0](1).TotalGroundedBmb),184 (md.results.TransientSolution[0](1).TotalFloatingBmb),185 (md.results.TransientSolution[0](2).Vx),186 (md.results.TransientSolution[0](2).Vy),187 (md.results.TransientSolution[0](2).Vel),188 (md.results.TransientSolution[0](2).Pressure),189 (md.results.TransientSolution[0](2).Base),190 (md.results.TransientSolution[0](2).Surface),191 (md.results.TransientSolution[0](2).Thickness),192 (md.results.TransientSolution[0](2).TotalGroundedBmb),193 (md.results.TransientSolution[0](2).TotalFloatingBmb),194 (md.results.TransientSolution[0](3).Vx),195 (md.results.TransientSolution[0](3).Vy),196 (md.results.TransientSolution[0](3).Vel),197 (md.results.TransientSolution[0](3).Pressure),198 (md.results.TransientSolution[0](3).Base),199 (md.results.TransientSolution[0](3).Surface),200 (md.results.TransientSolution[0](3).Thickness),201 (md.results.TransientSolution[0](3).TotalGroundedBmb),202 (md.results.TransientSolution[0](3).TotalFloatingBmb),203 ];204 });205 })33 //describe("test105", function() { 34 //it("contains test105", function() { 35 ////Test Name: SquareShelfConstrainedMasstransp2d 36 //var md = new model(); 37 //triangle(md,square[0],150000.); 38 //setmask(md,'all',''); 39 //parameterize(md); 40 //setflowequation(md,'SSA','all'); 41 ////md.cluster=generic('name',oshostname(),'np',3); 42 //md=solve(md,MasstransportSolutionEnum()); 43 44 ////Fields and tolerances to track changes 45 //field_names =['Thickness']; 46 //field_tolerances=[1e-13]; 47 //field_values=[ 48 //(md.results.MasstransportSolution[0].Thickness), 49 //]; 50 //}); 51 //}) 52 53 //describe("test110", function() { 54 //it("contains test110", function() { 55 ////Test Name: SquareShelfConstrainedTranSSA2d 56 //var md = new model(); 57 //triangle(md,square[0],150000.); 58 //setmask(md,'all',''); 59 //parameterize(md); 60 //setflowequation(md,'SSA','all'); 61 ////md.cluster=generic('name',oshostname(),'np',3); 62 //md.trans.requested_outputs=['IceVolume']; 63 64 //md=solve(md,TransientSolutionEnum()); 65 66 ////Fields and tolerances to track changes 67 //field_names =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Volume3']; 68 //field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13, 69 //1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13, 70 //1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]; 71 //field_values=[ 72 //(md.results.TransientSolution[0](1).Vx), 73 //(md.results.TransientSolution[0](1).Vy), 74 //(md.results.TransientSolution[0](1).Vel), 75 //(md.results.TransientSolution[0](1).Pressure), 76 //(md.results.TransientSolution[0](1).Base), 77 //(md.results.TransientSolution[0](1).Surface), 78 //(md.results.TransientSolution[0](1).Thickness), 79 //(md.results.TransientSolution[0](1).IceVolume), 80 //(md.results.TransientSolution[0](2).Vx), 81 //(md.results.TransientSolution[0](2).Vy), 82 //(md.results.TransientSolution[0](2).Vel), 83 //(md.results.TransientSolution[0](2).Pressure), 84 //(md.results.TransientSolution[0](2).Base), 85 //(md.results.TransientSolution[0](2).Surface), 86 //(md.results.TransientSolution[0](2).Thickness), 87 //(md.results.TransientSolution[0](2).IceVolume), 88 //(md.results.TransientSolution[0](3).Vx), 89 //(md.results.TransientSolution[0](3).Vy), 90 //(md.results.TransientSolution[0](3).Vel), 91 //(md.results.TransientSolution[0](3).Pressure), 92 //(md.results.TransientSolution[0](3).Base), 93 //(md.results.TransientSolution[0](3).Surface), 94 //(md.results.TransientSolution[0](3).Thickness), 95 //(md.results.TransientSolution[0](3).IceVolume), 96 //]; 97 //}); 98 //}) 99 100 //describe("test112", function() { 101 //it("contains test112", function() { 102 ////Test Name: SquareShelfConstrainedSurfSlop2d 103 //var md = new model(); 104 //triangle(md,square[0],150000.); 105 //setmask(md,'all',''); 106 //parameterize(md); 107 //setflowequation(md,'SSA','all'); 108 ////md.cluster=generic('name',oshostname(),'np',3); 109 //md=solve(md,SurfaceSlopeSolutionEnum()); 110 111 ////Fields and tolerances to track changes 112 //field_names =['SurfaceSlopeX','SurfaceSlopeY']; 113 //field_tolerances=[1e-13,1e-13]; 114 //field_values=[ 115 //(md.results.SurfaceSlopeSolution[0].SurfaceSlopeX), 116 //(md.results.SurfaceSlopeSolution[0].SurfaceSlopeY), 117 //]; 118 //}); 119 //}) 120 121 //describe("test114", function() { 122 //it("contains test114", function() { 123 ////Test Name: SquareShelfConstrainedBedSlop2d 124 //var md = new model(); 125 //triangle(md,square[0],150000.); 126 //setmask(md,'all',''); 127 //parameterize(md); 128 //setflowequation(md,'SSA','all'); 129 ////md.cluster=generic('name',oshostname(),'np',3); 130 //md=solve(md,BedSlopeSolutionEnum()); 131 132 ////Fields and tolerances to track changes 133 //field_names =['BedSlopeX','BedSlopeY']; 134 //field_tolerances=[1e-13,1e-13]; 135 //field_values=[ 136 //(md.results.BedSlopeSolution[0].BedSlopeX), 137 //(md.results.BedSlopeSolution[0].BedSlopeY), 138 //]; 139 //}); 140 //}) 141 142 //describe("test201", function() { 143 //it("contains test201", function() { 144 ////Test Name: SquareShelfStressSSA2d 145 //var md = new model(); 146 //triangle(md,square[0],150000.); 147 //setmask(md,'all',''); 148 //parameterize(md); 149 //setflowequation(md,'SSA','all'); 150 ////md.cluster=generic('name',oshostname(),'np',3); 151 //md=solve(md,StressbalanceSolutionEnum()); 152 153 ////Fields and tolerances to track changes 154 //field_names =['Vx','Vy','Vel','Pressure']; 155 //field_tolerances=[1e-13,1e-13,1e-13,1e-13]; 156 //field_values=[ 157 //(md.results.StressbalanceSolution[0].Vx), 158 //(md.results.StressbalanceSolution[0].Vy), 159 //(md.results.StressbalanceSolution[0].Vel), 160 //(md.results.StressbalanceSolution[0].Pressure), 161 //]; 162 //}); 163 //}) 164 165 //describe("test208", function() { 166 //it("contains test208", function() { 167 ////Test Name: SquareShelfTranSSA2d 168 //var md = new model(); 169 //triangle(md,square[0],150000.); 170 //setmask(md,'all',''); 171 //parameterize(md); 172 //setflowequation(md,'SSA','all'); 173 ////md.cluster=generic('name',oshostname(),'np',3); 174 //md.trans.requested_outputs=['default','FloatingArea','GroundedArea','TotalGroundedBmb','TotalFloatingBmb']; 175 //for (var i = 0; i < md.basalforcings.floatingice_melting_rate.length; ++i) { 176 //md.basalforcings.floatingice_melting_rate[i] = 1; 177 //} 178 //md=solve(md,TransientSolutionEnum()); 179 180 ////Fields and tolerances to track changes 181 //field_names =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','TotalGroundedBmb1','TotalFloatingBmb1', 182 //'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','TotalGroundedBmb2','TotalFloatingBmb2', 183 //'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','TotalGroundedBmb3','TotalFloatingBmb3']; 184 //field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13, 185 //1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13, 186 //1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]; 187 //field_values=[ 188 //(md.results.TransientSolution[0](1).Vx), 189 //(md.results.TransientSolution[0](1).Vy), 190 //(md.results.TransientSolution[0](1).Vel), 191 //(md.results.TransientSolution[0](1).Pressure), 192 //(md.results.TransientSolution[0](1).Base), 193 //(md.results.TransientSolution[0](1).Surface), 194 //(md.results.TransientSolution[0](1).Thickness), 195 //(md.results.TransientSolution[0](1).TotalGroundedBmb), 196 //(md.results.TransientSolution[0](1).TotalFloatingBmb), 197 //(md.results.TransientSolution[0](2).Vx), 198 //(md.results.TransientSolution[0](2).Vy), 199 //(md.results.TransientSolution[0](2).Vel), 200 //(md.results.TransientSolution[0](2).Pressure), 201 //(md.results.TransientSolution[0](2).Base), 202 //(md.results.TransientSolution[0](2).Surface), 203 //(md.results.TransientSolution[0](2).Thickness), 204 //(md.results.TransientSolution[0](2).TotalGroundedBmb), 205 //(md.results.TransientSolution[0](2).TotalFloatingBmb), 206 //(md.results.TransientSolution[0](3).Vx), 207 //(md.results.TransientSolution[0](3).Vy), 208 //(md.results.TransientSolution[0](3).Vel), 209 //(md.results.TransientSolution[0](3).Pressure), 210 //(md.results.TransientSolution[0](3).Base), 211 //(md.results.TransientSolution[0](3).Surface), 212 //(md.results.TransientSolution[0](3).Thickness), 213 //(md.results.TransientSolution[0](3).TotalGroundedBmb), 214 //(md.results.TransientSolution[0](3).TotalFloatingBmb), 215 //]; 216 //}); 217 //})
Note:
See TracChangeset
for help on using the changeset viewer.