Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into kokkos_la_d_vecto…
Browse files Browse the repository at this point in the history
…r_device_aware_mpi
  • Loading branch information
masterleinad committed Jan 25, 2023
2 parents 6488702 + 7627788 commit d74fa6e
Show file tree
Hide file tree
Showing 59 changed files with 1,000 additions and 1,115 deletions.
21 changes: 21 additions & 0 deletions bundled/boost-1.70.0/include/boost/concept/detail/general.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,44 @@ namespace detail
template <class Model>
struct requirement
{
# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wnonnull"
# endif
static void failed() { ((Model*)0)->~Model(); }
# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
# pragma GCC diagnostic pop
# endif
};

struct failed {};

template <class Model>
struct requirement<failed ************ Model::************>
{
# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wnonnull"
# endif
static void failed() { ((Model*)0)->~Model(); }
# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
# pragma GCC diagnostic pop
# endif
};

# ifdef BOOST_OLD_CONCEPT_SUPPORT

template <class Model>
struct constraint
{
# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wnonnull"
# endif
static void failed() { ((Model*)0)->constraints(); }
# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
# pragma GCC diagnostic pop
# endif
};

template <class Model>
Expand Down
7 changes: 7 additions & 0 deletions bundled/boost-1.70.0/include/boost/concept/usage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ namespace boost { namespace concepts {
template <class Model>
struct usage_requirements
{
# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wnonnull"
# endif
~usage_requirements() { ((Model*)0)->~Model(); }
# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
# pragma GCC diagnostic pop
# endif
};

# if BOOST_WORKAROUND(__GNUC__, <= 3)
Expand Down
4 changes: 3 additions & 1 deletion cmake/modules/FindDEAL_II_SLEPC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ set_if_empty(PETSC_ARCH "$ENV{PETSC_ARCH}")

deal_ii_find_library(SLEPC_LIBRARY
NAMES slepc libslepc
HINTS ${SLEPC_DIR} ${SLEPC_DIR}/${PETSC_ARCH} ${PETSC_DIR}
HINTS ${SLEPC_DIR} ${SLEPC_DIR}/${PETSC_ARCH} ${PETSC_DIR} ${PETSC_DIR}/${PETSC_ARCH}
PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
)

Expand All @@ -50,6 +50,7 @@ deal_ii_find_path(SLEPC_INCLUDE_DIR_ARCH slepcconf.h
${SLEPC_DIR}/${PETSC_ARCH}
${SLEPC_INCLUDE_DIRS}
${PETSC_DIR}
${PETSC_DIR}/${PETSC_ARCH}
PATH_SUFFIXES slepc include include/slepc
)

Expand All @@ -59,6 +60,7 @@ deal_ii_find_path(SLEPC_INCLUDE_DIR_COMMON slepcversion.h
${SLEPC_DIR}/${PETSC_ARCH}
${SLEPC_INCLUDE_DIRS}
${PETSC_DIR}
${PETSC_DIR}/${PETSC_ARCH}
PATH_SUFFIXES slepc include include/slepc
)

Expand Down
4 changes: 4 additions & 0 deletions doc/news/changes/minor/20221221StefanoZampini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
New: Expose PETScWrappers::MPI::BlockVector as a PETSc VecNest vector, and make sure the mpi communicator is always
queried from the internal vec object.
<br>
(Stefano Zampini, 2022/12/21)
4 changes: 0 additions & 4 deletions include/deal.II/base/array_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -611,10 +611,6 @@ inline typename ArrayView<ElementType, MemorySpaceType>::value_type &
ArrayView<ElementType, MemorySpaceType>::operator[](const std::size_t i) const
{
AssertIndexRange(i, n_elements);
Assert(
(std::is_same<MemorySpaceType, MemorySpace::Host>::value),
ExcMessage(
"Accessing elements is only allowed if the data is stored in CPU memory!"));

return *(starting_element + i);
}
Expand Down
199 changes: 75 additions & 124 deletions include/deal.II/grid/reference_cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,37 @@ class ReferenceCell
*/
constexpr ReferenceCell(const std::uint8_t kind);

/**
* Table containing all vertex permutations for a line.
*/
static constexpr ndarray<unsigned int, 2, 2> line_vertex_permutations = {
{{{1, 0}}, {{0, 1}}}};


/**
* Table containing all vertex permutations for a triangle.
*/
static constexpr ndarray<unsigned int, 6, 3> triangle_vertex_permutations = {
{{{0, 2, 1}},
{{0, 1, 2}},
{{2, 1, 0}},
{{1, 2, 0}},
{{1, 0, 2}},
{{2, 0, 1}}}};

/**
* Table containing all vertex permutations for a quadrilateral.
*/
static constexpr ndarray<unsigned int, 8, 4>
quadrilateral_vertex_permutations = {{{{0, 2, 1, 3}},
{{0, 1, 2, 3}},
{{2, 3, 0, 1}},
{{2, 0, 3, 1}},
{{3, 1, 2, 0}},
{{3, 2, 1, 0}},
{{1, 0, 3, 2}},
{{1, 3, 0, 2}}}};

/**
* A kind of constructor -- not quite private because it can be
* called by anyone, but at least hidden in an internal namespace.
Expand Down Expand Up @@ -1865,80 +1896,23 @@ ReferenceCell::standard_to_real_face_vertex(
break;
case ReferenceCells::Triangle:
case ReferenceCells::Quadrilateral:
{
static constexpr ndarray<unsigned int, 2, 2> table = {
{{{1, 0}}, {{0, 1}}}};

return table[face_orientation][vertex];
}
return line_vertex_permutations[face_orientation][vertex];
case ReferenceCells::Tetrahedron:
{
static constexpr ndarray<unsigned int, 6, 3> table = {{{{0, 2, 1}},
{{0, 1, 2}},
{{2, 1, 0}},
{{1, 2, 0}},
{{1, 0, 2}},
{{2, 0, 1}}}};

return table[face_orientation][vertex];
}
return triangle_vertex_permutations[face_orientation][vertex];
case ReferenceCells::Pyramid:
{
if (face == 0) // The quadrilateral face
{
return GeometryInfo<3>::standard_to_real_face_vertex(
vertex,
Utilities::get_bit(face_orientation, 0),
Utilities::get_bit(face_orientation, 2),
Utilities::get_bit(face_orientation, 1));
}
else // One of the triangular faces
{
static const ndarray<unsigned int, 6, 3> table = {{{{0, 2, 1}},
{{0, 1, 2}},
{{2, 1, 0}},
{{1, 2, 0}},
{{1, 0, 2}},
{{2, 0, 1}}}};

return table[face_orientation][vertex];
}
}
// face 0 is a quadrilateral
if (face == 0)
return quadrilateral_vertex_permutations[face_orientation][vertex];
else
return triangle_vertex_permutations[face_orientation][vertex];
case ReferenceCells::Wedge:
{
if (face > 1) // One of the quadrilateral faces
{
return GeometryInfo<3>::standard_to_real_face_vertex(
vertex,
Utilities::get_bit(face_orientation, 0),
Utilities::get_bit(face_orientation, 2),
Utilities::get_bit(face_orientation, 1));
}
else // One of the triangular faces
{
static const ndarray<unsigned int, 6, 3> table = {{{{0, 2, 1}},
{{0, 1, 2}},
{{2, 1, 0}},
{{1, 2, 0}},
{{1, 0, 2}},
{{2, 0, 1}}}};

return table[face_orientation][vertex];
}
}
// faces 0 and 1 are triangles
if (face > 1)
return quadrilateral_vertex_permutations[face_orientation][vertex];
else
return triangle_vertex_permutations[face_orientation][vertex];
case ReferenceCells::Hexahedron:
{
static constexpr ndarray<unsigned int, 8, 4> table = {
{{{0, 2, 1, 3}},
{{0, 1, 2, 3}},
{{2, 3, 0, 1}},
{{2, 0, 3, 1}},
{{3, 1, 2, 0}},
{{3, 2, 1, 0}},
{{1, 0, 3, 2}},
{{1, 3, 0, 2}}}};
return table[face_orientation][vertex];
}
return quadrilateral_vertex_permutations[face_orientation][vertex];
default:
Assert(false, ExcNotImplemented());
}
Expand All @@ -1958,6 +1932,14 @@ ReferenceCell::standard_to_real_face_line(
AssertIndexRange(face, n_faces());
AssertIndexRange(line, face_reference_cell(face).n_lines());

static constexpr ndarray<unsigned int, 6, 3> triangle_table = {{{{2, 1, 0}},
{{0, 1, 2}},
{{1, 0, 2}},
{{1, 2, 0}},
{{0, 2, 1}},
{{2, 0, 1}}}};


switch (this->kind)
{
case ReferenceCells::Vertex:
Expand All @@ -1967,62 +1949,31 @@ ReferenceCell::standard_to_real_face_line(
Assert(false, ExcNotImplemented());
break;
case ReferenceCells::Tetrahedron:
{
static constexpr ndarray<unsigned int, 6, 3> table = {{{{2, 1, 0}},
{{0, 1, 2}},
{{1, 0, 2}},
{{1, 2, 0}},
{{0, 2, 1}},
{{2, 0, 1}}}};

return table[face_orientation][line];
}
return triangle_table[face_orientation][line];
case ReferenceCells::Pyramid:
{
if (face == 0) // The quadrilateral face
{
return GeometryInfo<3>::standard_to_real_face_line(
line,
Utilities::get_bit(face_orientation, 0),
Utilities::get_bit(face_orientation, 2),
Utilities::get_bit(face_orientation, 1));
}
else // One of the triangular faces
{
static constexpr ndarray<unsigned int, 6, 3> table = {
{{{2, 1, 0}},
{{0, 1, 2}},
{{1, 0, 2}},
{{1, 2, 0}},
{{0, 2, 1}},
{{2, 0, 1}}}};

return table[face_orientation][line];
}
}
if (face == 0) // The quadrilateral face
{
return GeometryInfo<3>::standard_to_real_face_line(
line,
Utilities::get_bit(face_orientation, 0),
Utilities::get_bit(face_orientation, 2),
Utilities::get_bit(face_orientation, 1));
}
else // One of the triangular faces
{
return triangle_table[face_orientation][line];
}
case ReferenceCells::Wedge:
{
if (face > 1) // One of the quadrilateral faces
{
return GeometryInfo<3>::standard_to_real_face_line(
line,
Utilities::get_bit(face_orientation, 0),
Utilities::get_bit(face_orientation, 2),
Utilities::get_bit(face_orientation, 1));
}
else // One of the triangular faces
{
static constexpr ndarray<unsigned int, 6, 3> table = {
{{{2, 1, 0}},
{{0, 1, 2}},
{{1, 0, 2}},
{{1, 2, 0}},
{{0, 2, 1}},
{{2, 0, 1}}}};

return table[face_orientation][line];
}
}
if (face > 1) // One of the quadrilateral faces
{
return GeometryInfo<3>::standard_to_real_face_line(
line,
Utilities::get_bit(face_orientation, 0),
Utilities::get_bit(face_orientation, 2),
Utilities::get_bit(face_orientation, 1));
}
else // One of the triangular faces
return triangle_table[face_orientation][line];
case ReferenceCells::Hexahedron:
{
static constexpr ndarray<unsigned int, 8, 4> table = {
Expand Down

0 comments on commit d74fa6e

Please sign in to comment.