Changeset 9656
- Timestamp:
- Feb 10, 2015, 6:31:05 PM (9 years ago)
- Location:
- trunk/anuga_core/anuga/parallel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/anuga/parallel/parallel_inlet.py
r9655 r9656 195 195 return 0.0 196 196 197 def get_global_average_elevation(self): 198 # GLOBAL: Master processor gathers elevations from all child processors, and returns average 199 200 # WARNING: requires synchronization, must be called by all procs associated 201 # with this inlet 202 203 import pypar 204 local_elevation = num.sum(self.get_elevations()*self.get_areas()) 205 global_area = self.get_global_area() 206 207 208 209 global_elevation = local_elevation 210 211 if self.myid == self.master_proc: 212 for i in self.procs: 213 if i == self.master_proc: continue 214 215 val = pypar.receive(i) 216 global_elevation = global_elevation + val 217 else: 218 pypar.send(local_elevation, self.master_proc) 219 220 221 if global_area > 0.0: 222 return global_elevation/global_area 223 else: 224 return 0.0 197 225 198 226 def get_xmoms(self): -
trunk/anuga_core/anuga/parallel/parallel_operator_factory.py
r9632 r9656 857 857 inlet_enq_proc = -1 858 858 859 860 861 859 # Calculate the number of points of the line inside full polygon 862 860 -
trunk/anuga_core/anuga/parallel/parallel_structure_operator.py
r9653 r9656 107 107 height = width 108 108 109 110 111 109 if apron is None: 112 110 apron = width … … 194 192 enquiry_proc = self.enquiry_proc[0], 195 193 verbose = self.verbose)) 194 195 # Try to enforce a constant inlet elevation 196 inlet_global_elevation = self.inlets[-1].get_global_average_elevation() 197 self.inlets[-1].set_elevations(inlet_global_elevation) 198 196 199 else: 197 200 self.inlets.append(None)
Note: See TracChangeset
for help on using the changeset viewer.