-
Notifications
You must be signed in to change notification settings - Fork 191
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
Enable p-refinement via an Event #6320
Enable p-refinement via an Event #6320
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy errors are not in our code and probably wrong, so nothing to do for those.
@@ -20,6 +20,7 @@ namespace evolution::dg { | |||
* 1. the volume mesh of the element. | |||
* 2. the volume mesh corresponding to the ghost cell data. This allows eliding | |||
* projection when all neighboring elements are doing DG. | |||
* 3. the mortar mesh of the data on the mortar | |||
* 3. the mesh of the neighboring element's face (not the mortar mesh!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renumber the later entries. (The numbering being wrong actually confuses doxygen, which surprises me.)
@@ -44,6 +44,7 @@ namespace evolution::dg::Tags { | |||
* 1. the volume mesh of the element. | |||
* 2. the volume mesh corresponding to the ghost cell data. This allows eliding | |||
* projection when all neighboring elements are doing DG. | |||
* 3. the mortar mesh of the data on the mortar | |||
* 3. the mesh of the neighboring element's face (not the mortar mesh!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, fix numbering.
face_mesh2.basis(i) == Spectral::Basis::Legendre, | ||
"Only Legendre basis meshes are supported for element faces so far, " | ||
"but " | ||
"face_mesh1 is " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[optional] formatting
|
||
/// \ingroup AmrGroup | ||
namespace amr { | ||
/// \brief %Eventss for adaptive mesh refinement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sspelling.
boundary_data_history->at(mortar_id).local().for_each( | ||
project_boundary_mortar_data); | ||
boundary_data_history->at(mortar_id).remote().for_each( | ||
project_boundary_mortar_data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call boundary_data_history->at(mortar_id).clear_coupling_cache()
.
if (mortar_mesh != | ||
received_mortar_data->second.boundary_correction_mesh) { | ||
boundary_data_history->at(mortar_id).remote().for_each( | ||
project_boundary_mortar_data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, clear the cache, unless this is only modifying the entry that was just inserted, in which case add a comment that you don't have to clear the cache.
<< "\n mortar_mesh: " << mortar_mesh << "\n"); | ||
ASSERT(local_data_on_mortar.number_of_grid_points() == | ||
neighbor_data_on_mortar.number_of_grid_points(), | ||
"RIP\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better message? Probably print out the values.
/// \brief %Eventss for adaptive mesh refinement | ||
namespace Events {} | ||
} // namespace amr | ||
namespace amr::Events {} // namespace amr::Events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move reformatting to the commit where it was added. Also remove the same-line closing comment.
{flux_data}, | ||
{neighbor_next_time_step_id}, | ||
decision}; | ||
const evolution::dg::BoundaryData<Dim> data{mesh, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to appropriate commit.
src/NumericalAlgorithms/DiscontinuousGalerkin/MortarHelpers.cpp
Outdated
Show resolved
Hide resolved
src/Evolution/DiscontinuousGalerkin/Actions/ApplyBoundaryCorrections.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to wait for my approval
const std::unordered_map<ElementId<Dim>, amr::Info<Dim>>& neighbor_info, | ||
const ::dg::MortarMap<Dim, Mesh<Dim>>& neighbor_mesh, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these changes go in a different commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My requests have been addressed. I don't need to look at this again before it's merged.
Still missing the LTS cache management. Have you tested this in an LTS evolution? |
This was missed in PR 6157.
This is the mesh corresponding to boundary_correction_data. It needs to be communicated in case the mortar needs to be reprojected after AMR increases resolution.
This is what will be used by reactive p-refinement for DG.
In order to reactively adapt to p-refinement done as an Event, the mortar data may need to be projected to a new mortar mesh.
This is the appropriate slice (which can be obtained from the mortar_id) of the volume_mesh
409b2c3
to
15f71c7
Compare
We discussed some methods of testing this elsewhere. I assume you've done some of those? |
Discussed elsewhere. The tests have been done. |
Proposed changes
This PR will allow p-refinement to be done as an Event.
This requires the DG scheme to reactively check if the communicated mortar data is on the correct Mesh.
Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments