anuga.Time_boundary

class anuga.Time_boundary(domain=None, function=None, default_boundary=None, verbose=False)[source]

Bases: Boundary

Time dependent boundary returns values for the conserved quantities as a function of time. Must specify domain to get access to model time and a function of t which must return conserved quantities as a function time.

Example

B = Time_boundary(domain,

function=lambda t: [(60<t<3660)*2, 0, 0])

This will produce a boundary condition with is a 2m high square wave starting 60 seconds into the simulation and lasting one hour. Momentum applied will be 0 at all times.

__init__(domain=None, function=None, default_boundary=None, verbose=False)[source]

Methods

__init__([domain, function, ...])

evaluate([vol_id, edge_id])

evaluate_segment(domain, segment_edges)

Evaluate boundary condition at edges of a domain in a list defined by segment_edges

get_boundary_values([t])

get_time()

evaluate_segment(domain, segment_edges)[source]

Evaluate boundary condition at edges of a domain in a list defined by segment_edges

segment_edges are a sublist of the list of edges definded by the arrays domain.boundary_cells and domain.boundary_edges

Go through list of boundary objects and update boundary values for all conserved quantities on boundary. It is assumed that the ordering of conserved quantities is consistent between the domain and the boundary object, i.e. the jth element of vector q must correspond to the jth conserved quantity in domain.

This implementation uses the evaluate proceudure, but for efficiency it is recommended to overload this procedure with a numpy or C based implementation.