Skip to content

Commit 305e49c

Browse files
author
Kloepfer
committed
fixed merge
2 parents 2759d0c + aa7bd0f commit 305e49c

14 files changed

+590
-243
lines changed

.github/workflows/cmake.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,3 @@ jobs:
129129
# only need to scan with a single build config if the installed cmake config files work
130130
if: matrix.compiler == 'g++' && matrix.build_type == 'Release'
131131
uses: github/codeql-action/analyze@v3
132-
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Doxygen GitHub Pages Deploy Action
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-22.04
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- name: Install dependencies
21+
run: |
22+
sudo apt update
23+
sudo apt install g++ cmake doxygen
24+
25+
- name: Kokkos Checkout repo
26+
uses: actions/checkout@v4
27+
with:
28+
repository: kokkos/kokkos
29+
path: kokkos
30+
31+
- name: Kokkos Configure CMake
32+
shell: bash
33+
run: cmake -S $GITHUB_WORKSPACE/kokkos -B ${{runner.workspace}}/build-kokkos
34+
-DCMAKE_CXX_COMPILER=g++
35+
-DKokkos_ENABLE_SERIAL=ON
36+
-DKokkos_ENABLE_OPENMP=OFF
37+
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/build-kokkos/install
38+
39+
- name: Kokkos Build
40+
shell: bash
41+
run: cmake --build ${{runner.workspace}}/build-kokkos --parallel 2 --target install
42+
43+
## Omegah
44+
- name: Omega_h Checkout repo
45+
uses: actions/checkout@v4
46+
with:
47+
repository: sandialabs/omega_h
48+
path: omegah
49+
50+
- name: Omega_h Configure CMake
51+
shell: bash
52+
run: cmake -S $GITHUB_WORKSPACE/omegah -B ${{runner.workspace}}/build-omegah
53+
-DCMAKE_BUILD_TYPE=Release
54+
-DCMAKE_CXX_COMPILER=g++
55+
-DBUILD_SHARED_LIBS=OFF
56+
-DOmega_h_USE_Kokkos=ON
57+
-DKokkos_PREFIX=${{runner.workspace}}/build-kokkos/install/lib/cmake
58+
-DOmega_h_USE_MPI=OFF
59+
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/build-omegah/install
60+
61+
- name: Omega_h Build
62+
shell: bash
63+
run: cmake --build ${{runner.workspace}}/build-omegah --parallel 2 --target install
64+
65+
## MeshFields
66+
- name: MeshFields Checkout repo
67+
uses: actions/checkout@v4
68+
with:
69+
repository: SCOREC/meshFields
70+
path: meshFields
71+
72+
- name: MeshFields Configure CMake
73+
shell: bash
74+
run: cmake -S $GITHUB_WORKSPACE/meshFields -B ${{runner.workspace}}/build-meshFields
75+
-DCMAKE_CXX_COMPILER=g++
76+
-DKokkos_ROOT=${{runner.workspace}}/build-kokkos/install
77+
-DMeshFields_USE_Cabana=OFF
78+
-DOmega_h_ROOT=${{runner.workspace}}/build-omegah/install
79+
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/build-meshFields/install
80+
81+
- name: Generate Doc
82+
run: doxygen ${{runner.workspace}}/build-meshFields/Doxyfile
83+
84+
- name: Upload artifact
85+
uses: actions/upload-pages-artifact@v3
86+
with:
87+
path: ./docs/html
88+
89+
- name: Deploy to GitHub Pages
90+
id: deployment
91+
uses: actions/deploy-pages@v4

.github/workflows/pr_comment_trigger_self_hosted.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
permissions:
1414
contents: read
1515
# The type of runner that the job will run on
16-
runs-on: self-hosted
16+
runs-on: [self-hosted, linux, x64, gpu]
1717

1818
if: |
1919
github.event.issue.pull_request &&

CMakeLists.txt

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
cmake_minimum_required(VERSION 3.13.0)
22

3-
project(meshFields VERSION 0.1.0 LANGUAGES CXX)
3+
project(meshfields VERSION 0.1.0 LANGUAGES CXX)
44

55
include(GNUInstallDirs)
66
include(CMakePackageConfigHelpers)
77

88
option(MeshFields_USE_Cabana "Build with the Cabana storage backend" OFF)
99

10+
find_package(Kokkos REQUIRED)
1011
find_package(Omega_h REQUIRED)
1112
#Clear the omegah compilation flags that it passes to cuda. Using the
1213
# kokkos target, and nvcc_wrapper, provide sufficient flags.
@@ -17,11 +18,14 @@ if(MeshFields_USE_Cabana)
1718
endif()
1819

1920
set(MESHFIELD_HEADERS
21+
src/MeshField_Defines.hpp
2022
src/MeshField_Utility.hpp
2123
src/MeshField_Macros.hpp
2224
src/KokkosController.hpp
2325
src/MeshField_Element.hpp
26+
src/MeshField_Integrate.hpp
2427
src/MeshField_Shape.hpp
28+
src/MeshField_ShapeField.hpp
2529
src/MeshField_Fail.hpp
2630
src/MeshField_For.hpp
2731
src/MeshField_Reduce.hpp
@@ -40,17 +44,18 @@ set(MESHFIELD_SOURCES
4044
src/MeshField_Fail.cpp
4145
)
4246

43-
add_library(meshFields ${MESHFIELD_SOURCES})
47+
add_library(meshfields ${MESHFIELD_SOURCES})
4448

45-
target_compile_features(meshFields INTERFACE cxx_std_17)
46-
target_include_directories(meshFields
49+
target_compile_features(meshfields INTERFACE cxx_std_20)
50+
target_include_directories(meshfields
4751
PUBLIC
4852
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>" # for MeshField_Config.hpp
4953
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
5054
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
51-
target_link_libraries(meshFields INTERFACE Omega_h::omega_h)
55+
target_link_libraries(meshfields INTERFACE Kokkos::kokkos)
56+
target_link_libraries(meshfields INTERFACE Omega_h::omega_h)
5257
if(Kokkos_ENABLE_CUDA)
53-
target_compile_options(meshFields INTERFACE "--expt-relaxed-constexpr")
58+
target_compile_options(meshfields INTERFACE "--expt-relaxed-constexpr")
5459
endif()
5560

5661
#enable/disable exceptions
@@ -63,8 +68,8 @@ configure_file(
6368
"${CMAKE_CURRENT_BINARY_DIR}/MeshField_Config.hpp")
6469

6570
if(MeshFields_USE_Cabana)
66-
target_link_libraries(meshFields INTERFACE Cabana::Core)
67-
target_compile_definitions(meshFields INTERFACE MESHFIELDS_ENABLE_CABANA)
71+
target_link_libraries(meshfields INTERFACE Cabana::Core)
72+
target_compile_definitions(meshfields INTERFACE MESHFIELDS_ENABLE_CABANA)
6873
endif()
6974

7075
#support ctags
@@ -77,7 +82,7 @@ if(MeshFields_USE_CTAGS)
7782
--exclude=docs --exclude=cmake --exclude=.git
7883
--exclude=.github .
7984
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
80-
add_dependencies(meshFields tags)
85+
add_dependencies(meshfields tags)
8186
endif()
8287

8388
# Set options for doxygen documentation
@@ -152,15 +157,17 @@ endfunction()
152157

153158
function(meshfields_add_exe EXE_NAME EXE_SRC)
154159
add_executable(${EXE_NAME} ${EXE_SRC})
155-
target_link_libraries(${EXE_NAME} PRIVATE meshFields)
160+
target_link_libraries(${EXE_NAME} PRIVATE meshfields)
156161
endfunction()
157162

158163
# Creating minimal reproduction of error
159164
meshfields_add_exe(KokkosTests test/testKokkos.cpp)
160165
meshfields_add_exe(SerializationTests test/testSerialize.cpp)
161166
meshfields_add_exe(ElementTests test/testElement.cpp)
167+
meshfields_add_exe(ElementJacobian1d test/testElementJacobian1d.cpp)
168+
meshfields_add_exe(ElementJacobian2d test/testElementJacobian2d.cpp)
169+
meshfields_add_exe(CountIntegrator test/testCountIntegrator.cpp)
162170
meshfields_add_exe(OmegahElementTests test/testOmegahElement.cpp)
163-
meshfields_add_exe(OmegahCoordFieldTest test/testOmegahCoordField.cpp)
164171
meshfields_add_exe(ExceptionTest test/testExceptions.cpp)
165172

166173
if(MeshFields_USE_Cabana)
@@ -173,8 +180,10 @@ endif()
173180
test_func(KokkosTests ./KokkosTests)
174181
test_func(SerializationTests ./SerializationTests)
175182
test_func(ElementTests ./ElementTests)
183+
test_func(ElementJacobian1d ./ElementJacobian1d)
184+
test_func(ElementJacobian2d ./ElementJacobian2d)
185+
test_func(CountIntegrator ./CountIntegrator)
176186
test_func(OmegahElementTests ./OmegahElementTests)
177-
test_func(OmegahCoordFieldTest ./OmegahCoordFieldTest)
178187
if(MeshFields_USE_EXCEPTIONS)
179188
# exception caught - no error
180189
test_func(ExceptionTest ./ExceptionTest)
@@ -184,8 +193,8 @@ endif()
184193

185194
#Code Coverage set up -------------------------------------------------------
186195

187-
option(meshFields_ENABLE_COVERAGE_BUILD "Do a coverage build" OFF)
188-
if(meshFields_ENABLE_COVERAGE_BUILD)
196+
option(meshfields_ENABLE_COVERAGE_BUILD "Do a coverage build" OFF)
197+
if(meshfields_ENABLE_COVERAGE_BUILD)
189198

190199
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
191200
include(CodeCoverage)
@@ -228,10 +237,10 @@ endif()
228237

229238

230239
## export the library
231-
set_target_properties(meshFields PROPERTIES PUBLIC_HEADER "${MESHFIELD_HEADERS}")
240+
set_target_properties(meshfields PROPERTIES PUBLIC_HEADER "${MESHFIELD_HEADERS}")
232241
install(
233-
TARGETS meshFields
234-
EXPORT meshFields-targets
242+
TARGETS meshfields
243+
EXPORT meshfields-targets
235244
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
236245
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
237246
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@@ -241,7 +250,7 @@ install(
241250
configure_package_config_file(
242251
"${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.in"
243252
"${CMAKE_CURRENT_BINARY_DIR}/meshfields-config.cmake"
244-
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/meshFields
253+
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/meshfields
245254
)
246255
write_basic_package_version_file(
247256
"${PROJECT_BINARY_DIR}/meshfields-config-version.cmake"
@@ -250,9 +259,9 @@ write_basic_package_version_file(
250259
install(FILES
251260
"${PROJECT_BINARY_DIR}/meshfields-config.cmake"
252261
"${PROJECT_BINARY_DIR}/meshfields-config-version.cmake"
253-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/meshFields)
262+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/meshfields)
254263

255264
install(
256-
EXPORT meshFields-targets
257-
NAMESPACE meshFields::
258-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/meshFields)
265+
EXPORT meshfields-targets
266+
NAMESPACE meshfields::
267+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/meshfields)

config.cmake.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
@PACKAGE_INIT@
22

3-
include("${CMAKE_CURRENT_LIST_DIR}/meshFields-targets.cmake")
3+
include("${CMAKE_CURRENT_LIST_DIR}/meshfields-targets.cmake")
44

5-
check_required_components(meshFields)
5+
check_required_components(meshfields)
66

77
include(CMakeFindDependencyMacro)
88

99
find_dependency(Omega_h)
10-
find_dependency(Cabana)
10+
if (MeshFields_USE_Cabana)
11+
find_dependency(Cabana)
12+
endif()
1113

src/MeshField.hpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ template <typename ExecutionSpace,
3838
size_t dim>
3939
decltype(MeshField::CreateCoordinateField<ExecutionSpace, Controller, dim>(
4040
MeshField::MeshInfo()))
41-
createCoordinateField(MeshField::MeshInfo mesh_info, Omega_h::Reals coords) {
41+
createCoordinateField(const MeshField::MeshInfo &mesh_info,
42+
Omega_h::Reals coords) {
4243
const auto meshDim = mesh_info.dim;
4344
auto coordField =
4445
MeshField::CreateCoordinateField<ExecutionSpace, Controller, dim>(
@@ -52,6 +53,11 @@ createCoordinateField(MeshField::MeshInfo mesh_info, Omega_h::Reals coords) {
5253
return coordField;
5354
}
5455

56+
} // anonymous namespace
57+
58+
namespace MeshField {
59+
60+
namespace Omegah {
5561
struct LinearTriangleToVertexField {
5662
Omega_h::LOs triVerts;
5763
LinearTriangleToVertexField(Omega_h::Mesh &mesh)
@@ -162,9 +168,7 @@ template <int ShapeOrder> auto getTriangleElement(Omega_h::Mesh &mesh) {
162168
}
163169
}
164170

165-
} // namespace
166-
167-
namespace MeshField {
171+
} // namespace Omegah
168172

169173
template <typename ExecutionSpace,
170174
template <typename...> typename Controller =
@@ -216,9 +220,9 @@ class OmegahMeshField {
216220
}
217221

218222
// evaluate a field at the specified local coordinate for each triangle
219-
template <typename AnalyticFunction, typename ViewType, typename ShapeField>
223+
template <typename ViewType, typename ShapeField>
220224
auto triangleLocalPointEval(ViewType localCoords, size_t NumPtsPerElem,
221-
AnalyticFunction func, ShapeField field) {
225+
ShapeField field) {
222226
const auto MeshDim = 2;
223227
if (mesh.dim() != MeshDim) {
224228
MeshField::fail("input mesh must be 2d\n");
@@ -228,7 +232,7 @@ class OmegahMeshField {
228232
MeshField::fail("input field order must be 1 or 2\n");
229233
}
230234

231-
const auto [shp, map] = getTriangleElement<ShapeOrder>(mesh);
235+
const auto [shp, map] = Omegah::getTriangleElement<ShapeOrder>(mesh);
232236

233237
MeshField::FieldElement f(meshInfo.numTri, field, shp, map);
234238
auto offsets = createOffsets(meshInfo.numTri, NumPtsPerElem);

0 commit comments

Comments
 (0)