Helper functions

UFFFiles.jl provides several helper functions to facilitate interaction with UFF datasets.

1 Dataset Type

dataset_type(data::UFFDataset)

Returns the dataset type presents in a UFFDataset object.

Input

  • data::UFFDataset: The UFFDataset object to extract types from.

Output

  • Symbol: A vector containing the dataset types.

using UFFFiles

# Only one dataset is read
data = readuff("path/to/your/file.uff")[1]
dtype = dataset_types(data)

# Several datasets are read
data_all = readuff("path/to/your/file.uff")
dtypes = dataset_types.(data_all)

2 Supported Datasets

supported_datasets()

Returns a vector of supported UFF dataset types.

using UFFFiles

valid_datasets = supported_datasets()

3 Supported file extensions

supported_file_extensions()

Returns a vector of supported UFF file extensions.

using UFFFiles

valid_file_extensions = supported_file_extensions()

4 SRDC Documentation

This function provides an easy access to the documentation for Universal File datasets that were originally developed by the Structural Dynamics Research Corporation (SDRC) in the late 1960s and early 1970s.

srdc_doc(data::UFFDataset)

Displays the documentation developed by the SRDC (Structural Dynamics Research Corporation) for a given dataset type.

Input

  • data::UFFDataset: An instance of a UFF dataset type (e.g., Dataset15, Dataset18, etc.).

Output

  • Displays the documentation for the SRDC of the specified dataset type.

using UFFFiles

# Get the documentation for Dataset 15
srdc_doc(Dataser15())

5 Connectivity Matrix

connectivity_matrix(dataset::Dataset2412)

Returns the connectivity matrix for a Dataset2412 object, where each row corresponds to an element and each column corresponds to a node. Missing values are filled with -1.

Input

  • dataset::Dataset2412: The Dataset2412 object to extract connectivity from.

Output

  • Matrix{Int}: A matrix representing the connectivity of elements to nodes.

using UFFFiles

# readuff returns a vector of datasets
data2412 = readuff("path/to/your/file2412.uff")[1]
connectivity = connectivity_matrix(data2412)

6 Dataset 55 to matrix

dataset55_to_mat(dataset::Vector{Dataset55})

Converts a vector of Dataset55 objects into a matrix of data values and a vector of corresponding x-values based on the analysis type.

Input

  • dataset::Vector{Dataset55}: A vector of Dataset55 objects to be converted

Outputs

  • mat::VecOrMat{dtype}: A matrix where each column corresponds to a dataset's data values.

  • x::Vector{xtype}: Vector of x-values corresponding to each dataset based on its analysis type.

Note

  • dtype and xtype depend on the dataset's dtype and analysis_type respectively.

  • It is assumed that all datasets in the input vector have the same number of data points and analysis type.

using UFFFiles

# Let's assume you have read a UFF file containing dataset 55 only
data55 = readuff("path/to/your/file55.uff")

# Convert dataset 55 to a matrix
matrix55, x = dataset55_to_mat(data55)

7 Dataset 58 to matrix

dataset58_to_mat(dataset::Vector{Dataset58})

Converts a vector of Dataset58 objects into a matrix of data values and a vector of corresponding x-values based on the dataset parameters.

Input

  • dataset::Vector{Dataset58}: A vector of Dataset58 objects to be converted

Outputs

  • mat::VecOrMat{dtype}: A matrix where each row corresponds to a dataset's data values.

  • x::Vector{xtype}: A vector of x-values corresponding to each dataset based on its parameters.

Note

  • dtype and xtype depend on the dataset's ord_dtype.

  • It is assumed that all datasets in the input vector have the same number of data points and data type.

using UFFFiles

# Let's assume you have read a UFF file containing dataset 58 only
data58 = readuff("path/to/your/file58.uff")

# Convert dataset 58 to a matrix
matrix58, x = dataset58_to_matrix(data58)