anuga.Size_field

class anuga.Size_field(area, xllcorner, yllcorner, cellsize)[source]

Bases: object

A raster of target (maximum) triangle area.

Parameters:
  • area (2D array) – area[row, col] is the maximum triangle area in the cell whose lower left corner is (xllcorner + col*cellsize, yllcorner + row*cellsize). Row 0 is the SOUTH edge. Values must be positive.

  • xllcorner (float) – Absolute coordinates of the lower left corner of the raster.

  • yllcorner (float) – Absolute coordinates of the lower left corner of the raster.

  • cellsize (float) – Edge length of a (square) raster cell.

Notes

A point outside the raster takes the value of the nearest cell.

The field is evaluated only at triangle centroids, so it should vary smoothly: if it jumps from coarse to fine over a short distance, a large triangle whose centroid lies on the coarse side can straddle the fine part unrefined. size_field_from_regions() grades its field for this reason.

__init__(area, xllcorner, yllcorner, cellsize)[source]

Methods

__init__(area, xllcorner, yllcorner, cellsize)

refinement_func([xoffset, yoffset])

Triangle user test for this field.

refinement_func(xoffset=0.0, yoffset=0.0)[source]

Triangle user test for this field.

Triangle works in coordinates relative to the mesh’s geo reference; xoffset, yoffset is that reference’s lower left corner.