Open fsimonis opened 3 years ago
Depending on what you are doing you might even want duplicate vertices. See https://precice.org/couple-your-code-distributed-meshes.html. Therefore I think it's a good idea to make this check configurable.
Does it suffice to check the local partitions in case of a parallel solver?
Yes. Looking at the link above I think this is what we want. We allow having duplicates globally, but not locally.
This is a very good idea and we should definitely add it. In my opinion it should be a debug feature though.
Should this be turned on by default?
Enabled if NDEBUG
is defined.
Should this be configured in the RBF mapping tag or globally?
Enable it independent of the employed mapping since it is still a relevant debug message. (My) adapter development always starts with NN mapping.
Does it suffice to check the local partitions in case of a parallel solver?
I think the check becomes in parallel cases even more relevant. However, I would still see it as a debug feature and disable it in case too many ranks (say >10) are involved.
Do we need to check both input and output mesh?
Input meshes should be enough and we should have internal checks in case things might go wrong during the partitioning.
NDEBUG
idea is worth thinking about. We do introduce additional compute complexity only for checking things. I would then also not make it an error message, but simply a DEBUG output. Then, we also don't need a separate configuration.Provide scripts to check input meshes. This however does not help if the adapter creates duplicate vertices.
In the long run, we want to reload preCICE vtks with ASTE. Then, we could check meshes of users by compiling preCICE in DEBUG mode and using them with ASTE.
I am not sure but it might be important for #986 #962 and #963. For connectivity-based mappings, we need to preserve the connectivity elements by defining vertices (and edges) globally multiple times. Otherwise, it will lead to wrong results, even worse broken simulations since scaled-consistent mapping cannot be executed if we do not have any connectivity element on a non-empty partition.
So we converge towards:
Be aware that limiting this check to debug builds means that it will never be "fast". This was my idea of adding a configuration option somewhere so that we could use it in release builds.
We could add further checks similar to the <export:vtk />
tags. Like this:
<participant name="..." />
<check:vertex-duplication />
</participant>
Please describe the problem you are trying to solve.
Having duplicate vertices in a mesh is a common issue for users of the RBF mappings. Currently, preCICE does not have very descriptive error messages as there are many things that could go wrong with RBF.
Describe the solution you propose.
We could use the index trees to efficiently check for duplications and stop preCICE with an error message listing the repeated coordinates.
A possible configuration could look like this:
This could be the resulting error message:
Open questions:
Describe alternatives you've considered
Provide scripts to check input meshes. This however does not help if the adapter creates duplicate vertices.
Additional context
nothing yet