Changeset 5221
- Timestamp:
- Apr 21, 2008, 5:11:58 PM (17 years ago)
- Location:
- anuga_core/source/anuga/abstract_2d_finite_volumes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/general_mesh.py
r4839 r5221 88 88 """ 89 89 90 if verbose: print 'General_mesh: Building basic mesh structure '90 if verbose: print 'General_mesh: Building basic mesh structure in ANUGA domain' 91 91 92 92 self.triangles = array(triangles, Int) -
anuga_core/source/anuga/abstract_2d_finite_volumes/generic_boundary_conditions.py
r5178 r5221 245 245 246 246 if verbose: print 'Initialise file_function' 247 self.F = file_function(filename, domain, 247 self.F = file_function(filename, 248 domain, 249 quantities=domain.conserved_quantities, 248 250 interpolation_points=self.midpoint_coordinates, 249 251 time_thinning=time_thinning, -
anuga_core/source/anuga/abstract_2d_finite_volumes/test_generic_boundary_conditions.py
r4171 r5221 253 253 254 254 try: 255 F = File_boundary(filename + '.tms', domain) 255 F = File_boundary(filename + '.tms', 256 domain) 256 257 except: 257 258 pass -
anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py
r5182 r5221 951 951 domain = Domain(points, vertices) 952 952 953 #Check that domain.starttime is updated if non-existing 954 F = file_function(filename + '.tms', domain) 955 953 # Check that domain.starttime is updated if non-existing 954 F = file_function(filename + '.tms', 955 domain, 956 quantities = ['Attribute0', 'Attribute1', 'Attribute2']) 956 957 assert allclose(domain.starttime, start) 957 958 958 # Check that domain.starttime is updated if too early959 # Check that domain.starttime is updated if too early 959 960 domain.starttime = start - 1 960 F = file_function(filename + '.tms', domain) 961 F = file_function(filename + '.tms', 962 domain, 963 quantities = ['Attribute0', 'Attribute1', 'Attribute2']) 961 964 assert allclose(domain.starttime, start) 962 965 963 # Check that domain.starttime isn't updated if later966 # Check that domain.starttime isn't updated if later 964 967 domain.starttime = start + 1 965 F = file_function(filename + '.tms', domain) 968 F = file_function(filename + '.tms', 969 domain, 970 quantities = ['Attribute0', 'Attribute1', 'Attribute2']) 966 971 assert allclose(domain.starttime, start+1) 967 972 968 973 domain.starttime = start 969 F = file_function(filename + '.tms', domain, 974 F = file_function(filename + '.tms', 975 domain, 970 976 quantities = ['Attribute0', 'Attribute1', 'Attribute2'], 971 977 use_cache=True) -
anuga_core/source/anuga/abstract_2d_finite_volumes/util.py
r5182 r5221 62 62 list of quantity names. The resulting function will return 63 63 a tuple of values - one for each quantity 64 If quantities are None, domain's conserved quantities 65 are used. 64 If quantities are None, the default quantities are 65 ['stage', 'xmomentum', 'ymomentum'] 66 66 67 67 68 interpolation_points - list of absolute UTM coordinates for points (N x 2) … … 72 73 73 74 74 See Interpolation function for further documentation75 See Interpolation function in anuga.fit_interpolate.interpolation for further documentation 75 76 """ 76 77 … … 85 86 # - interpolation points as absolute UTM coordinates 86 87 87 88 89 90 # Use domain's conserved_quantity names as defaults 88 if quantities is None: 89 if verbose: 90 msg = 'Quantities specified in file_function are None,' 91 msg += ' so I will use stage, xmomentum, and ymomentum in that order.' 92 print msg 93 94 quantities = ['stage', 'xmomentum', 'ymomentum'] 95 96 97 # Use domain's startime if available 91 98 if domain is not None: 92 if quantities is None:93 quantities = domain.conserved_quantities94 95 99 domain_starttime = domain.get_starttime() 96 100 else: … … 234 238 if type(quantity_names) == types.StringType: 235 239 quantity_names = [quantity_names] 236 240 237 241 if quantity_names is None or len(quantity_names) < 1: 238 # If no quantities are specified get quantities from file 239 # x, y, time are assumed as the independent variables so 240 # they are excluded as potentiol quantities 241 quantity_names = [] 242 for name in fid.variables.keys(): 243 if name not in ['x', 'y', 'time']: 244 quantity_names.append(name) 245 246 if len(quantity_names) < 1: 247 msg = 'ERROR: At least one independent value must be specified' 248 raise msg 242 msg = 'No quantities are specified in file_function' 243 raise Exception, msg 249 244 250 245
Note: See TracChangeset
for help on using the changeset viewer.