Changeset 8167
- Timestamp:
- Mar 25, 2011, 5:55:00 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/generic_domain.py
r8164 r8167 1344 1344 self.update_boundary() 1345 1345 1346 # Update any other quantities that might be useful 1347 self.update_other_quantities() 1348 1346 1349 # Update extrema if necessary (for reporting) 1347 1350 self.update_extrema() … … 1658 1661 1659 1662 def apply_fractional_steps(self): 1663 1660 1664 for operator in self.fractional_step_operators: 1661 1665 operator() … … 1784 1788 num.put(Q_cv, Idg, num.take(Q_cv, Idf, axis=0)) 1785 1789 1786 1790 def update_other_quantities(self): 1791 """ There may be a need to calculates some of the other quantities 1792 based on the new values of conserved quantities 1793 """ 1794 1795 pass 1796 1787 1797 def distribute_to_vertices_and_edges(self): 1788 1798 """Extrapolate conserved quantities from centroid to … … 1802 1812 else: 1803 1813 raise Exception('Unknown order: %s' % str(self._order_)) 1814 1804 1815 1805 1816 def centroid_norm(self, quantity, normfunc): -
trunk/anuga_core/source/anuga/operators/run_dam_break.py
r8166 r8167 15 15 from math import cos 16 16 from numpy import zeros, float, where 17 import numpy 17 18 from time import localtime, strftime, gmtime 18 19 … … 39 40 L = 100000. 40 41 W = 10*dx 42 #W = dx 41 43 42 44 # structured mesh … … 46 48 47 49 domain.set_name(output_file) 48 #domain.set_datadir(output_dir)49 50 50 51 #------------------------------------------------------------------------------ … … 53 54 domain.set_timestepping_method('rk2') 54 55 domain.set_default_order(2) 56 domain.set_beta(1.7) 55 57 56 58 #------------------------------------------------------------------------------ … … 59 61 domain.set_use_kinematic_viscosity(True) 60 62 61 domain.set_beta(1.7)62 63 #------------------------------------------------------------------------------ 63 64 # Setup initial conditions … … 87 88 88 89 # Associate boundary tags with boundary objects 89 domain.set_boundary({'left': Br, 'right': B t, 'top': Br, 'bottom': Br})90 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 90 91 91 92 … … 94 95 vis = RealtimeVisualiser(domain) 95 96 vis.render_quantity_height("stage", zScale = 50000/(h0-h1), dynamic=True) 96 vis.colour_height_quantity('stage', (0.0, 0.5, 1.0)) 97 vis.colour_height_quantity("stage", 98 # (lambda q: numpy.sqrt( (q["xvelocity"]**2 ) + (q['yvelocity']**2 )), 0.0, 10.0) ) 99 (lambda q: q["yvelocity"], -10.0, 10.0) ) 97 100 vis.start() 98 101 #=============================================================================== … … 112 115 # else: 113 116 # domain.set_use_kinematic_viscosity(True) 114 117 118 #print domain.quantities['height'].vertex_values 119 120 #domain.quantities['height'].vertex_values 121 122 #print domain.quantities['height'].vertex_values 123 124 #print len(domain) 125 126 #vertex_values, _ = domain.get_quantity('height').get_vertex_values(xy=False, smooth=False) 127 128 #print vertex_values 129 115 130 vis.update() 116 131 -
trunk/anuga_core/source/anuga/shallow_water/shallow_water_domain.py
r8165 r8167 582 582 protect_against_infinitesimal_and_negative_heights(self) 583 583 584 585 def update_other_quantities(self): 586 """ There may be a need to calculates some of the other quantities 587 based on the new values of conserved quantities 588 """ 589 590 # The centroid values of height and x and y velocity 591 # might not have been setup 592 593 self.update_centroids_of_velocities_and_height() 594 595 for name in ['height', 'xvelocity', 'yvelocity']: 596 Q = self.quantities[name] 597 if self._order_ == 1: 598 Q.extrapolate_first_order() 599 elif self._order_ == 2: 600 Q.extrapolate_second_order_and_limit_by_edge() 601 else: 602 raise Exception('Unknown order') 603 604 584 605 585 606 def update_centroids_of_velocities_and_height(self): -
trunk/anuga_core/source/anuga/visualiser/realtime.py
r7452 r8167 61 61 vertex_values, _ = self.source.get_quantity(quantityName).get_vertex_values(xy=False, smooth=False) 62 62 63 63 64 for n in range(N_vert): 64 65 qty_index[n] = vertex_values[n] … … 94 95 quantities = {} 95 96 for q in self.source.get_quantity_names(): 96 quantities[q], _ = self.source.get_quantity(q).get_vertex_values(xy=False) 97 #quantities[q], _ = self.source.get_quantity(q).get_vertex_values(xy=False) 98 quantities[q] = self.source.get_quantity(q).vertex_values.flatten() 97 99 return quantities 98 100 -
trunk/anuga_core/source/anuga/visualiser/visualiser.py
r6113 r8167 174 174 # range. 175 175 scalars = vtkFloatArray() 176 176 177 map(scalars.InsertNextValue, colour[0](self.build_quantity_dict())) 177 178 self.vtk_polyData[quantityName].GetPointData().SetScalars(scalars) 178 mapper.SetScalarRange(colour[1:])179 #mapper.SetScalarRange(colour[1:]) 179 180 mapper.Update() 180 181 else:
Note: See TracChangeset
for help on using the changeset viewer.