Changeset 1834
- Timestamp:
- Sep 15, 2005, 5:06:08 PM (18 years ago)
- Location:
- inundation
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/shallow_water.py
r1704 r1834 1009 1009 1010 1010 1011 class Dirichlet_Discharge_boundary(Boundary): 1012 """Returns same momentum conserved quantities as 1013 those present in its neighbour volume. Sets stage 1014 1015 Underlying domain must be specified when boundary is instantiated 1016 """ 1017 1018 def __init__(self, domain = None, h0=None, wh0=None): 1019 Boundary.__init__(self) 1020 1021 if domain is None: 1022 msg = 'Domain must be specified for this type boundary' 1023 raise msg 1024 1025 if h0 is None: 1026 h0 = 0.0 1027 1028 if wh0 is None: 1029 wh0 = 0.0 1030 1031 self.domain = domain 1032 self.h0 = h0 1033 self.wh0 = wh0 1034 1035 def __repr__(self): 1036 return 'Dirichlet_Discharge_boundary(%s)' %self.domain 1037 1038 def evaluate(self, vol_id, edge_id): 1039 """Dirichlet_Discharge_boundary boundaries return the edge momentum 1040 values of the volume they serve. 1041 """ 1042 1043 normal = self.domain.get_normal(vol_id,edge_id) 1044 q = [self.h0, -self.wh0*normal[0], -self.wh0*normal[1]] 1045 return q 1046 1047 1048 #FIXME: Consider this (taken from File_boundary) to allow 1049 #spatial variation 1050 #if vol_id is not None and edge_id is not None: 1051 # i = self.boundary_indices[ vol_id, edge_id ] 1052 # return self.F(t, point_id = i) 1053 #else: 1054 # return self.F(t) 1011 1055 1012 1056
Note: See TracChangeset
for help on using the changeset viewer.