Changeset 3572


Ignore:
Timestamp:
Sep 12, 2006, 6:33:04 PM (18 years ago)
Author:
ole
Message:

Got Rosh example to work again by allowing the boundary condition Transmissive_momentum_set_stage to
accept a scalar function of time rather than just a vector function. This modification ties in with
ticket:90

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r3563 r3572  
    10451045class Transmissive_Momentum_Set_Stage_boundary(Boundary):
    10461046    """Returns same momentum conserved quantities as
    1047     those present in its neighbour volume. Sets stage
     1047    those present in its neighbour volume.
     1048    Sets stage by specifying a function f of time which may either be a
     1049    vector function or a scalar function
     1050
     1051    Example:
     1052
     1053    def waveform(t):
     1054        return sea_level + normalized_amplitude/cosh(t-25)**2
     1055
     1056    Bts = Transmissive_Momentum_Set_Stage_boundary(domain, waveform)
     1057   
    10481058
    10491059    Underlying domain must be specified when boundary is instantiated
     
    10741084        q = self.domain.get_conserved_quantities(vol_id, edge = edge_id)
    10751085        value = self.function(self.domain.time)
    1076         q[0] = value[0]
     1086
     1087        try:
     1088            x = float(value)
     1089        except:   
     1090            x = float(value[0])
     1091           
     1092        q[0] = x
    10771093        return q
    10781094
Note: See TracChangeset for help on using the changeset viewer.