vaayu.nalu – Nalu Interface

vaayu.nalu provides various utilities to interact with Nalu and NaluWindUtils.

Nalu Exodus NetCDF Interface

class vaayu.nalu.mesh.exocdf.ExodusCDF(filename)[source]

Bases: object

Nalu Exodus NetCDF Interface

Interact with a Nalu Exodus-II mesh or results file using the netcdf4 library.

num_blocks

int – Number of blocks present in the file

num_side_sets

int – Number of side sets present in the file

blocks

list – Names of the mesh blocks present in the file

side_sets

list – Names of the side sets present in the file

elem_conn_map

dict – A mapping from block names to element ID used to extract connectivity data

coords(mask=None)[source]

Return the numpy array of the mesh coordinates

elem_nodes(blk_name, flatten=True)[source]

Element Node ID mapping for a given block

If flatten is True, then the method returns a one dimensional numpy array containing the unique set of node IDs corresponding to this mesh block. If False, then it returns a 2-D list where the inner array contains the list of nodes for each element. The shape of the 2-D array is (num_elems, num_nodes_per_elem).

Parameters:
  • blk_name (str) – Block name
  • flatten (bool) – Unique IDs or element connetivity map.
Returns:

A 1-D or 2-D array depending on flatten flag.

Return type:

np.ndarray

filename = None

string – Filename that is being processed

msh = None

Dataset – NetCDF msh database object

ndim = None

int – Dimensionality of the mesh

nelems = None

int – Total number of elements in the mesh

nnodes = None

int – Total number of nodes in the mesh

ss_nodes(ss_name, flatten=True)[source]

Node IDs for a given side set

If flatten is True, then the method returns a one dimensional numpy array containing the unique set of node IDs corresponding to this mesh side set. If False, then it returns a 2-D list where the inner array contains the list of nodes for each element. The shape of the 2-D array is (num_elems, num_nodes_per_elem).

Parameters:
  • blk_name (str) – Block name
  • flatten (bool) – Unique IDs or element connectivity map.
Returns:

A 1-D or 2-D array depending on flatten flag.

Return type:

np.ndarray

xco(mask=None)[source]

Return the x coordinates of the mesh

yco(mask=None)[source]

Return the y coordinates of the mesh

zco(mask=None)[source]

Return the z coordinates of the mesh

vaayu.nalu.mesh.exocdf.nc_convert_names(names_arr)[source]

Utility function to convert byte chars to strings.

Parameters:names_arr (np.ndarry) – Numpy string array from NetCDF
Returns:A list of strings corresponding to the names
Return type:list