Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

sdynpy.Exodus

Signature

class sdynpy.Exodus(filename, mode='r', title=None, num_dims=None, num_nodes=None, num_elem=None, num_blocks=None, num_node_sets=None, num_side_sets=None, clobber=False)

Read or write exodus files.

This class creates functionality to read or write exodus files using the netCDF4 python module.

Parameters

Attributes

NameSummary
num_blks
num_dimensions
num_elem_variables
num_elems
num_global_variables
num_node_sets
num_node_variables
num_nodes
num_side_sets
num_times
titleGet the title of the exodus file

num_blks

num_dimensions

num_elem_variables

num_elems

num_global_variables

num_node_sets

num_node_variables

num_nodes

num_side_sets

num_times

title

Get the title of the exodus file

Methods

NameSummary
__init__Initialize self. See help(type(self)) for accurate signature.
close
extract_sharp_edges
get_block_surfaceGets the node indices and element connectivity of surface elements
get_coordRetrieve the coordinates of the specified node in the exodus file.
get_coord_namesRetrieve the coordinate names in the exodus file.
get_coordsRetrieve the coordinates of the nodes in the exodus file.
get_displacements
get_elem_attrGets the element attributes for a given block
get_elem_blk_idsGets a list of the element block ID numbers in the exodus file
get_elem_blk_infoGets the element block information for the specified element block ID
get_elem_connectivityGets the element connectivity matrix for a given block
get_elem_num_mapRetrieve the list of local element IDs from the exodus file.
get_elem_typeGets the element type for a given block
get_elem_variable_namesGets a tuple of element variable names from the exodus file
get_elem_variable_tableGets the element variable table
get_elem_variable_valueGets an element’s variable value for the specified timestep
get_elem_variable_valuesGets a block’s element variable values for the specified timestep
get_element_property_names
get_element_property_value
get_global_variable_namesGets a tuple of global variable names from the exodus file
get_global_variable_valuesGets the global variable value for the specified timesteps
get_info_recordsGet the information records in the exodus file
get_node_num_mapRetrieve the list of local node IDs from the exodus file.
get_node_set_dist_factorsGet the distribution factors of the specified node set
get_node_set_idsGets a list of the node set ID numbers in the exodus file
get_node_set_namesRetrieve the node set names in the exodus file.
get_node_set_nodesGet the nodes in the specified node set
get_node_set_num_nodesGet the number of nodes in the specified node set
get_node_variable_namesGets a tuple of nodal variable names from the exodus file
get_node_variable_valueGets a node variable value for the specified timestep
get_node_variable_valuesGets the node variable values for the specified timestep
get_qa_recordsGet the quality assurance records in the exodus file
get_side_set_dist_factorsGet the distribution factors of the specified side set
get_side_set_facesGet the faces in the specified side set
get_side_set_idsGets a list of the side set ID numbers in the exodus file
get_side_set_namesRetrieve the side set names in the exouds file.
get_side_set_node_list
get_side_set_num_facesGet the number of faces in the specified side set
get_timesGets the time values from the exodus file
load_into_memoryLoads the exodus file into an ExodusInMemory object
num_attrGets the number of attributes per element for an element block
num_elems_in_blkGets the number of elements in an element block
num_nodes_per_elemGets the number of nodes per element in an element block
put_coord_namesPuts the coordinate names into the exodus file
put_coordsPuts the coordinate values into the exodus file
put_elem_blk_idsPuts a list of the element block ID numbers in the exodus file
put_elem_blk_infoPuts the element block information for an element block ID into the exodus file
put_elem_num_mapPuts a list of local element IDs into the exodus file.
put_elem_variable_namesPuts the specified variable names in the exodus file
put_element_property_names
put_element_property_value
put_global_variable_namesPuts the specified global variable names in the exodus file
put_info_recordsPuts the information records in the exodus file
put_node_num_mapPuts a list of local node IDs into the exodus file.
put_node_set_idsPuts a list of the node set ID numbers in the exodus file
put_node_set_infoPuts the node set information for a node set ID into the exodus file
put_node_set_namesPuts the node set names into the exodus file
put_node_variable_namesPuts the specified variable names in the exodus file
put_qa_recordsPuts the quality assurance records in the exodus file
put_side_set_idsPuts a list of the side set ID numbers in the exodus file
put_side_set_infoPuts the side set information for a side set ID into the exodus file
put_side_set_namesPuts the side set names into the exodus file
reduce_to_surfaces
set_elem_attrSets the element attributes for a given block
set_elem_connectivitySets the element connectivity matrix for a given block
set_elem_variable_valueSets an element variable value for the specified timestep
set_elem_variable_valuesSets a block’s element variable values for the specified timestep
set_global_variable_valuesSets the global variable values for the specified timestep
set_node_variable_valueSets the node variable values for the specified timestep
set_node_variable_valuesSets the node variable values for the specified timestep
set_timeSets the time value of a given step in the exodus file
set_timesSets the time vector for the exodus file
triangulate_surface_meshTriangulate a surface mesh for plotting patches

__init__

def sdynpy.Exodus.__init__(self, filename, mode='r', title=None, num_dims=None, num_nodes=None, num_elem=None, num_blocks=None, num_node_sets=None, num_side_sets=None, clobber=False)

Initialize self. See help(type(self)) for accurate signature.

close

def sdynpy.Exodus.close(self)

extract_sharp_edges

def sdynpy.Exodus.extract_sharp_edges(self, *args, **kwargs)

get_block_surface

def sdynpy.Exodus.get_block_surface(self, block_id, keep_midside_nodes=False, warn=True)

Gets the node indices and element connectivity of surface elements

This function “skins” the element block, returning a list of node indices and a surface connectivity matrix.

Parameters

Returns

get_coord

def sdynpy.Exodus.get_coord(self, index)

Retrieve the coordinates of the specified node in the exodus file.

Parameters

Returns

get_coord_names

def sdynpy.Exodus.get_coord_names(self)

Retrieve the coordinate names in the exodus file.

Returns

get_coords

def sdynpy.Exodus.get_coords(self)

Retrieve the coordinates of the nodes in the exodus file.

Returns

get_displacements

def sdynpy.Exodus.get_displacements(self, displacement_name='Disp', capital_coordinates=True)

get_elem_attr

def sdynpy.Exodus.get_elem_attr(self, id)

Gets the element attributes for a given block

Parameters

Returns

get_elem_blk_ids

def sdynpy.Exodus.get_elem_blk_ids(self)

Gets a list of the element block ID numbers in the exodus file

Returns

get_elem_blk_info

def sdynpy.Exodus.get_elem_blk_info(self, id)

Gets the element block information for the specified element block ID

Parameters

Returns

get_elem_connectivity

def sdynpy.Exodus.get_elem_connectivity(self, id)

Gets the element connectivity matrix for a given block

Parameters

Returns

get_elem_num_map

def sdynpy.Exodus.get_elem_num_map(self)

Retrieve the list of local element IDs from the exodus file.

Returns

Notes

If there is no elem_num_map in the exodus file, this function simply returns an array from 1 to self.num_elems

get_elem_type

def sdynpy.Exodus.get_elem_type(self, id)

Gets the element type for a given block

Parameters

Returns

get_elem_variable_names

def sdynpy.Exodus.get_elem_variable_names(self)

Gets a tuple of element variable names from the exodus file

Returns

get_elem_variable_table

def sdynpy.Exodus.get_elem_variable_table(self)

Gets the element variable table

Gets the element variable table showing which elements are defined for which blocks.

Returns

get_elem_variable_value

def sdynpy.Exodus.get_elem_variable_value(self, block_id, name_or_index, element_index, step=None)

Gets an element’s variable value for the specified timestep

Parameters

Returns

get_elem_variable_values

def sdynpy.Exodus.get_elem_variable_values(self, block_id, name_or_index, step=None)

Gets a block’s element variable values for the specified timestep

Parameters

Returns

get_element_property_names

def sdynpy.Exodus.get_element_property_names(self)

get_element_property_value

def sdynpy.Exodus.get_element_property_value(self)

get_global_variable_names

def sdynpy.Exodus.get_global_variable_names(self)

Gets a tuple of global variable names from the exodus file

Returns

get_global_variable_values

def sdynpy.Exodus.get_global_variable_values(self, name_or_index, step=None)

Gets the global variable value for the specified timesteps

Parameters

Returns

get_info_records

def sdynpy.Exodus.get_info_records(self)

Get the information records in the exodus file

Returns

get_node_num_map

def sdynpy.Exodus.get_node_num_map(self)

Retrieve the list of local node IDs from the exodus file.

Returns

Notes

If there is no node_num_map in the exodus file, this function simply returns an array from 1 to self.num_nodes

get_node_set_dist_factors

def sdynpy.Exodus.get_node_set_dist_factors(self, id)

Get the distribution factors of the specified node set

Parameters

Returns

get_node_set_ids

def sdynpy.Exodus.get_node_set_ids(self)

Gets a list of the node set ID numbers in the exodus file

Returns

get_node_set_names

def sdynpy.Exodus.get_node_set_names(self)

Retrieve the node set names in the exodus file.

Returns

get_node_set_nodes

def sdynpy.Exodus.get_node_set_nodes(self, id)

Get the nodes in the specified node set

Parameters

Returns

get_node_set_num_nodes

def sdynpy.Exodus.get_node_set_num_nodes(self, id)

Get the number of nodes in the specified node set

Parameters

Returns

get_node_variable_names

def sdynpy.Exodus.get_node_variable_names(self)

Gets a tuple of nodal variable names from the exodus file

Returns

get_node_variable_value

def sdynpy.Exodus.get_node_variable_value(self, name_or_index, node_index, step=None)

Gets a node variable value for the specified timestep

Parameters

Returns

get_node_variable_values

def sdynpy.Exodus.get_node_variable_values(self, name_or_index, step=None)

Gets the node variable values for the specified timestep

Parameters

Returns

get_qa_records

def sdynpy.Exodus.get_qa_records(self)

Get the quality assurance records in the exodus file

Returns

get_side_set_dist_factors

def sdynpy.Exodus.get_side_set_dist_factors(self, id)

Get the distribution factors of the specified side set

Parameters

Returns

get_side_set_faces

def sdynpy.Exodus.get_side_set_faces(self, id)

Get the faces in the specified side set

Parameters

Returns

get_side_set_ids

def sdynpy.Exodus.get_side_set_ids(self)

Gets a list of the side set ID numbers in the exodus file

Returns

get_side_set_names

def sdynpy.Exodus.get_side_set_names(self)

Retrieve the side set names in the exouds file.

Returns

get_side_set_node_list

def sdynpy.Exodus.get_side_set_node_list(self, id)

get_side_set_num_faces

def sdynpy.Exodus.get_side_set_num_faces(self, id)

Get the number of faces in the specified side set

Parameters

Returns

get_times

def sdynpy.Exodus.get_times(self, indices=None)

Gets the time values from the exodus file

Returns

load_into_memory

def sdynpy.Exodus.load_into_memory(self, close=True, variables=None, timesteps=None, blocks=None)

Loads the exodus file into an ExodusInMemory object

This function loads the exodus file into memory in an ExodusInMemory format. Not for use with large files.

Parameters

Returns

num_attr

def sdynpy.Exodus.num_attr(self, id)

Gets the number of attributes per element for an element block

Parameters

Returns

num_elems_in_blk

def sdynpy.Exodus.num_elems_in_blk(self, id)

Gets the number of elements in an element block

Parameters

Returns

num_nodes_per_elem

def sdynpy.Exodus.num_nodes_per_elem(self, id)

Gets the number of nodes per element in an element block

Parameters

Returns

put_coord_names

def sdynpy.Exodus.put_coord_names(self, coord_names)

Puts the coordinate names into the exodus file

Parameters

put_coords

def sdynpy.Exodus.put_coords(self, coords)

Puts the coordinate values into the exodus file

Parameters

put_elem_blk_ids

def sdynpy.Exodus.put_elem_blk_ids(self, block_ids)

Puts a list of the element block ID numbers in the exodus file

Parameters

put_elem_blk_info

def sdynpy.Exodus.put_elem_blk_info(self, id, elem_type, num_elements, num_nodes_per_element, num_attrs_per_elem=0)

Puts the element block information for an element block ID into the exodus file

Parameters

put_elem_num_map

def sdynpy.Exodus.put_elem_num_map(self, elem_num_map)

Puts a list of local element IDs into the exodus file.

Parameters

put_elem_variable_names

def sdynpy.Exodus.put_elem_variable_names(self, elem_var_names, elem_var_table=None)

Puts the specified variable names in the exodus file

Parameters

put_element_property_names

def sdynpy.Exodus.put_element_property_names(self)

put_element_property_value

def sdynpy.Exodus.put_element_property_value(self)

put_global_variable_names

def sdynpy.Exodus.put_global_variable_names(self, global_var_names)

Puts the specified global variable names in the exodus file

Parameters

put_info_records

def sdynpy.Exodus.put_info_records(self, records)

Puts the information records in the exodus file

Parameters

put_node_num_map

def sdynpy.Exodus.put_node_num_map(self, node_num_map)

Puts a list of local node IDs into the exodus file.

Parameters

put_node_set_ids

def sdynpy.Exodus.put_node_set_ids(self, ns_ids)

Puts a list of the node set ID numbers in the exodus file

Parameters

put_node_set_info

def sdynpy.Exodus.put_node_set_info(self, id, nodes, dist_fact=None)

Puts the node set information for a node set ID into the exodus file

Parameters

put_node_set_names

def sdynpy.Exodus.put_node_set_names(self, ns_names)

Puts the node set names into the exodus file

Parameters

put_node_variable_names

def sdynpy.Exodus.put_node_variable_names(self, node_var_names)

Puts the specified variable names in the exodus file

Parameters

put_qa_records

def sdynpy.Exodus.put_qa_records(self, records)

Puts the quality assurance records in the exodus file

Parameters

Notes

Each index in qa_records should consist of a length-4 tuple of strings:

  1. Analysis Code Name

  2. Analysis Code Version

  3. Analysis Date

  4. Analysis Time

put_side_set_ids

def sdynpy.Exodus.put_side_set_ids(self, ss_ids)

Puts a list of the side set ID numbers in the exodus file

Parameters

put_side_set_info

def sdynpy.Exodus.put_side_set_info(self, id, elements, sides, dist_fact=None)

Puts the side set information for a side set ID into the exodus file

Parameters

put_side_set_names

def sdynpy.Exodus.put_side_set_names(self, ss_names)

Puts the side set names into the exodus file

Parameters

reduce_to_surfaces

def sdynpy.Exodus.reduce_to_surfaces(self, *args, **kwargs)

set_elem_attr

def sdynpy.Exodus.set_elem_attr(self, id, attributes)

Sets the element attributes for a given block

Parameters

set_elem_connectivity

def sdynpy.Exodus.set_elem_connectivity(self, id, connectivity)

Sets the element connectivity matrix for a given block

Parameters

set_elem_variable_value

def sdynpy.Exodus.set_elem_variable_value(self, block_id, name_or_index, element_index, step, value)

Sets an element variable value for the specified timestep

Parameters

Notes

If step is not a valid index for the time vector, the time vector will be expanded so that it is.

set_elem_variable_values

def sdynpy.Exodus.set_elem_variable_values(self, block_id, name_or_index, step, values)

Sets a block’s element variable values for the specified timestep

Parameters

Notes

If step is not a valid index for the time vector, the time vector will be expanded so that it is.

set_global_variable_values

def sdynpy.Exodus.set_global_variable_values(self, name_or_index, step, value)

Sets the global variable values for the specified timestep

Parameters

Notes

If step is not a valid index for the time vector, the time vector will be expanded so that it is.

set_node_variable_value

def sdynpy.Exodus.set_node_variable_value(self, name_or_index, node_index, step, value)

Sets the node variable values for the specified timestep

Parameters

Notes

If step is not a valid index for the time vector, the time vector will be expanded so that it is.

set_node_variable_values

def sdynpy.Exodus.set_node_variable_values(self, name_or_index, step, values)

Sets the node variable values for the specified timestep

Parameters

Notes

If step is not a valid index for the time vector, the time vector will be expanded so that it is.

set_time

def sdynpy.Exodus.set_time(self, step, value)

Sets the time value of a given step in the exodus file

Parameters

Notes

If step is not a valid index for the time vector, the time vector will be expanded so that it is.

set_times

def sdynpy.Exodus.set_times(self, values)

Sets the time vector for the exodus file

Parameters

Notes

If the vector is longer than the current time step vector, it will be expanded. If the vector is shorter than the current time step vector, only the first len(values) entries of the time vector will be assigned.

triangulate_surface_mesh

def sdynpy.Exodus.triangulate_surface_mesh(self)

Triangulate a surface mesh for plotting patches

This function generates a triangle mesh for each block in the model if it can. If there are more than 3 nodes per element in a block, and the triangulation scheme hasn’t been defined in pyexodus.mesh_triangulation_array, it will be skipped.

Parameters

Returns