Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
b05953f
Removed unnecessary files
Aug 18, 2024
6374ec3
Added scripts
Aug 18, 2024
58d31fe
Updated third-party folder
Aug 18, 2024
67ba907
Updated Google Tests
Aug 18, 2024
9fd06b9
Improved InputFunctions - TestCases
Aug 18, 2024
d11b14b
Updated Utilities
Aug 18, 2024
6ea3568
New GMGPolar class
Aug 18, 2024
8a2ec45
Linear Algebra & Solvers
Aug 18, 2024
bef5fd4
New PolarGrid class
Aug 18, 2024
ec142fc
New Level class
Aug 18, 2024
fe8dc7d
New Interpolation class
Aug 18, 2024
5b9c151
New DirectSolver class
Aug 18, 2024
d26435e
New Residual class
Aug 18, 2024
bf07e52
New Smoother class
Aug 18, 2024
7d7bbba
Performance Improvements
Aug 29, 2024
152bd6d
Small changes
Aug 29, 2024
7a1627e
Performance Improvements
Sep 8, 2024
670a77d
FMG Interplation
Sep 10, 2024
5536113
FMG Interpolation for anisotropic meshes
Sep 12, 2024
8c86b46
Added Take Implementation
Oct 21, 2024
0f7617c
Bug fixes
Oct 21, 2024
80e576a
Added README.md Documentation
Oct 22, 2024
198677f
Stop tracking .vscode folder
Oct 22, 2024
0d19552
Stopped tracking Output files
Oct 22, 2024
42499cb
Added Convergence Order Script
Oct 22, 2024
43cc7f5
Minor Updates
Oct 22, 2024
2b7e627
Test
Oct 22, 2024
1639964
Removed main2.cpp
Oct 22, 2024
48a4765
Readme improvements
Oct 22, 2024
e3c8bc7
Improvedscripts
Oct 23, 2024
12a5554
Adjusted run.sh
Oct 23, 2024
12178a6
Improved formatting
Oct 23, 2024
842c9bb
Improved Scripts
Nov 28, 2024
4b09beb
Add modified files and new untracked files
Nov 28, 2024
344d8bd
Update Images
Nov 28, 2024
a67bf00
Comparison to Version 1.0
Nov 28, 2024
bae3aaa
Removed unused file
Nov 29, 2024
9e2e521
Apply formatting to all files and delete 70 MB of example_data
Dec 5, 2024
aa75f0f
Update symmetricTridiagonalSolver.h
julianlitz Dec 8, 2024
dc0a7b6
Improved clang-format issues.
Dec 12, 2024
7274612
ABug fix and formatting improvements
Dec 12, 2024
e618a3c
Update README.md
julianlitz Jan 10, 2025
883f416
Update README.md
julianlitz Jan 10, 2025
c7fb3c1
Update README.md
julianlitz Jan 10, 2025
32ed9de
Update README.md
julianlitz Jan 10, 2025
8a07d02
Update README.md
julianlitz Jan 10, 2025
bbd918b
Update README.md
julianlitz Jan 10, 2025
0c06157
Update README.md
julianlitz Jan 10, 2025
babb85e
Update README.md
julianlitz Jan 10, 2025
34f4b05
Update README.md
julianlitz Jan 10, 2025
44d8a8e
Update README.md
julianlitz Jan 10, 2025
7718842
Update README.md
julianlitz Jan 10, 2025
0c9c3eb
Update README.md
julianlitz Jan 10, 2025
2107722
Update README.md
julianlitz Jan 10, 2025
70283a4
Update README.md
julianlitz Jan 11, 2025
ce5efde
StencilType: Implemented suggested changes from review (discussion_r1…
Mar 13, 2025
daac90e
Stencil Comment: Implemented suggested changes from review (discussio…
Mar 13, 2025
09ba718
Level depth: Implemented suggested changes from review (discussion_r1…
Mar 13, 2025
48392b9
InPlace Comment: Implemented suggested changes from review (discussio…
Mar 13, 2025
1d9f6aa
InPlace Comment: Implemented suggested changes from review (discussio…
Mar 13, 2025
12a6d06
Unreachable Statement: Implemented suggested changes from review (dis…
Mar 13, 2025
a64f91d
Constant definitions: Implemented suggested changes from review (disc…
Mar 13, 2025
2556633
Workflow Testing
Mar 17, 2025
8de6038
Workflow Testing
Mar 17, 2025
d368f19
Workflow Testing
Mar 17, 2025
633ad80
Update
Mar 17, 2025
41e2247
Level Comments
Mar 17, 2025
c8410ff
Norm Comment
Mar 17, 2025
65e1ca4
DirectSolver Comments
Mar 17, 2025
377bd5c
BitShiftOperators Removed
Mar 17, 2025
328c1a9
TridiagonalSolver comments
Mar 17, 2025
5314e92
TridiagonalSolver comments
Mar 17, 2025
891468c
TridiagonalSolver comments
Mar 18, 2025
4373411
PolarGrid Comments
Mar 18, 2025
58e2396
merge main, remove test cases in old location
Mar 18, 2025
50aa438
PolarGrid Comments
Mar 18, 2025
a2a34cb
FMG_Interpolation Comments
Mar 18, 2025
af588ed
FMG_Interpolation Comments
Mar 18, 2025
c4cd3fb
Stencil Comments
Mar 18, 2025
33eac0f
Update level.h
julianlitz Mar 18, 2025
bfe58f0
Test
Mar 18, 2025
f020a58
Smoothing Removed in-place name
Mar 18, 2025
0befa4d
Custom LU Solver
Mar 21, 2025
7e78133
Mumps Indexing Improved
Mar 21, 2025
8136511
Added comments
Mar 21, 2025
8c6e608
smoother improvements
Mar 22, 2025
2e74600
various code improvements and comments
Mar 22, 2025
4678965
Replaced Jacobian Macro by inlined Function
Mar 22, 2025
33db84b
Improved Macros
Mar 24, 2025
2f9b2bc
Independent of MUMPS
Mar 30, 2025
b672d47
Improved Readme
Mar 30, 2025
8e67740
Reduced Coce Rerepetition
Mar 30, 2025
7204c09
Header improvemenets
Mar 30, 2025
3688aed
Remove all images
Mar 31, 2025
6853f97
Code Formatting
Mar 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
BasedOnStyle: LLVM
IndentWidth: 4
SortIncludes: false
ColumnLimit: 120
SortIncludes: false
ColumnLimit: 120
AlignTrailingComments: false
AccessModifierOffset: -4
AlignConsecutiveAssignments: true
ReflowComments: false
ReflowComments: false
BraceWrapping:
AfterClass: true
AfterClass: true
AfterFunction: true
BeforeElse: true
BeforeCatch: true
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.vscode/

.github/

Output/

*.vtu

# dependencies
/.pnp
.pnp.js
Expand Down
9 changes: 6 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: GMGPolar
version: 1.0.0
version: 2.0.0
date-released: "2023-04-14"
repository-code: "https://github.com/mknaranja/GMGPolar"
url: "https://github.com/mknaranja/GMGPolar"
Expand Down Expand Up @@ -29,9 +29,12 @@ authors:
orcid: "https://orcid.org/0000-0001-8796-8599"
- given-names: Allan
family-names: Kuhn
affiliation: "German Aerospace Center (DLR)"
affiliation: "German Aerospace Center (DLR)"
- given-names: Julian
family-names: Litz
affiliation: "German Aerospace Center (DLR)"
#Contributors
cff-version: 1.0.0
cff-version: 2.0.0
message: >-
If you use this software, please cite it using the
metadata from this file.
Expand Down
207 changes: 108 additions & 99 deletions CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,121 +1,130 @@
cmake_minimum_required(VERSION 3.16.3)

project(GMGPolar VERSION 1.0.0)
cmake_minimum_required(VERSION 3.12)
project(GMGPolar VERSION 2.0.0 LANGUAGES CXX)

option(GMGPOLAR_BUILD_TESTS "Build GMGPolar unit tests." ON)
option(GMGPOLAR_USE_MUMPS "Use MUMPS to compute matrix factorizations." OFF)
option(GMGPOLAR_USE_LIKWID "Use LIKWID to measure code (regions)." OFF)
option(GMGPOLAR_USE_MUMPS "Use MUMPS to solve linear systems." OFF)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_CXX_FLAGS "")
set(CMAKE_LINKER_FLAGS "")

add_subdirectory(src)

# code coverage analysis
# Note: this only works under linux and with make
# Ninja creates different directory names which do not work together with this scrupt
# as STREQUAL is case-sensitive https://github.com/TriBITSPub/TriBITS/issues/131, also allow DEBUG as accepted input
option(GMGPOLAR_TEST_COVERAGE "Enable GCov coverage analysis (adds a 'coverage' target)" OFF)

if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "DEBUG")
if(GMGPOLAR_TEST_COVERAGE)
message(STATUS "Coverage enabled")
include(CodeCoverage)
append_coverage_compiler_flags()
setup_target_for_coverage_lcov(
NAME coverage
EXECUTABLE tests/gmgpolar_tests
EXCLUDE "${CMAKE_SOURCE_DIR}/tests*" "${CMAKE_SOURCE_DIR}/src/test_cases*" "${CMAKE_BINARY_DIR}/*" "/usr*"
)
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()


add_library(GMGPolar ${SOURCES_SRC})

add_executable(gmgpolar_simulation ./src/main.cpp)

configure_file(${CMAKE_SOURCE_DIR}/include/config_internal.h.in ${CMAKE_SOURCE_DIR}/include/config_internal.h)

target_include_directories(gmgpolar_simulation PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/test_cases )
target_include_directories(GMGPolar PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/test_cases )

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -pedantic -Wno-unused")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -mtune=generic")

# # Mumps: Sparse Matrix Solver
# set(MUMPS_PREFIX_PATH "~/spack/opt/spack/linux-ubuntu20.04-icelake/gcc-9.4.0/mumps-5.6.2-m4xrhc4mshzrxmgptzbpult3nbf6qrzk")
# include_directories(${MUMPS_PREFIX_PATH}/include)
# link_directories(${MUMPS_PREFIX_PATH}/lib)

# # Metis: Matrix reordering for Mumps
# set(METIS_PREFIX_PATH "~/spack/opt/spack/linux-ubuntu20.04-icelake/gcc-9.4.0/metis-5.1.0-bgoncx22w55soviybggl5ydjakvkm34v")
# include_directories(${METIS_PREFIX_PATH}/include)
# link_directories(${METIS_PREFIX_PATH}/lib)

# # Likwid: Performance monitoring
# set(LIKWID_PREFIX_PATH "~/spack/opt/spack/linux-ubuntu20.04-icelake/gcc-9.4.0/likwid-5.3.0-6mvx2snsqnamuyhaqspd6gxkfuaso36g")
# include_directories(${LIKWID_PREFIX_PATH}/include)
# link_directories(${LIKWID_PREFIX_PATH}/lib)

# Include directories for the project
include_directories(include)

# 1. Create a library target for the PolarGrid module
file(GLOB_RECURSE POLAR_GRID_SOURCES "src/PolarGrid/*.cpp")
add_library(PolarGrid STATIC ${POLAR_GRID_SOURCES})
target_include_directories(PolarGrid PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/PolarGrid)

# 2. Create a library target for the InputFunctions module
file(GLOB_RECURSE INPUT_FUNCTIONS_SOURCES
"src/InputFunctions/DensityProfileCoefficients/*.cpp"
"src/InputFunctions/DomainGeometry/*.cpp"
"src/InputFunctions/ExactSolution/*.cpp"
"src/InputFunctions/BoundaryConditions/*.cpp"
"src/InputFunctions/SourceTerms/*.cpp"
)
add_library(InputFunctions STATIC ${INPUT_FUNCTIONS_SOURCES})
target_include_directories(InputFunctions PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/InputFunctions)

# 3. Collect all the common source files for GMGPolar into a library
file(GLOB_RECURSE GMG_POLAR_SOURCES "src/GMGPolar/*.cpp")
file(GLOB_RECURSE MULTIGRID_METHODS_SOURCES "src/GMGPolar/MultigridMethods/*.cpp")
file(GLOB_RECURSE LEVEL_SOURCES "src/Level/*.cpp")
file(GLOB_RECURSE STENCIL_SOURCES "src/Stencil/*.cpp")
file(GLOB_RECURSE INTERPOLATION_SOURCES "src/Interpolation/*.cpp")
file(GLOB_RECURSE DIRECT_SOLVER_SOURCES "src/DirectSolver/*.cpp" "src/DirectSolverGive/*.cpp" "src/DirectSolverTake/*.cpp" "src/DirectSolverGiveCustomLU/*.cpp" "src/DirectSolverTakeCustomLU/*.cpp")
file(GLOB_RECURSE RESIDUAL_SOURCES "src/Residual/*.cpp" "src/Residual/ResidualGive/*.cpp" "src/Residual/ResidualTake/*.cpp")
file(GLOB_RECURSE SMOOTHER_SOURCES "src/Smoother/*.cpp" "src/SmootherGive/*.cpp" "src/SmootherTake/*.cpp")
file(GLOB_RECURSE EXTRAPOLATED_SMOOTHER_SOURCES "src/ExtrapolatedSmoother/*.cpp" "src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/*.cpp" "src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/*.cpp")

# 4. Create the GMGPolarLib library and link PolarGrid and InputFunctions
add_library(GMGPolarLib STATIC
${GMG_POLAR_SOURCES}
${MULTIGRID_METHODS_SOURCES}
${LEVEL_SOURCES}
${STENCIL_SOURCES}
${INTERPOLATION_SOURCES}
${DIRECT_SOLVER_SOURCES}
${RESIDUAL_SOURCES}
${SMOOTHER_SOURCES}
${EXTRAPOLATED_SMOOTHER_SOURCES}
)
# Link PolarGrid and InputFunctions to GMGPolarLib
target_link_libraries(GMGPolarLib PUBLIC PolarGrid InputFunctions)

# Link Likwid to GMGPolarLib
if(GMGPOLAR_USE_LIKWID)

find_package(LIKWID REQUIRED)

target_include_directories(GMGPolar PUBLIC ${LIKWID_INCLUDE_DIRS})
target_link_libraries(GMGPolar PUBLIC ${LIKWID_LIBRARIES})
target_compile_definitions(GMGPolar PUBLIC "-DLIKWID_PERFMON")

target_link_libraries(GMGPolarLib PUBLIC likwid)
target_compile_definitions(GMGPolarLib PUBLIC "-DLIKWID_PERFMON")
add_compile_definitions(GMGPOLAR_USE_LIKWID)
endif()



# Link Mumps to GMGPolarLib
if(GMGPOLAR_USE_MUMPS)

set(INC_DIRS
/home/kueh_mj/.spack/rev.23.05/install/linux-rocky8-zen2/gcc-10.4.0/mumps-5.4.1-fftqkl/include
/sw/rev/23.05/linux-rocky8-zen2/gcc-10.4.0/metis-5.1.0-akhgsf/include
)

set(LIB_DIRS
/home/kueh_mj/.spack/rev.23.05/install/linux-rocky8-zen2/gcc-10.4.0/mumps-5.4.1-fftqkl/lib
/sw/rev/23.05/linux-rocky8-zen2/gcc-10.4.0/metis-5.1.0-akhgsf/lib
)

include_directories(
${INC_DIRS}
)

target_link_directories(
GMGPolar
PUBLIC
${LIB_DIRS}
)

set(LIBS
mpiseq
dmumps
set(MUMPS_LIBRARIES
mumps_common
smumps
dmumps
mpiseq
metis
)

target_link_libraries(
GMGPolar
PUBLIC
${LIBS}
)
target_link_libraries(GMGPolarLib PUBLIC ${MUMPS_LIBRARIES})
add_compile_definitions(GMGPOLAR_USE_MUMPS)
endif()


find_package(OpenMP)

#currently works on GNU compiler
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7))

string(APPEND CMAKE_CXX_FLAGS " -O2 -Wall -MMD -MP -Wwrite-strings")
string(APPEND CMAKE_LINKER_FLAGS " -O2 -Wall -MMD -MP -Wwrite-strings")

if(OPENMP_FOUND)
string(APPEND CMAKE_CXX_FLAGS " -fopenmp")
string(APPEND CMAKE_LINKER_FLAGS " -fopenmp")

else()
message(FATAL_ERROR "OpenMP needed")
endif()
else()
message(FATAL_ERROR "Please use GNU compiler or change CMakeLists manually")
# Add OpenMP flags if available and link to GMGPolarLib
find_package(OpenMP REQUIRED)
if(OpenMP_CXX_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
target_link_libraries(GMGPolarLib PUBLIC OpenMP::OpenMP_CXX)
endif()

# 5. Add the main executable target (gmgpolar)
set(MAIN_SOURCE "src/main.cpp")
add_executable(gmgpolar ${MAIN_SOURCE})

# 6. Add another executable target (convergence_order)
set(CONVERGENCE_ORDER_SOURCE "src/convergence_order.cpp")
add_executable(convergence_order ${CONVERGENCE_ORDER_SOURCE})

target_link_libraries(gmgpolar_simulation PRIVATE GMGPolar)
set(WEAK_SCALING_SOURCE "src/weak_scaling.cpp")
add_executable(weak_scaling ${WEAK_SCALING_SOURCE})

set(STRONG_SCALING_SOURCE "src/strong_scaling.cpp")
add_executable(strong_scaling ${STRONG_SCALING_SOURCE})

include(thirdparty/CMakeLists.txt)
add_subdirectory(tests)
# 7. Link GMGPolarLib (which now includes PolarGrid and InputFunctions) to both executables
target_link_libraries(gmgpolar PRIVATE GMGPolarLib)
target_link_libraries(convergence_order PRIVATE GMGPolarLib)
target_link_libraries(weak_scaling PRIVATE GMGPolarLib)
target_link_libraries(strong_scaling PRIVATE GMGPolarLib)

# 9. Enable testing and include other directories
if(GMGPOLAR_BUILD_TESTS)
enable_testing()
add_subdirectory(third-party)
add_subdirectory(tests)
endif()
Loading
Loading