- Timestamp:
- Feb 8, 2005, 7:07:56 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/generic_boundary_conditions.py
r850 r851 187 187 #any tagged boundary later on. 188 188 189 midpoint_coordinates = zeros( (len(domain.boundary), 2), Float)189 self.midpoint_coordinates = zeros( (len(domain.boundary), 2), Float) 190 190 boundary_keys = domain.boundary.keys() 191 192 #Record ordering #FIXME: should this happen in domain.py 193 self.boundary_indices = {} 194 191 195 for i, (vol_id, edge_id) in enumerate(boundary_keys): 192 196 … … 199 203 if edge_id == 1: m = array([(x0 + x2)/2, (y0 + y2)/2]) 200 204 if edge_id == 2: m = array([(x1 + x0)/2, (y1 + y0)/2]) 201 midpoint_coordinates[i,:] = m 202 203 self.midpoint_coordinates = midpoint_coordinates 205 self.midpoint_coordinates[i,:] = m 206 207 self.boundary_indices[(vol_id, edge_id)] = i 208 204 209 205 self.F = file_function(filename, domain, interpolation_points=midpoint_coordinates) 210 self.F = file_function(filename, domain, 211 interpolation_points=self.midpoint_coordinates) 206 212 self.domain = domain 207 213 208 214 #Test 209 q = self.F(0, 0,0)215 q = self.F(0, point_id=0) 210 216 211 217 d = len(domain.conserved_quantities) 212 msg = 'Values specified in file %s must be a list or an array of length %d' %(filename, d) 218 msg = 'Values specified in file %s must be ' %filename 219 msg += ' a list or an array of length %d' %d 213 220 assert len(q) == d, msg 214 221 … … 226 233 227 234 if vol_id is not None and edge_id is not None: 228 x, y = self.midpoint_coordinates[ vol_id, edge_id ]229 return self.F(t, x, y)235 i = self.boundary_indices[ vol_id, edge_id ] 236 return self.F(t, point_id = i) 230 237 else: 231 return self.F(t) 238 return self.F(t) #What should the semantics be? 232 239 233 240
Note: See TracChangeset
for help on using the changeset viewer.