Skip to content

Conversation

@daisy20170101
Copy link
Owner

Modernize Fortran code and build system for improved MPI portability, performance, and precision handling.


Open in Cursor Open in Web

@cursor
Copy link

cursor bot commented Aug 14, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@daisy20170101 daisy20170101 marked this pull request as ready for review August 14, 2025 02:57
daisy20170101 pushed a commit that referenced this pull request Nov 12, 2025
Updated test_tdstress.py with:
- All 15 test points matching Fortran test exactly
- Complete expected Exx values from corrected Fortran reference
- Comprehensive error reporting for both TDstressFS and TDstressHS

Updated TEST_RESULTS.md with:
- Full results table for all 15 points (both full-space and half-space)
- Detailed analysis showing 0 PASS, 9 FAIL, 6 NaN
- Critical issues: spurious NaNs at 6 valid points, large errors everywhere
- Root cause analysis linking to same bugs as original Fortran (Bug #2, #3, #4)
- Specific fix recommendations for each bug
- Runtime warnings documentation

Key findings:
- Python exhibits SAME BUGS as original unpatched Fortran code
- Bug #2 (barycentric coordinates): center point 88% error
- Bug #3 (edge detection): 6 spurious NaNs at valid distant points
- Bug #4 (matrix orientation): likely causing large errors (up to 3961%)

Ready for bug fixes to be applied following Fortran corrections.
daisy20170101 pushed a commit that referenced this pull request Nov 12, 2025
Analysis comparing MATLAB and Python code reveals Bug #4:
- Python incorrectly uses A.T (transpose) in 4 locations
- MATLAB uses A directly (no transpose) in same locations
- Affects TDstress_HarFunc and AngSetupFSC_S

Critical issues found:
1. tdstress_hs.py:163 - slip vector transformation uses A.T (should be A)
2. ang_setup_fsc.py:92 - point transformation uses A.T (should be A)
3. ang_setup_fsc.py:95 - side vector transformation uses A.T (should be A)
4. ang_setup_fsc.py:103 - slip vector transformation uses A.T (should be A)

Impact: Coordinate transformations reversed, causing errors up to 3961%
Root cause: Misunderstanding of MATLAB matrix construction conventions

Documented in MATRIX_TRANSPOSE_ISSUES.md with:
- Side-by-side MATLAB vs Python comparison
- Explanation of correct usage in TDstressFS
- Root cause analysis
- Fix recommendations for all 4 locations
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