anuga.Kinematic_viscosity_operator

class anuga.Kinematic_viscosity_operator(domain, diffusivity='height', use_triangle_areas=True, add_safety=False, verbose=False)[source]

Bases: Operator

Class for setting up structures and matrices for kinematic viscosity differential operator using centroid values.

As an anuga operator, when the __call__ method is called one step of the parabolic step is applied. In particular the x and y velocities are updated using

du/dt = div( h grad u ) dv/dt = div( h grad v )

__init__(domain, diffusivity='height', use_triangle_areas=True, add_safety=False, verbose=False)[source]

Methods

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

activate_logging()

build_elliptic_matrix(a)

Builds matrix representing

elliptic_multiply(input[, output])

elliptic_solve(u_in, b[, a, u_out, ...])

Solving div ( a grad u ) = b u | boundary = g

get_time()

get_timestep()

log_timestepping_statistics()

parabolic_multiply(input[, output])

parabolic_solve(u_in, b[, a, u_out, ...])

Solve for u in the equation

parallel_safe()

By default an operator is not parallel safe

print_statistics()

print_timestepping_statistics()

set_label([label])

set_logging([flag])

set_parabolic_solve(flag)

set_triangle_areas([flag])

statistics()

timestepping_statistics()

update_elliptic_boundary_term(boundary)

update_elliptic_matrix([a])

Updates the data values of matrix representing

Attributes

counter

build_elliptic_matrix(a)[source]

Builds matrix representing

div ( a grad )

which has the form [ A B ]

elliptic_solve(u_in, b, a=None, u_out=None, update_matrix=True, imax=10000, tol=1e-08, atol=1e-08, iprint=None, output_stats=False)[source]

Solving div ( a grad u ) = b u | boundary = g

u_in, u_out, f anf g are Quantity objects

Dirichlet BC g encoded into u_in boundary_values

Initial guess for iterative scheme is given by centroid values of u_in

Centroid values of a and b provide diffusivity and rhs

Solution u is retruned in u_out

parabolic_solve(u_in, b, a=None, u_out=None, update_matrix=True, output_stats=False, use_dt_tol=True, iprint=None, imax=10000)[source]

Solve for u in the equation

( I + dt div a grad ) u = b

u | boundary = g

u_in, u_out, f anf g are Quantity objects

Dirichlet BC g encoded into u_in boundary_values

Initial guess for iterative scheme is given by centroid values of u_in

Centroid values of a and b provide diffusivity and rhs

Solution u is retruned in u_out

parallel_safe()[source]

By default an operator is not parallel safe

update_elliptic_matrix(a=None)[source]

Updates the data values of matrix representing

div ( a grad )

If a is None then we set a = quantity which is set to 1