Ignore:
Timestamp:
Feb 13, 2006, 12:35:15 PM (19 years ago)
Author:
ole
Message:

Revisited profiling, cleaned up and added setter for spatial order

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/domain.py

    r2319 r2380  
    6060        #FIXME: Maybe have separate orders for h-limiter and w-limiter?
    6161        #Or maybe get rid of order altogether and use beta_w and beta_h
    62         self.default_order = 1
    63         self.order = self.default_order
     62        self.set_default_order(1)       
     63        #self.default_order = 1
     64        #self.order = self.default_order
     65
    6466        self.smallsteps = 0
    6567        self.max_smallsteps = max_smallsteps
     
    9294        N=self.number_of_elements
    9395        self.already_computed_flux = zeros((N, 3), Int)
     96
     97
     98    def set_default_order(self, n):
     99        """Set default (spatial) order to either 1 or 2
     100        """
     101
     102        msg = 'Default order must be either 1 or 2. I got %s' %n
     103        assert n in [1,2], msg
     104       
     105        self.default_order = n
     106        self.order = self.default_order
     107
    94108
    95109    #Public interface to Domain
     
    197211
    198212        return self.quantities[name].get_values( location, indices = indices)
     213
     214    def get_quantity_object(self, name):
     215        """Get object for named quantity
     216
     217        name: Name of quantity
     218        """
     219
     220        return self.quantities[name]
    199221
    200222
Note: See TracChangeset for help on using the changeset viewer.