Defined as:
sdynpy.fem.sdynpy_exodus.ExodusInMemoryModule:
sdynpy.fem.sdynpy_exodusSource: GitHub
Signature¶
class sdynpy.ExodusInMemory(exo=None, variables=None, timesteps=None, blocks=None)Read or write exodus files loaded into memory
This is a convenience class wrapped around the exodus class to enable easier manipulation of exodus files that fit entirely into memory
Parameters¶
exo : exodus An exodus object, if you want to load an exodus file into memory, or None if you want to create an empty exodus file.
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.
Methods¶
| Name | Summary |
|---|---|
__init__ | Initialize self. See help(type(self)) for accurate signature. |
extract_sharp_edges | |
from_sdynpy | |
get_block_surface | Gets the node indices and element connectivity of surface elements |
load_from_exodus | |
reduce_to_surfaces | |
repack | Repackages an exodus file as a linear combination of itself |
triangulate_surface_mesh | Triangulate a surface mesh for plotting patches |
write_to_file |
__init__¶
Source: GitHub
def sdynpy.ExodusInMemory.__init__(self, exo=None, variables=None, timesteps=None, blocks=None)Initialize self. See help(type(self)) for accurate signature.
extract_sharp_edges¶
Source: GitHub
def sdynpy.ExodusInMemory.extract_sharp_edges(self, *args, **kwargs)from_sdynpy¶
Source: GitHub
def sdynpy.ExodusInMemory.from_sdynpy(geometry, displacement_data=None)get_block_surface¶
Source: GitHub
def sdynpy.ExodusInMemory.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)
load_from_exodus¶
Source: GitHub
def sdynpy.ExodusInMemory.load_from_exodus(self, exo, variables=None, timesteps=None, blocks=None)reduce_to_surfaces¶
Source: GitHub
def sdynpy.ExodusInMemory.reduce_to_surfaces(self, *args, **kwargs)repack¶
Source: GitHub
def sdynpy.ExodusInMemory.repack(self, q, modes=None)Repackages an exodus file as a linear combination of itself
triangulate_surface_mesh¶
Source: GitHub
def sdynpy.ExodusInMemory.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
write_to_file¶
Source: GitHub
def sdynpy.ExodusInMemory.write_to_file(self, filename, clobber=False)