Skip to content

Initialize PBSAM inputs and pass surface file count - #324

Merged
sobolevnrm merged 1 commit into
mainfrom
fix/pbsam-input-init
Oct 26, 2026
Merged

sobolevnrm merged 1 commit into
mainfrom
fix/pbsam-input-init

Conversation

@sobolevnrm

Copy link
Copy Markdown
Member

This fixes two input-setup bugs in solvePBSAM that are still on main.
PBAMInput pbamIn was uninitialized, and gridPts_ was only set when the input file specified pts, so PBSAM otherwise received an indeterminate grid-point count and other unset fields.
pbsamIn.surfct_ was never set, so PBSAM ignored any surf files listed in the input.

Changes:

  • Zero-initialize pbamIn.
  • Always pass parm->gridpt, which defaults to 15 in PBAMparm_ctor2.
  • Copy samparm->surfct into pbsamIn.surfct_.
  • Add a release note.

This supersedes the routines.c portion of draft #311.
Its CMake mc linking change already landed in #322.
The pbsam-barn_bars example data problem from #298 is not addressed here.

Validation: a local macOS build with ENABLE_PBAM=ON and ENABLE_PBSAM=ON passes pbam_test and pbsam_test with no compiler warnings in routines.c.
The PR's pb-solvers CI job runs the same tests on Linux.

Refs #321, #311.

solvePBSAM left the PBAMInput struct uninitialized, only set gridPts_
when the input explicitly specified it, and never copied surfct, so
PBSAM ignored any surf files. Zero-initialize the struct, always pass
the grid-point count (which defaults to 15), and set surfct_.

Supersedes the routines.c portion of #311; its CMake change already
landed in #322.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 3eaf20ea-3ac0-4701-958f-28527bf641fc
@sobolevnrm
sobolevnrm merged commit 237f2e5 into main Oct 26, 2026
16 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.

1 participant