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

Acoustic surface #94

Merged
merged 6 commits into from
Nov 20, 2023
Merged

Acoustic surface #94

merged 6 commits into from
Nov 20, 2023

Conversation

Rohit-Kakodkar
Copy link
Collaborator

Description

This pull request implements dirichlet and stacey BCs.

  • Implementation details

    • The boundary conditions are implemeted as template parameter on an element. This should improve modularity when implementing other BCs, as long as BCs have same interfaces
    • The boundary conditions are enforces in the compute_forces kernel in contradiction to the fortran code where BCs are enforced in subsequent CUDA kernels.
  • Changes and reorganizations

    • Moved array type to kokkos abstractions
    • Moved specfem::enums::coupling::type::edge -> specfem::enums::edge::type

Issue Number

If there is an issue created for these changes, link it here

Checklist

Please make sure to check developer documentation on specfem docs.

  • I ran the code through pre-commit to check style
  • My code passes all the integration tests
  • I have added sufficient unittests to test my changes
  • I have added/updated documentation for the changes I am proposing
  • I have updated CMakeLists to ensure my code builds
  • My code builds across all platforms

- Free surfaces in acoustic domains require a dirichlet BC on pressure.
  - The implementation provided in this commit implements the general case of dirichlet boundary condition for any type of element. In particular, for now we only implement hard wall BCs
  - The boundary conditions are implemeted as template parameter on an element. This should improve modularity when implementing other BCs, as long as BCs have same interfaces.

- Implemeted routines for reading acoustic free surfaces from mesh database and generating a compute interface for the same.

The boundary conditions are enforces in the compute_forces kernel in contradiction to the fortran code where BCs are enforced in subsequent CUDA kernels.
- There are minor changes from previous commit.
  - Key change includes elements on corner of domain or elements that have more than one edge / node on a free surface. To account for this I added a boundary_types struct to tag which node/edge is on the boundary for every element on the boundary.
  - Another change includes how elements on the boundary are tagged inside kernel and an explicit assertion that checks if the order of elements matches the one in compute::boundaries

- Performance is similar to the one in devel branch (optimal performance).
- Moved array type to kokkos abstractions
- Boundary conditions interface now takes partial derivatives and element properties structs as inputs during calculations. This is needed for more complicated BCs that depend on element shape and material propetrties.
- Moved specfem::enums::coupling::type::edge -> specfem::enums::edge::type
- Implements Stacey BC as a separate class
- GLL weights are passed as parameter to BC class
Major changes since previous commit

- I had to add compute time mass matrix terms to account for modification on mass matrix at the boundary when using the Newmark timescheme
- These contributions are added using mass_time_contribution function in the BC classes
- The function is templated on type of timescheme and specialized implementation should exist when a contribution is required
@Rohit-Kakodkar
Copy link
Collaborator Author

retest this please

@Rohit-Kakodkar Rohit-Kakodkar merged commit 4a7067c into code-along Nov 20, 2023
4 of 6 checks passed
@Rohit-Kakodkar Rohit-Kakodkar deleted the acoustic-surface branch November 12, 2024 18:27
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.

1 participant