Skip to content

Port openfast-registry to C++ and change pointers#1589

Closed
deslaughter wants to merge 1 commit intoOpenFAST:dev-unstable-pointersfrom
deslaughter:f/ofreg
Closed

Port openfast-registry to C++ and change pointers#1589
deslaughter wants to merge 1 commit intoOpenFAST:dev-unstable-pointersfrom
deslaughter:f/ofreg

Conversation

@deslaughter
Copy link
Collaborator

@deslaughter deslaughter commented May 24, 2023

This pull request is nearly ready to be merged, but it will likely break SeaState so we may need to discuss

Feature or improvement description

This pull request contains a port of the openfast-registry to C++. The new registry doesn't support the dimspec command used in AD14 so they were replaced in the input file. This module will be removed soon and this feature is not used by other modules so it didn't seem necessary to keep this feature. AeroDyn_Registry.txt had a malformed line which was acceptable to the previous parser, but didn't work for the new one so the input file was updated. All other registry files are unchanged.

The registry implements specifying a target and a regular pointer pointer on the field name using & and * respectively. The registry treats TARGETs (&) the same as allocatable fields with respect to pack/unpack/copy. Essentially, target's own their memory and it is packed/unpacked/copied like an allocatable field. POINTERS (*) do not own their memory and are not packed/unpacked. The pointer association is maintained by the copy function.

typedef  ^  ^  FlowFieldType    *FlowField   - - -  "Pointer to field, does not own memory, should only be used to point to targets"
typedef  ^  ^  FlowFieldType    &FlowField  - - -  "Target pointer, owns memory, will be deallocated when Destroy is called"  -

Impacted areas of the software
Mainly affects openfast-registry, but due to some insignificant differences all _Types.f90 files have been regenerated.

Test results, if applicable

Merge Ordering
Merge after #1008, but only when SeaState refactoring is ready for merging.

This commit contains a complete port of the openfast-registry to C++.
The new registry doesn't support the dimspecs used in AD14 so
they were replaced in the input file. This module will be removed soon
and this feature is not used by other modules so it didn't seem
necessary to keep this feature.

AeroDyn_Registry.txt had a malformed line which was acceptable to the
previous parser, but didn't work for the new one so the input file was
updated.

The registry implements specifying a target and a regular pointer
pointer on the field name using & and * respectively. The registry
treats TARGETs (&) the same as allocatable fields wrt pack/unpack/copy.
Essentially, target's own their memory. POINTERS (*) do not own their
memory and are not packed/unpacked. The pointer association is
maintained by the copy function.
@luwang00
Copy link
Contributor

luwang00 commented May 25, 2023

This pull request might create some conflict with the current implementation of SeaState (PR #1008 and PR #1578). Suggest holding off until PR #1008 and PR #1578 are merged in first. We can perhaps save this for v4.1.0.

@deslaughter
Copy link
Collaborator Author

@luwang00 I agree with holding off until SeaState has been merged, but I'd like to have it in before v4.1.0. If you've already pulled this into the SeaState refactoring branch, then we could probably merge that branch and I can just close this PR.

@andrew-platt
Copy link
Collaborator

Let's keep this as separate PR. There will be a few other PR's that depend on this (Wake added turbulence, LidarSim).

I would also like to get this in before 4.1.0, which means we will merge in the SeaState refactoring as part of 4.0.0 instead of in 4.1.0.

@luwang00
Copy link
Contributor

The commit associated with this pull request is cherry-picked into this branch. Currently working on updating SeaState and HydroDyn to be compatible with and to make full use of the new OpenFAST Registry capabilities with pointers to derived types. It should be done in time for v4.0.0 release.

@andrew-platt andrew-platt changed the base branch from dev to dev-unstable-pointers June 5, 2023 21:25
@deslaughter
Copy link
Collaborator Author

Closing this PR as the code changes are included in #1609.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments