exodus module#
exodus.py v 1.21.3 (seacas-py3) is a python wrapper of some of the exodus library (Python 3 Version)
Exodus is a common database for multiple application codes (mesh generators, analysis codes, visualization software, etc.) affording flexibility and robustness for both the application code developer and application code user. By using the Exodus data model, a user inherits the flexibility of using a large array of application codes (including vendor-supplied codes) which access this common data file directly or via translators.
The uses of the Exodus data model include the following:
problem definition – mesh generation, specification of locations of boundary conditions and load application, specification of material types.
simulation – model input and results output.
visualization – model verification, results postprocessing, data interrogation, and analysis tracking.
The data in Exodus files can be divided into three primary categories: * initialization data, * model data, and * results data.
Initialization data includes sizing parameters (number of nodes, number of elements, etc.), optional quality assurance information (names of codes that have operated on the data), and optional informational text.
The model is described by data which are static (do not change through time). This data includes nodal coordinates, element connectivity (node lists for each element), element attributes, and node sets and side sets (used to aid in applying loading conditions and boundary constraints).
The results are optional and include five types of variables – nodal, element, nodeset, sideset, and global – each of which is stored through time.
Nodal results are output (at each time step) for all the nodes in the model. An example of a nodal variable is displacement in the X direction.
Element, nodeset, and sideset results are output (at each time step) for all entities (elements, nodes, sides) in one or more entity block. For example, stress may be an element variable.
Another use of element variables is to record element status (a binary flag indicating whether each element is “alive” or “dead”) through time.
Global results are output (at each time step) for a single element or node, or for a single property. Linear momentum of a structure and the acceleration at a particular point are both examples of global variables.
Although these examples correspond to typical FE applications, the data format is flexible enough to accommodate a spectrum of uses.
Copyright(C) 1999-2023 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software.
See packages/seacas/LICENSE for details
- exodus.add_variables(exo, global_vars=None, nodal_vars=None, element_vars=None, node_set_vars=None, side_set_vars=None)[source]#
This function adds variables to the exodus object. The values of the variables are set to their defaults so that the user can populate them later.
- Parameters:
exo (exodus database object) – Exodus database that variables will be added to.
global_vars (list) – global variable names to add.
nodal_vars (list) – nodal variable names to add.
element_vars (list) – list of element variable names to add to all blocks or tuples ( name, blkIds ) where name is the element variable to add and blkIds is a list of blkIds to add it to.
node_set_vars (list) – list of node set variable names to add to all sets or tuples ( name, setIds ) where name is the node set variable to add and setIds is a list of setIds to add it to.
side_set_vars (list) – list of side set variable names to add to all sets or tuples ( name, setIds ) where name is the side set variable to add and setIds is a list of setIds to add it to.
- Returns:
exo – Exodus database with variables added to it. (The values of the variables are set to their defaults so that the user can populate them later.)
- Return type:
exodus database object
Note
This function does not allow one to add element attributes to an exodus database. See
exodus.copy_mesh()
function for that capability.
- exodus.collectElemConnectivity(exodusHandle, connectivity)[source]#
This function generates a list of lists that represent the element connectivity.
>>> with exodus("file.g", "r") as exodusHandle: >>> connectivity = [] >>> collectElemConnectivity(exodusHandle, connectivity)
- exodus.collectLocalElemToLocalElems(exodusHandle, connectivity, localNodeToLocalElems, localElemToLocalElems)[source]#
This function generates a list of lists to go from local elem id to connected local elem ids.
>>> connectivity = [] ## If this is not empty it will assume it is already filled. >>> localNodeToLocalElems = [] ## If this is not empty it will assume it is already filled. >>> localElemToLocalElems = [] >>> with exodus("file.g", "r") as exodusHandle: >>> collectLocalElemToLocalElems(exodusHandle, connectivity, localNodeToLocalElems, ... localElemToLocalElems)
- exodus.collectLocalNodeToLocalElems(exodusHandle, connectivity, localNodeToLocalElems)[source]#
This function generates a list of lists to go from local node id to local elem id.
>>> connectivity = [] ## If this is not empty it will assume it is already filled. >>> localNodeToLocalElems = [] >>> with exodus("file.g", "r") as exodusHandle: >>> collectLocalNodeToLocalElems(exodusHandle, connectivity, localNodeToLocalElems)
- exodus.copyTransfer(fromFileName, toFileName, array_type='ctype', additionalGlobalVariables=None, additionalNodalVariables=None, additionalElementVariables=None, additionalNodeSetVariables=None, additionalSideSetVariables=None, additionalElementAttributes=None)[source]#
This function creates an exodus file toFileName and copies everything from exodus file fromFileName returning a file handle to toFileName.
Additional space is allocated for additionalGlobalVariables, additionalNodalVariables and additionalElementVariables if specified.
- Parameters:
fromFileName (string) – File name of the exodus mesh to be copied
toFileName (string) – File name of the new exodus mesh
array_type ('ctype' | 'numpy') – Specifies whether arrays will be imported and copied as ctype or numpy arrays. (This option should make no difference to the user, but it can be used by developers to test whether the commands within this function handle both array types correctly.)
additionalGlobalVariables (list) – list of global variable names to add.
additionalNodalVariables (list) – list of nodal variable names to add.
additionalElementVariables (list) – should be a list of element variable names to add to all blocks or tuples (name, blkIds) where name is the element variable to add and blkIds is a list of blkIds to add it to.
additionalElementAttributes (list) – list of element attribute names to add to all blocks or tuples ( name, blkIds ) where name is the element attribute to add and blkIds is a list of blkIds to add it to.
>>> fromFileName = "input.e" >>> toFileName = "output.e" >>> addGlobalVariables = [] ## Do not add any new global variables >>> ## Add node_dummy1 and node_dummy2 as new node variables >>> addNodeVariables = ["node_dummy1", "node_dummy2"] >>> ## Add elem_dummy1 on blkIds 1, 2, 3 and elem_dummy2 on all blocks >>> addElementVariables = [ ("elem_dummy1", [1, 2, 3]), "elem_dummy2" ] >>> ## Add elem_attr_dummy1 on blkIds 1,2,3 and elem_attr_dummy2 on all blocks >>> addElementAttributes = [ ("elem_attr_dummy1",[1,2,3]), "elem_attr_dummy2" ] >>> >>> toFileHandle = copyTransfer(fromFileName,toFileName,addGlobalVariables,addNodeVariables, ... addElementVariables,addElementAttributes) ... >>> ## Fill in new variables ... >>> toFileHandle.close()
- exodus.copy_mesh(fromFileName, toFileName, exoFromObj=None, additionalElementAttributes=None, array_type='ctype')[source]#
Copies the mesh data from an existing exodus database to a new exodus database.
- Parameters:
fromFileName (string) – File name of the exodus mesh to be copied
toFileName (string) – File name of the new exodus mesh
exoFromObj (exodus object, optional) – Exodus object to be copied from. If an exodus object is supplied, the fromFileName string will be ignored.
additionalElementAttributes (list) – list of element attribute names to add to all blocks or tuples ( name, blkIds ) where name is the element attribute to add and blkIds is a list of blkIds to add it to.
array_type ('ctype' | 'numpy') – Specifies whether arrays will be imported and copied as ctype or numpy arrays. (This option should make no difference to the user, but it can be used by developers to test whether the commands within this function handle both array types correctly.)
- Returns:
exo_to – New exodus mesh
- Return type:
exodus object
Note
This function also allows one to add new element attributes during the copy process. The number of element attributes is permanently set when the block is created, meaning new element attributes can only be added to an existing mesh by copying it to a new mesh. The values of the element attributes are set to their defaults so that the user can populate them later.
- exodus.ctype_to_numpy(exo, c_array)[source]#
Converts a c-type array into a numpy array
- Parameters:
exo (exodus object) – exodus database object initialized with the option array_type = ‘numpy’
c_array (c-type array) – c-type array to be converted into a numpy array
- Returns:
np_array – Numpy array converted from c-type array
- Return type:
numpy array
- class exodus.ex_assembly[source]#
Bases:
Structure
Structure defining the assembly parameters.
- id#
- Type:
int64_t
- name#
- Type:
char *
- type#
- Type:
- entity_count#
- Type:
int
- entity_list#
- Type:
void_int *
- entity_count#
Structure/Union member
- entity_list#
Structure/Union member
- id#
Structure/Union member
- name#
Structure/Union member
- type#
Structure/Union member
- class exodus.ex_attribute[source]#
Bases:
Structure
Used for accessing underlying exodus library…
- entity_type#
- Type:
- entity_id#
- Type:
int64_t
- name#
- Type:
char[257]
- value_count#
- Type:
int
- values#
- Type:
void*
- entity_id#
Structure/Union member
- entity_type#
Structure/Union member
- name#
Structure/Union member
- type#
Structure/Union member
- value_count#
Structure/Union member
- values#
Structure/Union member
- class exodus.ex_blob[source]#
Bases:
Structure
Structure defining the blob parameters.
- id#
- Type:
int64_t
- name#
- Type:
char *
- num_entry#
- Type:
int64_t
- id#
Structure/Union member
- name#
Structure/Union member
- num_entry#
Structure/Union member
- class exodus.ex_entity_type(value)[source]#
Bases:
Enum
The ex_entity_type enum from the exodusII.h include file
- EX_NODAL#
nodal “block” for variables
- EX_NODE_BLOCK#
alias for EX_NODAL
- EX_NODE_SET#
node set property code
- EX_EDGE_BLOCK#
edge block property code
- EX_EDGE_SET#
edge set property code
- EX_FACE_BLOCK#
face block property code
- EX_FACE_SET#
face set property code
- EX_ELEM_BLOCK#
element block property code
- EX_ELEM_SET#
face set property code
- EX_SIDE_SET#
side set property code
- EX_ELEM_MAP#
element map property code
- EX_NODE_MAP#
node map property code
- EX_EDGE_MAP#
edge map property code
- EX_FACE_MAP#
face map property code
- EX_GLOBAL#
global “block” for variables
- EX_COORDINATE#
kluge so some internal wrapper functions work
- EX_ASSEMBLY#
assemblies (collections of other entities)
- EX_BLOB#
blob (arbitrary sized binary object)
- EX_INVALID#
invalid
- EX_ASSEMBLY = 16#
- EX_BLOB = 17#
- EX_COORDINATE = 15#
- EX_EDGE_BLOCK = 6#
- EX_EDGE_MAP = 11#
- EX_EDGE_SET = 7#
- EX_ELEM_BLOCK = 1#
- EX_ELEM_MAP = 4#
- EX_ELEM_SET = 10#
- EX_FACE_BLOCK = 8#
- EX_FACE_MAP = 12#
- EX_FACE_SET = 9#
- EX_GLOBAL = 13#
- EX_INVALID = -1#
- EX_NODAL = 14#
- EX_NODE_BLOCK = 14#
- EX_NODE_MAP = 5#
- EX_NODE_SET = 2#
- EX_SIDE_SET = 3#
- class exodus.ex_init_params[source]#
Bases:
Structure
Parameters defining the model dimension, note that many are optional.
- num_dim#
number of model dimensions
- Type:
int
- num_nodes#
number of model nodes
- Type:
int
- num_edge#
number of model edges
- Type:
int
- num_edge_blk#
number of model edge blocks
- Type:
int
- num_face#
number of model faces
- Type:
int
- num_face_blk#
number of model face blocks
- Type:
int
- num_elem#
number of model elements
- Type:
int
- num_elem_blk#
number of model element blocks
- Type:
int
- num_node_sets#
number of model node sets
- Type:
int
- num_edge_sets#
number of model edge sets
- Type:
int
- num_face_sets#
number of model face sets
- Type:
int
- num_side_sets#
number of model side sets
- Type:
int
- num_elem_sets#
number of model elem sets
- Type:
int
- num_node_maps#
number of model node maps
- Type:
int
- num_edge_maps#
number of model edge maps
- Type:
int
- num_face_maps#
number of model face maps
- Type:
int
- num_elem_maps#
number of model elem maps
- Type:
int
- num_assembly#
number of assemblies
- Type:
int
- num_blob#
number of blobs
- Type:
int
- num_assembly#
Structure/Union member
- num_blob#
Structure/Union member
- num_dim#
Structure/Union member
- num_edge#
Structure/Union member
- num_edge_blk#
Structure/Union member
- num_edge_maps#
Structure/Union member
- num_edge_sets#
Structure/Union member
- num_elem#
Structure/Union member
- num_elem_blk#
Structure/Union member
- num_elem_maps#
Structure/Union member
- num_elem_sets#
Structure/Union member
- num_face#
Structure/Union member
- num_face_blk#
Structure/Union member
- num_face_maps#
Structure/Union member
- num_face_sets#
Structure/Union member
- num_node_maps#
Structure/Union member
- num_node_sets#
Structure/Union member
- num_nodes#
Structure/Union member
- num_side_sets#
Structure/Union member
- title#
Structure/Union member
- class exodus.ex_inquiry(value)[source]#
Bases:
Enum
An enumeration.
- EX_INQ_API_VERS = 2#
- EX_INQ_ASSEMBLY = 60#
- EX_INQ_BLOB = 61#
- EX_INQ_COORD_FRAMES = 47#
- EX_INQ_DB_FLOAT_SIZE = 51#
- EX_INQ_DB_MAX_ALLOWED_NAME_LENGTH = 48#
- EX_INQ_DB_MAX_USED_NAME_LENGTH = 49#
- EX_INQ_DB_VERS = 3#
- EX_INQ_DIM = 5#
- EX_INQ_EB_PROP = 17#
- EX_INQ_EDGE = 27#
- EX_INQ_EDGE_BLK = 28#
- EX_INQ_EDGE_MAP = 45#
- EX_INQ_EDGE_PROP = 32#
- EX_INQ_EDGE_SETS = 29#
- EX_INQ_ELEM = 7#
- EX_INQ_ELEM_BLK = 8#
- EX_INQ_ELEM_MAP = 25#
- EX_INQ_ELEM_SETS = 41#
- EX_INQ_ELS_DF_LEN = 43#
- EX_INQ_ELS_LEN = 42#
- EX_INQ_ELS_PROP = 44#
- EX_INQ_EM_PROP = 23#
- EX_INQ_ES_DF_LEN = 31#
- EX_INQ_ES_LEN = 30#
- EX_INQ_ES_PROP = 33#
- EX_INQ_FACE = 34#
- EX_INQ_FACE_BLK = 35#
- EX_INQ_FACE_MAP = 46#
- EX_INQ_FACE_PROP = 39#
- EX_INQ_FACE_SETS = 36#
- EX_INQ_FILE_TYPE = 1#
- EX_INQ_FS_DF_LEN = 38#
- EX_INQ_FS_LEN = 37#
- EX_INQ_FS_PROP = 40#
- EX_INQ_INFO = 15#
- EX_INQ_INVALID = -1#
- EX_INQ_LIB_VERS = 22#
- EX_INQ_MAX_READ_NAME_LENGTH = 50#
- EX_INQ_NM_PROP = 24#
- EX_INQ_NODES = 6#
- EX_INQ_NODE_MAP = 26#
- EX_INQ_NODE_SETS = 9#
- EX_INQ_NS_DF_LEN = 20#
- EX_INQ_NS_NODE_LEN = 10#
- EX_INQ_NS_PROP = 18#
- EX_INQ_QA = 14#
- EX_INQ_SIDE_SETS = 11#
- EX_INQ_SS_DF_LEN = 21#
- EX_INQ_SS_ELEM_LEN = 13#
- EX_INQ_SS_NODE_LEN = 12#
- EX_INQ_SS_PROP = 19#
- EX_INQ_TIME = 16#
- EX_INQ_TITLE = 4#
- exodus.ex_obj_to_inq(objType)[source]#
Return the ex_inquiry string corresponding to the specified objType. This can be passed to the ex_inquiry_map() function to get the number of objects of the specified objType
- class exodus.ex_options(value)[source]#
Bases:
Enum
ex_opts() function codes - codes are OR’ed into exopts
- EX_DEFAULT#
Application responsible for calling ex_err() to get error and warning messages to output; library is quiet
- EX_VERBOSE#
Verbose mode – output all error and warning messages
- EX_DEBUG#
Output Debug messages
- EX_ABORT#
If an error is detected, library will abort instead of letting application decide
- EX_NULLVERBOSE#
Output error and warning messages for NULL Entity errors and warnings
- EX_ABORT = 4#
- EX_DEBUG = 2#
- EX_DEFAULT = 0#
- EX_NULLVERBOSE = 8#
- EX_VERBOSE = 1#
- class exodus.ex_type(value)[source]#
Bases:
Enum
An enumeration.
- EX_CHAR = 2#
- EX_DOUBLE = 6#
- EX_INTEGER = 4#
- EX_INVALID = -1#
- class exodus.exodus(file, mode=None, array_type='ctype', title=None, numDims=None, numNodes=None, numElems=None, numBlocks=None, numNodeSets=None, numSideSets=None, numAssembly=None, numBlob=None, init_params=None, io_size=0)[source]#
Bases:
object
The exodus model abstraction
- close()[source]#
close the exodus file
>>> exo.close()
Note
Can only be called once for an exodus object, and once called all methods for that object become inoperable
- copy(fileName, include_transient=False, mode='a')[source]#
Copies exodus database to file_name and returns an opened copy as a new exodus object. This object will need to be closed when it is done being used.
>>> exo_copy = exo.copy(file_name) >>> exo_copy.close()
- Parameters:
file_name (str) – name of exodus file to open
- Returns:
exo_copy
- Return type:
exodus object opened in append mode by default
- copy_file(file_id, include_transient=False)[source]#
Copies exodus database to the database pointed to by fileId Returns the passed in file_id.
>>> with exodus.exodus(file_name, mode='w') as exofile: >>> with exo.copy_file(exofile.fileId, include_transient=True) as exo_copy: >>> exo_copy.close()
- Parameters:
fileId (str) – name of exodus file to open
include_transient (bool) – should the transient data in the original file also be copied to the output file or just the mesh (non-transient) portion.
- Returns:
file_id
- Return type:
The file_id of the copied to file
- elem_blk_info(object_id)[source]#
get the element block info
>>> elem_type, num_blk_elems, num_elem_nodes, num_elem_attrs ... = exo.elem_blk_info(elem_blk_id)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
- Returns:
elem_type (string) – element type, e.g. ‘HEX8’
num_blk_elems (int) – number of elements in the block
num_elem_nodes (int) – number of nodes per element
num_elem_attrs (int) – number of attributes per element
- elem_type(object_id)[source]#
get the element type, e.g. “HEX8”, for an element block
>>> elem_type = exo.elem_type(elem_blk_id)
- Parameters:
object_id (ex_entity_id) – element block ID (not INDEX)
- Returns:
elem_type
- Return type:
string
- get_all_global_variable_values(step)[source]#
get all global variable values (one for each global variable name, and in the order given by exo.get_global_variable_names()) at a specified time step
>>> gvar_vals = exo.get_all_global_variable_values(time_step)
- Parameters:
step (int) – 1-based index of time step
- Returns:
if array_type == ‘ctype’ – <list<double>> gvar_vals
if array_type == ‘numpy’ – <np_array<double>> gvar_vals
- get_all_node_set_params()[source]#
get total number of nodes and distribution factors (e.g. nodal ‘weights’) combined among all node sets
>>> tot_num_ns_nodes, ... tot_num_ns_dist_facts = exo.get_all_node_set_params()
- Returns:
tot_num_ns_nodes (int)
tot_num_ns_dist_facts (int)
- get_all_side_set_params()[source]#
get total number of sides, nodes, and distribution factors (e.g. nodal ‘weights’) combined among all side sets
>>> tot_num_ss_sides, tot_num_ss_nodes, tot_num_ss_dist_facts = ... exo.get_all_side_set_params()
- Returns:
tot_num_ss_sides (int)
tot_num_ss_nodes (int)
tot_num_ss_dist_facts (int)
Note
The number of nodes (and distribution factors) in a side set is the sum of all face nodes. A single node can be counted more than once, i.e. once for each face it belongs to in the side set.
- get_assemblies(object_ids)[source]#
reads the assembly parameters and assembly data for all assemblies with ids in object_ids
- get_attr_values(objType, elem_blk_id, elem_attr_name)[source]#
get an attribute for each element in a block
>>> elem_attrs = exo.get_elem_attr(elem_blk_id)
- Parameters:
objType (ex_entity_type) – type of object being queried
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
elem_attr_name (string) – element attribute name
- Returns:
if array_type == ‘ctype’ (<list<double>> values)
if array_type == ‘numpy’ (<np_array<double>> values) – array of values for the requested attribute. Array has dimensions of 1 x num_elem, where num_elem is the number of elements on the element block.
- get_attribute_count(objType, objId)[source]#
IS THIS NEEDED, PYTHONIC WAY MAY BE TO JUST GET THEM…
get the number of attributes on the specified entity
>>> num_attribute = exo.get_attribute_count('EX_ASSEMBLY', 100)
- Parameters:
objType (ex_entity_type) – type of object being queried
objId (int) – entity ID (not INDEX)
- Returns:
num_attribute
- Return type:
int
- get_attribute_names(objType, blkId)[source]#
get the list of attribute names for the specified block/set
>>> attr_names = exo.get_attribute_names('EX_ELEM_BLOCK', elem_blk_id)
- Parameters:
objType (ex_entity_type) – entity type
blkid (ex_entity_id) – block/set ID (not INDEX)
- Returns:
attr_names
- Return type:
list<string>
- get_attributes(objType, objId)[source]#
>>> attributes = exo.get_attributes('EX_ASSEMBLY', 100)
- Parameters:
objType (ex_entity_type) – type of object being queried
objId (int) – entity ID (not INDEX)
- Returns:
attributes
- Return type:
ex_attribute list
- get_block_id_map(obj_type, entity_id)[source]#
Gets the map of elements found in the given entity_id of an object of obj_type.
INDEX ordering, a 1-based system going from 1 to number of elements in the elem_block, used by exodus for storage and input/output of array data stored on the elements; a user or application can optionally use a separate element ID numbering system, so the elem_id_map points to the element ID for each element INDEX
>>> elem_block_id_map = exo.get_block_id_map("EX_ELEM_BLOCK", 100)
- Returns:
if array_type == ‘ctype’ – <list<int>> elem_id_map
if array_type == ‘numpy’ – <np_array<int>> elem_id_map
- get_coord(i)[source]#
get model coordinates of a single node
>>> x_coord, y_coord, z_coord = exo.get_coord(node_index)
- Parameters:
node_index (int) – the 1-based node index (indexing is from 1 to exo.num_nodes())
- Returns:
x_coord (double) – global x-direction coordinate
y_coord (double) – global y-direction coordinate
z_coord (double) – global z-direction coordinate
Note
>>> x_coords, y_coords, z_coords = exo.get_coords() >>> x_coord = x_coords[node_index-1] >>> y_coord = y_coords[node_index-1] >>> z_coord = z_coords[node_index-1] ... is equivalent to ... >>> x_coord, y_coord, z_coord = exo.get_coords(node_index)
- get_coord_names()[source]#
get a list of length exo.num_dimensions() that has the name of each model coordinate direction, e.g. [‘x’, ‘y’, ‘z’]
>>> coord_names = exo.get_coord_names()
- Returns:
coord_names
- Return type:
list<string>
- get_coords()[source]#
get model coordinates of all nodes; for each coordinate direction, a length exo.num_nodes() list is returned
>>> x_coords, y_coords, z_coords = exo.get_coords()
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> x_coords global x-direction coordinates <list<ctypes.c_double>> y_coords global y-direction coordinates <list<ctypes.c_double>> z_coords global z-direction coordinates
if array_type == ‘numpy’ – <np_array<double>> x_coords global x-direction coordinates <np_array<double>> y_coords global y-direction coordinates <np_array<double>> z_coords global z-direction coordinates
- get_elem_attr(elem_blk_id)[source]#
get all attributes for each element in a block
>>> elem_attrs = exo.get_elem_attr(elem_blk_id)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
- Returns:
if array_type == ‘ctype’ (<list<double>> elem_attrs)
if array_type == ‘numpy’ (<np_array<double>> elem_attrs) – list of attribute values for all elements in the block; the list cycles through all attributes of the first element, then all attributes of the second element, etc. Attributes are ordered by the ordering of the names returned by
exodus.get_attribute_names()
- get_elem_attr_values(elem_blk_id, elem_attr_name)[source]#
get an attribute for each element in a block
>>> elem_attrs = exo.get_elem_attr(elem_blk_id)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
elem_attr_name (string) – element attribute name
- Returns:
if array_type == ‘ctype’ (<list<double>> values)
if array_type == ‘numpy’ (<np_array<double>> values) – array of values for the requested attribute. Array has dimensions of 1 x num_elem, where num_elem is the number of elements on the element block.
- get_elem_blk_ids()[source]#
get mapping of exodus element block index to user- or application-defined element block id; elem_blk_ids is ordered by the element block INDEX ordering, a 1-based system going from 1 to exo.num_blks(), used by exodus for storage and input/output of array data stored on the element blocks; a user or application can optionally use a separate element block ID numbering system, so the elem_blk_ids array points to the element block ID for each element block INDEX
>>> elem_blk_ids = exo.get_elem_blk_ids()
- Returns:
if array_type == ‘ctype’ – <list<int>> elem_blk_ids
if array_type == ‘numpy’ – <np_array<int>> elem_blk_ids
- get_elem_blk_name(object_id)[source]#
get the element block name
>>> elem_blk_name = exo.get_elem_blk_name(elem_blk_id)
- Parameters:
object_id (ex_entity_id) – element block ID (not INDEX)
- Returns:
elem_blk_name
- Return type:
string
- get_elem_blk_names()[source]#
get a list of all element block names ordered by block INDEX; (see
exodus.get_ids()
for explanation of the difference between block ID and block INDEX)>>> elem_blk_names = exo.get_elem_blk_names()
- Returns:
elem_blk_names
- Return type:
list<string>
- get_elem_connectivity(object_id)[source]#
get the nodal connectivity, number of elements, and number of nodes per element for a single block
>>> elem_conn, num_blk_elems, num_elem_nodes ... = exo.get_elem_connectivity(elem_blk_id)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
- Returns:
elem_conn (<list<int>> (if array_type == ‘ctype’))
elem_conn (<np_array<int>> (if array_type == ‘numpy’)) – ordered list of node INDICES that define the connectivity of each element in the block; the list cycles through all nodes of the first element, then all nodes of the second element, etc. (see
exodus.get_id_map()
for explanation of node INDEX versus node ID)num_blk_elems (int) – number of elements in the block
num_elem_nodes (int) – number of nodes per element
- get_elem_id_map()[source]#
get mapping of exodus element index to user- or application- defined element id; elem_id_map is ordered by the element INDEX ordering, a 1-based system going from 1 to exo.num_elems(), used by exodus for storage and input/output of array data stored on the elements; a user or application can optionally use a separate element ID numbering system, so the elem_id_map points to the element ID for each element INDEX
>>> elem_id_map = exo.get_elem_id_map()
- Returns:
if array_type == ‘ctype’ – <list<int>> elem_id_map
if array_type == ‘numpy’ – <np_array<int>> elem_id_map
- get_elem_num_map()[source]#
DEPRECATED use: get_elem_id_map()
get mapping of exodus element index to user- or application- defined element id; elem_id_map is ordered by the element INDEX ordering, a 1-based system going from 1 to exo.num_elems(), used by exodus for storage and input/output of array data stored on the elements; a user or application can optionally use a separate element ID numbering system, so the elem_id_map points to the element ID for each element INDEX
>>> elem_id_map = exo.get_elem_num_map()
- Returns:
elem_id_map
- Return type:
list<ctypes.c_int>
- get_elem_order_map()[source]#
get mapping of exodus element index to application-defined optimal ordering; elem_order_map is ordered by the element index ordering used by exodus for storage and input/output of array data stored on the elements; a user or application can optionally use a separate element ordering, e.g. for optimal solver performance, so the elem_order_map points to the index used by the application for each exodus element index
>>> elem_order_map = exo.get_elem_order_map()
- Returns:
if array_type == ‘ctype’ – <list<int>> elem_order_map
if array_type == ‘numpy’ – <np_array<int>> elem_order_map
- get_element_attribute_names(blkId)[source]#
get the list of element attribute names for a block
>>> attr_names = exo.get_element_attribute_names(elem_blk_id)
- Parameters:
blkid (ex_entity_id) – block/set ID (not INDEX)
- Returns:
attr_names
- Return type:
list<string>
- get_element_property_names()[source]#
get the list of element property names for all element blocks in the model
>>> eprop_names = exo.get_element_property_names()
- Returns:
eprop_names
- Return type:
list<string>
- get_element_property_value(object_id, name)[source]#
get element property value (an integer) for a specified element block and element property name
>>> eprop_val = exo.get_element_property_value(elem_blk_id, eprop_name)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
name (string) –
- Returns:
eprop_val
- Return type:
int
- get_element_variable_names()[source]#
get the list of element variable names in the model
>>> evar_names = exo.get_element_variable_names()
- Returns:
evar_names
- Return type:
list<string>
- get_element_variable_number()[source]#
get the number of element variables in the model
>>> num_evars = exo.get_element_variable_number()
- Returns:
num_evars
- Return type:
int
- get_element_variable_values(blockId, name, step)[source]#
get list of element variable values for a specified element block, element variable name, and time step
>>> evar_vals = exo.get_element_variable_values(elem_blk_id, ... evar_name, time_step)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
evar_name (string) – name of element variable
time_step (int) – 1-based index of time step
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> evar_vals
if array_type == ‘numpy’ – <np_array<double>> evar_vals
- get_entity_count(objType, entityId)[source]#
get number of nodes/elements in the specified set/block. Typically used internally by other user-callable functions.
- Parameters:
objType (ex_entity_type) – type of object being queried
entityid (ex_entity_id) – id of the entity (block, set) ID (not INDEX)
- get_global_variable_names()[source]#
get the list of global variable names in the model
>>> gvar_names = exo.get_global_variable_names()
- Returns:
gvar_names
- Return type:
list<string>
- get_global_variable_number()[source]#
get the number of global variables in the model
>>> num_gvars = exo.get_global_variable_number()
- Returns:
num_gvars
- Return type:
int
- get_global_variable_value(name, step)[source]#
get a global variable value for a specified global variable name and time step
>>> gvar_val = exo.get_global_variable_value(gvar_name, time_step)
- Parameters:
name (string) – name of global variable
step (int) – 1-based index of time step
- Returns:
gvar_val
- Return type:
double
- get_global_variable_values(name)[source]#
get global variable values over all time steps for one global variable name
>>> gvar_vals = exo.get_global_variable_values(gvar_name)
- Parameters:
name (string) – name of global variable
- Returns:
if array_type == ‘ctype’ – <list<double>> gvar_vals
if array_type == ‘numpy’ – <np_array<double>> gvar_vals
- get_id_map(mapType)[source]#
get mapping of exodus element/node/edge/face index to user- or application- defined element/node/edge/face id; id_map is ordered by the INDEX ordering, a 1-based system going from 1 to exo.num_elem, exo.num_node, used by exodus for storage and input/output of array data stored on the elements/nodes/edges/faces; a user or application can optionally use a separate ID numbering system, so the id_map points to the element/node/edge/face ID for each INDEX
>>> elem_id_map = exo.get_id_map('EX_ELEM_MAP')
- Parameters:
mapType (ex_entity_type) – type of map being queried (‘EX_ELEM_MAP’, ‘EX_NODE_MAP’, ‘EX_FACE_MAP’, ‘EX_EDGE_MAP’)
- Returns:
if array_type == ‘ctype’ – <list<int>> id_map
if array_type == ‘numpy’ – <np_array<int>> id_map
- get_ids(objType)[source]#
get mapping of exodus block/set index to user- or application- defined block/set id; ids is ordered by the INDEX ordering, a 1-based system going from 1 to number_set_or_block, used by exodus for storage and input/output of array data stored on the blocks/sets; a user or application can optionally use a separate block/set ID numbering system, so the ids array points to the block/set ID for each set INDEX
>>> node_set_ids = exo.get_ids('EX_NODE_SET')
- Returns:
if array_type == ‘ctype’ – <list<int>> ids
if array_type == ‘numpy’ – <np_array<int>> ids
- get_info_records()[source]#
get a list info records where each entry in the list is one info record, e.g. a line of an input deck
>>> info_recs = exo.get_info_records()
- Returns:
info_recs
- Return type:
list<string>
- get_name(object_type, object_id)[source]#
get the name of the specified entity_type and entity
>>> elem_blk_name = exo.get_name('EX_ELEM_BLOCK', elem_blk_id)
- Parameters:
object_type (int) – block/set type
object_id (ex_entity_type) – block/set ID (not INDEX)
- Returns:
name
- Return type:
string
- get_names(object_type)[source]#
get a list of all block/set names ordered by block/set INDEX; (see
exodus.get_ids()
for explanation of the difference between ID and INDEX)>>> blk_names = exo.get_names('EX_ELEM_BLOCK')
- Parameters:
object_type (int) – block/set type
- Returns:
names
- Return type:
list<string>
- get_node_id_map()[source]#
get mapping of exodus node index to user- or application- defined node id; node_id_map is ordered the same as the nodal coordinate arrays returned by exo.get_coords() – this ordering follows the exodus node INDEX order, a 1-based system going from 1 to exo.num_nodes(); a user or application can optionally use a separate node ID numbering system, so the node_id_map points to the node ID for each node INDEX
>>> node_id_map = exo.get_node_id_map()
- Returns:
if array_type == ‘ctype’ – <list<int>> node_id_map
if array_type == ‘numpy’ – <np_array<int>> node_id_map
- get_node_num_map()[source]#
DEPRECATED use: get_node_id_map()
get mapping of exodus node index to user- or application- defined node id; node_id_map is ordered the same as the nodal coordinate arrays returned by exo.get_coords() – this ordering follows the exodus node INDEX order, a 1-based system going from 1 to exo.num_nodes(); a user or application can optionally use a separate node ID numbering system, so the node_id_map points to the node ID for each node INDEX
>>> node_id_map = exo.get_node_num_map()
- Returns:
node_id_map
- Return type:
list<ctypes.c_int>
- get_node_set_dist_facts(object_id)[source]#
get the list of distribution factors for nodes in a node set
>>> ns_dist_facts = exo.get_node_set_dist_facts(node_set_id)
- Parameters:
node_set_id (ex_entity_id) – node set ID (not INDEX)
- Returns:
if array_type == ‘ctype’ –
- <list<double>> ns_dist_facts a list of distribution factors,
e.g. nodal ‘weights’
if array_type == ‘numpy’ –
- <np_array<double>> ns_dist_facts a list of distribution
factors, e.g. nodal ‘weights’
- get_node_set_ids()[source]#
get mapping of exodus node set index to user- or application- defined node set id; node_set_ids is ordered by the INDEX ordering, a 1-based system going from 1 to exo.num_node_sets(), used by exodus for storage and input/output of array data stored on the node sets; a user or application can optionally use a separate node set ID numbering system, so the node_set_ids array points to the node set ID for each node set INDEX
>>> node_set_ids = exo.get_ids('EX_NODE_SET')
- Returns:
if array_type == ‘ctype’ – <list<int>> node_set_ids
if array_type == ‘numpy’ – <np_array<int>> node_set_ids
- get_node_set_name(object_id)[source]#
get the name of a node set
>>> node_set_name = exo.get_node_set_name(node_set_id)
- Parameters:
node_set_id (ex_entity_id) – node set ID (not INDEX)
- Returns:
node_set_name
- Return type:
string
- get_node_set_names()[source]#
get a list of all node set names ordered by node set INDEX; (see
exodus.get_ids()
for explanation of the difference between node set ID and node set INDEX)>>> node_set_names = exo.get_node_set_names()
- Returns:
node_set_names
- Return type:
list<string>
- get_node_set_nodes(object_id)[source]#
get the list of node INDICES in a node set (see
exodus.get_id_map()
for explanation of node INDEX versus node ID)>>> ns_nodes = exo.get_node_set_nodes(node_set_id)
- Parameters:
node_set_id (ex_entity_id) – node set ID (not INDEX)
- Returns:
if array_type == ‘ctype’ – <list<int>> ns_nodes
if array_type == ‘numpy’ – <np_array<int>> ns_nodes
- get_node_set_property_names()[source]#
get the list of node set property names for all node sets in the model
>>> nsprop_names = exo.get_node_set_property_names()
- Returns:
nsprop_names
- Return type:
list<string>
- get_node_set_property_value(object_id, name)[source]#
get node set property value (an integer) for a specified node set and node set property name
>>> nsprop_val = exo.get_node_set_property_value(node_set_id, nsprop_name)
- Parameters:
node_set_id (ex_entity_id) – node set ID (not INDEX)
name (string) –
- Returns:
nsprop_val
- Return type:
int
- get_node_set_variable_names()[source]#
get the list of node set variable names in the model
>>> nsvar_names = exo.get_node_set_variable_names()
- Returns:
nsvar_names
- Return type:
list<string>
- get_node_set_variable_number()[source]#
get the number of node set variables in the model
>>> num_nsvars = exo.get_node_set_variable_number()
- Returns:
num_nsvars
- Return type:
int
- get_node_set_variable_values(object_id, name, step)[source]#
get list of node set variable values for a specified node set, node set variable name, and time step; the list has one variable value per node in the set
>>> nsvar_vals = ... exo.get_node_set_variable_values(node_set_id, ... nsvar_name, time_step)
- Parameters:
node_set_id (ex_entity_id) – node set ID (not INDEX)
nsvar_name (string) – name of node set variable
time_step (int) – 1-based index of time step
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> nsvar_vals
if array_type == ‘numpy’ – <np_array<double>> nsvar_vals
- get_node_variable_names()[source]#
get the list of nodal variable names in the model
>>> nvar_names = exo.get_node_variable_names()
- Returns:
nvar_names
- Return type:
list<string>
- get_node_variable_number()[source]#
get the number of nodal variables in the model
>>> num_nvars = exo.get_node_variable_number()
- Returns:
num_nvars
- Return type:
int
- get_node_variable_values(name, step)[source]#
get list of nodal variable values for a nodal variable name and time step
>>> nvar_vals = exo.get_node_variable_values(nvar_name, time_step)
- Parameters:
name (string) – name of nodal variable
step (int) – 1-based index of time step
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> nvar_vals
if array_type == ‘numpy’ – <np_array<double>> nvar_vals
- get_num_map(mapType, idx)[source]#
get user-defined map of exodus element/node/edge/face index to user- or application- defined element/node/edge/face values. Map values are arbitrary integers
>>> elem_num_map = exo.get_num_map('EX_ELEM_MAP', 1)
- Parameters:
mapType (ex_entity_type) – type of map being queried (‘EX_ELEM_MAP’, ‘EX_NODE_MAP’, ‘EX_FACE_MAP’, ‘EX_EDGE_MAP’)
idx (int) – which map to return (1-based). Use inquire(mapType) to get number of maps stored on database.
- Returns:
if array_type == ‘ctype’ – <list<int>> num_map
if array_type == ‘numpy’ – <np_array<int>> num_map
>>> em_cnt = exo.inquire('EX_INQ_ELEM_MAP') >>> em = exo.get_names('EX_ELEM_MAP') >>> map = exo.get_num_map('EX_ELEM_MAP', 2)
- get_partial_element_variable_values(blockId, name, step, start_index, num_elements)[source]#
get list of element variable values for a specified element block, element variable name, and time step
>>> evar_vals = exo.get_element_variable_values(elem_blk_id, ... evar_name, time_step)
- Parameters:
blockid (ex_entity_id) – element block ID (not INDEX)
name (string) – name of element variable
step (int) – 1-based index of time step
start_index (int) – 1-based index of element in block to start returning data
num_elements (int) – number of elements to return data for.
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> evar_vals
if array_type == ‘numpy’ – <np_array<double>> evar_vals
- get_partial_node_set_variable_values(object_id, name, step, start_index, num_nodes)[source]#
get list of node set variable values for a specified node set, node set variable name, and time step; the list has one variable value per node in the set
>>> nsvar_vals = ... exo.get_node_set_variable_values(node_set_id, ... nsvar_name, time_step)
- Parameters:
node_set_id (ex_entity_id) – node set ID (not INDEX)
nsvar_name (string) – name of node set variable
time_step (int) – 1-based index of time step
start_index (int) – 1-based index of node to start returning data
num_nodes (int) – number of nodes to return data for.
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> nsvar_vals
if array_type == ‘numpy’ – <np_array<double>> nsvar_vals
- get_partial_node_variable_values(name, step, start_index, num_nodes)[source]#
get partial list of nodal variable values for a nodal variable name and time step. Start at node node_index (1-based) and return num_nodes from that point.
>>> nvar_vals = exo.get_partial_node_variable_values(nvar_name, time_step, 10, 100)
- Parameters:
nvar_name (string) – name of nodal variable
time_step (int) – 1-based index of time step
start_index (int) – 1-based index of node to start returning data
num_nodes (int) – number of nodes to return data for.
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> nvar_vals
if array_type == ‘numpy’ – <np_array<double>> nvar_vals
- get_partial_side_set_variable_values(object_id, name, step, start_index, num_sides)[source]#
get list of side set variable values for a specified side set, side set variable name, and time step; the list has one variable value per side in the set
>>> ssvar_vals = exo.get_side_set_variable_values(side_set_id, ... ssvar_name, time_step)
- Parameters:
object_id (ex_entity_id) – side set ID (not INDEX)
name (string) – name of side set variable
step (int) – 1-based index of time step
start_index (int) – 1-based index of side to start returning data
num_sides (int) – number of sides to return data for.
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> ssvar_vals
if array_type == ‘numpy’ – <np_array<double>> ssvar_vals
- get_qa_records()[source]#
- get a list of QA records where each QA record is a length-4 tuple of strings:
the software name that accessed/modified the database
the software descriptor, e.g. version
additional software data
time stamp
>>> qa_recs = exo.get_qa_records()
- Returns:
qa_recs
- Return type:
list<tuple[4]<string>>
- get_reduction_variable_name(objType, varId)[source]#
get a single reduction variable name in the model for the specified object type and index.
>>> nar_name = exo.get_reduction_variable_name('EX_ASSEMBL"Y', 100)
- Returns:
nvar_name
- Return type:
string
- get_reduction_variable_names(objType)[source]#
get the list of reduction variable names in the model for the specified object type.
>>> nar_names = exo.get_reduction_variable_names('EX_ASSEMBL"Y')
- Returns:
nvar_names
- Return type:
list<string>
- get_reduction_variable_number(objType)[source]#
get the number of reduction variables of the specified type in the model
>>> num_nvars = exo.get_reduction_variable_number('EX_ASSEMBLY')
- Returns:
num_nvars
- Return type:
int
- get_reduction_variable_values(objType, id, step)[source]#
get list of reduction variable values for a specified entity type and id, and time step
>>> evar_vals = exo.get_reduction_variable_values('EX_ELEM_BLOCK', elem_blk_id, time_step)
- Parameters:
objType (ex_entity_type) – type of object being queried
id (int) – entity ID (not INDEX)
time_step (int) – 1-based index of time step
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> evar_vals
if array_type == ‘numpy’ – <np_array<double>> evar_vals
- get_set_params(object_type, object_id)[source]#
get number of entities and distribution factors (e.g. nodal ‘weights’) in the specified set
>>> num_ns_nodes, num_ns_dist_facts = ... exo.get_set_params('EX_NODE_SET', node_set_id)
- Parameters:
set_id (ex_entity_id) – set ID (not INDEX)
- Returns:
num_set_entities (int)
num_set_dist_facts (int)
- get_side_set(object_id)[source]#
get the lists of element and side indices in a side set; the two lists correspond: together, ss_elems[i] and ss_sides[i] define the face of an element
>>> ss_elems, ss_sides = exo.get_side_set(side_set_id)
- Parameters:
side_set_id (ex_entity_id) – side set ID (not INDEX)
- Returns:
if array_type == ‘ctype’ – <list<int>> ss_elems <list<int>> ss_sides
if array_type == ‘numpy’ – <np_array<int>> ss_elems <np_array<int>> ss_sides
- get_side_set_dist_fact(object_id)[source]#
get the list of distribution factors for nodes in a side set
>>> ss_dist_facts = exo.get_side_set_dist_fact(side_set_id)
- Parameters:
side_set_id (ex_entity_id) – side set ID (not INDEX)
- Returns:
if array_type == ‘ctype’ –
- <list<double>> ss_dist_facts a list of distribution factors,
e.g. nodal ‘weights’
if array_type == ‘numpy’ –
- <np_array<double>> ss_dist_facts a list of distribution
factors, e.g. nodal ‘weights’
Note
The number of nodes (and distribution factors) in a side set is the sum of all face nodes. A single node can be counted more than once, i.e. once for each face it belongs to in the side set.
- get_side_set_ids()[source]#
get mapping of exodus side set index to user- or application- defined side set id; side_set_ids is ordered by the INDEX ordering, a 1-based system going from 1 to exo.num_side_sets(), used by exodus for storage and input/output of array data stored on the side sets; a user or application can optionally use a separate side set ID numbering system, so the side_set_ids array points to the side set ID for each side set INDEX
>>> side_set_ids = exo.get_ids('EX_SIDE_SET')
- Returns:
if array_type == ‘ctype’ – <list<int>> side_set_ids
if array_type == ‘numpy’ – <np_array<int>> side_set_ids
- get_side_set_name(object_id)[source]#
get the name of a side set
>>> side_set_name = exo.get_side_set_name(side_set_id)
- Parameters:
object_id (ex_entity_id) – side set ID (not INDEX)
- Returns:
side_set_name
- Return type:
string
- get_side_set_names()[source]#
get a list of all side set names ordered by side set INDEX; (see
exodus.get_ids()
for explanation of the difference between side set ID and side set INDEX)>>> side_set_names = exo.get_side_set_names()
- Returns:
side_set_names
- Return type:
list<string>
- get_side_set_node_list(object_id)[source]#
- get two lists:
number of nodes for each side in the set
concatenation of the nodes for each side in the set
>>> ss_num_nodes_per_side, ss_nodes = exo.get_side_set_node_list(side_set_id)
- Parameters:
side_set_id (ex_entity_id) – side set ID (not INDEX)
- Returns:
if array_type == ‘ctype’ – <list<int>> ss_num_side_nodes <list<int>> ss_nodes
if array_type == ‘numpy’ – <np_array<int>> ss_num_side_nodes <np_array<int>> ss_nodes
Note
The number of nodes (and distribution factors) in a side set is the sum of all face nodes. A single node can be counted more than once, i.e. once for each face it belongs to in the side set.
- get_side_set_params(object_id)[source]#
get number of sides and nodal distribution factors (e.g. nodal ‘weights’) in a side set
>>> num_ss_sides, num_ss_dist_facts = exo.get_side_set_params(side_set_id)
- Parameters:
side_set_id (ex_entity_id) – side set ID (not INDEX)
- Returns:
num_ss_sides (int)
num_ss_dist_facts (int)
Note
The number of nodes (and distribution factors) in a side set is the sum of all face nodes. A single node can be counted more than once, i.e. once for each face it belongs to in the side set.
- get_side_set_property_names()[source]#
get the list of side set property names for all side sets in the model
>>> ssprop_names = exo.get_side_set_property_names()
- Returns:
ssprop_names
- Return type:
list<string>
- get_side_set_property_value(object_id, name)[source]#
get side set property value (an integer) for a specified side set and side set property name
>>> ssprop_val = exo.get_side_set_property_value(side_set_id, ssprop_name)
- Parameters:
object_id (ex_entity_id) – side set ID (not INDEX)
name (string) – name of side set property
- Returns:
ssprop_val
- Return type:
int
- get_side_set_variable_names()[source]#
get the list of side set variable names in the model
>>> ssvar_names = exo.get_side_set_variable_names()
- Returns:
ssvar_names
- Return type:
list<string>
- get_side_set_variable_number()[source]#
get the number of side set variables in the model
>>> num_ssvars = exo.get_side_set_variable_number()
- Returns:
num_ssvars
- Return type:
int
- get_side_set_variable_values(object_id, name, step)[source]#
get list of side set variable values for a specified side set, side set variable name, and time step; the list has one variable value per side in the set
>>> ssvar_vals = exo.get_side_set_variable_values(side_set_id, ... ssvar_name, time_step)
- Parameters:
side_set_id (ex_entity_id) – side set ID (not INDEX)
ssvar_name (string) – name of side set variable
time_step (int) – 1-based index of time step
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> ssvar_vals
if array_type == ‘numpy’ – <np_array<double>> ssvar_vals
- get_sierra_input(inpFileName=None)[source]#
parse sierra input deck from the info records if inp_file_name is passed the deck is written to this file; otherwise a list of input deck file lines is returned
>>> inp = exo.get_sierra_input(inpFileName=inp_file_name)
- Parameters:
inp_file_name (string, optional) – Name of text file where info records corresponding to the Sierra input deck will be written
- Returns:
inp – lines if inp_file_name not provided; otherwise, an empty list
- Return type:
list<string>
- get_times()[source]#
get the time values
>>> time_vals = exo.get_times()
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> time_vals
if array_type == ‘numpy’ – <np_array<double>> time_vals
- get_variable_names(objType)[source]#
get the list of variable names in the model for the specified object type.
>>> nar_names = exo.get_variable_names('EX_NODAL')
- Returns:
nvar_names
- Return type:
list<string>
- get_variable_number(objType)[source]#
get the number of variables of the specified type in the model
>>> num_nvars = exo.get_variable_number('EX_NODAL')
- Returns:
num_nvars
- Return type:
int
- get_variable_truth_table(objType, entId=None)[source]#
gets a truth table indicating which variables are defined for specified entity type; if entId is not passed, then a concatenated truth table for all entities is returned with variable index cycling faster than entity index
>>> ssvar_truth_tab = exo.get_variable_truth_table('EX_SIDE_SET', sideSetID=side_set_id)
- Parameters:
objType (ex_entity_type) – type of object begin queried
entid (ex_entity_id, optional) – entity ID (not INDEX)
- Returns:
truth_tab – True for variable defined in an entity, False otherwise
- Return type:
list<bool>
- get_variable_values(objType, entityId, name, step)[source]#
get list of objType variable values for a specified object id block, variable name, and time step
>>> evar_vals = exo.get_variable_values('EX_ELEM_BLOCK', elem_blk_id, ... evar_name, time_step)
- Parameters:
objType (ex_entity_type) – type of object being queried
entityid (ex_entity_id) – id of the entity (block, set) ID (not INDEX)
name (string) – name of variable
time_step (int) – 1-based index of time step
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> evar_vals
if array_type == ‘numpy’ – <np_array<double>> evar_vals
- get_variable_values_time(objType, entityId, var_name, start_step, end_step)[source]#
get list of objType variable values for a specified object id block, variable name, and range of time steps
>>> evar_vals = exo.get_variable_values_time('EX_ELEM_BLOCK', entity_id, ... var_name, start_step, end_step)
- Parameters:
objType (ex_entity_type) – type of object being queried
entityid (ex_entity_id) – id of the entity (block, set) ID (not INDEX)
var_name (string) – name of variable
start_step (int) – 1-based index of time step
end_step (int) – 1-based index of time step
- Returns:
if array_type == ‘ctype’ – <list<ctypes.c_double>> evar_vals
if array_type == ‘numpy’ – <np_array<double>> evar_vals
- inquire(inquiry)[source]#
Inquire about various properties of the database
- Returns:
inq_res
- Return type:
int
- num_assembly()[source]#
get the number of assemblies in the model
>>> num_assembly = exo.num_assembly()
- Returns:
num_assembly
- Return type:
int
- num_attr(object_id)[source]#
get the number of attributes per element for an element block
>>> num_elem_attrs = exo.num_attr(elem_blk_id)
- Parameters:
object_id (ex_entity_id) – element block ID (not INDEX)
- Returns:
num_elem_attrs
- Return type:
int
- num_blks()[source]#
get the number of element blocks in the model
>>> num_elem_blks = exo.num_blks()
- Returns:
num_elem_blks
- Return type:
int
- num_blob()[source]#
get the number of blobs in the model
>>> num_assembly = exo.num_blob()
- Returns:
num_blob
- Return type:
int
- num_dimensions()[source]#
get the number of model spatial dimensions
>>> num_dims = exo.num_dimensions()
- Returns:
num_dims
- Return type:
int
- num_elems()[source]#
get the number of elements in the model
>>> num_elems = exo.num_elems()
- Returns:
num_elems
- Return type:
int
- num_elems_in_blk(object_id)[source]#
get the number of elements in an element block
>>> num_blk_elems = exo.num_elems_in_blk(elem_blk_id)
- Parameters:
object_id (ex_entity_id) – element block ID (not INDEX)
- Returns:
num_blk_elems
- Return type:
int
- num_faces_in_side_set(object_id)[source]#
get the number of faces in a side set
>>> num_ss_faces = exo.num_faces_in_side_set(side_set_id)
- Parameters:
side_set_id (ex_entity_id) – side set ID (not INDEX)
- Returns:
num_ss_faces
- Return type:
int
- num_info_records()[source]#
get the number of info records
>>> num_info_recs = exo.num_info_records()
- Returns:
num_info_recs
- Return type:
int
- num_node_sets()[source]#
get the number of node sets in the model
>>> num_node_sets = exo.num_node_sets()
- Returns:
num_node_sets
- Return type:
int
- num_nodes()[source]#
get the number of nodes in the model
>>> num_nodes = exo.num_nodes()
- Returns:
num_nodes
- Return type:
int
- num_nodes_in_node_set(object_id)[source]#
get the number of nodes in a node set
>>> num_ns_nodes = exo.num_nodes_in_node_set(node_set_id)
- Parameters:
node_set_id (ex_entity_id) – node set ID (not INDEX)
- Returns:
num_ns_nodes
- Return type:
int
- num_nodes_per_elem(object_id)[source]#
get the number of nodes per element for an element block
>>> num_elem_nodes = exo.num_nodes_per_elem(elem_blk_id)
- Parameters:
object_id (ex_entity_id) – element block ID (not INDEX)
- Returns:
num_elem_nodes
- Return type:
int
- num_qa_records()[source]#
get the number of qa records
>>> num_qa_recs = exo.num_qa_records()
- Returns:
num_qa_recs
- Return type:
int
- num_side_sets()[source]#
get the number of side sets in the model
>>> num_side_sets = exo.num_side_sets()
- Returns:
num_side_sets
- Return type:
int
- num_times()[source]#
get the number of time steps
>>> num_times = exo.num_times()
- Returns:
num_times
- Return type:
int
- put_all_global_variable_values(step, values)[source]#
store all global variable values (one for each global variable name, and in the order given by exo.get_global_variable_names()) at a specified time step
>>> status = exo.put_all_global_variable_values(time_step, gvar_vals)
- Parameters:
step (int) – 1-based index of time step
values (list<double>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_assemblies(assemblies)[source]#
writes the assembly parameters and assembly data for multiple assemblies
- put_attribute(attribute)[source]#
>>> attribute = exodus.attribute('Scale', 'EX_ASSEMBLY', 100) >>> attribute.values = [1.1, 1.0, 1.2] >>> attributes = exo.put_attribute(attribute)
- Returns:
attributes
- Return type:
ex_attribute list
- put_attribute_names(objType, blkId, names)[source]#
store the list of element attribute names for a block
>>> status = exo.put_attribute_names('EX_ELEM_BLOCK', elem_blk_id, attr_names)
- Parameters:
objType – entity type
blkid (ex_entity_id) – block/set ID (not INDEX)
attr_names (list<string>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_concat_elem_blk(elem_blk_ids, elem_type, num_blk_elems, num_elem_nodes, num_elem_attrs, defineMaps)[source]#
same as exo.put_elem_blk_info() but for all blocks at once
>>> status = exo.put_concat_elem_blk(elem_blk_ids, elem_types, ... num_blk_elems, num_elem_nodes, num_elem_attrs)
- Parameters:
elem_blk_ids (list<int>) – element block ID (not INDEX) for each block
elem_types (list<string>) – element type for each block
num_blk_elems (list<int>) – number of elements for each block
num_elem_nodes (list<int>) – number of nodes per element for each block
num_elem_attrs (list<int>) – number of attributes per element for each block
- Returns:
status – True = successful execution
- Return type:
bool
- put_coord_names(names)[source]#
store a list of length exo.num_dimensions() that has the name of each model coordinate direction, e.g. [‘x’, ‘y’, ‘z’]
>>> exo.put_coord_names()
- Parameters:
coord_names (list<string>) –
- put_coords(xCoords, yCoords, zCoords)[source]#
store model coordinates of all nodes; for each coordinate direction, a length exo.num_nodes() list is input
>>> status = exo.put_coords(x_coords, y_coords, z_coords)
- Parameters:
x_coord (list<double>) – global x-direction coordinates
y_coord (list<double>) – global y-direction coordinates
z_coord (list<double>) – global z-direction coordinates
- Returns:
status – True = successful execution
- Return type:
bool
- put_elem_attr(elem_blk_id, elem_attrs)[source]#
store all attributes for each element in a block
>>> exo.put_elem_attr(elem_blk_id, elem_attrs)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
elem_attrs (list<double>) – list of all attribute values for all elements in the block; the list cycles through all attributes of the first element, then all attributes of the second element, etc. Attributes are ordered by the ordering of the names returned by exo.get_attribute_names()
- put_elem_attr_values(elem_blk_id, elem_attr_name, values)[source]#
store an attribute for each element in a block
>>> exo.put_elem_attr_values(elem_blk_id, elem_attr_name, values)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
elem_attr_name (string) – element attribute name
values (list<double>) – list of values for a single attribute on a element block. List dimensions should be 1 x N_elem, where N_elem is the number of elements on the element block.
- put_elem_blk_info(elem_blk_id, elem_type, num_blk_elems, num_elem_nodes, num_elem_attrs)[source]#
store the element block ID and element block info
>>> exo.put_elem_blk_info(elem_blk_id, elem_type, num_blk_elems, ... num_elem_nodes, num_elem_attrs)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
elem_type (string) – element type (all caps), e.g. ‘HEX8’
num_blk_elems (int) – number of elements in the block
num_elem_nodes (int) – number of nodes per element
num_elem_attrs (int) – number of attributes per element
- put_elem_blk_name(object_id, name)[source]#
store the element block name
>>> exo.put_elem_blk_name(elem_blk_id, elem_blk_name)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
elem_blk_name (string) –
- put_elem_blk_names(names)[source]#
store a list of all element block names ordered by block INDEX; (see
exodus.get_ids()
for explanation of the difference between block ID and block INDEX)>>> exo.put_elem_blk_names(elem_blk_names)
- Parameters:
elem_blk_names (list<string>) –
- put_elem_connectivity(object_id, connectivity)[source]#
store the nodal connectivity, number of elements, and number of nodes per element for a single block
>>> exo.put_elem_connectivity(elem_blk_id, elem_conn)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
connectivity (list<int>) – ordered list of node INDICES that define the connectivity of each element in the block; the list cycles through all nodes of the first element, then all nodes of the second element, etc. (see
exodus.get_id_map()
for explanation of node INDEX versus node ID)
- put_elem_face_conn(blkId, elemFaceConn)[source]#
put in connectivity information from elems to faces
>>> status = exo.put_elem_face_conn(blkID, elemFaceConn)
- Parameters:
blkID (ex_entity_id) – id of the block to be added
'ctype' (if array_type ==) – <list<int>> elemFaceConn (raveled/flat list)
'numpy' (if array_type ==) – <np_array<int>> elemFaceConn (raveled/flat array)
- Returns:
status – True = successful execution
- Return type:
bool
- put_elem_id_map(id_map)[source]#
store mapping of exodus element index to user- or application- defined element id; elem_id_map is ordered by the element INDEX ordering, a 1-based system going from 1 to exo.num_elems(), used by exodus for storage and input/output of array data stored on the elements; a user or application can optionally use a separate element ID numbering system, so the elem_id_map points to the element ID for each element INDEX
>>> status = exo.put_elem_id_map(elem_id_map)
- Parameters:
elem_id_map (list<int>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_element_attribute_names(blkId, names)[source]#
store the list of element attribute names for a block
>>> status = exo.put_attribute_names(elem_blk_id, attr_names)
- Parameters:
blkid (ex_entity_id) – block/set ID (not INDEX)
names (list<string>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_element_property_value(object_id, name, value)[source]#
store an element property name and its integer value for an element block
>>> status = exo.put_element_property_value(elem_blk_id, ... eprop_name, eprop_val)
- Parameters:
elem_blk_id (ex_entity_id) – element block ID (not INDEX)
eprop_name (string) –
eprop_val (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_element_variable_name(name, index)[source]#
add the name and index of a new element variable to the model; element variable indexing goes from 1 to exo.get_element_variable_number()
>>> status = exo.put_element_variable_name(evar_name, evar_index)
- Parameters:
name (string) – name of new element variable
index (int) – 1-based index of new element variable
- Returns:
status – True = successful execution
- Return type:
bool
Example
this method is often called within the following sequence:
>>> num_evars = exo.get_element_variable_number() >>> new_evar_index = num_evars + 1 >>> num_evars += 1 >>> exo.set_element_variable_number(num_evars) >>> exo.put_element_variable_name("new_evar", new_evar_index)
- put_element_variable_values(blockId, name, step, values)[source]#
store a list of element variable values for a specified element block, element variable name, and time step
>>> status = exo.put_element_variable_values(elem_blk_id, ... evar_name, time_step, evar_vals)
- Parameters:
blockid (ex_entity_id) – element block ID (not INDEX)
name (string) – name of element variable
step (int) – 1-based index of time step
values (list<double>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_face_count_per_polyhedra(blkID, entityCounts)[source]#
put in a count of faces in for each polyhedra in an elem block
>>> status = exo.put_face_count_per_polyhedra(blkID, entityCounts)
- Parameters:
blkID (ex_entity_id) – id of the block to be added
'ctype' (if array_type ==) – <list<int>> entityCounts
'numpy' (if array_type ==) – <np_array<int>> entityCounts
- Returns:
status – True = successful execution
- Return type:
bool
- put_face_node_conn(blkId, faceNodeConn)[source]#
put in connectivity information from faces to nodes
>>> status = exo.put_face_node_conn(blkID, faceNodeConn)
- Parameters:
blkID (ex_entity_id) – id of the block to be added
'ctype' (if array_type ==) – <list<int>> faceNodeConn (raveled/flat list)
'numpy' (if array_type ==) – <np_array<int>> faceNodeConn (raveled/flat array)
- Returns:
status – True = successful execution
- Return type:
bool
- put_global_variable_name(name, index)[source]#
add the name and index of a new global variable to the model; global variable indexing goes from 1 to exo.get_global_variable_number()
>>> status = exo.put_global_variable_name(gvar_name, gvar_index)
- Parameters:
name (string) – name of new global variable
index (int) – 1-based index of new global variable
- Returns:
status – True = successful execution
- Return type:
bool
Example
this method is often called within the following sequence:
>>> num_gvars = exo.get_global_variable_number() >>> new_gvar_index = num_gvars + 1 >>> num_gvars += 1 >>> exo.set_global_variable_number(num_gvars) >>> exo.put_global_variable_name("new_gvar", new_gvar_index)
- put_global_variable_value(name, step, value)[source]#
store a global variable value for a specified global variable name and time step
>>> status = exo.put_global_variable_value(gvar_name, time_step, gvar_val)
- Parameters:
name (string) – name of global variable
step (int) – 1-based index of time step
value (double) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_id_map(map_type, id_map)[source]#
store mapping of exodus entity index to user- or application- defined entity id; id_map is ordered by the entity INDEX ordering, a 1-based system going from 1 to exo.num_XXX(), used by exodus for storage and input/output of array data stored on the entities; a user or application can optionally use a separate entity ID numbering system, so the elem_id_map points to the entity ID for each entity INDEX
>>> status = exo.put_id_map('EX_ELEM_MAP', elem_id_map)
- Parameters:
map_type (ex_entity_type) – type of map being queried (‘EX_ELEM_MAP’, ‘EX_NODE_MAP’, ‘EX_FACE_MAP’, ‘EX_EDGE_MAP’)
elem_id_map (list<int>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_info(Title, numDim, numNodes, numElem, numElemBlk, numNodeSets, numSideSets)[source]#
Initialize static metadata for the database.
>>> status = exo.put_info(title, num_dims, num_nodes, num_elems, ... num_blocks, num_ns, num_ss)
- Parameters:
title (string) – database title
num_dims (int) – number of model dimensions
num_nodes (int) – number of model nodes
num_elems (int) – number of model elements
num_blocks (int) – number of model element blocks
num_ns (int) – number of model node sets
num_ss (int) – number of model side sets
- Returns:
status – True = successful execution
- Return type:
bool
- put_info_ext(p)[source]#
put initialization information into exodus file
>>> e.put_info_ext(info_struct)
- put_info_records(info)[source]#
store a list of info records where each entry in the list is one line of info, e.g. a line of an input deck
>>> status = exo.put_info_records(info)
- Parameters:
info_recs (list<tuple[4]<string>>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_map_param(node_map_cnt, elem_map_cnt)[source]#
Define number of node and element maps that will be written to the database
- Parameters:
node_map_cnt (int) – number of node maps
elem_map_cnt (int) – number of element maps
- put_name(object_type, object_id, name)[source]#
put the name of the specified entity_type and entity
>>> exo.put_name('EX_ELEM_BLOCK', elem_blk_id, block_name)
- Parameters:
object_type (int) – block/set type
object_id (ex_entity_id) – block/set ID (not INDEX)
name (string) – block/set name
- Returns:
elem_blk_name
- Return type:
string
- put_names(object_type, names)[source]#
store a list of all block/set names of the specified object_type ordered by INDEX; (see
exodus.get_ids()
for explanation of the difference between ID and INDEX)>>> exo.put_names('EX_ELEM_BLOCK', elem_blk_names)
- Parameters:
object_type (int) –
names (list<string>) –
- put_node_count_per_face(blkID, entityCounts)[source]#
put in a count of nodes in for each face in a polygonal face block
>>> status = exo.put_node_count_per_face(blkID, entityCounts)
- Parameters:
blkID (ex_entity_id) – id of the block to be added
'ctype' (if array_type ==) – <list<int>> entityCounts
'numpy' (if array_type ==) – <np_array<int>> entityCounts
- Returns:
status – True = successful execution
- Return type:
bool
- put_node_id_map(id_map)[source]#
store mapping of exodus node index to user- or application- defined node id; node_id_map is ordered the same as the nodal coordinate arrays returned by exo.get_coords() – this ordering follows the exodus node INDEX order, a 1-based system going from 1 to exo.num_nodes(); a user or application can optionally use a separate node ID numbering system, so the node_id_map points to the node ID for each node INDEX
>>> status = exo.put_node_id_map(node_id_map)
- Parameters:
node_id_map (list<int>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_node_set(object_id, nodeSetNodes)[source]#
store a node set by its id and the list of node INDICES in the node set (see
exodus.get_id_map()
for explanation of node INDEX versus node ID)>>> exo.put_node_set(node_set_id, ns_nodes)
- Parameters:
node_set_id (ex_entity_id) – node set ID (not INDEX)
ns_nodes (list<int>) –
- put_node_set_dist_fact(object_id, nodeSetDistFact)[source]#
store the list of distribution factors for nodes in a node set
>>> exo.put_node_set_dist_fact(node_set_id, ns_dist_facts)
- Parameters:
object_id (ex_entity_id) – node set ID (not INDEX)
nodeSetDistFact (list<double>) – a list of distribution factors, e.g. nodal ‘weights’
- put_node_set_name(object_id, name)[source]#
store the name of a node set
>>> exo.put_node_set_name(node_set_id, node_set_name)
- Parameters:
node_set_id (ex_entity_id) – node set ID (not INDEX)
node_set_name (string) –
- put_node_set_names(names)[source]#
store a list of all node set names ordered by node set INDEX; (see
exodus.get_ids()
for explanation of the difference between node set ID and node set INDEX)>>> exo.put_node_set_names(node_set_names)
- Parameters:
names (list<string>) –
- put_node_set_property_value(object_id, name, value)[source]#
store a node set property name and its integer value for a node set
>>> status = exo.put_node_set_property_value(node_set_id, ... nsprop_name, nsprop_val)
- Parameters:
node_set_id (ex_entity_id) – node set ID (not INDEX)
name (string) –
value (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_node_set_variable_name(name, index)[source]#
add the name and index of a new node set variable to the model; node set variable indexing goes from 1 to exo.get_node_set_variable_number()
>>> status = exo.put_node_set_variable_name(nsvar_name, nsvar_index)
- Parameters:
name (string) – name of new node set variable
index (int) – 1-based index of new node set variable
- Returns:
status – True = successful execution
- Return type:
bool
Example
this method is often called within the following sequence:
>>> num_nsvars = exo.get_node_set_variable_number() >>> new_nsvar_index = num_nsvars + 1 >>> num_nsvars += 1 >>> exo.set_node_set_variable_number(num_nsvars) >>> exo.put_node_set_variable_name("new_nsvar", new_nsvar_index)
- put_node_set_variable_values(object_id, name, step, values)[source]#
store a list of node set variable values for a specified node set, node set variable name, and time step; the list has one variable value per node in the set
>>> status = ... exo.put_node_set_variable_values(node_set_id, ... nsvar_name, time_step, nsvar_vals)
- Parameters:
node_set_id (ex_entity_id) – node set ID (not INDEX)
nsvar_name (string) – name of node set variable
time_step (int) – 1-based index of time step
nsvar_vals (list<double>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_node_variable_name(name, index)[source]#
add the name and index of a new nodal variable to the model; nodal variable indexing goes from 1 to exo.get_node_variable_number()
>>> status = exo.put_node_variable_name(nvar_name, nvar_index)
- Parameters:
nvar_name (string) – name of new nodal variable
nvar_index (int) – 1-based index of new nodal variable
- Returns:
status – True = successful execution
- Return type:
bool
Example
this method is often called within the following sequence:
>>> num_nvars = exo.get_node_variable_number() >>> new_nvar_index = num_nvars + 1 >>> num_nvars += 1 >>> exo.set_node_variable_number(num_nvars) >>> exo.put_node_variable_name("new_nvar_name", new_nvar_index)
- put_node_variable_values(name, step, values)[source]#
store a list of nodal variable values for a nodal variable name and time step
>>> status = exo.put_node_variable_values(nvar_name, time_step, nvar_vals)
- Parameters:
nvar_name (string) – name of nodal variable
time_step (int) – 1-based index of time step
nvar_vals (list<double>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_num_map(mapType, idx, num_map)[source]#
put user-defined map of exodus element/node/edge/face index to user- or application- defined element/node/edge/face values. Map values are arbitrary integers
- Parameters:
mapType (ex_entity_type) – type of map being written (‘EX_ELEM_MAP’, ‘EX_NODE_MAP’, ‘EX_FACE_MAP’, ‘EX_EDGE_MAP’)
idx (int) – which map to write (1-based). Use put_map_param(node_map_cnt, elem_map_cnt) prior to this function to define number of maps on the database.
elem_id_map (list<int>) –
>>> exo.put_map_param(nm_cnt, em_cnt) >>> nm[0] = "My_Node_Map" >>> exo.put_names('EX_NODE_MAP', nm); >>> exo.put_num_map('EX_NODE_MAP', 1, scale_map)
- put_polyhedra_elem_blk(blkID, num_elems_this_blk, num_faces, num_attr_per_elem)[source]#
put in an element block with polyhedral elements
>>> status = exo.put_polyhedra_elem_blk(blkID, num_elems_this_blk, ... num_faces, num_attr_per_elem)
- Parameters:
blkID (ex_entity_id) – id of the block to be added
num_elems_this_blk (int) –
num_faces (int) – total number of faces in this block
num_attr_per_elem (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_polyhedra_face_blk(blkID, num_faces_this_blk, num_nodes, num_attr_per_face)[source]#
put in a block of faces
>>> status = exo.put_polyhedra_face_blk(blkID, num_faces_this_blk, ... num_nodes, num_attr_per_face)
- Parameters:
blkID (ex_entity_id) – id of the block to be added
num_faces_this_blk (int) –
num_nodes (int) – total number of nodes in this block
num_attr_per_face (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_qa_records(records)[source]#
- store a list of QA records where each QA record is a length-4 tuple of strings:
the software name that accessed/modified the database
the software descriptor, e.g. version
additional software data
time stamp
>>> status = exo.put_qa_records()
- Parameters:
qa_recs (list<tuple[4]<string>>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_reduction_variable_name(objType, name, index)[source]#
add the name and index of a new reduction variable to the model; variable indexing goes from 1 to get_reduction_variable_number()
>>> status = exo.put_reduction_variable_name('EX_ASSEMBLY', assemvar_name, assemvar_index)
- Parameters:
objType (ex_entity_type) – type of object begin queried
var_name (string) – name of new variable
index (int) – 1-based index of new variable
- Returns:
status – True = successful execution
- Return type:
bool
Example
this method is often called within the following sequence:
>>> num_assem_vars = exo.get_reduction_variable_number('EX_ASSEMBLY') >>> new_assem_var_index = num_assem_vars + 1 >>> num_assem_vars += 1 >>> exo.set_reduction_variable_number('EX_ASSEMBLY', num_assem_vars) >>> exo.put_reduction_variable_name('EX_ASSEMBLY', "new_assem_var_name", new_assem_var_index)
- put_reduction_variable_values(objType, id, step, values)[source]#
store a list of ‘objType’ variable values for a specified entity, and time step
>>> status = exo.put_redcution_variable_values('EX_ELEM_BLOCK', elem_blk_id, ... time_step, evar_vals)
- Parameters:
objType (ex_entity_type) – type of object begin queried
id (ex_entity_id) – element block ID (not INDEX)
step (int) – 1-based index of time step
values (list<double>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_set_params(object_type, object_id, numSetEntity, numSetDistFacts=None)[source]#
initialize a new set of the specified type
>>> exo.put_set_params('EX_NODE_SET', node_set_id, ... num_ns_nodes, num_ns_dist_facts)
- Parameters:
set_id (ex_entity_id) – set ID (not INDEX)
num_set_entity (int) – number of nodes/edges/faces/elements to be added to set
num_dist_facts (int, optional) – number of distribution factors (e.g. nodal ‘weights’) – must be equal to zero or num_set_entity
- put_side_set(object_id, sideSetElements, sideSetSides)[source]#
store a side set by its id and the lists of element and side indices in the side set; the two lists correspond: together, ss_elems[i] and ss_sides[i] define the face of an element
>>> exo.put_side_set(side_set_id, ss_elems, ss_sides)
- Parameters:
side_set_id (ex_entity_id) – side set ID (not INDEX)
ss_elems (list<int>) –
ss_sides (list<int>) –
- put_side_set_dist_fact(object_id, sideSetDistFact)[source]#
store the list of distribution factors for nodes in a side set
>>> exo.put_side_set_dist_fact(side_set_id, ss_dist_facts)
- Parameters:
object_id (ex_entity_id) – node set ID (not INDEX)
sideSetDistFact (list<double>) – a list of distribution factors, e.g. nodal ‘weights’
Note
The number of nodes (and distribution factors) in a side set is the sum of all face nodes. A single node can be counted more than once, i.e. once for each face it belongs to in the side set.
- put_side_set_name(object_id, name)[source]#
store the name of a side set
>>> exo.put_side_set_name(side_set_id, side_set_name)
- Parameters:
side_set_id (ex_entity_id) – side set ID (not INDEX)
side_set_name (string) –
- put_side_set_names(names)[source]#
store a list of all side set names ordered by side set INDEX; (see
exodus.get_ids()
for explanation of the difference between side set ID and side set INDEX)>>> exo.put_side_set_names(side_set_names)
- Parameters:
side_set_names (list<string>) –
- put_side_set_params(object_id, numSetSides, numSetDistFacts)[source]#
initialize a new side set
>>> exo.put_side_set_params(side_set_id, num_ss_sides, num_ss_dist_facts)
- Parameters:
side_set_id (ex_entity_id) – side set ID (not INDEX)
num_ss_sides (int) – number of sides to be added to set
num_ss_dist_facts (int) – number of nodal distribution factors (e.g. nodal ‘weights’)
Note
The number of nodes (and distribution factors) in a side set is the sum of all face nodes. A single node can be counted more than once, i.e. once for each face it belongs to in the side set.
- put_side_set_property_value(object_id, name, value)[source]#
store a side set property name and its integer value for a side set
>>> status = exo.put_side_set_property_value(side_set_id, ... ssprop_name, ssprop_val)
- Parameters:
object_id (ex_entity_id) – side set ID (not INDEX)
name (string) – name of side set property
value (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_side_set_variable_name(name, index)[source]#
add the name and index of a new side set variable to the model; side set variable indexing goes from 1 to exo.get_side_set_variable_number()
>>> status = exo.put_side_set_variable_name(ssvar_name, ssvar_index)
- Parameters:
name (string) – name of new side set variable
index (int) – 1-based index of new side set variable
- Returns:
status – True = successful execution
- Return type:
bool
Example
this method is often called within the following sequence:
>>> num_ssvars = exo.get_side_set_variable_number() >>> new_ssvar_index = num_ssvars + 1 >>> num_ssvars += 1 >>> exo.set_side_set_variable_number(num_ssvars) >>> exo.put_side_set_variable_name("new_ssvar", new_ssvar_index)
- put_side_set_variable_values(object_id, name, step, values)[source]#
store a list of side set variable values for a specified side set, side set variable name, and time step; the list has one variable value per side in the set
>>> status = exo.put_side_set_variable_values(side_set_id, ... ssvar_name, time_step, ssvar_vals)
- Parameters:
object_id (ex_entity_id) – side set ID (not INDEX)
name (string) – name of side set variable
step (int) – 1-based index of time step
values (list<double>) –
- Returns:
status – True = successful execution
- Return type:
bool
- put_time(step, value)[source]#
store a new time
>>> exo.put_time(time_step, time_val)
- Parameters:
time_step (int) – time step index (1-based)
time_val (double) – time value for this step
- Returns:
status – True = successful execution
- Return type:
bool
- put_variable_name(objType, name, index)[source]#
add the name and index of a new variable to the model; variable indexing goes from 1 to exo.get_variable_number()
>>> status = exo.put_variable_name('EX_NODAL', nvar_name, nvar_index)
- Parameters:
objType (ex_entity_type) – type of object begin queried
var_name (string) – name of new variable
nvar_index (int) – 1-based index of new nodal variable
- Returns:
status – True = successful execution
- Return type:
bool
Example
this method is often called within the following sequence:
>>> num_nvars = exo.get_variable_number('EX_NODAL') >>> new_nvar_index = num_nvars + 1 >>> num_nvars += 1 >>> exo.set_variable_number('EX_NODAL', num_nvars) >>> exo.put_variable_name('EX_NODAL', "new_nvar_name", new_nvar_index)
- put_variable_values(objType, entityId, name, step, values)[source]#
store a list of element variable values for a specified element block, element variable name, and time step
>>> status = exo.put_variable_values('EX_ELEM_BLOCK', elem_blk_id, ... evar_name, time_step, evar_vals)
- Parameters:
entityid (ex_entity_id) – entity ID (not INDEX)
name (string) – name of variable
time_step (int) – 1-based index of time step
values (list<double>) – the variable values to be output
- Returns:
status – True = successful execution
- Return type:
bool
- set_element_variable_number(number)[source]#
update the number of element variables in the model
>>> status = exo.set_element_variable_number(num_evars)
- Parameters:
number (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- set_global_variable_number(number)[source]#
update the number of global variables in the model
>>> status = exo.set_global_variable_number(num_gvars)
- Parameters:
number (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- set_node_set_variable_number(number)[source]#
update the number of node set variables in the model
>>> status = exo.set_node_set_variable_number(num_nsvars)
- Parameters:
number (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- set_node_variable_number(number)[source]#
update the number of nodal variables in the model
>>> status = exo.set_node_variable_number(num_nvars)
- Parameters:
num_nvars (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- set_reduction_variable_number(objType, number)[source]#
update the number of reduction variables in the model
>>> status = exo.set_reduction_variable_number('EX_ASSEMBLY', num_nvars)
- Parameters:
objType (ex_entity_type) – type of object begin queried
number (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- set_side_set_variable_number(number)[source]#
update the number of side set variables in the model
>>> status = exo.set_side_set_variable_number(num_ssvars)
- Parameters:
number (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- set_variable_number(objType, number)[source]#
update the number of variables in the model
>>> status = exo.set_variable_number('EX_NODAL', num_nvars)
- Parameters:
objType (ex_entity_type) – type of object begin queried
number (int) –
- Returns:
status – True = successful execution
- Return type:
bool
- set_variable_truth_table(objType, table)[source]#
stores a truth table indicating which variables are defined for all sets/blocks of the specified objType and all variables; variable index cycles faster than entity index
>>> status = exo.set_variable_truth_table('EX_NODE_SET', nsvar_truth_tab)
- Parameters:
objType (ex_entity_type) – type of object begin queried
table (list<bool>) – True for variable defined in a node set, False otherwise
- Returns:
status – True = successful execution
- Return type:
bool
- summarize()[source]#
Outputs a summary of the exodus file data. Output is similar to:
Database: base_ioshell_copy.e Title: This is the title Number of spatial dimensions = 3 Number of global variables = 10 Number of node blocks = 1 Number of nodes = 1,331 Number of nodal variables = 2 Number of element blocks = 1 Number of elements = 1,000 Number of element variables = 5 Number of node sets = 3 Length of node list = 363 Number of nodeset variables = 4 Number of element side sets = 3 Length of element sides = 300 Number of sideset variables = 3 Number of assemblies = 4 Number of assembly variables = 10 Number of blobs = 0 Number of blob variables = 0 Number of time steps = 5
- exodus.getExodusVersion()[source]#
Parse the exodusII.h header file and return the version number or 0 if not found.
- exodus.internal_add_variables(exo, obj_type, entvars, debugPrint)[source]#
Internal support function for
exodus.add_variables()
- exodus.internal_transfer_variables(exoFrom, exo_to, obj_type, additionalVariables, debugPrint)[source]#
Internal support function for
exodus.transfer_variables()
- exodus.transfer_variables(exoFrom, exo_to, array_type='ctype', additionalGlobalVariables=None, additionalNodalVariables=None, additionalElementVariables=None, additionalNodeSetVariables=None, additionalSideSetVariables=None)[source]#
This function transfers variables from exoFrom to exo_to and allows additional variables to be added with additionalGlobalVariables, additionalNodalVariables, and additionalElementVariables. Additional variables values are set to their defaults so that the user can populate them later.
- Parameters:
exoFrom (exodus database object) – exodus object to transfer from
exo_to (exodus database object) – exodus object to transfer to
additionalGlobalVariables (list) – list of global variable names to add.
additionalNodalVariables (list) – list of nodal variable names to add.
additionalElementVariables (list) – should be a list of element variable names to add to all blocks or tuples (name, blkIds) where name is the element variable to add and blkIds is a list of block ids to add it to.