# Changeset 7498

Ignore:
Timestamp:
Sep 8, 2009, 12:49:14 PM (14 years ago)
Message:

Refactored file boundary to make use of new midpoint data structure.

Location:
anuga_core/source/anuga/abstract_2d_finite_volumes
Files:
3 edited

Unmodified
Added
Removed
• ## anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py

 r7492 def get_vertex_coordinates(self, *args, **kwargs): return self.mesh.get_vertex_coordinates(*args, **kwargs) def get_vertex_coordinate(self, *args, **kwargs): return self.mesh.get_vertex_coordinate(*args, **kwargs) def get_edge_midpoint_coordinates(self, *args, **kwargs): return self.mesh.get_edge_midpoint_coordinates(*args, **kwargs) def get_edge_midpoint_coordinate(self, *args, **kwargs): return self.mesh.get_edge_midpoint_coordinate(*args, **kwargs) def get_triangles(self, *args, **kwargs):
• ## anuga_core/source/anuga/abstract_2d_finite_volumes/general_mesh.py

 r7484 offset=num.array([self.geo_reference.get_xllcorner(), self.geo_reference.get_yllcorner()], num.float) return num.array([V[i3,:]+offset, V[i3+1,:]+offset, V[i3+2,:]+offset], num.float) return V[i3:i3+3,:] + offset else: return num.array([V[i3,:], V[i3+1,:], V[i3+2,:]], num.float) return V[i3:i3+3,:] def get_vertex_coordinate(self, i, j, absolute=False): offset=num.array([self.geo_reference.get_xllcorner(), self.geo_reference.get_yllcorner()], num.float) return num.array([E[i3,:]+offset, E[i3+1,:]+offset, E[i3+2,:]+offset], num.float) return E[i3:i3+3,:] + offset else: return num.array([E[i3,:], E[i3+1,:], E[i3+2,:]], num.float) return E[i3:i3+3,:] E = self.get_edge_midpoint_coordinates(triangle_id=i, absolute=absolute) return E[j,:] return E[j,:] # Return (x, y) for edge mid point
• ## anuga_core/source/anuga/abstract_2d_finite_volumes/generic_boundary_conditions.py

 r7317 boundary_keys.sort() # Record ordering #FIXME: should this also happen in domain.py? # Record ordering #FIXME: should this also happen in domain.py or general_mesh.py? self.boundary_indices = {} for i, (vol_id, edge_id) in enumerate(boundary_keys): base_index = 3*vol_id x0, y0 = V[base_index, :] x1, y1 = V[base_index+1, :] x2, y2 = V[base_index+2, :] # Compute midpoints if edge_id == 0: m = num.array([(x1 + x2)/2, (y1 + y2)/2], num.float) if edge_id == 1: m = num.array([(x0 + x2)/2, (y0 + y2)/2], num.float) if edge_id == 2: m = num.array([(x1 + x0)/2, (y1 + y0)/2], num.float) # Convert to absolute UTM coordinates m[0] += xllcorner m[1] += yllcorner # Register point and index self.midpoint_coordinates[i,:] = m self.midpoint_coordinates[i,:] = domain.get_edge_midpoint_coordinate(vol_id, edge_id, absolute=True) # Register index of this boundary edge for use with evaluate self.boundary_indices[(vol_id, edge_id)] = i if verbose: log.critical('Initialise file_function') self.F = file_function(filename,
Note: See TracChangeset for help on using the changeset viewer.