- Timestamp:
- Nov 19, 2009, 5:23:52 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py
r7519 r7562 1138 1138 # Input checks 1139 1139 if quantities is None: 1140 quantities = self. conserved_quantities1140 quantities = self.evolved_quantities 1141 1141 elif type(quantities) == types.StringType: 1142 1142 quantities = [quantities] #Turn it into a list … … 1752 1752 ## 1753 1753 # @brief Mapping between conserved quantites and evolved quantities 1754 # @param q_cons array of conserved quantity values 1755 # @param q_evolved array of current evolved quantity values 1756 def conserved_to_evolved(self, q_cons, q_evolved): 1754 # @param Input: q_cons array of conserved quantity values 1755 # @param Input: q_evol array of current evolved quantity values 1756 # @note Output: Updated q_evol array 1757 def conserved_values_to_evolved_values(self, q_cons, q_evol): 1757 1758 """Needs to be overridden by Domain subclass 1758 1759 """ 1759 1760 1760 if len(q_cons) == len(q_evol ved):1761 q_evol ved[:] = q_cons1761 if len(q_cons) == len(q_evol): 1762 q_evol[:] = q_cons 1762 1763 else: 1763 msg = 'Method conserved_ to_evolvedmust be overridden by Domain subclass'1764 msg = 'Method conserved_values_to_evolved_values must be overridden by Domain subclass' 1764 1765 raise Exception, msg 1766 1767 return q_evol 1765 1768 1766 1769 ## … … 1781 1784 log.critical('WARNING: Ignored boundary segment (None)') 1782 1785 else: 1783 q_ cons= B.evaluate(vol_id, edge_id)1784 1785 if len(q_ cons) == len(self.evolved_quantities):1786 q_bdry = B.evaluate(vol_id, edge_id) 1787 1788 if len(q_bdry) == len(self.evolved_quantities): 1786 1789 # conserved and evolved quantities are the same 1787 q_evol = q_ cons1788 elif len(q_ cons) == len(self.conserved_quantities):1790 q_evol = q_bdry 1791 elif len(q_bdry) == len(self.conserved_quantities): 1789 1792 # boundary just returns conserved quantities 1790 1793 # Need to calculate all the evolved quantities … … 1793 1796 q_evol = self.get_evolved_quantities(vol_id, edge = edge_id) 1794 1797 1795 self.conserved_to_evolved(q_cons, q_evol)1798 q_evol = self.conserved_values_to_evolved_values(q_bdry, q_evol) 1796 1799 else: 1797 1800 msg = 'Boundary must return array of either conserved or evolved quantities'
Note: See TracChangeset
for help on using the changeset viewer.