Skip to content

Commit

Permalink
Merge Pull Request #13388 from trilinos/Trilinos/master_merge_2024082…
Browse files Browse the repository at this point in the history
…3_175813

Automatically Merged using Trilinos Master Merge AutoTester
PR Title: b'Trilinos Master Merge PR Generator: Auto PR created to promote from master_merge_20240823_175813 branch to master'
PR Author: trilinos-autotester
  • Loading branch information
trilinos-autotester authored Aug 24, 2024
2 parents bf922e7 + 4b4c119 commit 2ad2602
Show file tree
Hide file tree
Showing 258 changed files with 6,300 additions and 5,464 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
uses: github/codeql-action/init@883d8588e56d1753a8a58c1c86e88976f0c23449 # v3.26.3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
Expand All @@ -85,6 +85,6 @@ jobs:
make -j 2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
uses: github/codeql-action/analyze@883d8588e56d1753a8a58c1c86e88976f0c23449 # v3.26.3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
uses: github/codeql-action/upload-sarif@883d8588e56d1753a8a58c1c86e88976f0c23449 # v3.26.3
with:
sarif_file: results.sarif
2 changes: 0 additions & 2 deletions packages/framework/ini-files/config-specs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1750,14 +1750,12 @@ opt-set-cmake-var NOX_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-e
opt-set-cmake-var Pamgen_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
opt-set-cmake-var Phalanx_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
opt-set-cmake-var Pike_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Werror
opt-set-cmake-var Piro_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
opt-set-cmake-var ROL_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
opt-set-cmake-var Sacado_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
opt-set-cmake-var Shards_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
opt-set-cmake-var ShyLU_Node_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
opt-set-cmake-var STK_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
opt-set-cmake-var Stokhos_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
opt-set-cmake-var Stratimikos_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
# opt-set-cmake-var Tempus_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Werror
opt-set-cmake-var Zoltan_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
opt-set-cmake-var TrilinosCouplings_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow
Expand Down
75 changes: 67 additions & 8 deletions packages/ifpack2/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,70 @@ TRIBITS_ADD_EXECUTABLE(
)


TRIBITS_ADD_TEST(
BlockTriDiagonalSolver
NAME BlockTriDiExample
ARGS ""
COMM serial mpi
NUM_MPI_PROCS 1-4
STANDARD_PASS_OUTPUT
)
TRIBITS_ADD_TEST(
BlockTriDiagonalSolver
NAME BlockTriDiExample
ARGS ""
COMM serial mpi
NUM_MPI_PROCS 1-4
STANDARD_PASS_OUTPUT
)

ASSERT_DEFINED (
${PACKAGE_NAME}_ENABLE_Xpetra
${PACKAGE_NAME}_ENABLE_Galeri
)

IF(${PACKAGE_NAME}_ENABLE_Xpetra AND ${PACKAGE_NAME}_ENABLE_Galeri)

set(blockSize 11)
set(nx 256)
set(ny 128)
set(nz 128)

set(COMMON_ARGS "--withoutOverlapCommAndComp --matrixType=Laplace3D --blockSize=${blockSize} --nx=${nx} --ny=${ny} --nz=${nz} --tol=0 --numIters=5 --withStackedTimer --numRepeats=5")
set(BTDS_ARGS "${COMMON_ARGS} --sublinesPerLine=1 --sublinesPerLineSchur=1")
set(BTDS_SCHUR_ARGS "${COMMON_ARGS} --sublinesPerLine=1 --sublinesPerLineSchur=2")
set(BTDS_DEFAULT_SCHUR_ARGS "${COMMON_ARGS} --sublinesPerLine=1 --sublinesPerLineSchur=-1")
set(BLOCK_JACOBI_ARGS "${COMMON_ARGS} --sublinesPerLine=-1")

set(TEST_ARGS ${BTDS_ARGS} ${BTDS_SCHUR_ARGS} ${BTDS_DEFAULT_SCHUR_ARGS} ${BLOCK_JACOBI_ARGS})
set(TEST_NAMES "BTDS" "BTDS_Schur" "BTDS_Schur_Default" "BTDS_Jacobi")
set(ARCHS "CUDA" "HIP")

list(LENGTH TEST_ARGS len1)
math(EXPR N_TESTS "${len1} - 1")

ASSERT_DEFINED(
Tpetra_INST_CUDA
Tpetra_INST_HIP
)

foreach(ARCH ${ARCHS})
IF (Tpetra_INST_${ARCH})
MESSAGE(STATUS "Ifpack2: BlockTriDiagonalSolver ${ARCH} test ENABLED")
set(COUNTER 2)
set(MAX_COUNT 8)

WHILE(COUNTER LESS MAX_COUNT)
math(EXPR NP "1 << ${COUNTER}")
foreach(I_TEST RANGE ${N_TESTS})
list(GET TEST_ARGS ${I_TEST} TEST_ARG)
list(GET TEST_NAMES ${I_TEST} TEST_NAME)
TRIBITS_ADD_TEST(
BlockTriDiagonalSolver
NAME "${TEST_NAME}_${ARCH}"
COMM mpi
ARGS "${TEST_ARG} --problemName=\"${TEST_NAME} ${ARCH} ${blockSize}x${nx}x${ny}x${nz} ${NP} ranks\""
NUM_MPI_PROCS ${NP}
RUN_SERIAL
CATEGORIES PERFORMANCE
)

endforeach()

math(EXPR COUNTER "${COUNTER} + 1")
ENDWHILE()
ENDIF()
endforeach()
ENDIF()
95 changes: 95 additions & 0 deletions packages/intrepid2/src/Cell/Intrepid2_CellData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,101 @@ class RefCellCenter {
//! whether the center coordinates have been already set using the method set()
static bool isReferenceCellCenterDataSet_;
};

//============================================================================================//
// //
// PointInclusion //
// //
//============================================================================================//


/** \class Intrepid2::PointInclusion
\brief This class implements a <var>check</var> function that determines whether a given point is
inside or outside the reference cell for a specific topology.
The class has a template argument for the key of the shards topology
*/

template<unsigned CellTopologyKey>
struct PointInclusion;

/**
\brief Line topology
*/
template<>
struct PointInclusion<shards::Line<>::key> {
template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
static bool
check(const PointViewType &point, const double threshold);
};

/**
\brief Triangle topology
*/
template<>
struct PointInclusion<shards::Triangle<>::key> {
template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
static bool
check(const PointViewType &point, const double threshold);
};

/**
\brief Quadrilateral topology
*/
template<>
struct PointInclusion<shards::Quadrilateral<>::key> {

template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
static bool
check(const PointViewType &point, const double threshold);
};

/**
\brief Tetrahedron topology
*/
template<>
struct PointInclusion<shards::Tetrahedron<>::key> {
template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
static bool
check(const PointViewType &point, const double threshold);
};

/**
\brief Hexahedron topology
*/
template<>
struct PointInclusion<shards::Hexahedron<>::key> {
template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
static bool
check(const PointViewType &point, const double threshold);
};

/**
\brief Pyramid topology
*/
template<>
struct PointInclusion<shards::Pyramid<>::key> {
template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
static bool
check(const PointViewType &point, const double threshold);
};

/**
\brief Wedge topology
*/
template<>
struct PointInclusion<shards::Wedge<>::key> {
template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
static bool
check(const PointViewType &point, const double threshold);
};

}

#include "Intrepid2_CellDataDef.hpp"
Expand Down
92 changes: 85 additions & 7 deletions packages/intrepid2/src/Cell/Intrepid2_CellDataDef.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ isSupported( const unsigned cellTopoKey ) {
case shards::Beam<2>::key:
case shards::Beam<3>::key:
case shards::Triangle<3>::key:
// case shards::Triangle<4>::key:
case shards::Triangle<4>::key:
case shards::Triangle<6>::key:
// case shards::ShellTriangle<3>::key:
// case shards::ShellTriangle<6>::key:
Expand All @@ -44,17 +44,17 @@ isSupported( const unsigned cellTopoKey ) {
// case shards::ShellQuadrilateral<8>::key:
// case shards::ShellQuadrilateral<9>::key:
case shards::Tetrahedron<4>::key:
// case shards::Tetrahedron<8>::key:
case shards::Tetrahedron<8>::key:
case shards::Tetrahedron<10>::key:
// case shards::Tetrahedron<11>::key:
case shards::Tetrahedron<11>::key:
case shards::Hexahedron<8>::key:
case shards::Hexahedron<20>::key:
case shards::Hexahedron<27>::key:
case shards::Pyramid<5>::key:
// case shards::Pyramid<13>::key:
// case shards::Pyramid<14>::key:
case shards::Pyramid<13>::key:
case shards::Pyramid<14>::key:
case shards::Wedge<6>::key:
// case shards::Wedge<15>::key:
case shards::Wedge<15>::key:
case shards::Wedge<18>::key:
return true;
default:
Expand Down Expand Up @@ -821,7 +821,85 @@ refCenterDataStatic_ = {
// wedge
{ 1.0/3.0, 1.0/3.0, 0.0},
};
}


// Point Inclusion


template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
bool
PointInclusion<shards::Line<>::key>::
check(const PointViewType &point, const double threshold) {
const double minus_one = -1.0 - threshold, plus_one = 1.0 + threshold;
return (minus_one <= point(0) && point(0) <= plus_one);
}

template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
bool
PointInclusion<shards::Triangle<>::key>::
check(const PointViewType &point, const double threshold) {
const double distance = max( max( -point(0), -point(1) ), point(0) + point(1) - 1.0 );
return distance < threshold;
}

template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
bool
PointInclusion<shards::Quadrilateral<>::key>::
check(const PointViewType &point,
const double threshold) {
const double minus_one = -1.0 - threshold, plus_one = 1.0 + threshold;
return ((minus_one <= point(0) && point(0) <= plus_one) &&
(minus_one <= point(1) && point(1) <= plus_one));
}

template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
bool
PointInclusion<shards::Tetrahedron<>::key>::
check(const PointViewType &point, const double threshold) {
const double distance = max( max(-point(0),-point(1)),
max(-point(2), point(0) + point(1) + point(2) - 1) );
return distance < threshold;
}

template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
bool
PointInclusion<shards::Hexahedron<>::key>::
check(const PointViewType &point, const double threshold) {
const double minus_one = -1.0 - threshold, plus_one = 1.0 + threshold;
return ((minus_one <= point(0) && point(0) <= plus_one) &&
(minus_one <= point(1) && point(1) <= plus_one) &&
(minus_one <= point(2) && point(2) <= plus_one));
}

template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
bool
PointInclusion<shards::Pyramid<>::key>::
check(const PointViewType &point, const double threshold) {
const double minus_one = -1.0 - threshold, plus_one = 1.0 + threshold, minus_zero = -threshold;
const double left = minus_one + point(2);
const double right = plus_one - point(2);
return ((left <= point(0) && point(0) <= right) &&
(left <= point(1) && point(1) <= right) &&
(minus_zero <= point(2) && point(2) <= plus_one));
}

template<typename PointViewType>
KOKKOS_INLINE_FUNCTION
bool
PointInclusion<shards::Wedge<>::key>::
check(const PointViewType &point, const double threshold) {
const double minus_one = -1.0 - threshold, plus_one = 1.0 + threshold;
const double distance = max( max( -point(0), -point(1) ), point(0) + point(1) - 1 );
return (distance < threshold && (minus_one <= point(2) && point(2) <= plus_one));
}

} // Intrepid2 namespace

#endif

Loading

0 comments on commit 2ad2602

Please sign in to comment.