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

Hard-to-understand error messages for simplex triangulation #15352

Open
nfehn opened this issue Jun 13, 2023 · 3 comments
Open

Hard-to-understand error messages for simplex triangulation #15352

nfehn opened this issue Jun 13, 2023 · 3 comments

Comments

@nfehn
Copy link
Contributor

nfehn commented Jun 13, 2023

Creating a simplex triangulation by calling

dealii::TriangulationDescription::Utilities::
      create_description_from_triangulation_in_groups<dim, dim>(..., mesh_smoothing, triangulation_description_setting);

with the last two parameters set to

      mesh_smoothing = dealii::Triangulation<dim>::limit_level_difference_at_vertices;
      triangulation_description_setting =
        dealii::TriangulationDescription::construct_multigrid_hierarchy;

produces hard to understand error messages:

An error occurred in line <1283> of file <dealii/include/deal.II/grid/tria_accessor.templates.h> in function
    unsigned int dealii::TriaAccessor<<anonymous>, <anonymous>, <anonymous> >::vertex_index(unsigned int) const [with int structdim = 3; int dim = 3; int spacedim = 3]
The violated condition was: 
    ::dealii::deal_II_exceptions::internals::compare_less_than(corner, this->n_vertices())
Additional information: 
    Index 4 is not in the half-open range [0,4).

It seems as if construct_multigrid_hierarchy and/or (?) limit_level_difference_at_vertices is not supported for simplex. It would be helpful if certain functionality not supported for simplex triangulations were asserted with understandable error messages.

The documentation https://dealii.org/developer/doxygen/deal.II/namespaceTriangulationDescription_1_1Utilities.html#af155557fb9b46c44224a6aeeb2493cc8 seems to be incomplete as well. According to the note in the documentation, one parameter internally manipulates the other one, differing from the value set by the user? If there are proper asserts in the code, I do not see a need to extend the documentation. In the current setting with the present error message, however, I consider it very hard to use such functionality.

@bangerth
Copy link
Member

@nfehn Can you create a small but complete program that shows the error? I'll be happy to fix the error then.

@bangerth
Copy link
Member

@nfehn Ping?

@nfehn
Copy link
Contributor Author

nfehn commented Jun 17, 2023

Sorry, I did not find time to construct a minimal program this week. Here you can see how I resolved it in ExaDG for the time being, https://github.com/exadg/exadg/blob/1a98c62467c3bdee68a46b6fb90f743f16beeb60/include/exadg/grid/grid_utilities.h#L197-L215.

According to my current understanding, such a check would ideally be done inside dealii, i.e. if construct_multigrid_hierarchy or limit_level_difference_at_vertices is set by the user, assert that tria.all_reference_cells_are_hypercube() (or similar).

What happens if https://github.com/dealii/dealii/blob/master/tests/fullydistributed_grids/copy_distributed_tria_01.cc is done with a simplex grid? The problem I reported might, however, not be visible here since the triangulation constructed first is distributed, which might already contain a human-readable assert regarding simplex, I don't know. I could try to adapt this test, or are there already tests in dealii that are closer to my problem, @peterrum ?

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

No branches or pull requests

2 participants