Changeset 8138
- Timestamp:
- Mar 10, 2011, 8:33:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/shallow_water/forcing.py
r8125 r8138 156 156 157 157 self.const = eta_w*rho_a/rho_w 158 ## 159 # @brief 'execute' this class instance. 160 # @param domain 158 161 159 def __call__(self, domain): 162 160 """Evaluate windfield based on values found in domain""" … … 205 203 206 204 207 ##208 # @brief Assign wind field values209 # @param xmom_update210 # @param ymom_update211 # @param s_vec212 # @param phi_vec213 # @param const214 205 def assign_windfield_values(xmom_update, ymom_update, 215 206 s_vec, phi_vec, const): … … 237 228 238 229 239 ##240 # @brief A class for a general explicit forcing term.241 230 class General_forcing: 242 231 """General explicit forcing term for update of quantity … … 275 264 # FIXME (AnyOne) : Add various methods to allow spatial variations 276 265 277 ##278 # @brief Create an instance of this forcing term.279 # @param domain280 # @param quantity_name281 # @param rate282 # @param center283 # @param radius284 # @param polygon285 # @param default_rate286 # @param verbose287 266 def __init__(self, 288 267 domain, … … 425 404 self.default_rate_invoked = False # Flag 426 405 427 ##428 # @brief Execute this instance.429 # @param domain430 406 def __call__(self, domain): 431 407 """Apply inflow function at time specified in domain, update stage""" … … 477 453 self.update[k] += rate 478 454 479 ##480 # @brief Update the internal rate.481 # @param t A callable or scalar used to set the rate.482 # @return The new rate.483 455 def update_rate(self, t): 484 456 """Virtual method allowing local modifications by writing an … … 493 465 return rate 494 466 495 ##496 # @brief Get values for the specified quantity.497 # @param quantity_name Name of the quantity of interest.498 # @return The value(s) of the quantity.499 # @note If 'quantity_name' is None, use self.quantity_name.500 467 def get_quantity_values(self, quantity_name=None): 501 468 """Return values for specified quantity restricted to opening … … 512 479 indices=self.exchange_indices) 513 480 514 ##515 # @brief Set value for the specified quantity.516 # @param val The value object used to set value.517 # @param quantity_name Name of the quantity of interest.518 # @note If 'quantity_name' is None, use self.quantity_name.519 481 def set_quantity_values(self, val, quantity_name=None): 520 482 """Set values for specified quantity restricted to opening … … 536 498 537 499 return false 538 ## 539 # @brief A class for rainfall forcing function. 540 # @note Inherits from General_forcing. 500 541 501 class Rainfall(General_forcing): 542 502 """Class Rainfall - general 'rain over entire domain' forcing term. … … 584 544 """ 585 545 586 ##587 # @brief Create an instance of the class.588 # @param domain Domain of interest.589 # @param rate Total rain rate over the specified domain (mm/s).590 # @param center591 # @param radius592 # @param polygon Polygon to restrict rainfall.593 # @param default_rate594 # @param verbose True if this instance is to be verbose.595 546 def __init__(self, 596 547 domain, … … 629 580 630 581 631 ##632 # @brief A class for inflow (rain and drain) forcing function.633 # @note Inherits from General_forcing.634 582 class Inflow(General_forcing): 635 583 """Class Inflow - general 'rain and drain' forcing term. … … 680 628 """ 681 629 682 ##683 # @brief Create an instance of the class.684 # @param domain Domain of interest.685 # @param rate Total rain rate over the specified domain (mm/s).686 # @param center687 # @param radius688 # @param polygon Polygon to restrict rainfall.689 # @param default_rate690 # @param verbose True if this instance is to be verbose.691 630 def __init__(self, 692 631 domain, … … 697 636 default_rate=None, 698 637 verbose=False): 638 """Create an instance of the class 639 640 domain Domain of interest 641 rate Total rain rate over the specified domain (mm/s) 642 center 643 radius 644 polygon Polygon to restrict rainfall 645 default_rate 646 verbose True if this instance is to be verbose 647 """ 648 699 649 # Create object first to make area is available 700 650 General_forcing.__init__(self, … … 708 658 verbose=verbose) 709 659 710 ##711 # @brief Update the instance rate.712 # @param t New rate object.713 660 def update_rate(self, t): 714 661 """Virtual method allowing local modifications by writing an 715 662 overriding version in descendant 716 663 664 t New rate object 665 717 666 This one converts m^3/s to m/s which can be added directly 718 667 to 'stage' in ANUGA … … 727 676 728 677 729 ##730 # @brief A class for creating cross sections.731 # @note Inherits from General_forcing.732 678 class Cross_section: 733 679 """Class Cross_section - a class to setup a cross section from 734 680 which you can then calculate flow and energy through cross section 735 736 681 737 682 Cross_section(domain, polyline) … … 745 690 """ 746 691 747 ##748 # @brief Create an instance of the class.749 # @param domain Domain of interest.750 # @param polyline Polyline defining cross section751 # @param verbose True if this instance is to be verbose.752 692 def __init__(self, 753 693 domain, 754 694 polyline=None, 755 695 verbose=False): 696 """Create an instance of Cross_section. 697 698 domain domain of interest 699 polyline polyline defining cross section 700 verbose True if this instance is to be verbose 701 """ 756 702 757 703 self.domain = domain … … 770 716 self.midpoints = ensure_geospatial(self.midpoints, self.domain.geo_reference) 771 717 772 ##773 # @brief set verbose mode774 718 def set_verbose(self,verbose=True): 775 """Set verbose mode true or flase 776 """ 719 """Set verbose mode true or flase""" 777 720 778 721 self.verbose=verbose 779 722 780 ##781 # @brief calculate current flow through cross section782 723 def get_flow_through_cross_section(self): 783 724 """ Output: Total flow [m^3/s] across cross section. … … 809 750 810 751 811 ##812 # @brief calculate current energy flow through cross section813 752 def get_energy_through_cross_section(self, kind='total'): 814 753 """Obtain average energy head [m] across specified cross section. … … 954 893 self.pressure = p 955 894 956 ##957 # @brief 'execute' this class instance.958 # @param domain959 895 def __call__(self, domain): 960 896 """Evaluate pressure field based on values found in domain""" … … 994 930 995 931 996 ##997 # @brief Assign pressure field values998 # @param xmom_update999 # @param ymom_update1000 # @param s_vec1001 # @param phi_vec1002 # @param const1003 932 def assign_pressure_field_values(height, pressure, x, triangles, 1004 933 xmom_update, ymom_update): … … 1160 1089 1161 1090 1162 ##1163 # @brief 'execute' this class instance.1164 # @param domain1165 1091 def __call__(self, domain): 1166 1092 """Evaluate pressure field based on values found in domain""" … … 1345 1271 1346 1272 self.const = eta_w*rho_a/rho_w 1347 ## 1348 # @brief 'execute' this class instance. 1349 # @param domain 1273 1350 1274 def __call__(self, domain): 1351 1275 """Evaluate windfield based on values found in domain"""
Note: See TracChangeset
for help on using the changeset viewer.