Defined as:
sdynpy.fem.sdynpy_exodus.ExodusModule:
sdynpy.fem.sdynpy_exodusSource: GitHub
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¶
filename : str The path string to the file that will be opened
mode : str Mode with which the file is opened, ‘r’ - Read, ‘w’ - Write, ‘a’ - Append. Default is ‘r’.
title : str Title of the exodus file, only required if mode=‘w’.
num_dims : int Number of dimensions in the exodus file, only required if mode=‘w’.
num_nodes : int Number of nodes in the exodus file, only required if mode=‘w’.
num_elem : int Number of elements in the exodus file, only required if mode=‘w’.
num_blocks : int Number of blocks in the exodus file, only required if mode=‘w’.
num_node_sets : int Number of node sets in the exodus file, only required if mode = ‘w’.
num_side_sets : int Number of side sets in the exodus file, only required if mode=‘w’.
Attributes¶
| Name | Summary |
|---|---|
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 |
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¶
| Name | Summary |
|---|---|
__init__ | Initialize self. See help(type(self)) for accurate signature. |
close | |
extract_sharp_edges | |
get_block_surface | Gets the node indices and element connectivity of surface elements |
get_coord | Retrieve the coordinates of the specified node in the exodus file. |
get_coord_names | Retrieve the coordinate names in the exodus file. |
get_coords | Retrieve the coordinates of the nodes in the exodus file. |
get_displacements | |
get_elem_attr | Gets the element attributes for a given block |
get_elem_blk_ids | Gets a list of the element block ID numbers in the exodus file |
get_elem_blk_info | Gets the element block information for the specified element block ID |
get_elem_connectivity | Gets the element connectivity matrix for a given block |
get_elem_num_map | Retrieve the list of local element IDs from the exodus file. |
get_elem_type | Gets the element type for a given block |
get_elem_variable_names | Gets a tuple of element variable names from the exodus file |
get_elem_variable_table | Gets the element variable table |
get_elem_variable_value | Gets an element’s variable value for the specified timestep |
get_elem_variable_values | Gets a block’s element variable values for the specified timestep |
get_element_property_names | |
get_element_property_value | |
get_global_variable_names | Gets a tuple of global variable names from the exodus file |
get_global_variable_values | Gets the global variable value for the specified timesteps |
get_info_records | Get the information records in the exodus file |
get_node_num_map | Retrieve the list of local node IDs from the exodus file. |
get_node_set_dist_factors | Get the distribution factors of the specified node set |
get_node_set_ids | Gets a list of the node set ID numbers in the exodus file |
get_node_set_names | Retrieve the node set names in the exodus file. |
get_node_set_nodes | Get the nodes in the specified node set |
get_node_set_num_nodes | Get the number of nodes in the specified node set |
get_node_variable_names | Gets a tuple of nodal variable names from the exodus file |
get_node_variable_value | Gets a node variable value for the specified timestep |
get_node_variable_values | Gets the node variable values for the specified timestep |
get_qa_records | Get the quality assurance records in the exodus file |
get_side_set_dist_factors | Get the distribution factors of the specified side set |
get_side_set_faces | Get the faces in the specified side set |
get_side_set_ids | Gets a list of the side set ID numbers in the exodus file |
get_side_set_names | Retrieve the side set names in the exouds file. |
get_side_set_node_list | |
get_side_set_num_faces | Get the number of faces in the specified side set |
get_times | Gets the time values from the exodus file |
load_into_memory | Loads the exodus file into an ExodusInMemory object |
num_attr | Gets the number of attributes per element for an element block |
num_elems_in_blk | Gets the number of elements in an element block |
num_nodes_per_elem | Gets the number of nodes per element in an element block |
put_coord_names | Puts the coordinate names into the exodus file |
put_coords | Puts the coordinate values into the exodus file |
put_elem_blk_ids | Puts a list of the element block ID numbers in the exodus file |
put_elem_blk_info | Puts the element block information for an element block ID into the exodus file |
put_elem_num_map | Puts a list of local element IDs into the exodus file. |
put_elem_variable_names | Puts the specified variable names in the exodus file |
put_element_property_names | |
put_element_property_value | |
put_global_variable_names | Puts the specified global variable names in the exodus file |
put_info_records | Puts the information records in the exodus file |
put_node_num_map | Puts a list of local node IDs into the exodus file. |
put_node_set_ids | Puts a list of the node set ID numbers in the exodus file |
put_node_set_info | Puts the node set information for a node set ID into the exodus file |
put_node_set_names | Puts the node set names into the exodus file |
put_node_variable_names | Puts the specified variable names in the exodus file |
put_qa_records | Puts the quality assurance records in the exodus file |
put_side_set_ids | Puts a list of the side set ID numbers in the exodus file |
put_side_set_info | Puts the side set information for a side set ID into the exodus file |
put_side_set_names | Puts the side set names into the exodus file |
reduce_to_surfaces | |
set_elem_attr | Sets the element attributes for a given block |
set_elem_connectivity | Sets the element connectivity matrix for a given block |
set_elem_variable_value | Sets an element variable value for the specified timestep |
set_elem_variable_values | Sets a block’s element variable values for the specified timestep |
set_global_variable_values | Sets the global variable values for the specified timestep |
set_node_variable_value | Sets the node variable values for the specified timestep |
set_node_variable_values | Sets the node variable values for the specified timestep |
set_time | Sets the time value of a given step in the exodus file |
set_times | Sets the time vector for the exodus file |
triangulate_surface_mesh | Triangulate a surface mesh for plotting patches |
__init__¶
Source: GitHub
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¶
Source: GitHub
def sdynpy.Exodus.close(self)extract_sharp_edges¶
Source: GitHub
def sdynpy.Exodus.extract_sharp_edges(self, *args, **kwargs)get_block_surface¶
Source: GitHub
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¶
block_id : int The ID number of the block that will be skinned.
keep_midside_nodes : bool Specifies whether or not to keep midside nodes in the surface mesh. Default is False.
warn : bool Specifies whether or not to warn the user if the block ID doesn’t have a skinning method defined for its element type. Default is True.
Returns¶
element_block_information : list A list of tuples of element information. These data are element_type, node_indices, block_surface_connectivity, and block_surface_original_elements. The element_type is a string representing the new block element type (‘quad4’,‘tri3’,etc.). The node_indices can be used as an index into the coordinate or nodal variable arrays to select nodes corresponding to this block. The block_surface_connectivity represents the connectivity array of the surface faces of the block. Values in this array correspond to indices into the node_indices array. To recover the connectivity array in the original node indices of the exodus file, it can be passed through the node_indices as node_indices[block_surface_connectivity]. The block_surface_original_elements array shows the original element indices of the block that each surface came from. This can be used to map element variables to the new surface mesh. This list will normally be length 1 unless an element type is processed that has two different surface elements in it (e.g. wedges have tris and quads)
get_coord¶
Source: GitHub
def sdynpy.Exodus.get_coord(self, index)Retrieve the coordinates of the specified node in the exodus file.
Parameters¶
index : int The global node index (not node number) of the node of which the coordinates are desired
Returns¶
coords : np.array Returns an array with size num_dims
get_coord_names¶
Source: GitHub
def sdynpy.Exodus.get_coord_names(self)Retrieve the coordinate names in the exodus file.
Returns¶
coord_names : tuple Returns a tuple of strings containing the coordinate names in the exodus file.
get_coords¶
Source: GitHub
def sdynpy.Exodus.get_coords(self)Retrieve the coordinates of the nodes in the exodus file.
Returns¶
coords : np.array Returns a 2D array with size num_dims x num_nodes
get_displacements¶
Source: GitHub
def sdynpy.Exodus.get_displacements(self, displacement_name='Disp', capital_coordinates=True)get_elem_attr¶
Source: GitHub
def sdynpy.Exodus.get_elem_attr(self, id)Gets the element attributes for a given block
Parameters¶
id : int The block id for which the element connectivity matrix is desired.
Returns¶
attributes : np.masked_array The 2d attribute matrix for the block with dimensions num_elem x num_attributes
get_elem_blk_ids¶
Source: GitHub
def sdynpy.Exodus.get_elem_blk_ids(self)Gets a list of the element block ID numbers in the exodus file
Returns¶
block_ids : tuple A tuple containing the block ID numbers
get_elem_blk_info¶
Source: GitHub
def sdynpy.Exodus.get_elem_blk_info(self, id)Gets the element block information for the specified element block ID
Parameters¶
id : int Element Block ID number
Returns¶
element_type : str Name of the Element Type
elements_in_block : int Number of elements in the block
nodes_per_element : int Number of nodes per element in the block
attributes_per_element : int Number of attributes per element
get_elem_connectivity¶
Source: GitHub
def sdynpy.Exodus.get_elem_connectivity(self, id)Gets the element connectivity matrix for a given block
Parameters¶
id : int The block id for which the element connectivity matrix is desired.
Returns¶
connectivity : np.masked_array The 2d connectivity matrix for the block with dimensions num_elem x num_nodes_per_element. The returned value is converted from the 1-based Exodus indexing to 0-based Python/NumPy indexing.
get_elem_num_map¶
Source: GitHub
def sdynpy.Exodus.get_elem_num_map(self)Retrieve the list of local element IDs from the exodus file.
Returns¶
elem_num_map : np.array Returns a 1D array with size num_elems, denoting the element number for the element in each index
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¶
Source: GitHub
def sdynpy.Exodus.get_elem_type(self, id)Gets the element type for a given block
Parameters¶
id : int The block id for which the element connectivity matrix is desired.
Returns¶
type : str The element type of the block
get_elem_variable_names¶
Source: GitHub
def sdynpy.Exodus.get_elem_variable_names(self)Gets a tuple of element variable names from the exodus file
Returns¶
elem_var_names : tuple of strings Returns a tuple containing the names of the element variables in the exodus file.
get_elem_variable_table¶
Source: GitHub
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¶
elem_var_table : np.masked_array A 2D array with dimension num_blocks x num_element_variables. If the jth element variable is defined for the ith block, elem_var_table[i,j] == True
get_elem_variable_value¶
Source: GitHub
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¶
block_id : int Block id number for the block from which element variable value is desired.
name_or_index : str or int Name or Index of the element variable that is desired. If type(name_or_index) == str, then it is assumed to be the name. If type(name_or_index) == int, then it is assumed to be the index.
element_index : int element index at which to recover the nodal variable
step : int Time step at which to recover the nodal variable
Returns¶
elem_variable_value : float The variable values for the specified element at the specified time step.
get_elem_variable_values¶
Source: GitHub
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¶
block_id : int Block id number for the block from which element variable values are desired.
name_or_index : str or int Name or Index of the element variable that is desired. If type(name_or_index) == str, then it is assumed to be the name. If type(name_or_index) == int, then it is assumed to be the index.
step : int Time step at which to recover the element variable
Returns¶
elem_variable_values : maskedarray A 1d array consisting of the variable values for each element in the specified block at the specified time step.
get_element_property_names¶
Source: GitHub
def sdynpy.Exodus.get_element_property_names(self)get_element_property_value¶
Source: GitHub
def sdynpy.Exodus.get_element_property_value(self)get_global_variable_names¶
Source: GitHub
def sdynpy.Exodus.get_global_variable_names(self)Gets a tuple of global variable names from the exodus file
Returns¶
global_var_names : tuple of strings Returns a tuple containing the names of the global variables in the exodus file.
get_global_variable_values¶
Source: GitHub
def sdynpy.Exodus.get_global_variable_values(self, name_or_index, step=None)Gets the global variable value for the specified timesteps
Parameters¶
name_or_index : str or int Name or Index of the global variable that is desired. If type(name_or_index) == str, then it is assumed to be the name. If type(name_or_index) == int, then it is assumed to be the index.
step : int Time step at which to recover the nodal variable
Returns¶
global_variable_values : maskedarray or float A 1d array or floating point number consisting of the variable values at the specified time steps.
get_info_records¶
Source: GitHub
def sdynpy.Exodus.get_info_records(self)Get the information records in the exodus file
Returns¶
info_records : tuple Returns a tuple of strings where the index is the record number.
get_node_num_map¶
Source: GitHub
def sdynpy.Exodus.get_node_num_map(self)Retrieve the list of local node IDs from the exodus file.
Returns¶
node_num_map : np.array Returns a 1D array with size num_nodes, denoting the node number for the node in each index
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¶
Source: GitHub
def sdynpy.Exodus.get_node_set_dist_factors(self, id)Get the distribution factors of the specified node set
Parameters¶
id : int Node set ID (not index)
Returns¶
dist_factor : np.array The distribution factors in the node set
get_node_set_ids¶
Source: GitHub
def sdynpy.Exodus.get_node_set_ids(self)Gets a list of the node set ID numbers in the exodus file
Returns¶
ns_ids : tuple A tuple containing the node set ID numbers
get_node_set_names¶
Source: GitHub
def sdynpy.Exodus.get_node_set_names(self)Retrieve the node set names in the exodus file.
Returns¶
ns_names : tuple Returns a tuple of strings containing the node set names in the exodus file.
get_node_set_nodes¶
Source: GitHub
def sdynpy.Exodus.get_node_set_nodes(self, id)Get the nodes in the specified node set
Parameters¶
id : int Node set ID (not index)
Returns¶
nodes : np.array The node indices of nodes in the node set. Note that while the Exodus file format uses 1-based indexing, the returned nodes array is converted so it is 0-based.
get_node_set_num_nodes¶
Source: GitHub
def sdynpy.Exodus.get_node_set_num_nodes(self, id)Get the number of nodes in the specified node set
Parameters¶
id : int Node set ID (not index)
Returns¶
num_nodes : int The number of nodes in the node set.
get_node_variable_names¶
Source: GitHub
def sdynpy.Exodus.get_node_variable_names(self)Gets a tuple of nodal variable names from the exodus file
Returns¶
node_var_names : tuple of strings Returns a tuple containing the names of the nodal variables in the exodus file.
get_node_variable_value¶
Source: GitHub
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¶
name_or_index : str or int Name or Index of the nodal variable that is desired. If type(name_or_index) == str, then it is assumed to be the name. If type(name_or_index) == int, then it is assumed to be the index.
node_index : int Node index at which to recover the nodal variable
step : int Time step at which to recover the nodal variable
Returns¶
node_variable_value : float The variable values for the specified node at the specified time step.
get_node_variable_values¶
Source: GitHub
def sdynpy.Exodus.get_node_variable_values(self, name_or_index, step=None)Gets the node variable values for the specified timestep
Parameters¶
name_or_index : str or int Name or Index of the nodal variable that is desired. If type(name_or_index) == str, then it is assumed to be the name. If type(name_or_index) == int, then it is assumed to be the index.
step : int Time step at which to recover the nodal variable
Returns¶
node_variable_values : maskedarray A 1d array consisting of the variable values for each node at the specified time step.
get_qa_records¶
Source: GitHub
def sdynpy.Exodus.get_qa_records(self)Get the quality assurance records in the exodus file
Returns¶
qa_records : tuple Returns a nested tuple of strings where the first index is the record number, and the second is the line in the record.
get_side_set_dist_factors¶
Source: GitHub
def sdynpy.Exodus.get_side_set_dist_factors(self, id)Get the distribution factors of the specified side set
Parameters¶
id : int Side set ID (not index)
Returns¶
dist_factor : np.array The distribution factors in the node set
get_side_set_faces¶
Source: GitHub
def sdynpy.Exodus.get_side_set_faces(self, id)Get the faces in the specified side set
Parameters¶
id : int Side set ID (not index)
Returns¶
elements : np.array The element of each face in the sideset (converted from 1-based exodus indexing to 0-based python indexing)
sides : np.array The element side of each face in the sideset (converted from 1-based exodus indexing to 0-based python indexing)
get_side_set_ids¶
Source: GitHub
def sdynpy.Exodus.get_side_set_ids(self)Gets a list of the side set ID numbers in the exodus file
Returns¶
ss_ids : tuple A tuple containing the side set ID numbers
get_side_set_names¶
Source: GitHub
def sdynpy.Exodus.get_side_set_names(self)Retrieve the side set names in the exouds file.
Returns¶
ss_names : tuple Returns a tuple of strings containing the side set names in the exodus file
get_side_set_node_list¶
Source: GitHub
def sdynpy.Exodus.get_side_set_node_list(self, id)get_side_set_num_faces¶
Source: GitHub
def sdynpy.Exodus.get_side_set_num_faces(self, id)Get the number of faces in the specified side set
Parameters¶
id : int Side set ID (not index)
Returns¶
num_faces : int The number of faces in the side set.
get_times¶
Source: GitHub
def sdynpy.Exodus.get_times(self, indices=None)Gets the time values from the exodus file
Returns¶
time_array : np.masked_array A masked_array containing the time values.
load_into_memory¶
Source: GitHub
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¶
close : bool Close the netcdf file upon loading into memory. Optional argument, default is true.
variables : iterable A list of variable names that are loaded into memory. Default is to load all variables
timesteps : iterable A list of timestep indices that are loaded into memory. Default is to load all timesteps.
blocks : iterable A list of block ids that are loaded into memory. Default is to load all blocks.
Returns¶
fexo : ExodusInMemory The exodus file in an ExodusInMemory format
num_attr¶
Source: GitHub
def sdynpy.Exodus.num_attr(self, id)Gets the number of attributes per element for an element block
Parameters¶
d : int The block id for which the number of attributes is desired
Returns¶
attr_per_element : int The number of attributes per element in a block
num_elems_in_blk¶
Source: GitHub
def sdynpy.Exodus.num_elems_in_blk(self, id)Gets the number of elements in an element block
Parameters¶
d : int The block id for which the number of attributes is desired
Returns¶
elem_per_element : int The number of elements in the block
num_nodes_per_elem¶
Source: GitHub
def sdynpy.Exodus.num_nodes_per_elem(self, id)Gets the number of nodes per element in an element block
Parameters¶
d : int The block id for which the number of attributes is desired
Returns¶
nodes_per_elem : int The number of nodes per element in the block
put_coord_names¶
Source: GitHub
def sdynpy.Exodus.put_coord_names(self, coord_names)Puts the coordinate names into the exodus file
Parameters¶
coord_names : sequence of strings A sequence (list/tuple/etc.) containing the coordinate names.
put_coords¶
Source: GitHub
def sdynpy.Exodus.put_coords(self, coords)Puts the coordinate values into the exodus file
Parameters¶
coords : np.ndarray A 2d array containing coordinate values.
put_elem_blk_ids¶
Source: GitHub
def sdynpy.Exodus.put_elem_blk_ids(self, block_ids)Puts a list of the element block ID numbers in the exodus file
Parameters¶
block_ids : array-like A sequency of integers specifying the block id numbers
put_elem_blk_info¶
Source: GitHub
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¶
id : int The block ID (not index) that the information is being specified for
elem_type : str The element type (‘SHELL4’,‘HEX8’, etc.) in the block
num_elements : int The number of elements in the block
num_nodes_per_element : int The number of nodes per element in the block
num_attrs_per_element : int The number of attributes per element in the block
put_elem_num_map¶
Source: GitHub
def sdynpy.Exodus.put_elem_num_map(self, elem_num_map)Puts a list of local element IDs into the exodus file.
Parameters¶
elem_num_map : np.array A 1D array with size num_elems, denoting the element number for the element in each index
put_elem_variable_names¶
Source: GitHub
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¶
elem_var_names : tuple of strings A tuple containing the names of the element variables in the exodus file
elem_var_table : 2d array-like A 2d array of shape num_el_blk x num_elem_var defining which element variables are defined for which element blocks elem_var_table[i,j] should be True if the j-th element variable is defined for the i-th block (index, not id number) in the model. If not specified, it is assumed that all variables are defined for all blocks.
put_element_property_names¶
Source: GitHub
def sdynpy.Exodus.put_element_property_names(self)put_element_property_value¶
Source: GitHub
def sdynpy.Exodus.put_element_property_value(self)put_global_variable_names¶
Source: GitHub
def sdynpy.Exodus.put_global_variable_names(self, global_var_names)Puts the specified global variable names in the exodus file
Parameters¶
global_var_names : tuple of strings A tuple containing the names of the global variables in the model
put_info_records¶
Source: GitHub
def sdynpy.Exodus.put_info_records(self, records)Puts the information records in the exodus file
Parameters¶
info_records : sequence of strings A sequence (list/tuple/etc.) containing the information records.
put_node_num_map¶
Source: GitHub
def sdynpy.Exodus.put_node_num_map(self, node_num_map)Puts a list of local node IDs into the exodus file.
Parameters¶
node_num_map : np.array A 1D array with size num_nodes, denoting the node number for the node in each index
put_node_set_ids¶
Source: GitHub
def sdynpy.Exodus.put_node_set_ids(self, ns_ids)Puts a list of the node set ID numbers in the exodus file
Parameters¶
ns_ids : array-like A sequency of integers specifying the node set id numbers
put_node_set_info¶
Source: GitHub
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¶
id : int The node set ID (not index)
nodes : array-like A 1d array containing the node indices. Note the array should be zero-based, it will be converted to one based when written to the exodus file.
dist_fact : array-like A 1d array containing the node set distribution factors. If not specified, the distribution factors will be assumed to be 1.
put_node_set_names¶
Source: GitHub
def sdynpy.Exodus.put_node_set_names(self, ns_names)Puts the node set names into the exodus file
Parameters¶
ns_names : sequence of strings A sequence (list/tuple/etc.) containing the node set names.
put_node_variable_names¶
Source: GitHub
def sdynpy.Exodus.put_node_variable_names(self, node_var_names)Puts the specified variable names in the exodus file
Parameters¶
node_var_names : tuple of strings A tuple containing the names of the nodal variables in the model
put_qa_records¶
Source: GitHub
def sdynpy.Exodus.put_qa_records(self, records)Puts the quality assurance records in the exodus file
Parameters¶
qa_records : sequence of sequence of strings A nested sequence (list/tuple/etc.) containing the quality assurance records.
Notes¶
Each index in qa_records should consist of a length-4 tuple of strings:
Analysis Code Name
Analysis Code Version
Analysis Date
Analysis Time
put_side_set_ids¶
Source: GitHub
def sdynpy.Exodus.put_side_set_ids(self, ss_ids)Puts a list of the side set ID numbers in the exodus file
Parameters¶
ss_ids : array-like A sequency of integers specifying the side set id numbers
put_side_set_info¶
Source: GitHub
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¶
id : int The side set ID (not index)
elements : np.array The element of each face in the sideset (converted from 1-based exodus indexing to 0-based python indexing)
sides : np.array The element side of each face in the sideset (converted from 1-based exodus indexing to 0-based python indexing)
dist_fact : array-like A 1d array containing the node set distribution factors. If not specified, the distribution factors will be assumed to be 1.
put_side_set_names¶
Source: GitHub
def sdynpy.Exodus.put_side_set_names(self, ss_names)Puts the side set names into the exodus file
Parameters¶
ss_names : sequence of strings A sequence (list/tuple/etc.) containing the side set names.
reduce_to_surfaces¶
Source: GitHub
def sdynpy.Exodus.reduce_to_surfaces(self, *args, **kwargs)set_elem_attr¶
Source: GitHub
def sdynpy.Exodus.set_elem_attr(self, id, attributes)Sets the element attributes for a given block
Parameters¶
id : int The block id for which the element connectivity matrix is desired.
attributes : 2D array-like The 2d attribute matrix for the block with dimensions num_elem x num_attributes
set_elem_connectivity¶
Source: GitHub
def sdynpy.Exodus.set_elem_connectivity(self, id, connectivity)Sets the element connectivity matrix for a given block
Parameters¶
id : int The block id for which the element connectivity is being assigned
connectivity : 2D array-like A 2D array of dimension num_elements x num_nodes_per_element defining the element connectivity. Note that the connectivity matrix should be 0-based (first node index is zero) per Python conventions. It will be converted to one-based when it is written to the Exodus file.
set_elem_variable_value¶
Source: GitHub
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¶
block_id : int Block id number for the block from which element variable values are desired.
name_or_index : str or int Name or Index of the element variable that is desired. If type(name_or_index) == str, then it is assumed to be the name. If type(name_or_index) == int, then it is assumed to be the index.
step : int Time step at which to recover the element variable
value : float The variable values for the specified element in the specified block at the specified time step.
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¶
Source: GitHub
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¶
block_id : int Block id number for the block from which element variable values are desired.
name_or_index : str or int Name or Index of the element variable that is desired. If type(name_or_index) == str, then it is assumed to be the name. If type(name_or_index) == int, then it is assumed to be the index.
step : int Time step at which to recover the element variable
values : array-like A 1d array consisting of the variable values for each element in the specified block at the specified time step.
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¶
Source: GitHub
def sdynpy.Exodus.set_global_variable_values(self, name_or_index, step, value)Sets the global variable values for the specified timestep
Parameters¶
name_or_index : str or int Name or Index of the nodal variable that is desired. If type(name_or_index) == str, then it is assumed to be the name. If type(name_or_index) == int, then it is assumed to be the index.
step : int Time step at which to recover the nodal variable
value : array-like A 1d array consisting of the variable values for each node at the specified time step.
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¶
Source: GitHub
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¶
name_or_index : str or int Name or Index of the nodal variable that is desired. If type(name_or_index) == str, then it is assumed to be the name. If type(name_or_index) == int, then it is assumed to be the index.
node_index : int Node index at which to recover the nodal variable
step : int Time step at which to recover the nodal variable
value : float The variable value for the specified node at the specified time step.
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¶
Source: GitHub
def sdynpy.Exodus.set_node_variable_values(self, name_or_index, step, values)Sets the node variable values for the specified timestep
Parameters¶
name_or_index : str or int Name or Index of the nodal variable that is desired. If type(name_or_index) == str, then it is assumed to be the name. If type(name_or_index) == int, then it is assumed to be the index.
step : int Time step at which to recover the nodal variable
values : array-like A 1d array consisting of the variable values for each node at the specified time step.
Notes¶
If step is not a valid index for the time vector, the time vector will be expanded so that it is.
set_time¶
Source: GitHub
def sdynpy.Exodus.set_time(self, step, value)Sets the time value of a given step in the exodus file
Parameters¶
step : int The index in the time vector to set to value
value : float A real number to set the value of the specified index in the time vector to.
Notes¶
If step is not a valid index for the time vector, the time vector will be expanded so that it is.
set_times¶
Source: GitHub
def sdynpy.Exodus.set_times(self, values)Sets the time vector for the exodus file
Parameters¶
values : array-like A 1-dimensional array that has the time step values as it’s entries
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¶
Source: GitHub
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¶
None
Returns¶
triangulated_mesh_info : list A list of tuples containing block id, node_indices, triangulated connectivity, and original block elements