Skip to content

Move absbc into per-iteration loop with density recomputation#5

Merged
kylegodbey merged 4 commits intodevfrom
copilot/sub-pr-4
Mar 11, 2026
Merged

Move absbc into per-iteration loop with density recomputation#5
kylegodbey merged 4 commits intodevfrom
copilot/sub-pr-4

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 11, 2026

  • Analyze current absbc call placement issue in dynamic.f90
  • Remove absbc call from preparation phase (was only called once at iter=0)
  • Add absbc call inside per-iteration time-stepping loop after Step 3
  • Avoid double density computation: skip add_density in propagation loop when nabsorb > 0; compute densities once after absbc masks psi
  • Code review - no issues found

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 11, 2026 20:02
Co-authored-by: kylegodbey <5806808+kylegodbey@users.noreply.github.com>
Co-authored-by: kylegodbey <5806808+kylegodbey@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback on absorbing conditions implementation Move absbc into per-iteration loop with density recomputation Mar 11, 2026
@aaron-philip aaron-philip marked this pull request as ready for review March 11, 2026 20:18
@aaron-philip
Copy link
Copy Markdown
Collaborator

Ok Copilot is right, my fault!

@kylegodbey
Copy link
Copy Markdown
Member

@copilot We likely don't need to compute the densities twice, then. If nabsorb > 0, then don't compute the densities after the time step.

Co-authored-by: kylegodbey <5806808+kylegodbey@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Mar 11, 2026

@copilot We likely don't need to compute the densities twice, then. If nabsorb > 0, then don't compute the densities after the time step.

Done in commit de87ed9. The add_density call in the Step 3 propagation loop is now skipped when nabsorb > 0 (via IF(nabsorb == 0)), and similarly collect_densities is only called when nabsorb == 0. The redundant density reset inside the absbc block was also removed — densities are already zero from the Step 3 reset before the loop. So when nabsorb > 0, densities are computed exactly once after absbc masks the wavefunctions.

@kylegodbey kylegodbey merged commit d991584 into dev Mar 11, 2026
Copilot stopped work on behalf of kylegodbey due to an error March 11, 2026 20:23
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.

3 participants