Skip to content

Update tests/ examples to use new serac::Mesh#1365

Merged
chapman39 merged 39 commits into
developfrom
task/chapman39/serac-mesh-propagate
Jun 2, 2025
Merged

Update tests/ examples to use new serac::Mesh#1365
chapman39 merged 39 commits into
developfrom
task/chapman39/serac-mesh-propagate

Conversation

@chapman39

@chapman39 chapman39 commented Apr 23, 2025

Copy link
Copy Markdown
Collaborator

@chapman39 chapman39 added the refactoring Change the structure of the underlying data structures label Apr 23, 2025
@chapman39 chapman39 self-assigned this Apr 23, 2025
@chapman39 chapman39 added the WIP Work in progress label Apr 23, 2025
Comment thread src/serac/physics/tests/quasistatic_solid_adjoint.cpp Outdated
# TODO Shorten runtime down to less than one minute
# blt_add_test(NAME contact_${example_name}
# COMMAND contact_${example_name}
# NUM_MPI_TASKS 4)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ATM, these tests take too long to be in a regular CI job. Maybe we can have an option to tests examples nightly. Or we should somehow reduce the runtime of these examples similar to --fast in cylinder.cpp.

      Start 86: contact_beam_bending
86/93 Test #86: contact_beam_bending ....................   Passed   20.40 sec
      Start 87: contact_ironing
87/93 Test #87: contact_ironing .........................   Passed  277.27 sec
      Start 88: contact_sphere
88/93 Test #88: contact_sphere ..........................   Passed  294.65 sec
      Start 89: contact_twist
89/93 Test #89: contact_twist ...........................   Passed  143.91 sec

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can coarsen the meshes and/or just run them with 1 timestep for CI, but it'd be good to run them all the way once in a while. In my experience, convergence issues don't appear until towards the end of the simulation and with more refined meshes. I guess I'd vote for a nightly test for examples?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do these test have a 'gold' value that we are comparing to? If not, nightly or weekly, longer running tests don't add much anyways in my view. Perhaps we need to start developing a regression testing system, where we establish some expected result to compare to. Then, weekly running tests could catch changes in behavior. Though, realistically, they should be run through CI. Maybe we need to audit our CI for bottlenecks? For example, do we currently launch our 93 test in parallel, or do they wait for eachother to complete?

Comment thread src/serac/mesh_utils/CMakeLists.txt
Comment thread src/serac/physics/benchmarks/physics_benchmark_functional.cpp
@chapman39 chapman39 marked this pull request as ready for review May 23, 2025 23:58
@chapman39 chapman39 added ready for review Ready for active inspection by reviewers and removed WIP Work in progress labels May 23, 2025
Comment thread examples/buckling/CMakeLists.txt Outdated

@tupek2 tupek2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fantastic! Looks amazing to me. Maybe not as much duplication removal as hoped, but there getting rid of the Domain is big, as users no longer have to keep them in scope.

if (use_fast_options) {
dt = 1;
nonlinear_options.max_iterations = 5;
linear_options.max_iterations = 5;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have a silly question. For these examples, do we just run them and make sure they exit cleanly, or is there any regression testing on the actual result that comes back? If we are really just running them without checking their result at all, they are really just examples that need to keep compiling and not aborting.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I added them as a test to simply verify they run without error, since beforehand they failed at runtime. I agree there is a chance these examples could start producing invalid answers without us knowing - as it is now.

If we were to test the result, we could use gtest, but that might be messy considering these are meant to be a reference for users. We could add some kind of assert or SLIC_ERROR_IF alternatively, but given these examples take a long time to run, it may not make sense to run the entire thing on-push. So maybe in a future PR I can work on moving these to nightly CI and add some SLIC_ERROR_IF's?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

# TODO Shorten runtime down to less than one minute
# blt_add_test(NAME contact_${example_name}
# COMMAND contact_${example_name}
# NUM_MPI_TASKS 4)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do these test have a 'gold' value that we are comparing to? If not, nightly or weekly, longer running tests don't add much anyways in my view. Perhaps we need to start developing a regression testing system, where we establish some expected result to compare to. Then, weekly running tests could catch changes in behavior. Though, realistically, they should be run through CI. Maybe we need to audit our CI for bottlenecks? For example, do we currently launch our 93 test in parallel, or do they wait for eachother to complete?

Comment thread src/serac/physics/mesh.hpp Outdated
@chapman39 chapman39 merged commit 960c4a6 into develop Jun 2, 2025
13 checks passed
@white238 white238 mentioned this pull request Jul 16, 2025
@chapman39 chapman39 deleted the task/chapman39/serac-mesh-propagate branch July 23, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Ready for active inspection by reviewers refactoring Change the structure of the underlying data structures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bucking Cylinder example failing std::out_of_range Add all examples as tests

4 participants