Changeset 517
- Timestamp:
- Nov 10, 2004, 1:43:43 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/quantity.py
r514 r517 117 117 elif type(X) in [types.FloatType, types.IntType, types.LongType]: 118 118 if location == 'centroids': 119 self.centroid_values[:] = X 119 if (indexes == None): 120 self.centroid_values[:] = X 121 else: 122 #Brute force 123 for i in range(len(indexes)): 124 self.centroid_values[i,:] = X 125 120 126 elif location == 'edges': 121 self.edge_values[:] = X 127 if (indexes == None): 128 self.edge_values[:] = X 129 else: 130 #Brute force 131 for i in range(len(indexes)): 132 self.edge_values[i,:] = X 122 133 else: 123 self.vertex_values[:] = X 134 if (indexes == None): 135 self.vertex_values[:] = X 136 else: 137 #Brute force 138 for i in range(len(indexes)): 139 self.vertex_values[i,:] = X 124 140 125 141 else: … … 225 241 else: 226 242 for element_index, value in map(None, indexes, values): 227 self.vertex_values[element_index, 0] = value 228 self.vertex_values[element_index, 1] = value 229 self.vertex_values[element_index, 2] = value 243 self.vertex_values[element_index, :] = value 244 230 245 elif len(values.shape) == 2: 231 246 #Vertex values are given as a triplet for each triangle -
inundation/ga/storm_surge/pyvolution/test_quantity.py
r476 r517 649 649 650 650 def test_setting_some_vertex_values(self): 651 651 """ 652 set values based on triangle lists. 653 """ 652 654 from mesh_factory import rectangular 653 655 from shallow_water import Domain
Note: See TracChangeset
for help on using the changeset viewer.