finam.UnstructuredPoints#

class finam.UnstructuredPoints(points, order='C', axes_names=None, crs=None)[source]#

Bases: UnstructuredGrid

Unstructured points without cells.

Parameters:
  • points (arraylike) – Points (n, dim) defining the grid.

  • order (str, optional) – Data ordering. Either Fortran-like (“F”) or C-like (“C”), by default “C”

  • axes_names (list of str or None, optional) – Axes names (in xyz order), by default [“x”, “y”, “z”]

  • crs (str or None, optional) – The coordinate reference system, by default None

Attributes:
axes_names

list of str: Axes names (xyz order).

cell_centers

np.ndarray: Grid cell centers.

cell_count

int: Number of grid cells.

cell_node_counts

np.ndarray: Node count for each cell.

cell_types

np.ndarray: Cell types.

cells

np.ndarray: Cell nodes in ESMF format.

cells_connectivity

np.ndarray: Cells connectivity in ESMF format (list of node IDs).

cells_definition

np.ndarray: Cell definition in VTK format (list of number of nodes with node IDs).

cells_offset

np.ndarray: The location of the start of each cell in cells_connectivity.

crs

The coordinate reference system.

data_axes_names

list of str: Axes names of the data.

data_location

Location of the associated data (either CELLS or POINTS).

data_points

Points of the associated data (either cell_centers or points).

data_shape

np.ndarray: Grid points.

data_size

int: Size of the associated data.

dim

int: Dimension of the grid.

mesh_dim

int: Maximal cell dimension.

name

Grid name.

order

str: Point, cell and data order (C-like or F-like for flatten).

point_count

int: Number of grid points.

points

np.ndarray: Grid points.

Methods

compatible_with(other)

Check for compatibility with other Grid.

export_vtk(path[, data, cell_data, ...])

Export grid and data to a VTK file.

from_canonical(data)

Convert canonical data to grid specific form.

get_transform_to(other)

Transformation between compatible grids.

to_canonical(data)

Convert grid specific data to canonical form.

property cell_centers#

Grid cell centers.

Type:

np.ndarray

property cell_node_counts#

Node count for each cell.

Type:

np.ndarray

property mesh_dim#

Maximal cell dimension.

Type:

int

property axes_names#

Axes names (xyz order).

Type:

list of str

property cell_count#

Number of grid cells.

Type:

int

property cell_types#

Cell types.

Type:

np.ndarray

property cells#

Cell nodes in ESMF format.

Type:

np.ndarray

property cells_connectivity#

Cells connectivity in ESMF format (list of node IDs).

Type:

np.ndarray

property cells_definition#

Cell definition in VTK format (list of number of nodes with node IDs).

Type:

np.ndarray

property cells_offset#

The location of the start of each cell in cells_connectivity.

Type:

np.ndarray

compatible_with(other)#

Check for compatibility with other Grid.

Parameters:

other (instance of Grid) – Other grid to compatibility with.

Returns:

compatibility

Return type:

bool

property crs#

The coordinate reference system.

property data_axes_names#

Axes names of the data.

Type:

list of str

property data_location#

Location of the associated data (either CELLS or POINTS).

property data_points#

Points of the associated data (either cell_centers or points).

property data_shape#

Grid points.

Type:

np.ndarray

property data_size#

Size of the associated data.

Type:

int

property dim#

Dimension of the grid.

Type:

int

export_vtk(path, data=None, cell_data=None, point_data=None, field_data=None, mesh_type='unstructured')#

Export grid and data to a VTK file.

Parameters:
  • path (pathlike) – File path. Suffix will be replaced according to mesh type (.vtu)

  • data (dict or None, optional) – Data in the corresponding shape given by name, by default None

  • cell_data (dict or None, optional) – Additional cell data, by default None

  • point_data (dict or None, optional) – Additional point data, by default None

  • field_data (dict or None, optional) – Additional field data, by default None

  • mesh_type (str, optional) – Mesh type, by default “unstructured”

Raises:

ValueError – If mesh type is not supported.

from_canonical(data)#

Convert canonical data to grid specific form.

get_transform_to(other)#

Transformation between compatible grids.

property name#

Grid name.

property order#

Point, cell and data order (C-like or F-like for flatten).

Type:

str

property point_count#

Number of grid points.

Type:

int

property points#

Grid points.

Type:

np.ndarray

to_canonical(data)#

Convert grid specific data to canonical form.