Skip to content

Test for out-of-mesh-value on bad MeshFunction variable indices#4391

Merged
roystgnr merged 8 commits intolibMesh:develfrom
roystgnr:out_of_mesh_chatgpt
Feb 11, 2026
Merged

Test for out-of-mesh-value on bad MeshFunction variable indices#4391
roystgnr merged 8 commits intolibMesh:develfrom
roystgnr:out_of_mesh_chatgpt

Conversation

@roystgnr
Copy link
Member

The initial suggestion ChatGPT gave me here was broken, but I added the (simple) fix, as well as an analogous test for the second derivative API.

We only set the out_of_mesh_value for the first component of gradients
when we're using it to indicate a bad variable number
I'd like to add tests later that actually test the use of
a out_of_mesh_value for *out-of-mesh* lookups...
@jwpeterson
Copy link
Member

!!!FAILURES!!!
Test Results:
Run:  4985   Failures: 1   Errors: 0


1) test: MeshFunctionTest::test_bad_hessian_var_with_out_of_mesh_value (F) line: 271 ../../tests/mesh/mesh_function.C
double equality assertion failed
- Expected: 150
- Actual  : 150.000000000002
- Delta   : 1e-12

@roystgnr
Copy link
Member Author

Of course ChatGPT wouldn't think about compatibility with parallel partitioning; it's more embarrassing that I didn't either.

@roystgnr
Copy link
Member Author

Well, I was hoping I could fix things blind, but no such luck. I'll try to have a proper parallel fix tonight when I can plug in my dying Macbook.

We should instead change the behavior of these functions in the
out-of-mesh case, but that will wait on a later PR.
@roystgnr roystgnr enabled auto-merge February 10, 2026 21:11
@roystgnr
Copy link
Member Author

I set auto-merge since this definitely adds some feature coverage, but I definitely need to remember to look at the line coverage changes after CI finishes, to see just how bad the ratio there is...

@moosebuild
Copy link

Job Coverage, step Generate coverage on 5244b48 wanted to post the following:

Coverage

e2aad5 #4391 5244b4
Total Total +/- New
Rate 65.34% 65.36% +0.02% -
Hits 77753 77772 +19 0
Misses 41246 41227 -19 0

Diff coverage report

Full coverage report

This comment will be updated on new commits.

@roystgnr roystgnr merged commit 6f21dc9 into libMesh:devel Feb 11, 2026
26 checks passed
@roystgnr roystgnr deleted the out_of_mesh_chatgpt branch February 11, 2026 15:10
@roystgnr
Copy link
Member Author

roystgnr commented Feb 11, 2026

161 lines of tests for 19 lines of (new) coverage. 😆

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