Enable evolutions using non-conforming Blocks.#7202
Conversation
| *all_mortar_data.at(mortar_id).local().mortar_data.value(); | ||
| // neighbor_boundary_data_on_mortar = | ||
| // interpolator.interpolate_to_neighbor(host_data); | ||
| interpolated_boundary_data = InterpolatedBoundaryData<Dim>{ |
| // If we only have one conforming neighbor in this direction, we may or | ||
| // may not have to do any projection. If we don't have to do projection, | ||
| // then we can use the local_mortar_data itself to calculate the | ||
| // dg_package_data. However, if we need to project, then we hae to use |
| // the packaged_data_buffer that was passed in. | ||
| if (neighbors_in_direction.are_conforming() and | ||
| Spectral::needs_projection(face_mesh, mortar_mesh, mortar_size)) { | ||
| // Have to use packaged_data_buffer |
| const auto& element = db::get<domain::Tags::Element<volume_dim>>(*box); | ||
| const auto expected_messages = static_cast<size_t>(alg::accumulate( | ||
| mortar_next_time_step_ids, 0, | ||
| [&mortar_infos, &element, &time_to_process](size_t total, |
| static_cast<ptrdiff_t>( | ||
| volume_mesh.slice_away(direction.dimension()) | ||
| .number_of_grid_points()), | ||
| [](double v) { return std::isnan(v); }), |
There was a problem hiding this comment.
const double. Have you tested that this doesn't cause an FPE? There are sometimes weird things with signaling_NaNs...
| volume_mesh.slice_away(direction.dimension()) | ||
| .number_of_grid_points()), | ||
| [](double v) { return std::isnan(v); }), | ||
| "Not all points were interpolated"); |
There was a problem hiding this comment.
It would probably be helpful to print out the current ElementId, neighbor ID, etc.
wthrowe
left a comment
There was a problem hiding this comment.
The logic for receiving data looks right to me. My main concern is it looks like this introduces another fixed-size-map overflow. Have you tested with a sphere with more than 24 neighbors? If I'm interpreting it correctly, the test input file has exactly 24.
| } | ||
| neighbor_meshes) { | ||
| neighbor_meshes->insert_or_assign(received_mortar_id, | ||
| neighbor_mesh); |
There was a problem hiding this comment.
Doesn't this have the same "more than 24 neighbors" problem we had with the inbox?
From a quick grep of the code, we might only need the neighbor meshes for subcell these days, but I'm not certain. So it may be valid to just not record it near spheres.
| const auto& interpolator = | ||
| mortar_info.at(mortar_id).interpolator().value(); | ||
| const auto& host_data = | ||
| *all_mortar_data.at(mortar_id).local().mortar_data.value(); |
There was a problem hiding this comment.
This is the same as neighbor_boundary_data_on_mortar set a few lines above.
|
when trying out this PR combined with #7205 for a bbh evolution, I do get an error which looks like what Will pointed out above: std::pair<FixedHashMapIterator<MaxSize, Key, std::pair<const Key, ValueType>, Hash, KeyEqual>, bool> FixedHashMap<MaxSize, Key, ValueType, Hash, KeyEqual>::insert_or_assign_impl(key_type&&, M&&) [with bool Assign = false; M = Mesh<3>; long unsigned int MaxSize = 24; Key = DirectionalId<3>; ValueType [...] ::hash<DirectionalId<3> >; KeyEqual = std::equal_to<DirectionalId<3> >; key_type = DirectionalId<3>] in /home/nwittek/spectre/src/DataStructures/FixedHashMap.hpp:462 Unable to insert element into FixedHashMap of maximum size 24 because it is full. If the current size () is not equal to the maximum size then please file an issue with the code you used to produce this error. |
|
I happened to do a similar experiment to Niko without knowing and came here to also say that I tried combining this PR with #7205 and ran |
a1ccb81 to
ac77242
Compare
ac77242 to
81c2f96
Compare
|
The fixup does solve the problem with the map size. The evolution starts now but I am getting a deadlock at ~0.1M but I am not sure yet where that is coming from. |
If you are using local time-stepping, then it could be that there is a mismatch in the time step on the spheres vs the wedges as there is nothing in the code yet to enforce them to be equal. There is a mechanism to enforce the time steps to be the same for elements next to a DG-subcell boundary, so it will be straightforward to add something similar. |
|
Is it necessary for the time steps to be the same on the spherical shell and the Wedges it neighbors? |
|
yes |
|
I fixed the time step the same way subcell does it. This seems to have fixed the deadlock. However, the affected elements are stuck with the initial, very small time step which slows down the simulation massively so we should probably come up with something better than that. |
|
The fixups look fine to me. As noted, there are LTS issues that have to be worked out, but I don't think that needs to block this PR. |
Proposed changes
Enables evolutions with spherical shells next to cubed spheres. Tested with the input file for scalar wave.
Upgrade instructions
Code review checklist
make docto generate the documentation locally intoBUILD_DIR/docs/html.Then open
index.html.code review guide.
bugfixornew featureif appropriate."Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com",
"Co-Authored-by: Codex noreply@openai.com", or
"Co-Authored-By: GitHub Copilot CLI noreply@microsoft.com"
as the last line of the commit, depending on the agent.
Further comments