Changeset 9085
- Timestamp:
- Apr 11, 2014, 10:06:44 AM (11 years ago)
- Location:
- trunk/anuga_core
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/compile_all.py
r8871 r9085 6 6 buildroot = os.getcwd() 7 7 8 9 #-------------------------------------------------- 10 # Compiling anuga code 11 #-------------------------------------------------- 8 12 os.chdir('source') 9 13 os.chdir('anuga') … … 20 24 21 25 22 os.chdir(buildroot) 26 os.chdir(buildroot) 27 28 #-------------------------------------------------- 29 # Compiling anuga_1d code 30 #-------------------------------------------------- 31 os.chdir('source') 32 os.chdir('anuga_1d') 33 34 35 print 'Changing to', os.getcwd() 36 37 #entries = listdir('.') 38 39 t0 = time.time() 40 41 # Attempt to compile all ANUGA_1D extensions 42 execfile('compile_all.py') 43 44 45 os.chdir(buildroot) 46 47 #-------------------------------------------------- 48 # Compiling anuga_parallel code 49 #-------------------------------------------------- 23 50 24 51 try: -
trunk/anuga_core/source/anuga/utilities/compile.py
r8923 r9085 490 490 msg = 'Could not compile C extension %s\n' %filename 491 491 msg += str(e) 492 raise Exception(msg)492 f. raise Exception(msg) 493 493 else: 494 494 print 'C extension %s OK' %filename -
trunk/anuga_core/source/anuga_1d/base/generic_domain.py
r9076 r9085 1376 1376 Q = self.quantities[name] 1377 1377 Q.explicit_update[:] = 0.0 1378 1379 #for name in self.conserved_quantities: 1380 # Q = self.quantities[name] 1381 # Q.semi_implicit_update[:] = 0.0 1378 1382 1379 1383 for f in self.forcing_terms: -
trunk/anuga_core/source/anuga_1d/sqpipe/culvert.py
r9081 r9085 36 36 def top(x): 37 37 38 t = numpy.ones_like(x) 38 t = numpy.ones_like(x)*4 39 39 40 40 t = numpy.where(x<-40, 20, t) … … 45 45 return height(x)*width(x) 46 46 47 def friction(x): 48 return numpy.ones_like(x)*0.01 49 47 50 48 51 #=============================================================================== 49 52 50 53 def get_domain(): 51 N = 10054 N = 20 52 55 print "Evaluating domain with %d cells" %N 53 56 … … 57 60 58 61 domain.set_spatial_order(2) 59 domain.set_timestepping_method(' euler')62 domain.set_timestepping_method('rk2') 60 63 domain.set_CFL(0.5) 61 64 domain.set_limiter("vanleer") … … 68 71 domain.set_quantity('width',width) 69 72 domain.set_quantity('top',top) 73 domain.set_quantity('friction',friction) 70 74 71 75 Br = dom.Reflective_boundary(domain) 72 76 Bt = dom.Transmissive_boundary(domain) 73 77 74 domain.set_boundary({'left': Br, 'right' : B t})78 domain.set_boundary({'left': Br, 'right' : Br}) 75 79 76 80 return domain -
trunk/anuga_core/source/anuga_1d/sqpipe/run_culvert.py
r9081 r9085 8 8 9 9 finaltime = 100.0 10 yieldstep = 0. 00110 yieldstep = 0.1 11 11 12 12 model.animate_domain(domain, yieldstep, finaltime) -
trunk/anuga_core/source/anuga_1d/sqpipe/sqpipe_domain.py
r9076 r9085 81 81 self.epsilon = epsilon 82 82 83 #setup manning's friction 84 f = manning_friction 85 self.forcing_terms.append(f) 86 83 87 #forcing terms 84 88 for f in forcing_terms: … … 171 175 172 176 self.state = new_state 173 self.state = numpy.where(h>=t, 1, 0)177 #self.state = numpy.where(h>=t, 1, 0) 174 178 175 179 def distribute_to_vertices_and_edges(self): -
trunk/anuga_core/source/anuga_1d/sqpipe/sqpipe_forcing_terms.py
r9076 r9085 101 101 """ 102 102 103 from math import sqrt 104 105 w = domain.quantities['stage'].centroid_values 106 z = domain.quantities['elevation'].centroid_values 107 h = w-z 108 109 uh = domain.quantities['xmomentum'].centroid_values 110 #vh = domain.quantities['ymomentum'].centroid_values 103 from math import sqrt, fabs 104 111 105 eta = domain.quantities['friction'].centroid_values 112 106 113 xmom_update = domain.quantities['xmomentum'].semi_implicit_update 107 hw = domain.quantities['area'].centroid_values 108 w = domain.quantities['width'].centroid_values 109 uhw = domain.quantities['discharge'].centroid_values 110 111 h = hw/w 112 113 uhw_update = domain.quantities['discharge'].semi_implicit_update 114 114 #ymom_update = domain.quantities['ymomentum'].semi_implicit_update 115 115 116 116 N = domain.number_of_elements 117 eps = domain.minimum_allowed_height 118 g = domain.g 119 117 eps = 1.0e-10 118 g = domain.g 119 120 #print 'mannings' 120 121 for k in range(N): 121 122 if eta[k] >= eps: 122 123 if h[k] >= eps: 123 124 #S = -g * eta[k]**2 * sqrt((uh[k]**2 + vh[k]**2)) 124 S = -g * eta[k]**2 * uh[k]125 S = -g * eta[k]**2 * fabs(uhw[k]) 125 126 S /= h[k]**(7.0/3) 127 S /= w[k] 126 128 127 129 #Update momentum 128 xmom_update[k] += S*uh[k]130 uhw_update[k] += S*uhw[k] 129 131 #ymom_update[k] += S*vh[k] 130 132 -
trunk/anuga_core/test_all.py
r8949 r9085 10 10 print 11 11 print '======================= anuga tests =================================' 12 print 'Changing to', os.getcwd() # This is now different from buildroot 13 execfile('test_all.py') 14 15 16 os.chdir(buildroot) 17 os.chdir('source') 18 os.chdir('anuga_1d') 19 print 20 print '======================= anuga_1d tests =================================' 12 21 print 'Changing to', os.getcwd() # This is now different from buildroot 13 22 execfile('test_all.py')
Note: See TracChangeset
for help on using the changeset viewer.