Changeset 7498
- Timestamp:
- Sep 8, 2009, 12:49:14 PM (14 years ago)
- Location:
- anuga_core/source/anuga/abstract_2d_finite_volumes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py
r7492 r7498 306 306 def get_vertex_coordinates(self, *args, **kwargs): 307 307 return self.mesh.get_vertex_coordinates(*args, **kwargs) 308 309 def get_vertex_coordinate(self, *args, **kwargs): 310 return self.mesh.get_vertex_coordinate(*args, **kwargs) 311 312 def get_edge_midpoint_coordinates(self, *args, **kwargs): 313 return self.mesh.get_edge_midpoint_coordinates(*args, **kwargs) 314 315 def get_edge_midpoint_coordinate(self, *args, **kwargs): 316 return self.mesh.get_edge_midpoint_coordinate(*args, **kwargs) 308 317 309 318 def get_triangles(self, *args, **kwargs): -
anuga_core/source/anuga/abstract_2d_finite_volumes/general_mesh.py
r7484 r7498 313 313 offset=num.array([self.geo_reference.get_xllcorner(), 314 314 self.geo_reference.get_yllcorner()], num.float) 315 return num.array([V[i3,:]+offset, 316 V[i3+1,:]+offset, 317 V[i3+2,:]+offset], num.float) 315 316 return V[i3:i3+3,:] + offset 318 317 else: 319 return num.array([V[i3,:], V[i3+1,:], V[i3+2,:]], num.float)318 return V[i3:i3+3,:] 320 319 321 320 def get_vertex_coordinate(self, i, j, absolute=False): … … 383 382 offset=num.array([self.geo_reference.get_xllcorner(), 384 383 self.geo_reference.get_yllcorner()], num.float) 385 return num.array([E[i3,:]+offset, 386 E[i3+1,:]+offset, 387 E[i3+2,:]+offset], num.float) 384 385 return E[i3:i3+3,:] + offset 388 386 else: 389 return num.array([E[i3,:], E[i3+1,:], E[i3+2,:]], num.float)387 return E[i3:i3+3,:] 390 388 391 389 … … 399 397 400 398 E = self.get_edge_midpoint_coordinates(triangle_id=i, absolute=absolute) 401 return E[j,:] 399 return E[j,:] # Return (x, y) for edge mid point 402 400 403 401 -
anuga_core/source/anuga/abstract_2d_finite_volumes/generic_boundary_conditions.py
r7317 r7498 252 252 boundary_keys.sort() 253 253 254 # Record ordering #FIXME: should this also happen in domain.py ?254 # Record ordering #FIXME: should this also happen in domain.py or general_mesh.py? 255 255 self.boundary_indices = {} 256 256 for i, (vol_id, edge_id) in enumerate(boundary_keys): 257 257 258 base_index = 3*vol_id 259 x0, y0 = V[base_index, :] 260 x1, y1 = V[base_index+1, :] 261 x2, y2 = V[base_index+2, :] 262 263 # Compute midpoints 264 if edge_id == 0: m = num.array([(x1 + x2)/2, (y1 + y2)/2], num.float) 265 if edge_id == 1: m = num.array([(x0 + x2)/2, (y0 + y2)/2], num.float) 266 if edge_id == 2: m = num.array([(x1 + x0)/2, (y1 + y0)/2], num.float) 267 268 # Convert to absolute UTM coordinates 269 m[0] += xllcorner 270 m[1] += yllcorner 271 272 # Register point and index 273 self.midpoint_coordinates[i,:] = m 258 self.midpoint_coordinates[i,:] = domain.get_edge_midpoint_coordinate(vol_id, edge_id, 259 absolute=True) 274 260 275 261 # Register index of this boundary edge for use with evaluate 276 262 self.boundary_indices[(vol_id, edge_id)] = i 277 263 264 265 278 266 if verbose: log.critical('Initialise file_function') 279 267 self.F = file_function(filename,
Note: See TracChangeset
for help on using the changeset viewer.