Changeset 4838
- Timestamp:
- Nov 21, 2007, 9:40:40 AM (17 years ago)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/documentation/user_manual/demos/cairns/runcairns.py
r4809 r4838 95 95 # Setup computational domain 96 96 #------------------------------------------------------------------------------ 97 98 domain = Domain(meshname, use_cache=True, verbose=True) 97 from anuga.abstract_2d_finite_volumes.pmesh2domain import pmesh_to_domain_instance 98 from anuga.caching import cache 99 100 ##domain = cache(Domain(meshname, use_cache=True, verbose=True) 101 102 domain = cache(pmesh_to_domain_instance, 103 (meshname, Domain), 104 dependencies = [meshname]) 99 105 100 106 print 'Number of triangles = ', len(domain) … … 112 118 113 119 120 121 domain.points_file_block_line_size = 50000 114 122 115 123 #------------------------------------------------------------------------------ -
anuga_core/source/anuga/fit_interpolate/fit.py
r4822 r4838 41 41 42 42 import exceptions 43 class To FewPointsError(exceptions.Exception): pass43 class TooFewPointsError(exceptions.Exception): pass 44 44 class VertsWithNoTrianglesError(exceptions.Exception): pass 45 45 … … 213 213 self.D[v0,v2] += e20 214 214 215 216 215 def get_D(self): 217 216 return self.D.todense() 217 218 218 219 219 … … 324 324 325 325 """ 326 326 327 # use blocking to load in the point info 327 328 if type(point_coordinates_or_filename) == types.StringType: … … 350 351 351 352 # Build the array 353 352 354 points = geo_block.get_data_points(absolute=True) 353 355 z = geo_block.get_attributes(attribute_name=attribute_name) 354 self.build_fit_subset(points, z )356 self.build_fit_subset(points, z, verbose=verbose) 355 357 356 358 … … 379 381 msg += 'Alternatively, set smoothing parameter alpha to a small ' 380 382 msg += 'positive value,\ne.g. 1.0e-3.' 381 raise To FewPointsError(msg)383 raise TooFewPointsError(msg) 382 384 383 385 self._build_coefficient_matrix_B(verbose) … … 545 547 # Caching happens at the higher level anyway. 546 548 549 547 550 if mesh is None: 548 551 # FIXME(DSG): Throw errors if triangles or vertex_coordinates -
anuga_core/source/anuga/fit_interpolate/test_fit.py
r4779 r4838 549 549 try: 550 550 f = interp.fit(data_points,z) 551 except To FewPointsError:551 except TooFewPointsError: 552 552 pass 553 553 -
anuga_validation/convergence_study/animatesww2d_alt.py
r4715 r4838 104 104 max_stage = max(max(max_stages)) 105 105 stage_axis = [0, max_x, min_stage-1, max_stage+1] 106 from pylab import plot, xlabel, ylabel, savefig, close, hold, axis, title 106 from pylab import plot, xlabel, ylabel, savefig, close, hold, axis, title,show 107 107 hold(False) 108 108 figs = [] … … 110 110 #max_vec = zeros(100, Float) 111 111 112 if sys.platform == 'win32': 112 #if sys.platform == 'win32': 113 try: 113 114 for i in range(0,n,20): 114 115 #max_vec[i] = max(stage[i,:]) … … 121 122 title(name) 122 123 figs.append(name) 124 show() 125 except: 126 pass 127 123 128 124 129 close('all') -
anuga_validation/convergence_study/convergence_structured.py
r4722 r4838 23 23 # Setup computational domain 24 24 #------------------------------------------------------------------------------ 25 dx = 200.25 dx = 100. 26 26 dy = dx 27 27 L = 100000. 28 W = 3000.28 W = dx 29 29 30 30 # structured mesh … … 35 35 #points, vertices, boundary = rectangular_cross(1000, 100, 20, 3) # Basic mesh 36 36 domain = Domain(points, vertices, boundary) 37 domain.set_timestepping_method('rk2') 38 domain.set_default_order(2) 37 38 39 39 ## # unstructured mesh 40 40 ## poly_domain = [[0,-W],[0,W],[L,W],[L,-W]] … … 50 50 ## # Create domain 51 51 ## domain = Domain(meshname, use_cache=True, verbose = True) 52 domain.set_name('myexample6') 52 53 domain.set_timestepping_method('euler') 54 domain.set_default_order(2) 55 domain.set_name('myexample9') 53 56 domain.set_datadir('.') # Use current directory for output 57 58 domain.beta_w = 100.0 59 domain.beta_w_dry = 0.2 60 domain.beta_uh = 100.0 61 domain.beta_uh_dry = 0.2 62 domain.beta_vh = 100.0 63 domain.beta_vh_dry = 0.2 64 domain.beta_h = 100.0 54 65 55 66 #------------------------------------------------------------------------------ … … 83 94 domain.set_boundary({'left': Bw, 'right': Bt, 'top': Br, 'bottom': Br}) 84 95 85 #from anuga.visualiser import RealtimeVisualiser 86 #vis = RealtimeVisualiser(domain) 87 #vis.render_quantity_height("elevation", dynamic=False) 88 #vis.render_quantity_height("stage", dynamic=True) 89 #vis.colour_height_quantity('stage', (0.0, 0.0, 0.8)) 90 #vis.start() 96 ## from anuga.visualiser import RealtimeVisualiser 97 ## vis = RealtimeVisualiser(domain) 98 ## vis.render_quantity_height("elevation", dynamic=False) 99 ## vis.render_quantity_height("stage", dynamic=True, zScale=100.0) 100 ## #vis.colour_height_quantity('stage', (0.0, 0.0, 0.8)) 101 ## vis.colour_height_quantity('stage', (lambda q:q['stage'], -1, 1)) 102 ## vis.start() 91 103 92 104 #------------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.