Skip to content

Allow func_type=0 for UFF Data-Set 58 to Enable General Data Storage #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nuopel opened this issue Dec 10, 2024 · 3 comments · Fixed by #97
Closed

Allow func_type=0 for UFF Data-Set 58 to Enable General Data Storage #96

Nuopel opened this issue Dec 10, 2024 · 3 comments · Fixed by #97

Comments

@Nuopel
Copy link

Nuopel commented Dec 10, 2024

Hello,
I'm trying to use func_type = 0 with data-set 58 for a workaround data saving.

However it restricted to [1, 2, 3, 4, 6, 9]:

def _write58(fh, dset, mode='add', _filename=None, force_double=True):
    """Writes function at nodal DOF - data-set 58 - to an open file fh."""
    try:
        if not (dset['func_type'] in [1, 2, 3, 4, 6, 9]):
            raise ValueError('Unsupported function type')

is there any reason to restrict to these types only ?
From a doc i found : https://www.ceas3.uc.edu/sdrluff/view.php :

Record 6: Format(2(I5
,I10),2(1X,10A1,I10,I4))
DOF Identification
Field 1 - Function Type
0 - General or Unknown
1 - Time Response
2 - Auto Spectrum
3 - Cross Spectrum
4 - Frequency Response Function
5 - Transmissibility
6 - Coherence
7 - Auto Correlation
8 - Cross Correlation
9 - Power Spectral Density (PSD)
10 - Energy Spectral Density (ESD)
11 - Probability Density Function
12 - Spectrum
13 - Cumulative Frequency Distribution
14 - Peaks Valley
15 - Stress/Cycles
16 - Strain/Cycles
17 - Orbit
18 - Mode Indicator Function
19 - Force Pattern
20 - Partial Power
21 - Partial Coherence
22 - Eigenvalue
23 - Eigenvector
24 - Shock Response Spectrum
25 - Finite Impulse Response Filter
26 - Multiple Coherence
27 - Order Function
which in fine is just about the referencing not changing anything from the data ? I not sure about it for all the Function Type but the 0 type should be fine ?

Description:

The _write58 function in pyuff currently restricts the func_type parameter to specific values ([1, 2, 3, 4, 6, 9]), which prevents the use of func_type=0 (General or Unknown). According to the UFF standard documentation, func_type=0 is intended for general or unknown data.

Proposal:

Update _write58 to allow func_type=0, as it is defined in the UFF standard and does not impose any additional requirements on the data format. Maybe the others func_type too ?

Thanks,
Sam

@jankoslavic
Copy link
Contributor

@Nuopel Thank you for opening this issue. This sound reasonable. It is a small change. Would you be willing to prepare a pull request with a small test?

@Nuopel Nuopel mentioned this issue Dec 10, 2024
@Nuopel
Copy link
Author

Nuopel commented Dec 10, 2024

@jankoslavic Thank you, i've added 0 and a small test, tell me if it's enough

@jankoslavic
Copy link
Contributor

Great! Thank you for this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants