Skip to content

Comments

Pull out common classes for FFT/DST transforms in some Laplacians#3261

Open
ZedThree wants to merge 4 commits intonextfrom
laplace-common-transforms
Open

Pull out common classes for FFT/DST transforms in some Laplacians#3261
ZedThree wants to merge 4 commits intonextfrom
laplace-common-transforms

Conversation

@ZedThree
Copy link
Member

The Laplacian inversion solvers LaplaceCyclic, LaplacePCR, LaplacePCR_THOMAS all use identical code for transforming using FFTs/DSTs. This commit pulls out that common code to make it easier to maintain.

Also, make the transforms parallel-Z-ready by using the Z guard cells as offsets

@ZedThree ZedThree force-pushed the laplace-common-transforms branch from 89d4071 to cb6260d Compare January 30, 2026 13:38
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 25 out of 28. Check the log or trigger a new build to see more.

Also fix PCR and PCRThomas which were always using the global `nsys` array size,
instead of the local array size
The Laplacian inversion solvers `LaplaceCyclic`, `LaplacePCR`,
`LaplacePCR_THOMAS` all use identical code for transforming using
FFTs/DSTs. This commit pulls out that common code to make it easier to maintain.

Also, make the transforms parallel-Z-ready by using the Z guard cells as offsets
@ZedThree ZedThree force-pushed the laplace-common-transforms branch from bac2474 to 83d6660 Compare February 20, 2026 17:31
@ZedThree
Copy link
Member Author

Now also adds a couple of tests for FieldPerp as well

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

localmesh->getXcomm());
// Subtract average from kz=0 modes
for (int y = 0; y < ny; y++) {
BoutReal avg = global[y] / global[ny];
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'avg' of type 'BoutReal' (aka 'double') can be declared 'const' [misc-const-correctness]

Suggested change
BoutReal avg = global[y] / global[ny];
BoutReal const avg = global[y] / global[ny];

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.

1 participant