sgio.SGMesh#
- class sgio.SGMesh(points, cells, point_data=None, cell_data=None, field_data=None, point_sets=None, cell_sets=None, gmsh_periodic=None, info=None, cell_point_data=None)#
Backend-neutral mesh container for Structure Genome I/O.
Stores geometry (points, cell blocks) and standard mesh data, plus
cell_point_datafor element-nodal fields. Attribute layout mirrorsmeshio.Meshso adapters can accesspoints/cells/point_data/cell_data/field_data/point_sets/cell_sets/gmsh_periodic/infouniformly. Interop withmeshiogoes throughfrom_meshio()/to_meshio().- cell_point_data#
Dictionary of element nodal data (data at nodes of each element). Structure: {name: [array_for_cell_block_0, array_for_cell_block_1, …]} where each array has shape (n_elements, n_nodes_per_element, n_components). This is used for storing element_node data like strain/stress at element nodes.
- Type:
dict[str, list[np.ndarray]]
- __init__(points, cells, point_data=None, cell_data=None, field_data=None, point_sets=None, cell_sets=None, gmsh_periodic=None, info=None, cell_point_data=None)#
Methods
__init__(points, cells[, point_data, ...])add_cell_data_from_dict(name, dict_data)Attach per-element data (given as
{element_id: value}) to the mesh.add_point_data_from_dict(name, dict_data)Attach per-node data (given as
{node_id: value}) topoint_data.copy()Return a deep copy of this mesh.
from_meshio(mesh)Build an
SGMeshfrom ameshio.Mesh.from_pyvista(grid)Build an
SGMeshfrom a pyvista dataset.get_cell_block_by_type(cell_type)to_meshio()Export this mesh to a
meshio.Mesh.to_pyvista()Export this mesh to a
pyvista.UnstructuredGridfor visualization.