-
Notifications
You must be signed in to change notification settings - Fork 104
Add more tests for FCI operators #3196
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
Open
ZedThree
wants to merge
32
commits into
next
Choose a base branch
from
fci-tests
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+693
−469
Open
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
36f19fa
CI: Don't run clang-{tidy,format} on RC branches
ZedThree aaa4600
Fix reorder warning from snes
ZedThree e48cc34
Fix some easy clang-tidy snes warnings
ZedThree a855c06
Bump bundled fmt
ZedThree e2cd97c
Fix deprecation warning
ZedThree 89b0855
Remove `boututils` from requirements; bump `boutdata`
ZedThree 1704a4a
Suppress warning from `nodiscard` function
ZedThree 8c26fe3
Add shim for ARKodeGetNumRhsEvals
ZedThree ef744ea
tests: Ruff fixes for FCI runtest
ZedThree d889ecf
tests: Expand FCI MMS test to `Grad2_par2`
ZedThree 122c39a
tests: Generalise FCI MMS test to allow for more cases
ZedThree 1a0af58
tests: Add test for FCI `Div_par`
ZedThree 1e912bd
tests: Make MMS script update input in-place
ZedThree 560b005
tests: Add test for FCI `Div_par_K_Grad_par`
ZedThree 8910b61
Many small fixes for FCI
ZedThree d170ca8
tests: Fix for 3D metric in FCI test
ZedThree bdef58e
tests: Add test for FCI `Laplace_par`
ZedThree 969997c
Reduce duplication in FCI mms script
ZedThree 3468db4
Remove circular include
ZedThree aee8ecc
tests: Add cases for FCI interpolation methods
ZedThree 8e9c0fc
tests: Increase nx for hermitespline interpolation boundary problem
ZedThree 6a4204f
tests: Add monotonichermitespline, decrease resolution scan
ZedThree 8879da7
Merge branch 'next' into fci-tests
ZedThree 760a24f
tests: Small refactor of FCI tests
ZedThree 58e2673
Apply black changes
ZedThree 10b0d40
Apply clang-format changes
ZedThree ad30f00
Apply clang-tidy fixes to FCI tests
ZedThree f17d21a
Fix comment formatting
ZedThree 783968a
Apply suggestion from @dschwoerer
ZedThree c8faf01
tests: Fix typo that made tests always pass
ZedThree 3dbed9a
tests: Remove monotonichermitespline FCI case
ZedThree 9f78a3c
Add `rtol`, `atol` to `MonotonicHermiteSpline`
ZedThree File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,7 +157,7 @@ void XZHermiteSpline::calcWeights(const Field3D& delta_x, const Field3D& delta_z | |
|
|
||
| const int ny = localmesh->LocalNy; | ||
| const int nz = localmesh->LocalNz; | ||
| const int xend = (localmesh->xend - localmesh->xstart + 1) * localmesh->getNXPE() | ||
| const int xend = ((localmesh->xend - localmesh->xstart + 1) * localmesh->getNXPE()) | ||
| + localmesh->xstart - 1; | ||
| #ifdef HS_USE_PETSC | ||
| IndConverter conv{localmesh}; | ||
|
|
@@ -177,7 +177,19 @@ void XZHermiteSpline::calcWeights(const Field3D& delta_x, const Field3D& delta_z | |
| BoutReal t_x = delta_x(x, y, z) - static_cast<BoutReal>(i_corn); | ||
| BoutReal t_z = delta_z(x, y, z) - static_cast<BoutReal>(k_corner(x, y, z)); | ||
|
|
||
| // NOTE: A (small) hack to avoid one-sided differences | ||
| // NOTE: A (small) hack to avoid one-sided differences. We need at | ||
| // least 2 interior points due to an awkwardness with the | ||
| // boundaries. The splines need derivatives in x, but we don't | ||
| // know the value in the boundaries, so _any_ interpolation in the | ||
| // last interior cell can't be done. Instead, we fudge the | ||
| // interpolation in the last cell to be at the extreme right-hand | ||
| // edge of the previous cell (that is, exactly on the last | ||
| // interior point). However, this doesn't work with only one | ||
| // interior point, because we have to do something similar to the | ||
| // _first_ cell, and these two fudges cancel out and we end up | ||
| // indexing into the boundary anyway. | ||
| // TODO(peter): Can we remove this if we apply (dirichlet?) BCs to | ||
| // the X derivatives? Note that we need at least _2_ | ||
| if (i_corn >= xend) { | ||
| i_corn = xend - 1; | ||
| t_x = 1.0; | ||
|
|
@@ -346,6 +358,8 @@ Field3D XZHermiteSpline::interpolate(const Field3D& f, const std::string& region | |
| ASSERT1(f.getMesh() == localmesh); | ||
| Field3D f_interp{emptyFrom(f)}; | ||
|
|
||
| // TODO(peter): Should we apply dirichlet BCs to derivatives? | ||
|
|
||
|
Comment on lines
+361
to
+362
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not think so. What would be the motivation? So we do not need two x-guard cells? |
||
| #if USE_NEW_WEIGHTS | ||
| #ifdef HS_USE_PETSC | ||
| BoutReal* ptr; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think that applying dirichlet BCs will be in general a good idea.
I think in general this is not really an issue - anything that takes the case below should be
i_corn == xendandt_x = 0. Other cases should be boundaries, and should not take this path.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's true about the boundaries. The pain here is for grids where there's only one point in either x or z, so this fudge ends up cancelling out and breaking things. That's probably not super common, so maybe we just need
ASSERT4(mesh.Nx() >= 2)or somethingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that is only an issue for tests, that try to have a minimal grid. I do not think we should to much effort in for them ...