libMesh / libmesh

libMesh github repository
http://libmesh.github.io
GNU Lesser General Public License v2.1
659 stars 286 forks source link

Add NonManifoldGhostingFunctor and associated SidesToElemMap classes #3975

Closed jwpeterson closed 1 month ago

jwpeterson commented 1 month ago

We often have structural solves involving shells where more than two shell elements meet at a single Edge (see screenshots of some cases where 5 shells meet at a single Edge). In such cases, we don't have complete neighbor information, but it is still possible to correctly ghost the required DOFs when the different neighbors are on different processors. This PR adds a new GhostingFunctor which enables this type of ghosting, as well as several unit tests.

non_manifold_junction3 non_manifold_junction2 non_manifold_junction1 non_manifold_junction0

jwpeterson commented 1 month ago

The warning that I'm seeing from the Min clang testing makes no sense

mpicxx -std=gnu++17 -DHAVE_CONFIG_H -I. -I../../tests -I../include  -DNDEBUG  -I/usr/include -pthread -I/opt/petsc/include -I/opt/petsc//include -I/usr/include/tirpc -I../include -I../../contrib/metaphysicl/src/numerics/include -I../../contrib/metaphysicl/src/core/include -I../../contrib/metaphysicl/src/utilities/include -I../../contrib/nanoflann/nanoflann/include -I../../contrib/fparser -I../../contrib/libHilbert/include -I../../contrib/nemesis/v8.11/nemesis -I../../contrib/exodusii/v8.11/exodus/include -I../../contrib/exodusii/v8.11/exodus/sierra -I../../contrib/netcdf/netcdf-c/include -I../contrib/netcdf/netcdf-c/include -I../../contrib/eigen/eigen -I../../contrib/gmv -I../../contrib/qhull/qhull/src -I../../contrib/qhull/qhull/src/libqhullcpp -I../../contrib/triangle -I../../contrib/tetgen -I../../contrib/netgen/ -I../contrib/netgen/build/ -I../contrib/poly2tri/modified   -I../../contrib/gzstream -I../../contrib/sfcurves -I../../contrib/laspack -I../../contrib/boost/include -I../contrib/timpi/src/utilities/include -I../../contrib/timpi/src/utilities/include -I../../contrib/timpi/src/parallel/include -I../../contrib/timpi/src/algorithms/include   -DLIBMESH_IS_UNIT_TESTING  -O2 -felide-constructors -Qunused-arguments -Wunused-parameter -Wunused -ftrapping-math    -fopenmp -Werror -Wall -Wextra -Wcast-align -Wdisabled-optimization -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k -Winvalid-pch -Wmissing-field-initializers -Wmissing-include-dirs -Wpacked -Wstack-protector -Wtrigraphs -Wunreachable-code -Wunused-label -Wunused-parameter -Wunused-value -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings  -MT fe/unit_tests_opt-fe_lagrange_test.o -MD -MP -MF fe/.deps/unit_tests_opt-fe_lagrange_test.Tpo -c -o fe/unit_tests_opt-fe_lagrange_test.o `test -f 'fe/fe_lagrange_test.C' || echo '../../tests/'`fe/fe_lagrange_test.C
../../tests/base/nonmanifold_coupling_test.C:69:13: error: loop will run at most once (loop increment never executed) [-Werror,-Wunreachable-code-loop-increment]
            for (auto s : elem->side_index_range())
            ^~~

It's like it doesn't recognize that it's a range-based for-loop for some reason.

We use this construction in many places in the library, though, so no idea why it only -Werrors on this one.

jwpeterson commented 1 month ago

It's the same -Werror on Test clang as well, what the heck?

moosebuild commented 1 month ago

Job Coverage, step Generate coverage on 21554f1 wanted to post the following:

Coverage

7cda6a #3975 21554f
Total Total +/- New
Rate 62.33% 62.34% +0.01% 78.12%
Hits 72900 72954 +54 50
Misses 44065 44075 +10 14

Diff coverage report

Full coverage report

Warnings

This comment will be updated on new commits.

roystgnr commented 1 month ago

That error does not look like a false positive to me. You've got a for loop that should be iterating from 0 to n_sides. You then have return true at the end of the loop's block. This is equivalent to just setting s=0 instead of the for loop.

jwpeterson commented 1 month ago

@roystgnr I believe I have addressed all your review comments here.