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 reorder kernels for switching from/to Cartesian ordering #76

Merged
merged 11 commits into from Mar 21, 2024

Conversation

semi-h
Copy link
Member

@semi-h semi-h commented Mar 14, 2024

The idea is we interact with outside world always with Cartesian data order.

Backends require a special data structure, but they are capable of converting the specialist data structure into Cartesian and vice versa, so we can and should always input from and output to Cartesian ordered arrays.
We plan to carry out this operation with the get_field/set_field subroutines in both backends, but as of now they can't carry out the conversion to and from Cartesian yet. Becase in order to switch to and from Cartesian we need to be able to request a Cartesian shape from the allocator, (#34), and the plan is to merge the PR enables this on Monday after finalising some important decisions.

Although this PR doesn't enables the actual functionality we need, it provides all the necessary kernels. I think the best would be merging this before #34, and making the final minor changes in get_field/set_field in #34.

@semi-h
Copy link
Member Author

semi-h commented Mar 20, 2024

I think the PR in its final shape, and ready for a review. get_field_data and set_field_data functions are now implemented at base backend level, and capable of passing back a 3D array with any directionality we can optionally provide. All use cases in the codebase as of now input and output a Cartesian 3D array, so I made Cartesian ordering default if no directionality is specified. However, one can easily allocate a x-directional Fortran array and request get_field_data to output into x-directional 3D array. @JamieJQuinn, please let me know if the PR provides the functionality you need for the IO.

Copy link
Collaborator

@JamieJQuinn JamieJQuinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some documentation but otherwise looks good! Cartesian remap should enable continued development on IO.

src/backend.f90 Show resolved Hide resolved
src/backend.f90 Outdated Show resolved Hide resolved
src/backend.f90 Outdated Show resolved Hide resolved
src/backend.f90 Outdated Show resolved Hide resolved
src/backend.f90 Outdated Show resolved Hide resolved
src/backend.f90 Outdated Show resolved Hide resolved
src/backend.f90 Outdated Show resolved Hide resolved
Co-authored-by: Jamie J Quinn <JamieJQuinn@users.noreply.github.com>
@semi-h
Copy link
Member Author

semi-h commented Mar 21, 2024

Added some documentation but otherwise looks good! Cartesian remap should enable continued development on IO.

Thanks a lot!

@semi-h semi-h merged commit eaeae17 into xcompact3d:main Mar 21, 2024
2 checks passed
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 this pull request may close these issues.

None yet

2 participants