spatial.GeometryFM3D
spatial.GeometryFM3D(
self,
*,
node_coordinates,
element_table,
codes=None,
projection='LONG/LAT',
dfsu_type=DfsuFileType.Dfsu3DSigma,
element_ids=None,
node_ids=None,
n_layers=1,
n_sigma=None,
validate=True,
reindex=False,
)Flexible 3d mesh geometry.
Attributes
| Name | Description |
|---|---|
| bottom_elements | List of 3d element ids of bottom layer. |
| boundary_codes | Unique list of boundary codes. |
| codes | Node codes of all nodes (0=water, 1=land, 2…=open boundaries). |
| e2_e3_table | The 2d-to-3d element connectivity table for a 3d object. |
| elem2d_ids | The associated 2d element id for each 3d element. |
| element_coordinates | Center coordinates of each element. |
| is_geo | Are coordinates geographical (LONG/LAT)? |
| is_local_coordinates | Are coordinates relative (NON-UTM)? |
| layer_ids | The layer number (0=bottom, 1, 2, …) for each 3d element. |
| max_nodes_per_element | The maximum number of nodes for an element. |
| n_elements | Number of elements. |
| n_layers | Maximum number of layers. |
| n_layers_per_column | List of number of layers for each column. |
| n_nodes | Number of nodes. |
| n_sigma_layers | Number of sigma layers. |
| n_z_layers | Maximum number of z-layers. |
| projection | The projection. |
| projection_string | The projection string. |
| top_elements | List of 3d element ids of surface layer. |
Methods
| Name | Description |
|---|---|
| get_layer_elements | 3d element ids for one (or more) specific layer(s). |
| get_space_axis | Get geographic space axis indices within the geometry’s dims. |
| reduce | Return reduced geometry after spatial aggregation. |
| to_2d_geometry | extract 2d geometry from 3d geometry. |
get_layer_elements
spatial.GeometryFM3D.get_layer_elements(layers)3d element ids for one (or more) specific layer(s).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| layers | int or list(int) | layer between 0 (bottom) and n_layers-1 (top) (can also be negative counting from -1 at the top layer) | required |
Returns
| Name | Type | Description |
|---|---|---|
| np.array(int) | element ids |
get_space_axis
spatial.GeometryFM3D.get_space_axis()Get geographic space axis indices within the geometry’s dims.
Returns which of the geometry’s dims represent geographic space dimensions, as opposed to spectral or other non-geographic dimensions.
This is used when axis=“space” or axis=“spatial” is specified in operations like aggregate, mean, etc.
Returns
| Name | Type | Description |
|---|---|---|
| tuple[int, …] | Space axis indices (0-indexed within geometry.dims). Returns empty tuple if there are no space dimensions (e.g., point geometries, pure spectral geometries). |
Examples
Grid2D with dims=(“y”, “x”) returns (0, 1) - both are space. GeometryFMAreaSpectrum with dims=(“element”, “direction”, “frequency”) returns (0,) - only element is space, direction/frequency are spectral. GeometryFMPointSpectrum with dims=(“frequency”,) returns () - no space.
reduce
spatial.GeometryFM3D.reduce(axis)Return reduced geometry after spatial aggregation.
to_2d_geometry
spatial.GeometryFM3D.to_2d_geometry()extract 2d geometry from 3d geometry.
Returns
| Name | Type | Description |
|---|---|---|
| GeometryFM2D | 2d geometry |