anuga.Quantity

class anuga.Quantity(domain, vertex_values=None, name=None, register=False)[source]

Class Quantity - Implements values at each triangular element

__init__(domain, vertex_values=None, name=None, register=False)[source]

Create Quantity object

Parameters:
  • domain – Associated domain structure. Required.

  • vertex_values – N x 3 array of values at each vertex for each element. Default None

  • name (str) – Provides a way to refer to a created quantity

  • register – Register a quantity

Usage:

>>> Quantity(domain, name="newQ", register=True)

If vertex_values are None Create array of zeros compatible with domain. Otherwise check that it is compatible with dimensions of domain. Otherwise raise an exception

For Quantities that need to be saved during checkpointing, set register=True. Registered Quantities can be found in the dictionary domain.quantities (note, other Quantities can exist).

Methods

__init__(domain[, vertex_values, name, register])

Create Quantity object

backup_centroid_values()

bound_vertices_below_by_constant(bound)

bound_vertices_below_by_quantity(quantity)

compute_gradients()

compute_local_gradients()

extrapolate_first_order()

Extrapolate conserved quantities from centroid to vertices and edges for each volume using first order scheme.

extrapolate_second_order()

extrapolate_second_order_and_limit_by_edge()

extrapolate_second_order_and_limit_by_vertex()

get_beta()

Get default beta value for limiting

get_extremum_index([mode, indices])

Return index for maximum or minimum value of quantity (on centroids)

get_gradients()

Provide gradients.

get_integral([full_only, region, indices])

Compute the integral of quantity across entire domain, or over a region.

get_interpolated_values(interpolation_points)

Get values at interpolation points

get_maximum_index([indices])

See get extreme index for details

get_maximum_location([indices])

Return location of maximum value of quantity (on centroids)

get_maximum_value([indices])

Return maximum value of quantity (on centroids)

get_minimum_index([indices])

See get extreme index for details

get_minimum_location([indices])

Return location of minimum value of quantity (on centroids)

get_minimum_value([indices])

Return minimum value of quantity (on centroids)

get_name()

get_values([interpolation_points, location, ...])

Get values for quantity

get_vertex_values([xy, smooth, precision])

Return vertex values like an OBJ format i.e. one value per node.

interpolate()

Compute interpolated values at edges and centroid Pre-condition: vertex_values have been set

interpolate_from_edges_to_vertices()

interpolate_from_vertices_to_edges()

interpolate_old()

Compute interpolated values at edges and centroid Pre-condition: vertex_values have been set

limit()

limit_edges_by_all_neighbours()

limit_edges_by_neighbour()

limit_vertices_by_all_neighbours()

maximum(other)

Max of self with anything that could populate a quantity

minimum(other)

Max of self with anything that could populate a quantity

plot_quantity([filename, draw])

save_centroid_data_to_csv([filename])

save_data_to_dem([filename])

save_to_array([cellsize, NODATA_value, ...])

Interpolate quantity to an array

saxpy_centroid_values(a, b)

set_beta(beta)

Set default beta value for limiting

set_boundary_values([numeric])

Set boundary values

set_boundary_values_from_edges()

Set boundary values by simply extrapolating from the cells

set_name([name])

set_values([numeric, quantity, function, ...])

Set values for quantity based on different sources.

set_values_from_array(values[, location, ...])

Set values for quantity

set_values_from_constant(X, location, ...)

Set quantity values from specified constant X

set_values_from_file(filename, ...[, ...])

Set quantity based on arbitrary points in a points file using attribute_name selects name of attribute present in file.

set_values_from_function(f[, location, ...])

Set values for quantity using specified function

set_values_from_geospatial_data(...[, ...])

Set values based on geo referenced geospatial data object.

set_values_from_lat_long_grid_file(filename)

Read Digital model from the following ASCII format (.asc or .grd)

set_values_from_points(points, values, ...)

Set quantity values from arbitray data points using fit_interpolate.fit

set_values_from_quantity(q, location, ...)

Set quantity values from specified quantity instance q

set_values_from_tif_file(filename[, ...])

set_values_from_utm_grid_file(filename[, ...])

Read Digital Elevation model from the following ASCII format (.asc, .grd or .dem)

set_values_from_utm_raster(raster[, ...])

set_vertex_values(A[, indices, use_cache, ...])

Set vertex values for all unique vertices based on input array A which has one entry per unique vertex, i.e. one value for each row in array self.domain.nodes.

smooth_vertex_values([use_cache, verbose])

Smooths vertex values.

update(timestep)

Attributes

counter