Skip to content
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

Add functionality to mooring module #251

Open
hivanov-nrel opened this issue Jul 13, 2023 · 0 comments
Open

Add functionality to mooring module #251

hivanov-nrel opened this issue Jul 13, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@hivanov-nrel
Copy link
Contributor

hivanov-nrel commented Jul 13, 2023

Need to add functionality for reading in different types of mooring lines in the io module.
Mooring modular added in #235

 # TODO: get rod type property sets
        if line.count('---') > 0 and (line.upper().count('ROD DICTIONARY') > 0 or line.upper().count('ROD TYPES') > 0):
            # skip this header line, plus channel names and units lines
            line = next(f)
            # line = next(f)
            # line = next(f)
            # RodDict = dict()
            # while line.count('---') == 0:
            #     entries = line.split()
            #     #RodTypesName.append(entries[0]) # name string
            #     #RodTypesD.append(   entries[1]) # diameter
            #     RodDict[entries[0]] = entries[1] # add dictionary entry with name and diameter
            #     line = next(f)
            # #ds.attrs['ROD_TYPES'] = RodDict

        # TODO: get properties of each Body
        if line.count('---') > 0 and (line.upper().count('BODIES') > 0 or line.upper().count('BODY LIST') > 0 or line.upper().count('BODY PROPERTIES') > 0):
            # skip this header line, plus channel names and units lines
            line = next(f)
            # line = next(f)
            # line = next(f)
            # while line.count('---') == 0:
            #     entries = line.split()
            #     entry0 = entries[0].lower()

            #     num = np.int("".join(c for c in entry0 if not c.isalpha()))  # remove alpha characters to identify Body #

            #     if ("fair" in entry0) or ("coupled" in entry0) or ("ves" in entry0):       # coupled case
            #         bodyType = -1
            #     elif ("con" in entry0) or ("free" in entry0):                              # free case
            #         bodyType = 0
            #     else:                                                                      # for now assuming unlabeled free case
            #         bodyType = 0
            #         # if we detected there were unrecognized chars here, could: raise ValueError(f"Body type not recognized for Body {num}")
            #     #bodyType = -1   # manually setting the body type as -1 for FAST.Farm SM investigation

            #     r6  = np.array(entries[1:7], dtype=float)   # initial position and orientation [m, rad]
            #     r6[3:] = r6[3:]*np.pi/180.0                 # convert from deg to rad
            #     rCG = np.array(entries[7:10], dtype=float)  # location of body CG in body reference frame [m]
            #     m = np.float_(entries[10])                   # mass, centered at CG [kg]
            #     v = np.float_(entries[11])                   # volume, assumed centered at reference point [m^3]

            #     #self.bodyList.append( Body(self, num, bodyType, r6, m=m, v=v, rCG=rCG) )

            #     line = next(f)

        # TODO: get properties of each rod
        if line.count('---') > 0 and (line.upper().count('RODS') > 0 or line.upper().count('ROD LIST') > 0 or line.upper().count('ROD PROPERTIES') > 0):
            # skip this header line, plus channel names and units lines
            line = next(f)
            # line = next(f)
            # line = next(f)
            # while line.count('---') == 0:
            #     entries = line.split()
            #     entry0 = entries[0].lower()

            #     num = np.int("".join(c for c in entry0 if not c.isalpha()))  # remove alpha characters to identify Rod #
            #     lUnstr = 0 # not specified directly so skip for now
            #     #dia = RodDict[entries[2]] # find diameter based on specified rod type string
            #     nSegs = np.int(entries[9])

            #     # additional things likely missing here <<<

            #     #RodList.append( Line(dirName, num, lUnstr, dia, nSegs, isRod=1) )
            #     line = next(f)
            ```

@hivanov-nrel hivanov-nrel added the enhancement New feature or request label Jul 13, 2023
@hivanov-nrel hivanov-nrel self-assigned this Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant