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

Contact 2 of 3 #198

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Contact 2 of 3 #198

wants to merge 27 commits into from

Conversation

gabemorris12
Copy link
Collaborator

@gabemorris12 gabemorris12 commented May 16, 2024

Description

This is the second stage PR for contact in single-node-refactor. Since the first stage PR has not been approved yet, only accept this one and delete the first PR. But it is still good for the reviewer to read that one before continuing with this one.

The first stage focused on initializing the data structure and finding the nodes in proximity to the patch. This second stage pull request focuses on the detailed contact check and constructing the contact pairs, which will then lead to the third and final stage of determining the contact force. With these added changes in the second stage, the method resolution order for the contact algorithm is this (for each time step)

call sort()
    constructs lbox, nbox, npoint, and nsort to be used in find_nodes()
call get_contact_pairs()
    for each contact patch
        find_nodes()
        for each found node
            call contact_check()
            if contact_check() returns true then make modifications/manipulations to the contact_pairs member

As this code sits, there will need to be some modifications to optimize performance (like getting rid of the FOR_ALL_CLASS) and to ensure it runs on the GPU. There are several // todo statements that address these issues.

If not already aware, there is a python version of the entire algorithm with a plethora of examples here. Before reviewing, take the time to watch this video:

PR.2.Recap.mp4

Type of change

Please select all relevant options

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Formatting and/or style fixes
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

For the following tests, uncomment the run_contact_tests() function in SGH::setup(). If you haven't already see the attached video above this.

  • Test A : Run with contact_test.yaml as the input.
  • Test B : Run with edge_case1.yaml as the input.
  • Test B : Run with edge_case2.yaml as the input.
  • Test B : Run with edge_case3.yaml as the input.

Make sure that you are in the debug mode so that the assertions will register.

Test Configuration:

  • OS version: Windows WSL and MacOS
  • Hardware: Tested only on CPU with openmp
  • Compiler: Clang

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • The code builds from scratch with my new changes
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Yaml input now accepts 'global' as a geometry option for the boundary conditions. This is for contact only and means that contact will be checked on all boundary patches. Additionally, there is some cleanup here as contact features will begin to be added.
Setting things up with a function pointer for the case where there is no contact, an empty function will be getting executed instead of hitting an if statement.
Additionally, the contact_test.geo was changed so that the patch ordered in outward normal. Added additional members to contact_patch_t and contact_patches_t. Getting everything set up for the bucket sorting.
All the previous sorting methods lead up to the ability to find nodes that could potentially penetrate a patch. This ability is now implemented with the contact_patches_t::find_nodes function.
Added the get_contact_point method which determines the reference coordinates of the intersection point.
…t_nodes; added unit test for get_contact_point
… del_tc instead to prevent matar array allocation
Additionally, I've done a restructure of the unit test so that it can be based on the file name.
All tests are working and results are identical to the python implementation.
@gabemorris12 gabemorris12 added the enhancement New feature or request label May 16, 2024
@gabemorris12 gabemorris12 marked this pull request as ready for review May 16, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant