Ignore:
Timestamp:
Apr 24, 2009, 5:22:14 PM (16 years ago)
Author:
rwilson
Message:

Back-merge from Numeric trunk to numpy branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy/anuga/abstract_2d_finite_volumes/generic_boundary_conditions.py

    r6553 r6902  
    8282    """Time dependent boundary returns values for the
    8383    conserved quantities as a function of time.
    84     Must specify domain to get access to model time and a function f(t)
    85     which must return conserved quantities as a function time
     84    Must specify domain to get access to model time and a function of t
     85    which must return conserved quantities as a function time.
     86   
     87    Example:
     88      B = Time_boundary(domain,
     89                        function=lambda t: [(60<t<3660)*2, 0, 0])
     90     
     91      This will produce a boundary condition with is a 2m high square wave
     92      starting 60 seconds into the simulation and lasting one hour.
     93      Momentum applied will be 0 at all times.
     94                       
    8695    """
    8796
     
    98107        self.verbose = verbose
    99108
     109       
     110        # FIXME: Temporary code to deal with both f and function
     111        if function is not None and f is not None:
     112            raise Exception, 'Specify either function or f to Time_boundary'
     113           
     114        if function is None and f is None:
     115            raise Exception, 'You must specify a function to Time_boundary'
     116           
     117        if f is None:
     118            f = function
     119        #####
     120       
    100121        try:
    101122            q = f(0.0)
Note: See TracChangeset for help on using the changeset viewer.