Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tribol contact patch test miniapp [tribol-miniapp] #4054

Merged
merged 41 commits into from
Apr 9, 2024
Merged

Conversation

ebchin
Copy link
Contributor

@ebchin ebchin commented Jan 4, 2024

This PR adds a contact patch test miniapp using the Tribol interface physics library. Constraints are formulated using the mortar method and enforcement is via Lagrange multipliers.

Besides the miniapp source code, this PR also adds a README.md for installing and using the miniapp and changes to the MFEM GNU Make and CMake build systems to support Tribol. Tribol supports MFEM data structures natively and therefore has a dependency on MFEM. MFEM's dependency on Tribol is only through the new miniapp. This dependency relationship mirrors ParELAG and Tribol's TPL integration follows ParELAG's.

PR Author Editor Reviewers Assignment Approval Merge
#4054 @ebchin @tzanio @jwang125 + @thartland + @psocratis + @tzanio 2/3/24 4/7/24 4/9/24
PR Checklist
  • Code builds.
  • Code passes make style.
  • Update CHANGELOG:
    • Is this a new feature users need to be aware of? New or updated example or miniapp?
    • Does it make sense to create a new section in the CHANGELOG to group with other related features?
  • Update INSTALL:
    • Had a new optional library been added? If so, what range of versions of this library are required? (Make sure the external library is compatible with our BSD license, e.g. it is not licensed under GPL!)
    • Have the version ranges for any required or optional libraries changed?
    • Does make or cmake have a new target?
    • Did the requirements or the installation process change? (rare)
  • Update continuous integration server configurations if necessary (e.g. with new version requirements for each of MFEM's dependencies)
    • .github
    • .appveyor.yml
  • Update .gitignore:
    • Check if make distclean; git status shows any files that were generated from the source by the project (not an IDE) but we don't want to track in the repository.
    • Add new patterns (just for the new files above) and re-run the above test.
  • New examples:
    • All sample runs at the top of the example source file work.
    • Update examples/makefile:
      • Add the example code to the appropriate SEQ_EXAMPLES and PAR_EXAMPLES variables.
      • Add any files generated by it to the clean target.
      • Add the example binary and any files generated by it to the top-level .gitignore file.
    • Update examples/CMakeLists.txt:
      • Add the example code to the ALL_EXE_SRCS variable.
      • Make sure THIS_TEST_OPTIONS is set correctly for the new example.
    • List the new example in doc/CodeDocumentation.dox.
    • If new examples directory (e.g.examples/pumi), list it in doc/CodeDocumentation.conf.in
    • Companion pull request for documentation in mfem/web repo:
      • Update or add example-specific documentation, see e.g. the src/examples.md.
      • Add the description, labels and screenshots in src/examples.md and src/img.
      • In examples.md, list the example under the appropriate categories, add new categories if necessary.
      • Add a short description of the example in the "Extensive Examples" section of features.md.
  • New miniapps:
    • All sample runs at the top of the miniapp source file work.
    • Update top-level makefile and makefile in corresponding miniapp directory.
    • Add the miniapp binary and any files generated by it to the top-level .gitignore file.
    • Update CMake build system:
      • Update the CMakeLists.txt file in the miniapps directory, if the new miniapp is in a new directory.
      • Add/update the CMakeLists.txt file in the new miniapp directory.
      • Consider adding a new test for the new miniapp.
    • List the new miniapp in doc/CodeDocumentation.dox
    • If new miniapps directory (e.g.miniapps/nurbs), add it to MINIAPP_SUBDIRS in the makefile.
    • If new miniapps directory (e.g.miniapps/nurbs), list it in doc/CodeDocumentation.conf.in
    • Companion pull request for documentation in mfem/web repo:
      • Update or add miniapp-specific documentation, see e.g. the src/meshing.md and src/electromagnetics.md files.
      • Add the description, labels and screenshots in src/examples.md and src/img.
      • The miniapps go at the end of the page, and are usually listed only under a specific "Application (PDE)" category.
      • Add a short description of the miniapp in the "Extensive Examples" section of features.md.
  • New capability:
    • All new public, protected, and private classes, methods, data members, and functions have full Doxygen-style documentation in source comments. Documentation should include descriptions of member data, function arguments and return values, template parameters, and prerequisites for calling new functions.
    • Pointer arguments and return values must specify whether ownership is being transferred or lent with the call.
    • Any new functions should include descriptions of their intended use e.g. for internal use only, user-facing, etc., along with references to example code whenever possible/appropriate.
    • Consider adding new sample runs in existing examples to highlight the new capability.
    • Consider saving cool simulation pictures with the new capability in the Confluence gallery (LLNL only) or submitting them, via pull request, to the gallery section of the mfem/web repo.
    • If this is a major new feature, consider mentioning it in the short summary inside README (rare).
    • List major new classes in doc/CodeDocumentation.dox (rare).
  • Update this checklist, if the new pull request affects it.
  • Run make unittest to make sure all unit tests pass.
  • Run the tests in tests/scripts.
  • (LLNL only) After merging:
    • Update internal tests to include the new features.

@ebchin ebchin added the WIP Work in Progress label Jan 4, 2024
@ebchin ebchin self-assigned this Jan 4, 2024
@psocratis psocratis self-assigned this Jan 6, 2024
config/defaults.cmake Outdated Show resolved Hide resolved
Copy link

@srwopschall srwopschall left a comment

Choose a reason for hiding this comment

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

@ebchin - Looks great. I mainly reviewed for clarity with some minor suggestions along those lines throughout.

miniapps/tribol/ContactPatchTest.cpp Show resolved Hide resolved
miniapps/tribol/ContactPatchTest.cpp Outdated Show resolved Hide resolved
miniapps/tribol/ContactPatchTest.cpp Outdated Show resolved Hide resolved
miniapps/tribol/ContactPatchTest.cpp Outdated Show resolved Hide resolved
miniapps/tribol/ContactPatchTest.cpp Outdated Show resolved Hide resolved
miniapps/tribol/ContactPatchTest.cpp Show resolved Hide resolved
miniapps/tribol/README.md Show resolved Hide resolved
miniapps/tribol/README.md Outdated Show resolved Hide resolved
miniapps/tribol/README.md Show resolved Hide resolved
miniapps/tribol/README.md Outdated Show resolved Hide resolved
Copy link
Member

@psocratis psocratis left a comment

Choose a reason for hiding this comment

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

I am able to install tribol and axom and run the miniapp succesfully

TRIBOL_OPT = -I$(TRIBOL_DIR)/include -I$(AXOM_DIR)/include -I$(CONDUIT_DIR)/include/conduit
TRIBOL_LIB = -L$(TRIBOL_DIR)/lib -ltribol -lredecomp -L$(AXOM_DIR)/lib -laxom_mint\
-laxom_sidre -laxom_slam -laxom_slic -laxom_core -L$(CONDUIT_DIR)/lib -lconduit\
-lconduit_blueprint -lconduit_blueprint_mpi -lconduit_relay -lconduit_relay_mpi
Copy link
Member

Choose a reason for hiding this comment

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

The conduit libs are optional, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, conduit isn't needed. It was installed by default by the spack/uberenv build system, but the updated instructions no longer use it (see latest commits).

tribol::updateMfemParallelDecomposition();

// Save data in VisIt format
mfem::VisItDataCollection visit_vol_dc("ContactPatchTestVolume", &mesh);
Copy link
Member

Choose a reason for hiding this comment

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

These files have to be deleted with make clean in the miniapp make file and currently they are not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this. It's fixed!

@tzanio
Copy link
Member

tzanio commented Mar 31, 2024

Please merge in master to resolve conflicts and now that PR #3922 has been merged also do the following:

  1. replace use of double with real_t
  2. guard double/single-only sections with MFEM_USE_DOUBLE and MFEM_USE_SINGLE
  3. make sure tests run cleanly with default and MFEM_PRECISION=single configurations

See https://github.com/orgs/mfem/discussions/4207 for more details and/or ask @dylan-copeland for help.

@ebchin
Copy link
Contributor Author

ebchin commented Apr 2, 2024

@psocratis @jwang125 @thartland Thanks for testing while I was out on leave! I updated the build instructions to get rid of the spack/uberenv build system, which will hopefully make installation easier across different machines. I've tested locally on Ubuntu and a couple of TOSS 4 LC machines. Let me know if you run into any issues.

@tzanio I tested building with single precision, but I think Tribol will need additional changes for single precision support. Beyond changing data types, there are many geometric tolerances in the algorithms that will need to be revisited for single precision. @srwopschall likely has a better idea of the changes required. For now, I will make the miniapp require double precision.

@ebchin
Copy link
Contributor Author

ebchin commented Apr 2, 2024

I think #4135 should go in before this one, so I can simplify the code here.

@tzanio
Copy link
Member

tzanio commented Apr 2, 2024

@tzanio I tested building with single precision, but I think Tribol will need additional changes for single precision support. Beyond changing data types, there are many geometric tolerances in the algorithms that will need to be revisited for single precision. @srwopschall likely has a better idea of the changes required. For now, I will make the miniapp require double precision.

That's okay for now, it will be a gradual process to make sure all MFEM integrations support single precision correctly.

@tzanio
Copy link
Member

tzanio commented Apr 5, 2024

@ebchin, I am waiting on your 🟢 to merge this in next

@ebchin
Copy link
Contributor Author

ebchin commented Apr 5, 2024

It should be good to go now @tzanio

@tzanio
Copy link
Member

tzanio commented Apr 7, 2024

Merged in next for testing...

@tzanio tzanio added the in-next label Apr 7, 2024
tzanio added a commit that referenced this pull request Apr 7, 2024
Copy link
Member

@tzanio tzanio left a comment

Choose a reason for hiding this comment

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

Thanks so much, @ebchin !

@tzanio tzanio merged commit 4ff5eb8 into master Apr 9, 2024
27 checks passed
Pull Requests automation moved this from Review Now to Merged Apr 9, 2024
@tzanio tzanio deleted the tribol-miniapp branch April 9, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Pull Requests
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

6 participants