Fix constantface comm#542
Open
NickvonWit wants to merge 3 commits into
Open
Conversation
Create a new test file for a Constant Face and Periodic Face respectively. We remove the old file.
s-mayani
reviewed
Jun 8, 2026
| } | ||
|
|
||
| Inform m(""); | ||
| m << "size,h,relError,trueResidual,solverResidual,itCount,solveTime" << endl; |
Collaborator
There was a problem hiding this comment.
I think here it's better to print only the same things as were being printed by the TestCGSolver_convergence before.
s-mayani
reviewed
Jun 8, 2026
Comment on lines
+118
to
+143
|
|
||
| const double ax = pi * x; | ||
| const double ay = pi * y; | ||
| const double az = pi * z; | ||
|
|
||
| const double sx = sin(sin(ax)); | ||
| const double sy = sin(sin(ay)); | ||
| const double sz = sin(sin(az)); | ||
|
|
||
| const double cx = cos(sin(ax)); | ||
| const double cy = cos(sin(ay)); | ||
| const double cz = cos(sin(az)); | ||
|
|
||
| const double sax = sin(ax); | ||
| const double say = sin(ay); | ||
| const double saz = sin(az); | ||
|
|
||
| const double cax = cos(ax); | ||
| const double cay = cos(ay); | ||
| const double caz = cos(az); | ||
|
|
||
| const double u = sx * sy * sz; | ||
|
|
||
| const double f = pi * pi | ||
| * (cx * sax * sy * sz + sx * cy * say * sz + sx * sy * cz * saz | ||
| + sx * sy * sz * (cax * cax + cay * cay + caz * caz)); |
Collaborator
There was a problem hiding this comment.
maybe change it back to the same function as the original file, for readability
s-mayani
reviewed
Jun 8, 2026
Comment on lines
+187
to
+188
| m << pt << "," << std::setprecision(16) << dx << "," << relError << "," << trueResidual | ||
| << "," << solverResidual << "," << itCount << "," << solveTime << endl; |
Collaborator
There was a problem hiding this comment.
as said before, change back to original output results
s-mayani
reviewed
Jun 8, 2026
| } | ||
|
|
||
| Inform m(""); | ||
| m << "size,h,relError,trueResidual,solverResidual,itCount,solveTime" << endl; |
Collaborator
There was a problem hiding this comment.
same comment as before regarding which results are printed
s-mayani
reviewed
Jun 8, 2026
Comment on lines
+116
to
+140
| const double ax = a * x; | ||
| const double ay = a * y; | ||
| const double az = a * z; | ||
|
|
||
| const double sx = sin(sin(ax)); | ||
| const double sy = sin(sin(ay)); | ||
| const double sz = sin(sin(az)); | ||
|
|
||
| const double cx = cos(sin(ax)); | ||
| const double cy = cos(sin(ay)); | ||
| const double cz = cos(sin(az)); | ||
|
|
||
| const double sax = sin(ax); | ||
| const double say = sin(ay); | ||
| const double saz = sin(az); | ||
|
|
||
| const double cax = cos(ax); | ||
| const double cay = cos(ay); | ||
| const double caz = cos(az); | ||
|
|
||
| const double u = sx * sy * sz; | ||
|
|
||
| const double f = a * a | ||
| * (cx * sax * sy * sz + sx * cy * say * sz + sx * sy * cz * saz | ||
| + sx * sy * sz * (cax * cax + cay * cay + caz * caz)); |
s-mayani
reviewed
Jun 8, 2026
Comment on lines
+198
to
+199
| m << pt << "," << std::setprecision(16) << dx << "," << relError << "," << trueResidual | ||
| << "," << solverResidual << "," << itCount << "," << solveTime << endl; |
s-mayani
requested changes
Jun 8, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix face-specific boundary detection in
ExtrapolateFace::apply()This PR fixes #541. It also adds problem specific, Constant or Periodic Face, test files for the CG Solver.
The new test file for the constant face accounts for #535 by shifting the coordinates, to have the halo cells lie on the boundary instead of. The mechanism is explained in detail in my thesis.
File:
src/Field/BcTypes.hpp(ExtrapolateFace<Field>::apply())The old boundary check used an OR over both faces, so a rank touching the lower
global boundary would also apply the upper face BC (and vice versa). On multiple
ranks this overwrote internal halo cells that should come from neighbouring
ranks, breaking
ConstantFace/ZeroFaceproblems.The check is now face-specific: a face is only treated as a physical boundary if
this rank owns the matching global boundary side. Internal interfaces fall
through to halo exchange as intended.
Before:
bool isBoundary = (lDomains[myRank][d].max() == domain[d].max()) || (lDomains[myRank][d].min() == domain[d].min());After:
Running the same tests as in #541, again with 4 ranks/CPUs:
TestCGSolver_convergence_constant:
TestCGSolver_convergence_periodic: