fedoo.DataSet
- class DataSet(mesh: Mesh | None = None, data: dict | None = None, data_type: str = 'node')
Object to store, save, load and plot data associated to a mesh.
DataSet have a multiframe version
fedoo.MultiFrameDataSetthat is a class that encapsulate several DataSet mainly usefull for time dependent data.- mesh
Mesh object associated to the data
- Type:
fd.Mesh
- node_data
Dictionnary of data fields defined at mesh nodes.
- Type:
dict
- element_data
Dictionnary of data fields defined at mesh elements.
- Type:
dict
- gausspoint_data
Dictionnary of data fields defined at gauss points.
- Type:
dict
- res.scalar_data
Dictionnary of scalar data.
- Type:
dict
- field_metadata
Numeric field descriptions persisted in FDH5, including beam sections.
- Type:
dict
- current_local_frame
Read-only frame-field selection; change it with
set_current_local_frame(). None selects automatically per submesh. Selection affects arrow overlays, not the coordinate system of results.- Type:
str or None
- beam_options
Section
position(normalized (y, z)) orpoint_index, mutually exclusive.sourceis ‘auto’, ‘stored’ or ‘recomputed’.reductionis None, ‘max’, ‘min’, ‘signed_abs_max’ (largest magnitude retaining its sign) or ‘abs_max’ (default, nonnegative largest magnitude).samplesaffects recomputed sampling only. Extrema are estimates.- Type:
dict
- shell_options
Normalized thickness
positionin [-1, 1], orpoint_index. With no position/index, the default reads the sole saved thickness point, or the top face when multiple points or only generalized fields exist. Sources and reductions followbeam_options. Nonlinear stresses are interpolated layerwise from saved material points;samplessets the generated count per layer and is ignored for stored tensors.- Type:
dict
Notes
Data in the node_data, element_data or gauspoint_data dictionarries should be provided as 1D or 2D NumPy arrays, where the last dimension matches the number of nodes, elements or integration points in the associated mesh, respectively.
For gausspoint_data, the number of Gauss points per element is assumed to be constant and is inferred from the array’s shape.
If 2D NumPy arrays are provided, or 1D for scalar data, the first dimension corresponds to the data components.
To access data, it is recommended to use the
fedoo.DataSet.get_data()method as it supports automatic conversion between different data types.Local-frame selection is independent of the scalar field plotted. Use
set_current_local_frame()to select a tagged orientation field, thenplot()withshow_local_frame=Trueor a size percentage to show it. Selecting a frame alone does not enable arrows. The default selection, None, prefers saved shell/beam frames, then other tagged frames such as material orientations. If no field is available, geometric frames are constructed for surfaces in 3D and lines in 2D/3D. Full-dimensional 2D/3D meshes have no geometric fallback. A MultiMesh resolves this choice separately per submesh. Copies and iteration changes preserve the selection; FDH5 does not store it.- Parameters:
mesh (Mesh, optional) – Mesh object associated to the data. The default is None.
data (dict, optional) – dict containing the data. The default is None.
data_type (str in {'node', 'element', 'gausspoint', 'scalar', 'all'}) – type of data. The default is ‘node’.
- __init__(mesh: Mesh | None = None, data: dict | None = None, data_type: str = 'node') None
Methods
DataSet.__getitem__(items)DataSet.add_data(data_set)Update the DataSet object including all the node, element and gausspoint data from antoher DataSet object data_set.
DataSet.add_scalar_expression(name, expression)Compute one scalar per frame from fields, scalars and named sets.
Lazy section tensors, available when generalized fields have metadata.
Section metadata with varying properties evaluated at beam Gauss points.
Make a copy of the dataset.
Make a deep copy of the dataset.
DataSet.get_data(field[, component, ...])Retrieve data from the DataSet for a given field.
DataSet.global_element_id(submesh_id, ...)Return the global element id for a submesh-local element id.
DataSet.global_element_location(element_id)Return
(submesh_id, local_element_id)for a global element id.DataSet.load(data[, load_mesh, iteration])Load data from a data object.
DataSet.load_dict(data)Load data from a dict generated with the to_dict method.
DataSet.plot([field, component, data_type, ...])Plot a field on the surface of the associated mesh.
DataSet.read(filename[, file_format])Read a file from disk.
DataSet.save(filename[, save_mesh, ...])Save data to a file.
DataSet.save_mesh(filename)Save the mesh using a vtk file.
DataSet.savez(filename[, save_mesh])Write a npz file using the numpy savez function.
DataSet.savez_compressed(filename[, save_mesh])Write a compressed npz file using the numpy savez_compressed function.
Unified beam and shell tensor aliases for plotting.
DataSet.set_beam_section(section)Attach section properties to old generalized fields on a single mesh.
DataSet.set_current_local_frame([field])Select the orientation field used by local-frame arrow overlays.
Shell tensors selectable through the thickness after saving.
DataSet.shell_sources(kind)Available stored and reconstructed thickness distributions.
DataSet.split_global_element_indices(element_ids)Split global element ids into submesh-local element ids.
DataSet.to_csv(filename[, save_mesh])Write data in a csv file.
Return fields and optional JSON metadata for NPZ/FDZ storage.
DataSet.to_excel(filename[, save_mesh])Write data in a xlsx file (excel format).
DataSet.to_fdh5(filename[, iteration, ...])Write the dataset to a FDH5 file.
DataSet.to_fdz(filename[, save_mesh, ...])Write a fdz file from the dataset.
DataSet.to_msh(filename)Write a msh (gmsh format) file with mesh and associated data.
DataSet.to_pyvista([gp_data_to_node, ...])Convert the dataset to a PyVista unstructured grid.
DataSet.to_vtk(filename[, binary, ...])Write vtk file with the mesh and associated data.
Beam selection options; see
fedoo.util.beam_recovery.BeamOptions.Selected orientation field, or None for automatic per-submesh selection.
Thickness options; see
fedoo.util.shell_recovery.ShellOptions.Active submesh used by MultiMesh data access.