Skip to content

Issue 945 - Updates the STF and force implementations to match SPECFEM2D Fortran#1146

Merged
lsawade merged 2 commits intodevelfrom
issue-945
Sep 5, 2025
Merged

Issue 945 - Updates the STF and force implementations to match SPECFEM2D Fortran#1146
lsawade merged 2 commits intodevelfrom
issue-945

Conversation

@lsawade
Copy link
Collaborator

@lsawade lsawade commented Aug 26, 2025

Description

The changes should reflect SPECFEM2D's PR #1259 that updates the implementation of the source time function to more accurately match SPECFEM3D.

Problem

The way the acoustic force source_array was applied in the medium/compute_source had the wrong sign as a result of legacy code. One result of this is the definition of the source angle was inverted.

Solutions

  • Removing of negative signs in the compute_source_time_function member functions of the Ricker, Delta, dGaussian functions, e.g.
  • Updating sign and cosines in the angle computation of the elastic force
  • change sign of the operation of the potential in medium/compute_source<acoustic> from
    acc(...) += source_array(...) to acc(...) -= source_array(...)

Issue Number

Closes #945

Checklist

Please make sure to check developer documentation on specfem docs.

  • I ran the code through pre-commit to check style
  • THE DOCUMENTATION BUILDS WITHOUT WARNINGS/ERRORS
  • I have added labels to the PR (see right hand side of the PR page)
  • My code passes all the integration tests
  • I have added sufficient unittests to test my changes
  • I have added/updated documentation for the changes I am proposing
  • I have updated CMakeLists to ensure my code builds
  • My code builds across all platforms

…atch specfem2d fortran. ElasticSH is the only test that is failing.
@lsawade lsawade changed the base branch from main to devel August 26, 2025 18:51
@lsawade
Copy link
Collaborator Author

lsawade commented Aug 26, 2025

@danielpeter the tests here should fail right now since i didn't update the SH tests, which should fail due to the fixes. But maybe you could take a quick look just to make sure I'm getting "everything".

SPECFEM2D's PR #1259

@lsawade lsawade added the fix label Sep 2, 2025
Copy link
Collaborator

@Rohit-Kakodkar Rohit-Kakodkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a brief discription of what was wrong with original implementation as a comment here (just a few lines) ? Just as a reference to point to incase some one has question.

@lsawade lsawade merged commit 141b164 into devel Sep 5, 2025
8 checks passed
@lsawade lsawade deleted the issue-945 branch September 5, 2025 20:55
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.

Update acoustic source term and source time function

3 participants