Changeset 9705
- Timestamp:
- Mar 4, 2015, 10:17:28 AM (10 years ago)
- Location:
- trunk/anuga_core/anuga
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/anuga/parallel/parallel_inlet_operator.py
r9282 r9705 36 36 Q = 0.0, 37 37 velocity = None, 38 default = None,38 default = 0.0, 39 39 description = None, 40 40 label = None, … … 169 169 Q = self.Q(t) 170 170 except Modeltime_too_early, e: 171 raise Modeltime_too_early(e)171 Q = self.get_default(t) 172 172 except Modeltime_too_late, e: 173 173 Q = self.get_default(t) … … 238 238 #log_to_file(self.log_filename, self.culvert_type) 239 239 240 def log_timestepping_statistics(self):241 242 if self.logging and self.myid == self.master_proc:243 log_to_file(self.log_filename, self.timestepping_statistics())244 240 245 241 def timestepping_statistics(self): -
trunk/anuga_core/anuga/structures/inlet_operator.py
r9693 r9705 21 21 Q = 0.0, 22 22 velocity = None, 23 default = None,23 default = 0.0, 24 24 description = None, 25 25 label = None, … … 109 109 Q = self.Q(t) 110 110 except Modeltime_too_early, e: 111 raise Modeltime_too_early(e)111 Q = self.get_default(t,err_msg=e) 112 112 except Modeltime_too_late, e: 113 113 Q = self.get_default(t,err_msg=e) … … 187 187 """ 188 188 189 from anuga.fit_interpolate.interpolate import Modeltime_too_early, Modeltime_too_late 190 191 192 if self.default is None: 193 msg = '%s: ANUGA is trying to run longer than specified data.\n' %str(err_msg) 194 msg += 'You can specify keyword argument default in the ' 195 msg += 'operator to tell it what to do in the absence of time data.' 196 raise Modeltime_too_late(msg) 197 else: 198 # Pass control to default rate function 199 value = self.default(t) 200 201 if self.default_invoked is False: 202 # Issue warning the first time 203 msg = ('%s\n' 204 'Instead I will use the default rate: %s\n' 205 'Note: Further warnings will be supressed' 206 % (str(err_msg), str(self.default(t)))) 207 208 warnings.warn(msg) 209 210 # FIXME (Ole): Replace this crude flag with 211 # Python's ability to print warnings only once. 212 # See http://docs.python.org/lib/warning-filter.html 213 self.default_invoked = True 189 190 # Pass control to default rate function 191 value = self.default(t) 192 193 if self.default_invoked is False: 194 # Issue warning the first time 195 msg = ('%s\n' 196 'Instead I will use the default rate: %s\n' 197 'Note: Further warnings will be suppressed' 198 % (str(err_msg), str(self.default(t)))) 199 200 warnings.warn(msg) 201 202 # FIXME (Ole): Replace this crude flag with 203 # Python's ability to print warnings only once. 204 # See http://docs.python.org/lib/warning-filter.html 205 self.default_invoked = True 214 206 215 207 return value
Note: See TracChangeset
for help on using the changeset viewer.