Changeset 7317 for anuga_core/source/anuga/shallow_water/smf.py
- Timestamp:
- Jul 22, 2009, 9:22:11 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/smf.py
r7276 r7317 49 49 import numpy as num 50 50 51 import anuga.utilities.log as log 52 51 53 52 54 def find_min(x0, wa, kappad, dx): … … 143 145 #a few temporary print statements 144 146 if verbose is True: 145 print '\nThe slide ...'146 print '\tLength: ', length147 print '\tDepth: ', depth148 print '\tSlope: ', slope149 print '\tWidth: ', width150 print '\tThickness: ', thickness151 print '\tx0: ', x0152 print '\ty0: ', y0153 print '\tAlpha: ', alpha154 print '\tAcceleration: ', a0155 print '\tTerminal velocity: ', ut156 print '\tChar time: ', t0157 print '\tChar distance: ', s0158 print '\nThe tsunami ...'159 print '\tWavelength: ', w160 print '\t2D amplitude: ', a2D161 print '\t3D amplitude: ', a3D162 print '\tscale for eta(x,y):', scale147 log.critical('\nThe slide ...') 148 log.critical('\tLength: %s' % str(length)) 149 log.critical('\tDepth: %s' % str(depth)) 150 log.critical('\tSlope: %s' % str(slope)) 151 log.critical('\tWidth: %s' % str(width)) 152 log.critical('\tThickness: %s' % str(thickness)) 153 log.critical('\tx0: %s' % str(x0)) 154 log.critical('\ty0: %s' % str(y0)) 155 log.critical('\tAlpha: %s' % str(alpha)) 156 log.critical('\tAcceleration: %s' % str(a0)) 157 log.critical('\tTerminal velocity: %s' % str(ut)) 158 log.critical('\tChar time: %s' % str(t0)) 159 log.critical('\tChar distance: %s' % str(s0)) 160 log.critical('\nThe tsunami ...') 161 log.critical('\tWavelength: %s' % str(w)) 162 log.critical('\t2D amplitude: %s' % str(a2D)) 163 log.critical('\t3D amplitude: %s' % str(a3D)) 164 log.critical('\tscale for eta(x,y): %s' % str(scale)) 163 165 164 166 #keep an eye on some of the assumptions built into the maths … … 166 168 if ((slope < 5) or (slope > 30)): 167 169 if verbose is True: 168 print 'WARNING: slope out of range (5 - 30 degrees) ', slope 170 log.critical('WARNING: slope out of range (5 - 30 degrees) %s' 171 % str(slope)) 169 172 if ((depth/length < 0.06) or (depth/length > 1.5)): 170 173 if verbose is True: 171 print 'WARNING: d/b out of range (0.06 - 1.5) ', depth/length 174 log.critical('WARNING: d/b out of range (0.06 - 1.5) %s' 175 % str(depth/length)) 172 176 if ((thickness/length < 0.008) or (thickness/length > 0.2)): 173 177 if verbose is True: 174 print 'WARNING: T/b out of range (0.008 - 0.2) ', thickness/length 178 log.critical('WARNING: T/b out of range (0.008 - 0.2) %s' 179 % str(thickness/length)) 175 180 if ((gamma < 1.46) or (gamma > 2.93)): 176 181 if verbose is True: 177 print 'WARNING: gamma out of range (1.46 - 2.93) ', gamma 182 log.critical('WARNING: gamma out of range (1.46 - 2.93) %s' 183 % str(gamma)) 178 184 179 185 return Double_gaussian(a3D, w, width, x0, y0, alpha, kappa, kappad, zsmall, dx, scale) … … 286 292 #a few temporary print statements 287 293 if verbose is True: 288 print '\nThe slump ...'289 print '\tLength: ', length290 print '\tDepth: ', depth291 print '\tSlope: ', slope292 print '\tWidth: ', width293 print '\tThickness: ', thickness294 print '\tRadius: ', radius295 print '\tDphi: ', dphi296 print '\tx0: ', x0297 print '\ty0: ', y0298 print '\tAlpha: ', alpha299 print '\tAcceleration: ', a0300 print '\tMaximum velocity: ', um301 print '\tChar time: ', t0302 print '\tChar distance: ', s0303 print '\nThe tsunami ...'304 print '\tWavelength: ', w305 print '\t2D amplitude: ', a2D306 print '\t3D amplitude: ', a3D307 print '\tDelta x ', dx308 print '\tsmall ', zsmall309 print '\tKappa d ', kappad310 print '\tscale for eta(x,y):', scale294 log.critical('\nThe slump ...') 295 log.critical('\tLength: %s' % str(length)) 296 log.critical('\tDepth: %s' % str(depth)) 297 log.critical('\tSlope: %s' % str(slope)) 298 log.critical('\tWidth: %s' % str(width)) 299 log.critical('\tThickness: %s' % str(thickness)) 300 log.critical('\tRadius: %s' % str(radius)) 301 log.critical('\tDphi: %s' % str(dphi)) 302 log.critical('\tx0: %s' % str(x0)) 303 log.critical('\ty0: %s' % str(y0)) 304 log.critical('\tAlpha: %s' % str(alpha)) 305 log.critical('\tAcceleration: %s' % str(a0)) 306 log.critical('\tMaximum velocity: %s' % str(um)) 307 log.critical('\tChar time: %s' % str(t0)) 308 log.critical('\tChar distance: %s' % str(s0)) 309 log.critical('\nThe tsunami ...') 310 log.critical('\tWavelength: %s' % str(w)) 311 log.critical('\t2D amplitude: %s' % str(a2D)) 312 log.critical('\t3D amplitude: %s' % str(a3D)) 313 log.critical('\tDelta x %s' % str(dx)) 314 log.critical('\tsmall %s' % str(zsmall)) 315 log.critical('\tKappa d %s' % str(kappad)) 316 log.critical('\tscale for eta(x,y): %s' % str(scale)) 311 317 312 318 #keep an eye on some of the assumptions built into the maths … … 314 320 if ((slope < 10) or (slope > 30)): 315 321 if verbose is True: 316 print 'WARNING: slope out of range (10 - 30 degrees) ', slope 322 log.critical('WARNING: slope out of range (10 - 30 degrees) %s' 323 % str(slope)) 317 324 if ((depth/length < 0.34) or (depth/length > 0.5)): 318 325 if verbose is True: 319 print 'WARNING: d/b out of range (0.34 - 0.5) ', depth/length 326 log.critical('WARNING: d/b out of range (0.34 - 0.5) %s' 327 % str(depth/length)) 320 328 if ((thickness/length < 0.10) or (thickness/length > 0.15)): 321 329 if verbose is True: 322 print 'WARNING: T/b out of range (0.10 - 0.15) ', thickness/length 330 log.critical('WARNING: T/b out of range (0.10 - 0.15) %s' 331 % str(thickness/length)) 323 332 if ((radius/length < 1.0) or (radius/length > 2.0)): 324 333 if verbose is True: 325 print 'WARNING: R/b out of range (1 - 2) ', radius/length 334 log.critical('WARNING: R/b out of range (1 - 2) %s' 335 % str(radius/length)) 326 336 if ((dphi < 0.10) or (dphi > 0.52)): 327 337 if verbose is True: 328 print 'WARNING: del_phi out of range (0.10 - 0.52) ', dphi 338 log.critical('WARNING: del_phi out of range (0.10 - 0.52) %s' 339 % str(dphi)) 329 340 if ((gamma < 1.46) or (gamma > 2.93)): 330 341 if verbose is True: 331 print 'WARNING: gamma out of range (1.46 - 2.93) ', gamma 342 log.critical('WARNING: gamma out of range (1.46 - 2.93) %s' 343 % str(gamma)) 332 344 333 345 return Double_gaussian(a3D, w, width, x0, y0, alpha, kappa, kappad, zsmall, dx, scale)
Note: See TracChangeset
for help on using the changeset viewer.