Repository navigation
Fix issue #236: remove dead outflow-BC plumbing in Projection - #263
Merged
Merged
Conversation
…tion
- Remove the filterP declaration (never defined anywhere in the tree).
- Retire nodal_proj.add_vort_proj: it only fed initialVorticityProject,
which post_init_state aborts before calling.
- set_outflow_bcs / set_outflow_bcs_at_level only ever use Sig_in and
gravity, so drop the unused Vel_in, Divu_in, have_divu and which_call
parameters and compute gravity inside set_outflow_bcs. The remaining
job is the hydrostatic rho*g from computeRhoG, so every call site now
gates on gravity != 0:
- level_project: drop the "have_divu ||" term and the unused Vel_ML
and Divu_ML vectors.
- initialPressureProject: test gravity explicitly (its only caller
already did).
- initialVelocityProject, initialSyncProject: drop the calls. With
gravity == 0 they could only re-zero a phi that is already zero.
That also removes the ghost cells that existed solely to feed those
calls -- nghost is now 0 for sig in initialVelocityProject (so the
rho_wgt_vel_proj density-boundary block goes away) and for rhcc in
initialSyncProject -- so a divu run no longer does a pointless global
gather per level. MLNodeLaplacian copies only valid cells from sig and
rhcc and fills ghosts itself.
- Remove the now-unused which_call tags INITIAL_VEL, INITIAL_SYNC,
SYNC_PROJ and FILTER_P, and fix the stale comments about U_new/divusource
being used to construct the outflow BCs.
No change in results: regtest.2d.hotspot (gravity, outflow at y-hi,
have_divu, 2 levels of refinement) agrees bit-for-bit with the previous
code on all fields at all levels.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Fixes #236.
filterPdeclaration removed (never defined; any caller would get a link error).nodal_proj.add_vort_projretired — it only fedinitialVorticityProject, whichpost_init_stateaborts before reaching.set_outflow_bcs/set_outflow_bcs_at_levelonly consumeSig_inandgravity, so the unusedVel_in/Divu_in/have_divu/which_callparameters are gone and gravity is computed inside. The one remaining job is the hydrostaticrho*gfromcomputeRhoG, so every call site now gates ongravity != 0:level_project: drop thehave_divu ||term and the unusedVel_ML/Divu_MLvectors.initialPressureProject: test gravity explicitly (its only caller already did).initialVelocityProject,initialSyncProject: drop the calls — withgravity == 0they could only re-zero aphithat is already zero.That also removes the ghost cells that existed solely to feed those calls (
nghostis now 0 forsigininitialVelocityProject, so therho_wgt_vel_projdensity-boundary block goes away, and forrhccininitialSyncProject), so a divu run no longer does a pointless global gather per level. MLNodeLaplacian copies only valid cells fromsig/rhccand fills ghosts itself.Unused
which_calltags (INITIAL_VEL,INITIAL_SYNC,SYNC_PROJ,FILTER_P) removed, and the stale comments aboutU_new/divusourcebeing used to construct the outflow BCs fixed.OutFlowBC::SemiGrow/SemiCoarsenare dead too but belong to #239, so they are left alone;nodal_proj.do_outflow_bcsstays — it still switches the hydrostatic BC off.Verification
Exec/run2dandExec/run3dboth build clean;Projection.cppalso compiles clean under-Wall -Wextrawith asserts enabled, with no unused-parameter warnings.regtest.2d.hotspotexercises everything touched here:ns.gravity = -9.8,ns.hi_bc = 5 2(outflow at y-hi),do_temp = 1sohave_divu, andamr.max_level = 2so the fine level covers the outflow face andputDownruns. Before/after plotfiles at step 5 agree bit-for-bit on all fields at all three levels (fcompare: PLOTFILE AGREE).🤖 Generated with Claude Code