open-lasso-python / lasso-python

Home of the open-source CAE library lasso-python 🐍
BSD 3-Clause "New" or "Revised" License
50 stars 12 forks source link

ioshl3 flag values #39

Closed DavidR-Vortex closed 1 year ago

DavidR-Vortex commented 1 year ago

Add two new ioshl4 flag values for handling the presence of the combination of the internal energy, shell thickness values vs the unknown variables. This is not defined in the manual....999 was taken from a model. I don't know what the flag would be if there are unknown variables but no internal energy or thickness arrays....

A check also needs to be added if either internal energy or thickness is defined that both need to be as one cannot exist without the other

    # IOSHL3 - shell forces flag
    if (
        ArrayType.element_shell_shear_force in self.d3plot.arrays
        or ArrayType.element_shell_bending_moment in self.d3plot.arrays
        or ArrayType.element_shell_normal_force in self.d3plot.arrays
    ):
        new_header["ioshl3"] = 1000
    else:
        if (
            ArrayType.element_shell_thickness in self.d3plot.arrays 
            or ArrayType.element_shell_internal_energy in self.d3plot.arrays
        ):
                new_header["ioshl3"] = 999
        else:
            new_header["ioshl3"] = 0

    if n_shells == 0:
        new_header["ioshl3"] = (
            self.d3plot.header.raw_header["ioshl3"]
            if "ioshl3" in self.d3plot.header.raw_header
            else 0
        )

    # IOSHL4 - shell energy+2 unknown+thickness flag
    if (
        ArrayType.element_shell_thickness in self.d3plot.arrays
        or ArrayType.element_shell_unknown_variables in self.d3plot.arrays
        or ArrayType.element_shell_internal_energy in self.d3plot.arrays
    ):
        new_header["ioshl4"] = 1000
    else:
        # new_header["ioshl4"] = 999
        new_header["ioshl4"] = 0

    if n_shells == 0:
        new_header["ioshl4"] = (
            self.d3plot.header.raw_header["ioshl4"]
            if "ioshl4" in self.d3plot.header.raw_header
            else 0
        )
codie3611 commented 1 year ago

I would like to merge this but it bothers me that there is so much uncertainty in this ...

codie3611 commented 1 year ago

Checked witht he files I have and it seems fine ... will add to release