fedoo.DataSet.get_data
- DataSet.get_data(field, component=None, data_type=None, return_data_type=False)
Retrieve data from the DataSet for a given field.
This method is equivalent to the DataSet.__getitem__ magic method. One may prefer to use the shorthand syntax: dataset[field, component, data_type].
- Parameters:
field (str) – Name of the data field to retrieve.
component (int, str or None, optional) – Index or label of the component to extract if the data is multi-dimensional. If None, all components are returned.
data_type (str or None, optional) – Desired data type to convert to. Can be one of ‘Node’, ‘Element’, or ‘GaussPoint’. If None, the original data type is preserved.
return_data_type (bool, optional) – If True, the method returns a tuple (data, data_type) where data_type is the type of the returned data. If False, only the data is returned.
- Returns:
data (np.ndarray) – The requested data, possibly converted to the specified type.
data_type (str, optional) – Returned only if return_data_type is True. Indicates the type of the returned data.
Notes
This method supports automatic conversion between node, element, and Gauss point data types when applicable.