Changeset 7922
- Timestamp:
- Aug 5, 2010, 8:20:47 PM (14 years ago)
- Location:
- trunk/anuga_work/development/sudi/sw_1d
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/sudi/sw_1d/avalanche/A_velocity/shallow_water_domain_avalanche.py
r7914 r7922 668 668 import sys 669 669 from Numeric import Float 670 from numpy import zeros670 from numpy import array, zeros 671 671 from config import epsilon, h0 672 672 … … 719 719 720 720 for i in range(N): 721 if h_V[i]<= 0.0:722 h_V[i] = 0.0721 if min(h_V[i]) <= 0.0: 722 h_V[i] = array([0.0, 0.0]) 723 723 stage_V[i] = bed_V[i] 724 xmom_V[i] = 0.0724 xmom_V[i] = array([0.0, 0.0]) 725 725 726 726 u_V[:] = xmom_V/(h_V + h0/h_V) -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/cg/analytical_prescription.py
r7837 r7922 45 45 46 46 def prescribe(x,t): 47 from Numeric import array, zeros, Float 47 from Numeric import Float 48 from numpy import array, zeros 48 49 q_shore = shore(t) 49 50 q = zeros(2,Float) -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/cg/domain.py
r7837 r7922 24 24 """ 25 25 26 from Numeric import array, zeros,Float, Int27 26 from Numeric import Float, Int 27 from numpy import array, zeros 28 28 from config import timestepping_method 29 29 from config import CFL … … 175 175 self.vertexlist is built 176 176 """ 177 from Numericimport array177 from numpy import array 178 178 179 179 vertexlist = [None]*len(self.coordinates) … … 322 322 self.element_tag is defined 323 323 """ 324 from Numeric import array, Int 324 from Numeric import Int 325 from numpy import array 325 326 326 327 if tagged_elements is None: … … 393 394 394 395 if obj is True: 395 from Numericimport concatenate, reshape396 from numpy import concatenate, reshape 396 397 V = self.vertices 397 398 N = V.shape[0] … … 412 413 """ 413 414 414 from Numeric import zeros, Float 415 from Numeric import Float 416 from numpy import zeros 415 417 q = zeros( len(self.conserved_quantities), Float) 416 418 for i, name in enumerate(self.conserved_quantities): … … 436 438 """ 437 439 438 from Numeric import zeros, Float 440 from Numeric import Float 441 from numpy import zeros 439 442 q = zeros( len(self.evolved_quantities), Float) 440 443 … … 1078 1081 """ 1079 1082 import copy 1080 from Numeric import zeros,Float 1083 from Numeric import Float 1084 from numpy import zeros 1081 1085 1082 1086 N = self.number_of_elements … … 1136 1140 """ 1137 1141 import copy 1138 from Numeric import zeros,Float 1142 from Numeric import Float 1143 from numpy import zeros 1139 1144 1140 1145 N = self.number_of_elements … … 1354 1359 """ 1355 1360 1356 from Numeric import ones, sum, equal, Float 1361 from Numeric import Float 1362 from numpy import ones, sum, equal 1357 1363 1358 1364 N = self.number_of_elements -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/cg/domain_cg.py
r7837 r7922 218 218 """ 219 219 220 from Numeric import zeros, Float 220 from Numeric import Float 221 from numpy import zeros 221 222 222 223 assert len(q) == 3,\ … … 266 267 from config import g, epsilon, h0 267 268 from math import sqrt 268 from Numericimport array269 from numpy import array 269 270 270 271 #Align momentums with x-axis … … 336 337 def compute_timestep(domain): 337 338 import sys 338 from Numeric import zeros, Float 339 from Numeric import Float 340 from numpy import zeros 339 341 340 342 N = domain.number_of_elements … … 398 400 def compute_fluxes_C_wellbalanced(domain): 399 401 import sys 400 from Numeric import zeros, Float 402 from Numeric import Float 403 from numpy import zeros 401 404 402 405 N = domain.number_of_elements … … 506 509 507 510 import sys 508 from Numeric import zeros, Float 511 from Numeric import Float 512 from numpy import zeros 509 513 from config import epsilon, h0, h_min 510 514 … … 600 604 """ 601 605 602 from Numeric import zeros, Float 606 from Numeric import Float 607 from numpy import zeros 603 608 604 609 N = domain.number_of_elements … … 767 772 768 773 from util import gradient 769 from Numeric import zeros, Float, array, sum 774 from Numeric import Float 775 from numpy import zeros, array, sum 770 776 771 777 xmom = domain.quantities['xmomentum'].explicit_update … … 865 871 """ 866 872 867 from Numeric import ones, Float, array 873 from Numeric import Float 874 from numpy import ones, array 868 875 869 876 … … 947 954 948 955 from config import rho_a, rho_w, eta_w 949 from Numeric import array, Float 956 from Numeric import Float 957 from numpy import array 950 958 951 959 if len(args) == 2: … … 978 986 979 987 from math import pi, cos, sin, sqrt 980 from Numeric import Float, ones, ArrayType 988 from Numeric import Float 989 from numpy import ones, ArrayType 981 990 982 991 xmom_update = domain.quantities['xmomentum'].explicit_update -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/cg/generic_boundary_conditions.py
r7837 r7922 43 43 self.velocity = domain.quantities['velocity'].vertex_values 44 44 45 from Numeric import zeros, Float 45 from Numeric import Float 46 from numpy import zeros 46 47 self.evolved_quantities = zeros(5, Float) 47 48 … … 103 104 raise msg 104 105 105 from Numeric import array, Float 106 from Numeric import Float 107 from numpy import array 106 108 self.conserved_quantities=array(conserved_quantities).astype(Float) 107 109 … … 132 134 133 135 134 from Numeric import array, Float 136 from Numeric import Float 137 from numpy import array 135 138 try: 136 139 q = array(q).astype(Float) … … 173 176 def __init__(self, filename, domain): 174 177 import time 175 from Numericimport array178 from numpy import array 176 179 from config import time_format 177 180 from util import File_function … … 223 226 def __init__(self, filename, domain, verbose = False): 224 227 import time 225 from Numeric import array, zeros, Float 228 from Numeric import Float 229 from numpy import array, zeros 226 230 from config import time_format 227 231 from util import file_function … … 421 425 def __init__(self, domain = None, filename = None): 422 426 import time 423 from Numericimport array427 from numpy import array 424 428 from config import time_format 425 429 … … 479 483 480 484 def read_time_boundary(self): 481 from Numeric import zeros, Float, alltrue 485 from Numeric import Float 486 from numpy import zeros, alltrue 482 487 from config import time_format 483 488 import time -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/cg/parameter.py
r7837 r7922 2 2 from scipy import pi, sqrt, linspace, pi, sin, cos 3 3 from config import g 4 from Numeric import zeros, Float 4 from Numeric import Float 5 from numpy import zeros 5 6 from rootsearch import * 6 7 from bisect import * -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/cg/quantity.py
r7837 r7922 24 24 25 25 from domain import Domain 26 from Numeric import array, zeros, Float 26 from Numeric import Float 27 from numpy import array, zeros 27 28 28 29 msg = 'First argument in Quantity.__init__ ' … … 60 61 61 62 62 from Numeric import zeros, Float 63 from Numeric import Float 64 from numpy import zeros 63 65 64 66 #Allocate space for boundary values … … 194 196 """ 195 197 196 from Numeric import array, Float 198 from Numeric import Float 199 from numpy import zeros 197 200 198 201 values = array(values).astype(Float) … … 237 240 238 241 """ 239 from Numericimport take242 from numpy import take 240 243 241 244 if location not in ['vertices', 'centroids', 'unique vertices']: … … 310 313 """ 311 314 312 from Numeric import concatenate, zeros, Float, Int, array, reshape 315 from Numeric import Float, Int 316 from numpy import concatenate, zeros, array, reshape 313 317 314 318 … … 402 406 """ 403 407 404 from Numeric import sum, equal, ones, Float 408 from Numeric import Float 409 from numpy import sum, equal, ones 405 410 406 411 N = self.centroid_values.shape[0] … … 427 432 #print 'compute_gradient' 428 433 429 from Numeric import array, zeros, Float 434 from Numeric import Float 435 from numpy import array, zeros 430 436 431 437 N = self.centroid_values.shape[0] … … 518 524 #print 'compute_minmod_gradients' 519 525 520 from Numeric import array, zeros, Float,sign 526 from Numeric import Float,sign 527 from numpy import array, zeros 521 528 522 529 def xmin(a,b): … … 712 719 vertex values are updated 713 720 """ 714 from Numeric import zeros, Float 721 from Numeric import Float 722 from numpy import zeros 715 723 716 724 N = self.domain.number_of_elements … … 763 771 def limit_range(self): 764 772 import sys 765 from Numeric import zeros, Float 773 from Numeric import Float 774 from numpy import zeros 766 775 from util import minmod, minmod_kurganov, maxmod, vanleer, vanalbada 767 776 limiter = self.domain.limiter … … 822 831 823 832 import sys 824 from Numeric import zeros, Float 833 from Numeric import Float 834 from numpy import zeros 825 835 from util import minmod, minmod_kurganov, maxmod, vanleer 826 836 … … 950 960 #from domain import Domain 951 961 from domain_cg import Domain 952 from Numericimport arange962 from numpy import arange 953 963 954 964 points1 = [0.0, 1.0, 2.0, 3.0] -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/cg/run-discrepancy.py
r7837 r7922 4 4 from rootsearch import * 5 5 from bisect import * 6 from Numeric import zeros,Float,dot 6 from Numeric import Float 7 from numpy import zeros,dot 7 8 from gaussPivot import * 8 9 from config import g -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/cg/run-program.py
r7837 r7922 1 1 from scipy import sin, cos, sqrt, linspace, pi, dot 2 from Numeric import zeros, Float, array 2 from Numeric import Float 3 from numpy import zeros, array 3 4 from gaussPivot import * 4 5 from analytical_prescription import * … … 134 135 135 136 waktu = 10.0 #3.0*60.0 136 WAKTU = 1 2690.0 #20.0*Tp #Note: Tp=15.0*60.0137 WAKTU = 10.0#12690.0 #20.0*Tp #Note: Tp=15.0*60.0 137 138 yieldstep = finaltime = waktu 138 139 t0 = time.time() -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/cg/util.py
r7837 r7922 4 4 5 5 def mean(x): 6 from Numericimport sum6 from numpy import sum 7 7 return sum(x)/len(x) 8 8 … … 142 142 143 143 def analytic_cannal(C,t): 144 from Numeric import zeros, Float,sqrt,sin,cos 144 from Numeric import Float,sqrt,sin,cos 145 from numpy import zeros 145 146 146 147 -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/johns/analytical_prescription.py
r7837 r7922 27 27 28 28 def prescribe(x,t): 29 from Numeric import array, zeros, Float 29 from Numeric import Float 30 from numpy import array, zeros 30 31 if x<1.0: 31 32 q = zeros(2,Float) -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/johns/domain.py
r7837 r7922 24 24 """ 25 25 26 from Numeric import array, zeros, Float, Int 26 from Numeric import Float, Int 27 from numpy import array, zeros 27 28 28 29 from config import timestepping_method … … 175 176 self.vertexlist is built 176 177 """ 177 from Numericimport array178 from numpy import array 178 179 179 180 vertexlist = [None]*len(self.coordinates) … … 322 323 self.element_tag is defined 323 324 """ 324 from Numeric import array, Int 325 from Numeric import Int 326 from numpy import array 325 327 326 328 if tagged_elements is None: … … 393 395 394 396 if obj is True: 395 from Numericimport concatenate, reshape397 from numpy import concatenate, reshape 396 398 V = self.vertices 397 399 N = V.shape[0] … … 412 414 """ 413 415 414 from Numeric import zeros, Float 416 from Numeric import Float 417 from numpy import zeros 415 418 q = zeros( len(self.conserved_quantities), Float) 416 419 for i, name in enumerate(self.conserved_quantities): … … 436 439 """ 437 440 438 from Numeric import zeros, Float 441 from Numeric import Float 442 from numpy import zeros 439 443 q = zeros( len(self.evolved_quantities), Float) 440 444 … … 1078 1082 """ 1079 1083 import copy 1080 from Numeric import zeros,Float 1084 from Numeric import Float 1085 from numpy import zeros 1081 1086 1082 1087 N = self.number_of_elements … … 1136 1141 """ 1137 1142 import copy 1138 from Numeric import zeros,Float 1143 from Numeric import Float 1144 from numpy import zeros 1139 1145 1140 1146 N = self.number_of_elements … … 1335 1341 """ 1336 1342 1337 from Numeric import ones, sum, equal, Float 1343 from Numeric import Float 1344 from numpy import ones, sum, equal 1338 1345 1339 1346 N = self.number_of_elements -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/johns/domain_johns.py
r7837 r7922 218 218 """ 219 219 220 from Numeric import zeros, Float 220 from Numeric import Float 221 from numpy import zeros 221 222 222 223 assert len(q) == 3,\ … … 266 267 from config import g, epsilon, h0 267 268 from math import sqrt 268 from Numericimport array269 from numpy import array 269 270 270 271 #Align momentums with x-axis … … 336 337 def compute_timestep(domain): 337 338 import sys 338 from Numeric import zeros, Float 339 from Numeric import Float 340 from numpy import zeros 339 341 340 342 N = domain.number_of_elements … … 398 400 def compute_fluxes_C_wellbalanced(domain): 399 401 import sys 400 from Numeric import zeros, Float 402 from Numeric import Float 403 from numpy import zeros 401 404 402 405 N = domain.number_of_elements … … 506 509 507 510 import sys 508 from Numeric import zeros, Float 511 from Numeric import Float 512 from numpy import zeros 509 513 from config import epsilon, h0, h_min 510 514 … … 600 604 """ 601 605 602 from Numeric import zeros, Float 606 from Numeric import Float 607 from numpy import zeros 603 608 604 609 N = domain.number_of_elements … … 767 772 768 773 from util import gradient 769 from Numeric import zeros, Float, array, sum 774 from Numeric import Float 775 from numpy import zeros, array, sum 770 776 771 777 xmom = domain.quantities['xmomentum'].explicit_update … … 865 871 """ 866 872 867 from Numeric import ones, Float, array 873 from Numeric import Float 874 from numpy import ones, array 868 875 869 876 … … 947 954 948 955 from config import rho_a, rho_w, eta_w 949 from Numeric import array, Float 956 from Numeric import Float 957 from numpy import array 950 958 951 959 if len(args) == 2: … … 978 986 979 987 from math import pi, cos, sin, sqrt 980 from Numeric import Float, ones, ArrayType 988 from Numeric import Float, ArrayType 989 from numpy import ones 981 990 982 991 xmom_update = domain.quantities['xmomentum'].explicit_update -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/johns/generic_boundary_conditions.py
r7837 r7922 43 43 self.velocity = domain.quantities['velocity'].vertex_values 44 44 45 from Numeric import zeros, Float 45 from Numeric import Float 46 from numpy import zeros 46 47 self.evolved_quantities = zeros(5, Float) 47 48 … … 103 104 raise msg 104 105 105 from Numeric import array, Float 106 from Numeric import Float 107 from numpy import array 106 108 self.conserved_quantities=array(conserved_quantities).astype(Float) 107 109 … … 132 134 133 135 134 from Numeric import array, Float 136 from Numeric import Float 137 from numpy import array 135 138 try: 136 139 q = array(q).astype(Float) … … 173 176 def __init__(self, filename, domain): 174 177 import time 175 from Numericimport array178 from numpy import array 176 179 from config import time_format 177 180 from util import File_function … … 223 226 def __init__(self, filename, domain, verbose = False): 224 227 import time 225 from Numeric import array, zeros, Float 228 from Numeric import Float 229 from numpy import array, zeros 226 230 from config import time_format 227 231 from util import file_function … … 421 425 def __init__(self, domain = None, filename = None): 422 426 import time 423 from Numericimport array427 from numpy import array 424 428 from config import time_format 425 429 … … 479 483 480 484 def read_time_boundary(self): 481 from Numeric import zeros, Float, alltrue 485 from Numeric import Float 486 from numpy import zeros, alltrue 482 487 from config import time_format 483 488 import time -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/johns/parameter.py
r7837 r7922 2 2 from scipy import pi, sqrt, linspace, pi, sin, cos 3 3 from config import g 4 from Numeric import zeros, Float 4 from Numeric import Float 5 from numpy import zeros 5 6 from rootsearch import * 6 7 from bisect import * -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/johns/quantity.py
r7837 r7922 24 24 25 25 from domain import Domain 26 from Numeric import array, zeros, Float 26 from Numeric import Float 27 from numpy import array, zeros 27 28 28 29 msg = 'First argument in Quantity.__init__ ' … … 60 61 61 62 62 from Numeric import zeros, Float 63 from Numeric import Float 64 from numpy import zeros 63 65 64 66 #Allocate space for boundary values … … 194 196 """ 195 197 196 from Numeric import array, Float 198 from Numeric import Float 199 from numpy import array 197 200 198 201 values = array(values).astype(Float) … … 237 240 238 241 """ 239 from Numericimport take242 from numpy import take 240 243 241 244 if location not in ['vertices', 'centroids', 'unique vertices']: … … 310 313 """ 311 314 312 from Numeric import concatenate, zeros, Float, Int, array, reshape 315 from Numeric import Float, Int 316 from numpy import concatenate, zeros, array, reshape 313 317 314 318 … … 402 406 """ 403 407 404 from Numeric import sum, equal, ones, Float 408 from Numeric import Float 409 from numpy import sum, equal, ones 405 410 406 411 N = self.centroid_values.shape[0] … … 427 432 #print 'compute_gradient' 428 433 429 from Numeric import array, zeros, Float 434 from Numeric import Float 435 from numpy import array, zeros 430 436 431 437 N = self.centroid_values.shape[0] … … 518 524 #print 'compute_minmod_gradients' 519 525 520 from Numeric import array, zeros, Float,sign 526 from Numeric import Float,sign 527 from numpy import array, zeros 521 528 522 529 def xmin(a,b): … … 712 719 vertex values are updated 713 720 """ 714 from Numeric import zeros, Float 721 from Numeric import Float 722 from numpy import zeros 715 723 716 724 N = self.domain.number_of_elements … … 763 771 def limit_range(self): 764 772 import sys 765 from Numeric import zeros, Float 773 from Numeric import Float 774 from numpy import zeros 766 775 from util import minmod, minmod_kurganov, maxmod, vanleer, vanalbada 767 776 limiter = self.domain.limiter … … 822 831 823 832 import sys 824 from Numeric import zeros, Float 833 from Numeric import Float 834 from numpy import zeros 825 835 from util import minmod, minmod_kurganov, maxmod, vanleer 826 836 … … 947 957 #from domain import Domain 948 958 from domain_johns import Domain 949 from Numericimport arange959 from numpy import arange 950 960 951 961 points1 = [0.0, 1.0, 2.0, 3.0] -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/johns/run-discrepancy.py
r7837 r7922 4 4 from rootsearch import * 5 5 from bisect import * 6 from Numeric import zeros,Float,dot 6 from Numeric import Float 7 from numpy import zeros,dot 7 8 from gaussPivot import * 8 9 from config import g -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/johns/run-program.py
r7837 r7922 1 1 from scipy import sin, cos, sqrt, linspace, pi, dot 2 from Numeric import zeros, Float, array 2 from Numeric import Float 3 from numpy import zeros,array 3 4 from gaussPivot import * 4 5 from analytical_prescription import * … … 134 135 135 136 waktu = 10.0 #3.0*60.0 136 WAKTU = 1 2690.0 #Note: Tp=15.0*60.0137 WAKTU = 10.0#12690.0 #Note: Tp=15.0*60.0 137 138 yieldstep = finaltime = waktu 138 139 t0 = time.time() -
trunk/anuga_work/development/sudi/sw_1d/periodic_waves/johns/util.py
r7837 r7922 4 4 5 5 def mean(x): 6 from Numericimport sum6 from numpy import sum 7 7 return sum(x)/len(x) 8 8 … … 142 142 143 143 def analytic_cannal(C,t): 144 from Numeric import zeros, Float,sqrt,sin,cos 144 from Numeric import Float,sqrt,sin,cos 145 from numpy import zeros 145 146 146 147
Note: See TracChangeset
for help on using the changeset viewer.