diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c34fa57cd936e6e9a5fadf1bf3b45785aa26abbf..d28d6c1cc5d273a666ddd17e2f3e35da11040df1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,7 +17,7 @@ build:coverage: - mkdir -p build - cd build - CXX=g++-7 CC=gcc-7 cmake .. -DCMAKE_BUILD_TYPE=Coverage - - make pastis + - make pugs test:coverage: stage: test diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cb0905163f358b0b518d0507d1f92a990b12e20..42c84e09c2158327f280e90396b87113cafa9722 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,16 +11,16 @@ include(CheckNotInSources) #------------------------------------------------------ # custom variable allowing to define version suffixes such as -rc*, -beta*, ... -set(PASTIS_VERSION "0.3.0") +set(PUGS_VERSION "0.3.0") -# deduce PASTIS_SHORT_VERSION using regex -string(REGEX MATCH "^[0-9]+\.[0-9]+\.[0-9]+" PASTIS_SHORT_VERSION ${PASTIS_VERSION}) -if("${PASTIS_SHORT_VERSION}" STREQUAL "") - message(FATAL_ERROR "Unable to compute short version from PASTIS_VERSION=${PASTIS_VERSION}") +# deduce PUGS_SHORT_VERSION using regex +string(REGEX MATCH "^[0-9]+\.[0-9]+\.[0-9]+" PUGS_SHORT_VERSION ${PUGS_VERSION}) +if("${PUGS_SHORT_VERSION}" STREQUAL "") + message(FATAL_ERROR "Unable to compute short version from PUGS_VERSION=${PUGS_VERSION}") endif() -# set project version as PASTIS_SHORT_VERSION -project (Pastis VERSION ${PASTIS_SHORT_VERSION}) +# set project version as PUGS_SHORT_VERSION +project (Pugs VERSION ${PUGS_SHORT_VERSION}) #------------------------------------------------------ @@ -28,8 +28,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) #------------------------------------------------------ -set(PASTIS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") -set(PASTIS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") +set(PUGS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(PUGS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") # Change RelWithDebInfo to compile assertions SET("CMAKE_CXX_FLAGS_RELWITHDEBINFO" @@ -80,46 +80,46 @@ endif() #------------------------------------------------------ -# Checks if compiler version is compatible with Pastis sources +# Checks if compiler version is compatible with Pugs sources set(GNU_CXX_MIN_VERSION "7.0.0") set(CLANG_CXX_MIN_VERSION "5.0.0") -# Pastis default compiler flags -set(PASTIS_CXX_FLAGS "${PASTIS_CXX_FLAGS} -Wall -Wextra") +# Pugs default compiler flags +set(PUGS_CXX_FLAGS "${PUGS_CXX_FLAGS} -Wall -Wextra") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${GNU_CXX_MIN_VERSION}") - message(FATAL_ERROR "Pastis build requires at least g++-${GNU_CXX_MIN_VERSION}") + message(FATAL_ERROR "Pugs build requires at least g++-${GNU_CXX_MIN_VERSION}") endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${CLANG_CXX_MIN_VERSION}") - message(FATAL_ERROR "Pastis build requires at least llvm/clang ++-${CLANG_CXX_MIN_VERSION}") + message(FATAL_ERROR "Pugs build requires at least llvm/clang ++-${CLANG_CXX_MIN_VERSION}") endif() - set(PASTIS_CXX_FLAGS "${PASTIS_CXX_FLAGS} -Wsign-compare -Wunused -Wunused-member-function -Wunused-private-field") + set(PUGS_CXX_FLAGS "${PUGS_CXX_FLAGS} -Wsign-compare -Wunused -Wunused-member-function -Wunused-private-field") endif() #------------------------------------------------------ # defaults use of MPI -set(PASTIS_ENABLE_MPI AUTO CACHE STRING +set(PUGS_ENABLE_MPI AUTO CACHE STRING "Choose one of: AUTO ON OFF") -if (NOT PASTIS_ENABLE_MPI MATCHES "^(AUTO|ON|OFF)$") - message(FATAL_ERROR "PASTIS_ENABLE_MPI='${PASTIS_ENABLE_MPI}'. Must be set to one of AUTO, ON or OFF") +if (NOT PUGS_ENABLE_MPI MATCHES "^(AUTO|ON|OFF)$") + message(FATAL_ERROR "PUGS_ENABLE_MPI='${PUGS_ENABLE_MPI}'. Must be set to one of AUTO, ON or OFF") endif() # checks for MPI -if (PASTIS_ENABLE_MPI MATCHES "^(AUTO|ON)$") +if (PUGS_ENABLE_MPI MATCHES "^(AUTO|ON)$") find_package(MPI) endif() if (${MPI_FOUND}) - set(PASTIS_CXX_FLAGS "${PASTIS_CXX_FLAGS} ${MPI_CXX_COMPILER_FLAGS}") + set(PUGS_CXX_FLAGS "${PUGS_CXX_FLAGS} ${MPI_CXX_COMPILER_FLAGS}") include_directories(SYSTEM ${MPI_CXX_INCLUDE_DIRS}) -elseif(PASTIS_ENABLE_MPI STREQUAL "ON") +elseif(PUGS_ENABLE_MPI STREQUAL "ON") message(FATAL_ERROR "Could not find MPI library while requested") endif() -set(PASTIS_HAS_MPI ${MPI_FOUND}) +set(PUGS_HAS_MPI ${MPI_FOUND}) #------------------------------------------------------ # search for clang-format @@ -129,9 +129,9 @@ if (CLANG_FORMAT) add_custom_target(clang-format COMMAND echo "running ${CLANG_FORMAT} ..." COMMAND ${CMAKE_COMMAND} - -DPASTIS_SOURCE_DIR="${PASTIS_SOURCE_DIR}" + -DPUGS_SOURCE_DIR="${PUGS_SOURCE_DIR}" -DCLANG_FORMAT="${CLANG_FORMAT}" - -P ${PASTIS_SOURCE_DIR}/cmake/ClangFormatProcess.cmake) + -P ${PUGS_SOURCE_DIR}/cmake/ClangFormatProcess.cmake) else () message(WARNING "clang-format no found!") endif() @@ -151,7 +151,7 @@ set(KOKKOS_ENABLE_EXPLICIT_INSTANTIATION OFF CACHE BOOL "") set(KOKKOS_ENABLE_DEPRECATED_CODE OFF CACHE BOOL "") # Kokkos compiler flags -add_subdirectory(${PASTIS_SOURCE_DIR}/packages/kokkos) +add_subdirectory(${PUGS_SOURCE_DIR}/packages/kokkos) include_directories(SYSTEM ${Kokkos_INCLUDE_DIRS_RET}) include(GetKokkosCompilerFlags) @@ -168,33 +168,33 @@ endif() # C++ 17 flags if(${CMAKE_VERSION} VERSION_LESS "3.8.0") message(WARNING "Please consider to switch to CMake >= 3.8") - set(PASTIS_CXX_FLAGS "${PASTIS_CXX_FLAGS} -std=gnu++1z") + set(PUGS_CXX_FLAGS "${PUGS_CXX_FLAGS} -std=gnu++1z") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set(PASTIS_CXX_FLAGS "${PASTIS_CXX_FLAGS} -Wno-c++17-extensions") + set(PUGS_CXX_FLAGS "${PUGS_CXX_FLAGS} -Wno-c++17-extensions") endif() else() set(CMAKE_CXX_STANDARD "17") endif() # Compiler flags -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PASTIS_CXX_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PUGS_CXX_FLAGS}") # Add debug mode for Standard C++ library -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG -D_LIBCPP_DEBUG=1 ${PASTIS_CXX_FLAGS}") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D_GLIBCXX_DEBUG -D_LIBCPP_DEBUG=1 ${PASTIS_CXX_FLAGS}") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG -D_LIBCPP_DEBUG=1 ${PUGS_CXX_FLAGS}") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D_GLIBCXX_DEBUG -D_LIBCPP_DEBUG=1 ${PUGS_CXX_FLAGS}") #------------------------------------------------------ # Rang (colors? Useless thus necessary!) -include_directories(${PASTIS_SOURCE_DIR}/packages/rang/include) +include_directories(${PUGS_SOURCE_DIR}/packages/rang/include) # CLI11 -include_directories(${PASTIS_SOURCE_DIR}/packages/CLI11/include) +include_directories(${PUGS_SOURCE_DIR}/packages/CLI11/include) # PGETL -include_directories(${PASTIS_SOURCE_DIR}/packages/PEGTL/include/tao) +include_directories(${PUGS_SOURCE_DIR}/packages/PEGTL/include/tao) -# Pastis src +# Pugs src add_subdirectory(src) include_directories(src) @@ -205,12 +205,12 @@ include_directories(src/output) include_directories(src/scheme) include_directories(src/utils) -# Pastis generated sources -include_directories(${PASTIS_BINARY_DIR}/src/utils) +# Pugs generated sources +include_directories(${PUGS_BINARY_DIR}/src/utils) -# Pastis tests +# Pugs tests -set(CATCH_MODULE_PATH "${PASTIS_SOURCE_DIR}/packages/Catch2") +set(CATCH_MODULE_PATH "${PUGS_SOURCE_DIR}/packages/Catch2") set(CATCH_INCLUDE_PATH "${CATCH_MODULE_PATH}/single_include/catch2") include("${CATCH_MODULE_PATH}/contrib/ParseAndAddCatchTests.cmake") @@ -237,17 +237,17 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage") endif() set (GCOVR_EXCLUDE - -e "${PASTIS_SOURCE_DIR}/src/main.cpp" - -e "${PASTIS_SOURCE_DIR}/src/utils/BacktraceManager.cpp" - -e "${PASTIS_SOURCE_DIR}/src/utils/BacktraceManager.hpp" + -e "${PUGS_SOURCE_DIR}/src/main.cpp" + -e "${PUGS_SOURCE_DIR}/src/utils/BacktraceManager.cpp" + -e "${PUGS_SOURCE_DIR}/src/utils/BacktraceManager.hpp" ) - set(GCOVR_OPTIONS --object-directory="${PASTIS_BINARY_DIR}" -r "${PASTIS_SOURCE_DIR}/src" ${GCOVR_EXCLUDE} ${GCOVR_EXTRA}) + set(GCOVR_OPTIONS --object-directory="${PUGS_BINARY_DIR}" -r "${PUGS_SOURCE_DIR}/src" ${GCOVR_EXCLUDE} ${GCOVR_EXTRA}) add_custom_target(run_unit_tests ALL COMMAND ${CMAKE_CTEST_COMMAND} -j ${PROCESSOR_COUNT} - DEPENDS unit_tests mpi_unit_tests pastis + DEPENDS unit_tests mpi_unit_tests pugs COMMENT "Executing unit tests." ) @@ -260,12 +260,12 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage") add_custom_target(coverage-report ALL - COMMAND ${CMAKE_COMMAND} -E remove_directory "${PASTIS_BINARY_DIR}/coverage" - COMMAND ${CMAKE_COMMAND} -E make_directory "${PASTIS_BINARY_DIR}/coverage" - COMMAND ${GCOVR} ${GCOVR_OPTIONS} --delete --html --html-details -o "${PASTIS_BINARY_DIR}/coverage/index.html" + COMMAND ${CMAKE_COMMAND} -E remove_directory "${PUGS_BINARY_DIR}/coverage" + COMMAND ${CMAKE_COMMAND} -E make_directory "${PUGS_BINARY_DIR}/coverage" + COMMAND ${GCOVR} ${GCOVR_OPTIONS} --delete --html --html-details -o "${PUGS_BINARY_DIR}/coverage/index.html" DEPENDS coverage COMMENT "Building coverage html report." - WORKING_DIRECTORY "${PASTIS_BINARY_DIR}" + WORKING_DIRECTORY "${PUGS_BINARY_DIR}" ) endif() @@ -282,17 +282,17 @@ endif() link_libraries("-rdynamic") # ------------------- Source files -------------------- -# Pastis binary +# Pugs binary add_executable( - pastis + pugs src/main.cpp) # Libraries target_link_libraries( - pastis - PastisMesh - PastisUtils - PastisLanguage + pugs + PugsMesh + PugsUtils + PugsLanguage kokkos ${PARMETIS_LIBRARIES} ${MPI_CXX_LINK_FLAGS} ${MPI_CXX_LIBRARIES} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index db0e9743643a0edef82be61169fed45763c3850b..1cf5b7bfb6a2f8b0af32d2f7baf912d6a2aef136 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ `develop` and `master` branches are protected. This means that one cannot `push` on them, so **before** to do any code change one has to create a working branch. The following conventions are greatly encouraged: * `feature/my_outstanding_feature` -* `issue/issue-number` (if no number is related to the issue please consider [opening an issue](https://gitlab.delpinux.fr/code/pastis/issues) and assign it to yourself) +* `issue/issue-number` (if no number is related to the issue please consider [opening an issue](https://gitlab.delpinux.fr/code/pugs/issues) and assign it to yourself) ---- ## Tests and coverage diff --git a/README.md b/README.md index 998ca9a0365578584379848a92fe8f0af0a3bf65..601bbe612ad11190d9b277af91f6567bbc8db5a5 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,3 @@ -Pipelines -========= +The Pugs Platform +================= -> [](https://gitlab.delpinux.fr/code/pastis/pipelines) -[](https://gitlab.delpinux.fr/code/pastis/commits/develop) -[`develop`](https://gitlab.delpinux.fr/code/pastis/tree/develop) - -> [](https://gitlab.delpinux.fr/code/pastis/pipelines) -[](https://gitlab.delpinux.fr/code/pastis/commits/master) -[`master`](https://gitlab.delpinux.fr/code/pastis/tree/master) - -Appetizer -========= - -> -- *It's pastis time!* -- diff --git a/cmake/ClangFormatProcess.cmake b/cmake/ClangFormatProcess.cmake index f1da4c989461010208d407d85a6a4d47cc35bbee..062a46e3760c11b21bc5e1fc1048e659793b076e 100644 --- a/cmake/ClangFormatProcess.cmake +++ b/cmake/ClangFormatProcess.cmake @@ -1,10 +1,10 @@ # --------------- runs clang-format in place using the style file --------------- -if(PASTIS_SOURCE_DIR AND CLANG_FORMAT) +if(PUGS_SOURCE_DIR AND CLANG_FORMAT) # get C++ sources file list (ignoring packages) file(GLOB_RECURSE ALL_SOURCE_FILES - ${PASTIS_SOURCE_DIR}/src/**.[hc]pp - ${PASTIS_SOURCE_DIR}/tests/**.[hc]pp) + ${PUGS_SOURCE_DIR}/src/**.[hc]pp + ${PUGS_SOURCE_DIR}/tests/**.[hc]pp) # apply style to the file list foreach(SOURCE_FILE ${ALL_SOURCE_FILES}) diff --git a/cmake/GetPastisGitRevision.cmake b/cmake/GetPastisGitRevision.cmake deleted file mode 100644 index 470ed7191af9c6e51010a8c47969fe63813007ad..0000000000000000000000000000000000000000 --- a/cmake/GetPastisGitRevision.cmake +++ /dev/null @@ -1,65 +0,0 @@ -# --------------- get git revision info --------------- - -set(HAS_PASTIS_GIT_INFO "TRUE") - -find_package(Git QUIET) - -if(GIT_FOUND) - execute_process( - COMMAND "${GIT_EXECUTABLE}" describe "--abbrev=0" "--match=v[0-9]*" - WORKING_DIRECTORY "${PASTIS_SOURCE_DIR}" - OUTPUT_VARIABLE PASTIS_GIT_TAG - RESULT_VARIABLE FOUND_PASTIS_GIT_INFO - OUTPUT_STRIP_TRAILING_WHITESPACE) - - if(FOUND_PASTIS_GIT_INFO EQUAL 0) - execute_process( - COMMAND "${GIT_EXECUTABLE}" reflog -1 "--format=%H" - WORKING_DIRECTORY "${PASTIS_SOURCE_DIR}" - OUTPUT_VARIABLE PASTIS_GIT_HASH - OUTPUT_STRIP_TRAILING_WHITESPACE) - - execute_process( - COMMAND "${GIT_EXECUTABLE}" symbolic-ref HEAD - WORKING_DIRECTORY "${PASTIS_SOURCE_DIR}" - OUTPUT_VARIABLE PASTIS_GIT_HEAD - OUTPUT_STRIP_TRAILING_WHITESPACE) - - execute_process( - COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD - WORKING_DIRECTORY "${PASTIS_SOURCE_DIR}" - RESULT_VARIABLE STATE - OUTPUT_STRIP_TRAILING_WHITESPACE) - - if(STATE EQUAL 0) - set(PASTIS_GIT_HAS_LOCAL_CHANGES "CLEAN") - set(PASTIS_GIT_IS_CLEAN true) - else() - set(PASTIS_GIT_IS_CLEAN false) - set(PASTIS_GIT_HAS_LOCAL_CHANGES "DIRTY") - endif() - else() - unset(HAS_PASTIS_GIT_INFO) - endif() -else() - unset(HAS_PASTIS_GIT_INFO) -endif() - -if(FOUND_PASTIS_GIT_INFO EQUAL 0) - if(NOT("${PASTIS_GIT_TAG}" STREQUAL "v${PASTIS_VERSION}")) - message("") - message ("###### CMake code version ${PASTIS_VERSION} and") - message ("###### git revision info ${PASTIS_GIT_TAG} do not match!") - message("") - endif() -else() - message("") - message ("###### This source tree is not a git repository!") - message ("###### If you intend to change sources consider to clone a git repository!") - message("") -endif() - -# Generates revision header file candidate -configure_file("${PASTIS_SOURCE_DIR}/src/utils/pastis_git_revision.hpp.in" - "${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision" - @ONLY) diff --git a/cmake/GetPugsGitRevision.cmake b/cmake/GetPugsGitRevision.cmake new file mode 100644 index 0000000000000000000000000000000000000000..5b08bd4cf4c4cfe671a92a48e684e400d36966a5 --- /dev/null +++ b/cmake/GetPugsGitRevision.cmake @@ -0,0 +1,65 @@ +# --------------- get git revision info --------------- + +set(HAS_PUGS_GIT_INFO "TRUE") + +find_package(Git QUIET) + +if(GIT_FOUND) + execute_process( + COMMAND "${GIT_EXECUTABLE}" describe "--abbrev=0" "--match=v[0-9]*" + WORKING_DIRECTORY "${PUGS_SOURCE_DIR}" + OUTPUT_VARIABLE PUGS_GIT_TAG + RESULT_VARIABLE FOUND_PUGS_GIT_INFO + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(FOUND_PUGS_GIT_INFO EQUAL 0) + execute_process( + COMMAND "${GIT_EXECUTABLE}" reflog -1 "--format=%H" + WORKING_DIRECTORY "${PUGS_SOURCE_DIR}" + OUTPUT_VARIABLE PUGS_GIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE) + + execute_process( + COMMAND "${GIT_EXECUTABLE}" symbolic-ref HEAD + WORKING_DIRECTORY "${PUGS_SOURCE_DIR}" + OUTPUT_VARIABLE PUGS_GIT_HEAD + OUTPUT_STRIP_TRAILING_WHITESPACE) + + execute_process( + COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD + WORKING_DIRECTORY "${PUGS_SOURCE_DIR}" + RESULT_VARIABLE STATE + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(STATE EQUAL 0) + set(PUGS_GIT_HAS_LOCAL_CHANGES "CLEAN") + set(PUGS_GIT_IS_CLEAN true) + else() + set(PUGS_GIT_IS_CLEAN false) + set(PUGS_GIT_HAS_LOCAL_CHANGES "DIRTY") + endif() + else() + unset(HAS_PUGS_GIT_INFO) + endif() +else() + unset(HAS_PUGS_GIT_INFO) +endif() + +if(FOUND_PUGS_GIT_INFO EQUAL 0) + if(NOT("${PUGS_GIT_TAG}" STREQUAL "v${PUGS_VERSION}")) + message("") + message ("###### CMake code version ${PUGS_VERSION} and") + message ("###### git revision info ${PUGS_GIT_TAG} do not match!") + message("") + endif() +else() + message("") + message ("###### This source tree is not a git repository!") + message ("###### If you intend to change sources consider to clone a git repository!") + message("") +endif() + +# Generates revision header file candidate +configure_file("${PUGS_SOURCE_DIR}/src/utils/pugs_git_revision.hpp.in" + "${CMAKE_CURRENT_BINARY_DIR}/pugs_git_revision" + @ONLY) diff --git a/packages/README.md b/packages/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3b59e52bbaae2fb3286eb519a273ba3af1f31cef --- /dev/null +++ b/packages/README.md @@ -0,0 +1,10 @@ +# IMPORTANT NOTICE + +This directory contains third party libraries that are mandatory to a minimal +build of `pugs` + +These libraries are **NOT** part of `pugs`, they are only distributed to ease +`pugs`' building! + +**THIS LIBRARIES ARE SUBJECT TO THEIR OWN LICENSE AND DO NOT FOLLOW `PUGS` +LICENCE** diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2c8b15598515bd6049bb81dffd6122a752c953de..7557831db4a04bb627024a023c026bf85812f05e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,25 +3,25 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) #------------------------------------------------------ -# Pastis utils +# Pugs utils add_subdirectory(utils) include_directories(utils) -# Pastis language +# Pugs language add_subdirectory(language) include_directories(language) -# Pastis algebra +# Pugs algebra #add_subdirectory(algebra) include_directories(algebra) -# Pastis mesh +# Pugs mesh add_subdirectory(mesh) include_directories(mesh) -# Pastis mesh +# Pugs mesh #add_subdirectory(mesh) include_directories(scheme) -# Pastis output +# Pugs output include_directories(output) diff --git a/src/algebra/TinyMatrix.hpp b/src/algebra/TinyMatrix.hpp index b26cd022fe5e0c5655707c3bc7ab19b9c3617b33..2c504170186a17391a893533963ad1a8982b122b 100644 --- a/src/algebra/TinyMatrix.hpp +++ b/src/algebra/TinyMatrix.hpp @@ -1,8 +1,8 @@ #ifndef TINY_MATRIX_HPP #define TINY_MATRIX_HPP -#include <PastisAssert.hpp> -#include <PastisMacros.hpp> +#include <PugsAssert.hpp> +#include <PugsMacros.hpp> #include <TinyVector.hpp> #include <Types.hpp> @@ -19,7 +19,7 @@ class TinyMatrix T m_values[N * N]; static_assert((N > 0), "TinyMatrix size must be strictly positive"); - PASTIS_FORCEINLINE + PUGS_FORCEINLINE constexpr size_t _index(const size_t& i, const size_t& j) const noexcept { @@ -27,7 +27,7 @@ class TinyMatrix } template <typename... Args> - PASTIS_FORCEINLINE constexpr void + PUGS_FORCEINLINE constexpr void _unpackVariadicInput(const T& t, Args&&... args) noexcept { m_values[N * N - 1 - sizeof...(args)] = t; @@ -37,7 +37,7 @@ class TinyMatrix } public: - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix operator-() const { @@ -48,14 +48,14 @@ class TinyMatrix return std::move(opposed); } - PASTIS_INLINE + PUGS_INLINE constexpr friend TinyMatrix operator*(const T& t, const TinyMatrix& A) { TinyMatrix B = A; return std::move(B *= t); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix& operator*=(const T& t) { @@ -65,7 +65,7 @@ class TinyMatrix return *this; } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix operator*(const TinyMatrix& B) const { const TinyMatrix& A = *this; @@ -82,7 +82,7 @@ class TinyMatrix return std::move(AB); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector<N, T> operator*(const TinyVector<N, T>& x) const { const TinyMatrix& A = *this; @@ -97,7 +97,7 @@ class TinyMatrix return std::move(Ax); } - PASTIS_INLINE + PUGS_INLINE constexpr friend std::ostream& operator<<(std::ostream& os, const TinyMatrix& A) { @@ -117,7 +117,7 @@ class TinyMatrix return os; } - PASTIS_INLINE + PUGS_INLINE constexpr bool operator==(const TinyMatrix& A) const { @@ -128,14 +128,14 @@ class TinyMatrix return true; } - PASTIS_INLINE + PUGS_INLINE constexpr bool operator!=(const TinyMatrix& A) const { return not this->operator==(A); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix operator+(const TinyMatrix& A) const { @@ -146,7 +146,7 @@ class TinyMatrix return std::move(sum); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix operator+(TinyMatrix&& A) const { @@ -156,7 +156,7 @@ class TinyMatrix return std::move(A); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix operator-(const TinyMatrix& A) const { @@ -167,7 +167,7 @@ class TinyMatrix return std::move(difference); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix operator-(TinyMatrix&& A) const { @@ -177,7 +177,7 @@ class TinyMatrix return std::move(A); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix& operator+=(const TinyMatrix& A) { @@ -187,7 +187,7 @@ class TinyMatrix return *this; } - PASTIS_INLINE + PUGS_INLINE constexpr void operator+=(const volatile TinyMatrix& A) volatile { @@ -196,7 +196,7 @@ class TinyMatrix } } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix& operator-=(const TinyMatrix& A) { @@ -206,7 +206,7 @@ class TinyMatrix return *this; } - PASTIS_INLINE + PUGS_INLINE constexpr T& operator()(const size_t& i, const size_t& j) noexcept(NO_ASSERT) { @@ -214,7 +214,7 @@ class TinyMatrix return m_values[_index(i, j)]; } - PASTIS_INLINE + PUGS_INLINE constexpr const T& operator()(const size_t& i, const size_t& j) const noexcept(NO_ASSERT) { @@ -222,7 +222,7 @@ class TinyMatrix return m_values[_index(i, j)]; } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix& operator=(const ZeroType&) noexcept { @@ -234,7 +234,7 @@ class TinyMatrix return *this; } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix& operator=(const IdentityType&) noexcept { @@ -248,14 +248,14 @@ class TinyMatrix return *this; } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix& operator=(const TinyMatrix& A) noexcept = default; - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix& operator=(TinyMatrix&& A) noexcept = default; template <typename... Args> - PASTIS_INLINE constexpr TinyMatrix(const T& t, Args&&... args) noexcept + PUGS_INLINE constexpr TinyMatrix(const T& t, Args&&... args) noexcept { static_assert(sizeof...(args) == N * N - 1, "wrong number of parameters"); this->_unpackVariadicInput(t, std::forward<Args>(args)...); @@ -263,10 +263,10 @@ class TinyMatrix // One does not use the '=default' constructor to avoid (unexpected) // performances issues - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix() noexcept {} - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix(const ZeroType&) noexcept { static_assert( @@ -277,7 +277,7 @@ class TinyMatrix } } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix(const IdentityType&) noexcept { static_assert( @@ -290,18 +290,18 @@ class TinyMatrix } } - PASTIS_INLINE + PUGS_INLINE constexpr TinyMatrix(const TinyMatrix&) noexcept = default; - PASTIS_INLINE + PUGS_INLINE TinyMatrix(TinyMatrix&& A) noexcept = default; - PASTIS_INLINE + PUGS_INLINE ~TinyMatrix() = default; }; template <size_t N, typename T> -PASTIS_INLINE constexpr TinyMatrix<N, T> +PUGS_INLINE constexpr TinyMatrix<N, T> tensorProduct(const TinyVector<N, T>& x, const TinyVector<N, T>& y) { TinyMatrix<N, T> A; @@ -314,7 +314,7 @@ tensorProduct(const TinyVector<N, T>& x, const TinyVector<N, T>& y) } template <size_t N, typename T> -PASTIS_INLINE constexpr T +PUGS_INLINE constexpr T det(const TinyMatrix<N, T>& A) { static_assert(std::is_arithmetic<T>::value, @@ -363,7 +363,7 @@ det(const TinyMatrix<N, T>& A) } template <typename T> -PASTIS_INLINE constexpr T +PUGS_INLINE constexpr T det(const TinyMatrix<1, T>& A) { static_assert(std::is_arithmetic<T>::value, @@ -372,7 +372,7 @@ det(const TinyMatrix<1, T>& A) } template <typename T> -PASTIS_INLINE constexpr T +PUGS_INLINE constexpr T det(const TinyMatrix<2, T>& A) { static_assert(std::is_arithmetic<T>::value, @@ -381,7 +381,7 @@ det(const TinyMatrix<2, T>& A) } template <typename T> -PASTIS_INLINE constexpr T +PUGS_INLINE constexpr T det(const TinyMatrix<3, T>& A) { static_assert(std::is_arithmetic<T>::value, @@ -392,7 +392,7 @@ det(const TinyMatrix<3, T>& A) } template <size_t N, typename T> -PASTIS_INLINE constexpr TinyMatrix<N - 1, T> +PUGS_INLINE constexpr TinyMatrix<N - 1, T> getMinor(const TinyMatrix<N, T>& A, const size_t& I, const size_t& J) { static_assert(N >= 2, "minor calculation requires at least 2x2 matrices"); @@ -418,10 +418,10 @@ getMinor(const TinyMatrix<N, T>& A, const size_t& I, const size_t& J) } template <size_t N, typename T> -PASTIS_INLINE constexpr TinyMatrix<N, T> inverse(const TinyMatrix<N, T>& A); +PUGS_INLINE constexpr TinyMatrix<N, T> inverse(const TinyMatrix<N, T>& A); template <typename T> -PASTIS_INLINE constexpr TinyMatrix<1, T> +PUGS_INLINE constexpr TinyMatrix<1, T> inverse(const TinyMatrix<1, T>& A) { static_assert(std::is_arithmetic<T>::value, @@ -434,7 +434,7 @@ inverse(const TinyMatrix<1, T>& A) } template <size_t N, typename T> -PASTIS_INLINE constexpr T +PUGS_INLINE constexpr T cofactor(const TinyMatrix<N, T>& A, const size_t& i, const size_t& j) { static_assert(std::is_arithmetic<T>::value, @@ -445,7 +445,7 @@ cofactor(const TinyMatrix<N, T>& A, const size_t& i, const size_t& j) } template <typename T> -PASTIS_INLINE constexpr TinyMatrix<2, T> +PUGS_INLINE constexpr TinyMatrix<2, T> inverse(const TinyMatrix<2, T>& A) { static_assert(std::is_arithmetic<T>::value, @@ -461,7 +461,7 @@ inverse(const TinyMatrix<2, T>& A) } template <typename T> -PASTIS_INLINE constexpr TinyMatrix<3, T> +PUGS_INLINE constexpr TinyMatrix<3, T> inverse(const TinyMatrix<3, T>& A) { static_assert(std::is_arithmetic<T>::value, diff --git a/src/algebra/TinyVector.hpp b/src/algebra/TinyVector.hpp index 8dfdc33f5d2b1f1dc9cdbafd45be248ac1cd6b68..f49c83de7815307eef8838960709c5d69176d4ba 100644 --- a/src/algebra/TinyVector.hpp +++ b/src/algebra/TinyVector.hpp @@ -3,8 +3,8 @@ #include <iostream> -#include <PastisAssert.hpp> -#include <PastisMacros.hpp> +#include <PugsAssert.hpp> +#include <PugsMacros.hpp> #include <Types.hpp> @@ -21,7 +21,7 @@ class TinyVector static_assert((N > 0), "TinyVector size must be strictly positive"); template <typename... Args> - PASTIS_FORCEINLINE constexpr void + PUGS_FORCEINLINE constexpr void _unpackVariadicInput(const T& t, Args&&... args) noexcept { m_values[N - 1 - sizeof...(args)] = t; @@ -31,7 +31,7 @@ class TinyVector } public: - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector operator-() const { @@ -42,14 +42,14 @@ class TinyVector return std::move(opposed); } - PASTIS_INLINE + PUGS_INLINE constexpr size_t dimension() const { return N; } - PASTIS_INLINE + PUGS_INLINE constexpr bool operator==(const TinyVector& v) const { @@ -60,14 +60,14 @@ class TinyVector return true; } - PASTIS_INLINE + PUGS_INLINE constexpr bool operator!=(const TinyVector& v) const { return not this->operator==(v); } - PASTIS_INLINE + PUGS_INLINE constexpr T operator,(const TinyVector& v) const { T t = m_values[0] * v.m_values[0]; @@ -77,7 +77,7 @@ class TinyVector return std::move(t); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector& operator*=(const T& t) { @@ -87,21 +87,21 @@ class TinyVector return *this; } - PASTIS_INLINE + PUGS_INLINE constexpr friend TinyVector operator*(const T& t, const TinyVector& v) { TinyVector w = v; return std::move(w *= t); } - PASTIS_INLINE + PUGS_INLINE constexpr friend TinyVector operator*(const T& t, TinyVector&& v) { v *= t; return std::move(v); } - PASTIS_INLINE + PUGS_INLINE constexpr friend std::ostream& operator<<(std::ostream& os, const TinyVector& v) { @@ -113,7 +113,7 @@ class TinyVector return os; } - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector operator+(const TinyVector& v) const { @@ -124,7 +124,7 @@ class TinyVector return std::move(sum); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector operator+(TinyVector&& v) const { @@ -134,7 +134,7 @@ class TinyVector return std::move(v); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector operator-(const TinyVector& v) const { @@ -145,7 +145,7 @@ class TinyVector return std::move(difference); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector operator-(TinyVector&& v) const { @@ -155,7 +155,7 @@ class TinyVector return std::move(v); } - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector& operator+=(const TinyVector& v) { @@ -165,7 +165,7 @@ class TinyVector return *this; } - PASTIS_INLINE + PUGS_INLINE constexpr void operator+=(const volatile TinyVector& v) volatile { @@ -174,7 +174,7 @@ class TinyVector } } - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector& operator-=(const TinyVector& v) { @@ -184,21 +184,21 @@ class TinyVector return *this; } - PASTIS_INLINE + PUGS_INLINE constexpr T& operator[](const size_t& i) noexcept(NO_ASSERT) { Assert(i < N); return m_values[i]; } - PASTIS_INLINE + PUGS_INLINE constexpr const T& operator[](const size_t& i) const noexcept(NO_ASSERT) { Assert(i < N); return m_values[i]; } - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector& operator=(const ZeroType&) noexcept { @@ -210,14 +210,14 @@ class TinyVector return *this; } - PASTIS_INLINE + PUGS_INLINE TinyVector& operator=(const TinyVector&) noexcept = default; - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector& operator=(TinyVector&& v) noexcept = default; template <typename... Args> - PASTIS_INLINE constexpr TinyVector(const T& t, Args&&... args) noexcept + PUGS_INLINE constexpr TinyVector(const T& t, Args&&... args) noexcept { static_assert(sizeof...(args) == N - 1, "wrong number of parameters"); this->_unpackVariadicInput(t, std::forward<Args>(args)...); @@ -225,10 +225,10 @@ class TinyVector // One does not use the '=default' constructor to avoid (unexpected) // performances issues - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector() noexcept {} - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector(const ZeroType&) noexcept { static_assert( @@ -239,18 +239,18 @@ class TinyVector } } - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector(const TinyVector&) noexcept = default; - PASTIS_INLINE + PUGS_INLINE constexpr TinyVector(TinyVector&& v) noexcept = default; - PASTIS_INLINE + PUGS_INLINE ~TinyVector() noexcept = default; }; template <size_t N, typename T> -PASTIS_INLINE constexpr T +PUGS_INLINE constexpr T l2Norm(const TinyVector<N, T>& x) { static_assert(std::is_arithmetic<T>(), @@ -262,7 +262,7 @@ l2Norm(const TinyVector<N, T>& x) // Cross product is only defined for K^3 vectors template <typename T> -PASTIS_INLINE constexpr TinyVector<3, T> +PUGS_INLINE constexpr TinyVector<3, T> crossProduct(const TinyVector<3, T>& u, const TinyVector<3, T>& v) { TinyVector<3, T> cross_product(u[1] * v[2] - u[2] * v[1], diff --git a/src/language/CMakeLists.txt b/src/language/CMakeLists.txt index 31b2bb1bc08fc66071514385b52fbddfb3e271ea..2a9e7547f454f11714e3487cc01390ea77142028 100644 --- a/src/language/CMakeLists.txt +++ b/src/language/CMakeLists.txt @@ -4,10 +4,10 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) # ------------------- Source files -------------------- add_library( - PastisLanguage - PastisParser.cpp) + PugsLanguage + PugsParser.cpp) -#include_directories(${PASTIS_SOURCE_DIR}/utils) +#include_directories(${PUGS_SOURCE_DIR}/utils) # Additional dependencies -#add_dependencies(PastisMesh) +#add_dependencies(PugsMesh) diff --git a/src/language/PastisParser.hpp b/src/language/PastisParser.hpp deleted file mode 100644 index 3a61ef813b7e2215db3e71ff9c6ae1298fd7f2d1..0000000000000000000000000000000000000000 --- a/src/language/PastisParser.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef PASTIS_PARSER_HPP -#define PASTIS_PARSER_HPP - -#include <string> - -void parser(const std::string& filename); - -#endif // PASTIS_PARSER_HPP diff --git a/src/language/PastisParser.cpp b/src/language/PugsParser.cpp similarity index 99% rename from src/language/PastisParser.cpp rename to src/language/PugsParser.cpp index bba7434ef4d496c3e1b159583620951082dc5ea7..ed2be7c163de9ec37bff8205039001d1f0805e07 100644 --- a/src/language/PastisParser.cpp +++ b/src/language/PugsParser.cpp @@ -1,4 +1,4 @@ -#include <PastisParser.hpp> +#include <PugsParser.hpp> #include <iostream> #include <rang.hpp> diff --git a/src/language/PugsParser.hpp b/src/language/PugsParser.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1e1919a5e942cee66816177f9f8db43ca10a0f70 --- /dev/null +++ b/src/language/PugsParser.hpp @@ -0,0 +1,8 @@ +#ifndef PUGS_PARSER_HPP +#define PUGS_PARSER_HPP + +#include <string> + +void parser(const std::string& filename); + +#endif // PUGS_PARSER_HPP diff --git a/src/main.cpp b/src/main.cpp index b047d640a9646bdcb9ea45a95a81020ce315fb8c..83d73a54d64437eb3a8fcb1cc561a0db0f9f52c2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,5 @@ -#include <PastisOStream.hpp> -#include <PastisUtils.hpp> +#include <PugsOStream.hpp> +#include <PugsUtils.hpp> #include <rang.hpp> @@ -21,7 +21,7 @@ #include <MeshNodeBoundary.hpp> #include <GmshReader.hpp> -#include <PastisParser.hpp> +#include <PugsParser.hpp> #include <SynchronizerManager.hpp> diff --git a/src/mesh/CMakeLists.txt b/src/mesh/CMakeLists.txt index ad245fb038c4a09e451591ff44098da80cb22106..117cdac4ecdc1867521b9cfe3c094565c37852c3 100644 --- a/src/mesh/CMakeLists.txt +++ b/src/mesh/CMakeLists.txt @@ -4,14 +4,14 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) # ------------------- Source files -------------------- add_library( - PastisMesh + PugsMesh Connectivity.cpp ConnectivityComputer.cpp GmshReader.cpp ConnectivityDispatcher.cpp SynchronizerManager.cpp) -include_directories(${PASTIS_BINARY_DIR}/src/utils) +include_directories(${PUGS_BINARY_DIR}/src/utils) # Additional dependencies -#add_dependencies(PastisMesh) +#add_dependencies(PugsMesh) diff --git a/src/mesh/CellType.hpp b/src/mesh/CellType.hpp index a3b35c8944af51cea0e981d04651e10b6682e08f..875ecd6bfc83ed55ad116319e4d18adb3e74a156 100644 --- a/src/mesh/CellType.hpp +++ b/src/mesh/CellType.hpp @@ -1,7 +1,7 @@ #ifndef CELL_TYPE_HPP #define CELL_TYPE_HPP -#include <PastisMacros.hpp> +#include <PugsMacros.hpp> #include <string_view> enum class CellType : unsigned short @@ -17,7 +17,7 @@ enum class CellType : unsigned short Hexahedron }; -PASTIS_INLINE +PUGS_INLINE std::string_view name(const CellType& cell_type) { diff --git a/src/mesh/Connectivity.cpp b/src/mesh/Connectivity.cpp index 86b94b9344e7389393e8519e4518d06bd084f3c1..946933e8fc54720448e680bfb6455777edc9d597 100644 --- a/src/mesh/Connectivity.cpp +++ b/src/mesh/Connectivity.cpp @@ -32,7 +32,7 @@ Connectivity<Dimension>::_buildFrom(const ConnectivityDescriptor& descriptor) { WeakCellValue<CellType> cell_type(*this); - parallel_for(this->numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(this->numberOfCells(), PUGS_LAMBDA(const CellId& j) { cell_type[j] = descriptor.cell_type_vector[j]; }); m_cell_type = cell_type; @@ -53,7 +53,7 @@ Connectivity<Dimension>::_buildFrom(const ConnectivityDescriptor& descriptor) { WeakCellValue<int> cell_global_index(*this); int first_index = 0; - parallel_for(this->numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(this->numberOfCells(), PUGS_LAMBDA(const CellId& j) { cell_global_index[j] = first_index + j; }); m_cell_global_index = cell_global_index; @@ -68,7 +68,7 @@ Connectivity<Dimension>::_buildFrom(const ConnectivityDescriptor& descriptor) { const int rank = parallel::rank(); WeakCellValue<bool> cell_is_owned(*this); - parallel_for(this->numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(this->numberOfCells(), PUGS_LAMBDA(const CellId& j) { cell_is_owned[j] = (m_cell_owner[j] == rank); }); m_cell_is_owned = cell_is_owned; @@ -83,7 +83,7 @@ Connectivity<Dimension>::_buildFrom(const ConnectivityDescriptor& descriptor) { const int rank = parallel::rank(); WeakNodeValue<bool> node_is_owned(*this); - parallel_for(this->numberOfNodes(), PASTIS_LAMBDA(const NodeId& r) { + parallel_for(this->numberOfNodes(), PUGS_LAMBDA(const NodeId& r) { node_is_owned[r] = (m_node_owner[r] == rank); }); m_node_is_owned = node_is_owned; @@ -129,7 +129,7 @@ Connectivity<Dimension>::_buildFrom(const ConnectivityDescriptor& descriptor) { const int rank = parallel::rank(); WeakFaceValue<bool> face_is_owned(*this); - parallel_for(this->numberOfFaces(), PASTIS_LAMBDA(const FaceId& l) { + parallel_for(this->numberOfFaces(), PUGS_LAMBDA(const FaceId& l) { face_is_owned[l] = (m_face_owner[l] == rank); }); m_face_is_owned = face_is_owned; @@ -176,7 +176,7 @@ Connectivity<Dimension>::_buildFrom(const ConnectivityDescriptor& descriptor) { const int rank = parallel::rank(); WeakEdgeValue<bool> edge_is_owned(*this); - parallel_for(this->numberOfEdges(), PASTIS_LAMBDA(const EdgeId& e) { + parallel_for(this->numberOfEdges(), PUGS_LAMBDA(const EdgeId& e) { edge_is_owned[e] = (m_edge_owner[e] == rank); }); m_edge_is_owned = edge_is_owned; diff --git a/src/mesh/Connectivity.hpp b/src/mesh/Connectivity.hpp index 980bb5f9a7aa0a8a6fd9cbf10acc5df06f20932b..7d37e41435f32653cbbd4db87c6e2155fcddced3 100644 --- a/src/mesh/Connectivity.hpp +++ b/src/mesh/Connectivity.hpp @@ -1,13 +1,13 @@ #ifndef CONNECTIVITY_HPP #define CONNECTIVITY_HPP -#include <PastisAssert.hpp> -#include <PastisMacros.hpp> +#include <PugsAssert.hpp> +#include <PugsMacros.hpp> -#include <PastisOStream.hpp> -#include <PastisUtils.hpp> +#include <PugsOStream.hpp> +#include <PugsUtils.hpp> -#include <PastisTraits.hpp> +#include <PugsTraits.hpp> #include <TinyVector.hpp> @@ -42,7 +42,7 @@ template <size_t Dim> class Connectivity final : public IConnectivity { public: - PASTIS_INLINE + PUGS_INLINE static std::shared_ptr<Connectivity<Dim>> build( const ConnectivityDescriptor&); @@ -52,7 +52,7 @@ class Connectivity final : public IConnectivity public: static constexpr size_t Dimension = Dim; - PASTIS_INLINE + PUGS_INLINE size_t dimension() const final { @@ -125,7 +125,7 @@ class Connectivity final : public IConnectivity void _computeCellFaceAndFaceNodeConnectivities(); template <typename SubItemValuePerItemType> - PASTIS_INLINE const SubItemValuePerItemType& + PUGS_INLINE const SubItemValuePerItemType& _lazzyBuildItemNumberInTheirChild( const SubItemValuePerItemType& sub_item_value_per_item) const { @@ -141,7 +141,7 @@ class Connectivity final : public IConnectivity friend class ConnectivityComputer; - PASTIS_INLINE + PUGS_INLINE const ConnectivityMatrix& _getMatrix(const ItemType& item_type_0, const ItemType& item_type_1) const { @@ -156,35 +156,35 @@ class Connectivity final : public IConnectivity } public: - PASTIS_INLINE + PUGS_INLINE const auto& cellType() const { return m_cell_type; } - PASTIS_INLINE + PUGS_INLINE const auto& cellNumber() const { return m_cell_number; } - PASTIS_INLINE + PUGS_INLINE const auto& faceNumber() const { return m_face_number; } - PASTIS_INLINE + PUGS_INLINE const auto& edgeNumber() const { return m_edge_number; } - PASTIS_INLINE + PUGS_INLINE const auto& nodeNumber() const { @@ -192,7 +192,7 @@ class Connectivity final : public IConnectivity } template <ItemType item_type> - PASTIS_INLINE const auto& + PUGS_INLINE const auto& number() const { if constexpr (item_type == ItemType::cell) { @@ -208,21 +208,21 @@ class Connectivity final : public IConnectivity } } - PASTIS_INLINE + PUGS_INLINE const auto& cellOwner() const { return m_cell_owner; } - PASTIS_INLINE + PUGS_INLINE const auto& faceOwner() const { return m_face_owner; } - PASTIS_INLINE + PUGS_INLINE const auto& edgeOwner() const { @@ -231,7 +231,7 @@ class Connectivity final : public IConnectivity return m_edge_owner; } - PASTIS_INLINE + PUGS_INLINE const auto& nodeOwner() const { @@ -239,7 +239,7 @@ class Connectivity final : public IConnectivity } template <ItemType item_type> - PASTIS_INLINE const auto& + PUGS_INLINE const auto& owner() const { if constexpr (item_type == ItemType::cell) { @@ -255,21 +255,21 @@ class Connectivity final : public IConnectivity } } - PASTIS_INLINE + PUGS_INLINE const auto& cellIsOwned() const { return m_cell_is_owned; } - PASTIS_INLINE + PUGS_INLINE const auto& faceIsOwned() const { return m_face_is_owned; } - PASTIS_INLINE + PUGS_INLINE const auto& edgeIsOwned() const { @@ -278,7 +278,7 @@ class Connectivity final : public IConnectivity return m_edge_is_owned; } - PASTIS_INLINE + PUGS_INLINE const auto& nodeIsOwned() const { @@ -286,7 +286,7 @@ class Connectivity final : public IConnectivity } template <ItemType item_type> - PASTIS_INLINE const auto& + PUGS_INLINE const auto& isOwned() const { if constexpr (item_type == ItemType::cell) { @@ -302,7 +302,7 @@ class Connectivity final : public IConnectivity } } - PASTIS_INLINE + PUGS_INLINE const bool& isConnectivityMatrixBuilt(const ItemType& item_type_0, const ItemType& item_type_1) const @@ -312,98 +312,98 @@ class Connectivity final : public IConnectivity return connectivity_matrix.isBuilt(); } template <ItemType source_item_type, ItemType target_item_type> - PASTIS_INLINE auto + PUGS_INLINE auto getItemToItemMatrix() const { return ItemToItemMatrix<source_item_type, target_item_type>( _getMatrix(source_item_type, target_item_type)); } - PASTIS_INLINE + PUGS_INLINE auto cellToFaceMatrix() const { return this->template getItemToItemMatrix<ItemType::cell, ItemType::face>(); } - PASTIS_INLINE + PUGS_INLINE auto cellToEdgeMatrix() const { return this->template getItemToItemMatrix<ItemType::cell, ItemType::edge>(); } - PASTIS_INLINE + PUGS_INLINE auto cellToNodeMatrix() const { return this->template getItemToItemMatrix<ItemType::cell, ItemType::node>(); } - PASTIS_INLINE + PUGS_INLINE auto faceToCellMatrix() const { return this->template getItemToItemMatrix<ItemType::face, ItemType::cell>(); } - PASTIS_INLINE + PUGS_INLINE auto faceToEdgeMatrix() const { return this->template getItemToItemMatrix<ItemType::face, ItemType::edge>(); } - PASTIS_INLINE + PUGS_INLINE auto faceToNodeMatrix() const { return this->template getItemToItemMatrix<ItemType::face, ItemType::node>(); } - PASTIS_INLINE + PUGS_INLINE auto edgeToCellMatrix() const { return this->template getItemToItemMatrix<ItemType::edge, ItemType::cell>(); } - PASTIS_INLINE + PUGS_INLINE auto edgeToFaceMatrix() const { return this->template getItemToItemMatrix<ItemType::edge, ItemType::face>(); } - PASTIS_INLINE + PUGS_INLINE auto edgeToNodeMatrix() const { return this->template getItemToItemMatrix<ItemType::edge, ItemType::node>(); } - PASTIS_INLINE + PUGS_INLINE auto nodeToCellMatrix() const { return this->template getItemToItemMatrix<ItemType::node, ItemType::cell>(); } - PASTIS_INLINE + PUGS_INLINE auto nodeToFaceMatrix() const { return this->template getItemToItemMatrix<ItemType::node, ItemType::face>(); } - PASTIS_INLINE + PUGS_INLINE auto nodeToEdgeMatrix() const { return this->template getItemToItemMatrix<ItemType::node, ItemType::edge>(); } - PASTIS_INLINE + PUGS_INLINE const auto& cellFaceIsReversed() const { @@ -412,7 +412,7 @@ class Connectivity final : public IConnectivity return m_cell_face_is_reversed; } - PASTIS_INLINE + PUGS_INLINE const auto& faceEdgeIsReversed() const { @@ -421,7 +421,7 @@ class Connectivity final : public IConnectivity return m_face_edge_is_reversed; } - PASTIS_INLINE + PUGS_INLINE const auto& cellLocalNumbersInTheirNodes() const { @@ -429,7 +429,7 @@ class Connectivity final : public IConnectivity m_cell_local_numbers_in_their_nodes); } - PASTIS_INLINE + PUGS_INLINE const auto& cellLocalNumbersInTheirEdges() const { @@ -441,7 +441,7 @@ class Connectivity final : public IConnectivity } } - PASTIS_INLINE + PUGS_INLINE const auto& cellLocalNumbersInTheirFaces() const { @@ -453,7 +453,7 @@ class Connectivity final : public IConnectivity } } - PASTIS_INLINE + PUGS_INLINE const auto& faceLocalNumbersInTheirCells() const { @@ -465,7 +465,7 @@ class Connectivity final : public IConnectivity } } - PASTIS_INLINE + PUGS_INLINE const auto& faceLocalNumbersInTheirEdges() const { @@ -474,7 +474,7 @@ class Connectivity final : public IConnectivity m_face_local_numbers_in_their_edges); } - PASTIS_INLINE + PUGS_INLINE const auto& faceLocalNumbersInTheirNodes() const { @@ -483,7 +483,7 @@ class Connectivity final : public IConnectivity m_face_local_numbers_in_their_nodes); } - PASTIS_INLINE + PUGS_INLINE const auto& edgeLocalNumbersInTheirCells() const { @@ -495,7 +495,7 @@ class Connectivity final : public IConnectivity } } - PASTIS_INLINE + PUGS_INLINE const auto& edgeLocalNumbersInTheirFaces() const { @@ -504,7 +504,7 @@ class Connectivity final : public IConnectivity m_edge_local_numbers_in_their_faces); } - PASTIS_INLINE + PUGS_INLINE const auto& edgeLocalNumbersInTheirNodes() const { @@ -513,7 +513,7 @@ class Connectivity final : public IConnectivity m_edge_local_numbers_in_their_nodes); } - PASTIS_INLINE + PUGS_INLINE const auto& nodeLocalNumbersInTheirCells() const { @@ -521,7 +521,7 @@ class Connectivity final : public IConnectivity m_node_local_numbers_in_their_cells); } - PASTIS_INLINE + PUGS_INLINE const auto& nodeLocalNumbersInTheirEdges() const { @@ -530,7 +530,7 @@ class Connectivity final : public IConnectivity m_node_local_numbers_in_their_edges); } - PASTIS_INLINE + PUGS_INLINE const auto& nodeLocalNumbersInTheirFaces() const { @@ -590,7 +590,7 @@ class Connectivity final : public IConnectivity } } - PASTIS_INLINE + PUGS_INLINE CSRGraph cellToCellGraph() const { @@ -642,7 +642,7 @@ class Connectivity final : public IConnectivity return CSRGraph(entries, neighbors); } - PASTIS_INLINE + PUGS_INLINE size_t numberOfNodes() const final { @@ -651,7 +651,7 @@ class Connectivity final : public IConnectivity return node_to_cell_matrix.numRows(); } - PASTIS_INLINE + PUGS_INLINE size_t numberOfEdges() const final { @@ -660,7 +660,7 @@ class Connectivity final : public IConnectivity return edge_to_node_matrix.numRows(); } - PASTIS_INLINE + PUGS_INLINE size_t numberOfFaces() const final { @@ -669,7 +669,7 @@ class Connectivity final : public IConnectivity return face_to_node_matrix.numRows(); } - PASTIS_INLINE + PUGS_INLINE size_t numberOfCells() const final { @@ -686,7 +686,7 @@ class Connectivity final : public IConnectivity m_item_to_item_matrix[itemTId(ItemType::cell)][itemTId(ItemType::node)]; WeakCellValue<double> inv_cell_nb_nodes(*this); - parallel_for(this->numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(this->numberOfCells(), PUGS_LAMBDA(const CellId& j) { const auto& cell_nodes = cell_to_node_matrix.rowConst(j); inv_cell_nb_nodes[j] = 1. / cell_nodes.length; }); @@ -712,7 +712,7 @@ class Connectivity final : public IConnectivity }; template <size_t Dim> -PASTIS_INLINE std::shared_ptr<Connectivity<Dim>> +PUGS_INLINE std::shared_ptr<Connectivity<Dim>> Connectivity<Dim>::build(const ConnectivityDescriptor& descriptor) { std::shared_ptr<Connectivity<Dim>> connectivity_ptr(new Connectivity<Dim>); diff --git a/src/mesh/ConnectivityComputer.cpp b/src/mesh/ConnectivityComputer.cpp index 226ae3ac96e3d8884fce398b527bcd81d1e4b144..f5d88bb5cd151751d0af6778fc1e28683709be7f 100644 --- a/src/mesh/ConnectivityComputer.cpp +++ b/src/mesh/ConnectivityComputer.cpp @@ -4,7 +4,7 @@ #include <map> template <typename ConnectivityType> -PASTIS_INLINE ConnectivityMatrix +PUGS_INLINE ConnectivityMatrix ConnectivityComputer::computeConnectivityMatrix( const ConnectivityType& connectivity, const ItemType& item_type, diff --git a/src/mesh/ConnectivityDescriptor.hpp b/src/mesh/ConnectivityDescriptor.hpp index b6e6bac837e1fae6f7f48ca804aa2bbe7a840d4f..8b190be0c01abfd266508e64a22d4be1ff629b71 100644 --- a/src/mesh/ConnectivityDescriptor.hpp +++ b/src/mesh/ConnectivityDescriptor.hpp @@ -2,7 +2,7 @@ #define CONNECTIVITY_DESCRIPTOR_HPP #include <ItemOfItemType.hpp> -#include <PastisTraits.hpp> +#include <PugsTraits.hpp> #include <RefItemList.hpp> #include <vector> diff --git a/src/mesh/ConnectivityDispatcher.cpp b/src/mesh/ConnectivityDispatcher.cpp index 95825d6cb879c2ca3f5a86c698422a6208ceb168..e3f419ca78cde0c41171a7f76b15ea56dcc36809 100644 --- a/src/mesh/ConnectivityDispatcher.cpp +++ b/src/mesh/ConnectivityDispatcher.cpp @@ -28,7 +28,7 @@ ConnectivityDispatcher<Dimension>::_buildNewOwner() using ItemId = ItemIdT<item_type>; ItemValue<int, item_type> item_new_owner(m_connectivity); - parallel_for(item_new_owner.size(), PASTIS_LAMBDA(const ItemId& l) { + parallel_for(item_new_owner.size(), PUGS_LAMBDA(const ItemId& l) { const auto& item_to_cell = item_to_cell_matrix[l]; CellId Jmin = item_to_cell[0]; @@ -297,7 +297,7 @@ ConnectivityDispatcher<Dimension>::_buildNumberOfSubItemPerItemToRecvByProc() using ItemId = ItemIdT<SubItemOfItemT::item_type>; parallel_for( - number_of_sub_item_per_item.size(), PASTIS_LAMBDA(const ItemId& j) { + number_of_sub_item_per_item.size(), PUGS_LAMBDA(const ItemId& j) { number_of_sub_item_per_item[j] = item_to_sub_item_matrix[j].size(); }); @@ -423,7 +423,7 @@ ConnectivityDispatcher<Dimension>::_buildRecvItemIdCorrespondanceByProc() for (size_t i_rank = 0; i_rank < parallel::size(); ++i_rank) { Array<int> send_item_number(item_list_to_send_by_proc[i_rank].size()); const Array<const ItemId> send_item_id = item_list_to_send_by_proc[i_rank]; - parallel_for(send_item_number.size(), PASTIS_LAMBDA(const size_t& j) { + parallel_for(send_item_number.size(), PUGS_LAMBDA(const size_t& j) { send_item_number[j] = item_number[send_item_id[j]]; }); send_item_number_by_proc[i_rank] = send_item_number; @@ -595,7 +595,7 @@ ConnectivityDispatcher<Dimension>::_buildItemReferenceList() for (size_t i_rank = 0; i_rank < parallel::size(); ++i_rank) { Array<block_type> send_item_refs(nb_item_to_send_by_proc[i_rank]); const Array<const ItemId> send_item_id = send_item_id_by_proc[i_rank]; - parallel_for(send_item_id.size(), PASTIS_LAMBDA(const size_t& l) { + parallel_for(send_item_id.size(), PUGS_LAMBDA(const size_t& l) { const ItemId& item_id = send_item_id[l]; send_item_refs[l] = item_references[item_id]; }); diff --git a/src/mesh/ConnectivityDispatcher.hpp b/src/mesh/ConnectivityDispatcher.hpp index 28829e6f583bf06490452ee43b69f38a897ec408..afc2f2ef5002b68a39ced2a1320d4f73b5d97fbf 100644 --- a/src/mesh/ConnectivityDispatcher.hpp +++ b/src/mesh/ConnectivityDispatcher.hpp @@ -37,7 +37,7 @@ class ConnectivityDispatcher DispatchedItemInfo<ItemType::node> m_dispatched_node_info; template <ItemType item_type> - PASTIS_INLINE DispatchedItemInfo<item_type>& + PUGS_INLINE DispatchedItemInfo<item_type>& _dispatchedInfo() { if constexpr (item_type == ItemType::cell) { @@ -52,7 +52,7 @@ class ConnectivityDispatcher } template <ItemType item_type> - PASTIS_INLINE const DispatchedItemInfo<item_type>& + PUGS_INLINE const DispatchedItemInfo<item_type>& _dispatchedInfo() const { if constexpr (item_type == ItemType::cell) { @@ -90,7 +90,7 @@ class ConnectivityDispatcher DispatchedItemOfItemInfo<CellOfNode> m_dispatched_cell_of_node_info; template <typename ItemOfItem> - PASTIS_INLINE DispatchedItemOfItemInfo<ItemOfItem>& + PUGS_INLINE DispatchedItemOfItemInfo<ItemOfItem>& _dispatchedInfo() { if constexpr (std::is_same_v<NodeOfCell, ItemOfItem>) { @@ -123,7 +123,7 @@ class ConnectivityDispatcher } template <typename ItemOfItem> - PASTIS_INLINE const DispatchedItemOfItemInfo<ItemOfItem>& + PUGS_INLINE const DispatchedItemOfItemInfo<ItemOfItem>& _dispatchedInfo() const { if constexpr (std::is_same_v<NodeOfCell, ItemOfItem>) { @@ -223,7 +223,7 @@ class ConnectivityDispatcher for (size_t i = 0; i < parallel::size(); ++i) { const Array<const ItemId>& item_list = item_list_to_send_by_proc[i]; Array<MutableDataType> item_value_list(item_list.size()); - parallel_for(item_list.size(), PASTIS_LAMBDA(const ItemId& item_id) { + parallel_for(item_list.size(), PUGS_LAMBDA(const ItemId& item_id) { item_value_list[item_id] = item_value[item_list[item_id]]; }); item_value_to_send_by_proc[i] = item_value_list; @@ -267,7 +267,7 @@ class ConnectivityDispatcher for (size_t i = 0; i < parallel::size(); ++i) { const Array<const ItemId>& item_list = item_list_to_send_by_proc[i]; Array<MutableDataType> item_value_list(item_list.size()); - parallel_for(item_list.size(), PASTIS_LAMBDA(const ItemId& item_id) { + parallel_for(item_list.size(), PUGS_LAMBDA(const ItemId& item_id) { item_value_list[item_id] = item_value[item_list[item_id]]; }); item_value_to_send_by_proc[i] = item_value_list; @@ -292,7 +292,7 @@ class ConnectivityDispatcher const auto& recv_item_id_correspondance = recv_item_id_correspondance_by_proc[i_rank]; const auto& recv_item_value = recv_item_value_by_proc[i_rank]; - parallel_for(recv_item_value.size(), PASTIS_LAMBDA(size_t r) { + parallel_for(recv_item_value.size(), PUGS_LAMBDA(size_t r) { const ItemId& item_id = recv_item_id_correspondance[r]; new_item_value[item_id] = recv_item_value[r]; }); diff --git a/src/mesh/ConnectivityMatrix.hpp b/src/mesh/ConnectivityMatrix.hpp index 0a2a36c1eafb5afb4211097790ea31b32562d16e..6573d011daaac3430df4a77b3283b624af76f057 100644 --- a/src/mesh/ConnectivityMatrix.hpp +++ b/src/mesh/ConnectivityMatrix.hpp @@ -3,7 +3,7 @@ #include <Array.hpp> #include <Kokkos_StaticCrsGraph.hpp> -#include <PastisUtils.hpp> +#include <PugsUtils.hpp> class ConnectivityMatrix { @@ -36,35 +36,35 @@ class ConnectivityMatrix return m_host_matrix.row_map; } - PASTIS_INLINE + PUGS_INLINE auto numEntries() const { return m_host_matrix.entries.extent(0); } - PASTIS_INLINE + PUGS_INLINE auto numRows() const { return m_host_matrix.numRows(); } - PASTIS_INLINE + PUGS_INLINE auto rowConst(const size_t& j) const { return m_host_matrix.rowConst(j); } - PASTIS_INLINE + PUGS_INLINE const auto& rowMap(const size_t& j) const { return m_host_matrix.row_map[j]; } - PASTIS_INLINE + PUGS_INLINE ConnectivityMatrix(const std::vector<std::vector<unsigned int>>& initializer) : m_host_matrix{Kokkos::create_staticcrsgraph<HostMatrix>( "connectivity_matrix", diff --git a/src/mesh/GmshReader.cpp b/src/mesh/GmshReader.cpp index ea9e7338de7e4e262e92f0a7d92758616bae40c2..563048abc7997080bc31cee19734a9e9234d1383 100644 --- a/src/mesh/GmshReader.cpp +++ b/src/mesh/GmshReader.cpp @@ -1,5 +1,5 @@ #include <GmshReader.hpp> -#include <PastisMacros.hpp> +#include <PugsMacros.hpp> #include <fstream> #include <iostream> @@ -204,14 +204,14 @@ class ConnectivityFace<2> return m_reversed; } - PASTIS_INLINE + PUGS_INLINE bool operator==(const ConnectivityFace& f) const { return ((m_node0_id == f.m_node0_id) and (m_node1_id == f.m_node1_id)); } - PASTIS_INLINE + PUGS_INLINE bool operator<(const ConnectivityFace& f) const { @@ -223,7 +223,7 @@ class ConnectivityFace<2> m_node_number_vector[f.m_node1_id]))); } - PASTIS_INLINE + PUGS_INLINE ConnectivityFace(const std::vector<unsigned int>& node_id_list, const std::vector<int>& node_number_vector) : m_node_number_vector(node_number_vector) @@ -242,10 +242,10 @@ class ConnectivityFace<2> } } - PASTIS_INLINE + PUGS_INLINE ConnectivityFace(const ConnectivityFace&) = default; - PASTIS_INLINE + PUGS_INLINE ~ConnectivityFace() = default; }; @@ -273,7 +273,7 @@ class ConnectivityFace<3> std::vector<NodeId::base_type> m_node_id_list; const std::vector<int>& m_node_number_vector; - PASTIS_INLINE + PUGS_INLINE std::vector<unsigned int> _sort(const std::vector<unsigned int>& node_list) { @@ -298,21 +298,21 @@ class ConnectivityFace<3> } public: - PASTIS_INLINE + PUGS_INLINE const bool& reversed() const { return m_reversed; } - PASTIS_INLINE + PUGS_INLINE const std::vector<unsigned int>& nodeIdList() const { return m_node_id_list; } - PASTIS_INLINE + PUGS_INLINE ConnectivityFace(const std::vector<unsigned int>& given_node_id_list, const std::vector<int>& node_number_vector) : m_reversed(false), @@ -337,7 +337,7 @@ class ConnectivityFace<3> return false; } - PASTIS_INLINE + PUGS_INLINE bool operator<(const ConnectivityFace& f) const { @@ -352,13 +352,13 @@ class ConnectivityFace<3> return m_node_id_list.size() < f.m_node_id_list.size(); } - PASTIS_INLINE + PUGS_INLINE ConnectivityFace(const ConnectivityFace&) = default; - PASTIS_INLINE + PUGS_INLINE ConnectivityFace() = delete; - PASTIS_INLINE + PUGS_INLINE ~ConnectivityFace() = default; }; diff --git a/src/mesh/IConnectivity.hpp b/src/mesh/IConnectivity.hpp index a5a4bd36594b475d26c639c733a48965f84719ad..136ff17c080fb27c07b574562d2a7b58f1d22e9b 100644 --- a/src/mesh/IConnectivity.hpp +++ b/src/mesh/IConnectivity.hpp @@ -39,28 +39,28 @@ class IConnectivity : public std::enable_shared_from_this<IConnectivity> }; template <> -PASTIS_INLINE size_t +PUGS_INLINE size_t IConnectivity::numberOf<ItemType::node>() const { return this->numberOfNodes(); } template <> -PASTIS_INLINE size_t +PUGS_INLINE size_t IConnectivity::numberOf<ItemType::edge>() const { return this->numberOfEdges(); } template <> -PASTIS_INLINE size_t +PUGS_INLINE size_t IConnectivity::numberOf<ItemType::face>() const { return this->numberOfFaces(); } template <> -PASTIS_INLINE size_t +PUGS_INLINE size_t IConnectivity::numberOf<ItemType::cell>() const { return this->numberOfCells(); diff --git a/src/mesh/ItemId.hpp b/src/mesh/ItemId.hpp index a33e3a8e383d2ca824e166788bbf79f71a1265e7..de7790668e17261edf0446cea870ff1c1f9202a9 100644 --- a/src/mesh/ItemId.hpp +++ b/src/mesh/ItemId.hpp @@ -2,7 +2,7 @@ #define ITEM_ID_HPP #include <ItemType.hpp> -#include <PastisMacros.hpp> +#include <PugsMacros.hpp> template <ItemType item_type> class ItemIdT @@ -14,13 +14,13 @@ class ItemIdT base_type m_id; public: - PASTIS_INLINE + PUGS_INLINE constexpr operator const base_type&() const { return m_id; } - PASTIS_INLINE + PUGS_INLINE constexpr ItemIdT operator++(int) { @@ -29,7 +29,7 @@ class ItemIdT return std::move(item_id); } - PASTIS_INLINE + PUGS_INLINE constexpr ItemIdT& operator++() { @@ -37,7 +37,7 @@ class ItemIdT return *this; } - PASTIS_INLINE + PUGS_INLINE constexpr ItemIdT& operator=(const base_type& id) { @@ -45,25 +45,25 @@ class ItemIdT return *this; } - PASTIS_INLINE + PUGS_INLINE constexpr ItemIdT& operator=(const ItemIdT&) = default; - PASTIS_INLINE + PUGS_INLINE constexpr ItemIdT& operator=(ItemIdT&&) = default; - PASTIS_INLINE + PUGS_INLINE constexpr ItemIdT(const base_type& id) : m_id{id} {} - PASTIS_INLINE + PUGS_INLINE constexpr ItemIdT(const ItemIdT&) = default; - PASTIS_INLINE + PUGS_INLINE constexpr ItemIdT(ItemIdT&&) = default; - PASTIS_INLINE + PUGS_INLINE constexpr ItemIdT() = default; - PASTIS_INLINE + PUGS_INLINE ~ItemIdT() = default; // forbidden rules diff --git a/src/mesh/ItemToItemMatrix.hpp b/src/mesh/ItemToItemMatrix.hpp index 66e4f812656f9b0963c8a1a5d4eaf60aa39f34c3..2438da59d96cc5b23583f191c715fc4c332ba06e 100644 --- a/src/mesh/ItemToItemMatrix.hpp +++ b/src/mesh/ItemToItemMatrix.hpp @@ -5,7 +5,7 @@ #include <ItemType.hpp> #include <ConnectivityMatrix.hpp> -#include <PastisUtils.hpp> +#include <PugsUtils.hpp> template <ItemType SourceItemType, ItemType TargetItemType> class ItemToItemMatrix @@ -21,38 +21,38 @@ class ItemToItemMatrix const RowType m_row; public: - PASTIS_INLINE + PUGS_INLINE size_t size() const { return m_row.length; } - PASTIS_INLINE + PUGS_INLINE TargetItemId operator[](const size_t& j) const { return m_row(j); } - PASTIS_INLINE + PUGS_INLINE SubItemList(const RowType& row) : m_row{row} { ; } - PASTIS_INLINE + PUGS_INLINE SubItemList& operator=(const SubItemList&) = default; - PASTIS_INLINE + PUGS_INLINE SubItemList& operator=(SubItemList&&) = default; - PASTIS_INLINE + PUGS_INLINE SubItemList(const SubItemList&) = default; - PASTIS_INLINE + PUGS_INLINE SubItemList(SubItemList&&) = default; - PASTIS_INLINE + PUGS_INLINE ~SubItemList() = default; }; @@ -72,7 +72,7 @@ class ItemToItemMatrix return m_connectivity_matrix.entries(); } - PASTIS_INLINE + PUGS_INLINE auto operator[](const SourceItemId& source_id) const { using RowType = decltype(m_connectivity_matrix.rowConst(source_id)); @@ -80,7 +80,7 @@ class ItemToItemMatrix } template <typename IndexType> - PASTIS_INLINE const auto& operator[](const IndexType& source_id) const + PUGS_INLINE const auto& operator[](const IndexType& source_id) const { static_assert(std::is_same_v<IndexType, SourceItemId>, "ItemToItemMatrix must be indexed using correct ItemId"); @@ -88,26 +88,26 @@ class ItemToItemMatrix return SubItemList<RowType>(m_connectivity_matrix.rowConst(source_id)); } - PASTIS_INLINE + PUGS_INLINE ItemToItemMatrix(const ConnectivityMatrix& connectivity_matrix) : m_connectivity_matrix{connectivity_matrix} { ; } - PASTIS_INLINE + PUGS_INLINE ItemToItemMatrix& operator=(const ItemToItemMatrix&) = default; - PASTIS_INLINE + PUGS_INLINE ItemToItemMatrix& operator=(ItemToItemMatrix&&) = default; - PASTIS_INLINE + PUGS_INLINE ItemToItemMatrix(ItemToItemMatrix&&) = default; - PASTIS_INLINE + PUGS_INLINE ItemToItemMatrix(const ItemToItemMatrix&) = default; - PASTIS_INLINE + PUGS_INLINE ~ItemToItemMatrix() = default; }; diff --git a/src/mesh/ItemType.hpp b/src/mesh/ItemType.hpp index 659e95acad6e57dabcd0c397cacb74c1f669d4cf..ea5c2648629457fa2858bc1854db5a0810444ddb 100644 --- a/src/mesh/ItemType.hpp +++ b/src/mesh/ItemType.hpp @@ -13,7 +13,7 @@ enum class ItemType cell = 3 }; -PASTIS_INLINE +PUGS_INLINE constexpr std::string_view itemName(const ItemType& item_type) { @@ -46,7 +46,7 @@ struct ItemTypeId template <> struct ItemTypeId<1> { - PASTIS_INLINE + PUGS_INLINE static constexpr size_t itemTId(const ItemType& item_type) { @@ -71,7 +71,7 @@ struct ItemTypeId<1> template <> struct ItemTypeId<2> { - PASTIS_INLINE + PUGS_INLINE static constexpr size_t itemTId(const ItemType& item_type) { @@ -99,7 +99,7 @@ struct ItemTypeId<2> template <> struct ItemTypeId<3> { - PASTIS_INLINE + PUGS_INLINE static constexpr size_t itemTId(const ItemType& item_type) { @@ -127,6 +127,6 @@ struct ItemTypeId<3> }; template <ItemType item_type> -PASTIS_INLINE constexpr bool is_false_item_type_v = false; +PUGS_INLINE constexpr bool is_false_item_type_v = false; #endif // ITEM_TYPE_HPP diff --git a/src/mesh/ItemValue.hpp b/src/mesh/ItemValue.hpp index 07ce36712b84b13fd3719e6b6fed559e0137b1b7..d2ff6bedb048a3ca2f25a6ed3da20c17b4dca9fb 100644 --- a/src/mesh/ItemValue.hpp +++ b/src/mesh/ItemValue.hpp @@ -1,8 +1,8 @@ #ifndef ITEM_VALUE_HPP #define ITEM_VALUE_HPP -#include <PastisAssert.hpp> -#include <PastisOStream.hpp> +#include <PugsAssert.hpp> +#include <PugsOStream.hpp> #include <Array.hpp> @@ -43,7 +43,7 @@ class ItemValue // Allow const std:weak_ptr version to access our data friend ItemValue<std::add_const_t<DataType>, item_type, ConnectivityWeakPtr>; - friend PASTIS_INLINE + friend PUGS_INLINE ItemValue<std::remove_const_t<DataType>, item_type, ConnectivityPtr> copy(const ItemValue<DataType, item_type, ConnectivityPtr>& source) { @@ -55,14 +55,14 @@ class ItemValue } public: - PASTIS_INLINE + PUGS_INLINE bool isBuilt() const noexcept { return m_connectivity_ptr.use_count() != 0; } - PASTIS_INLINE + PUGS_INLINE std::shared_ptr<const IConnectivity> connectivity_ptr() const noexcept { @@ -73,7 +73,7 @@ class ItemValue } } - PASTIS_INLINE + PUGS_INLINE size_t size() const noexcept(NO_ASSERT) { @@ -81,7 +81,7 @@ class ItemValue return m_values.size(); } - PASTIS_INLINE + PUGS_INLINE void fill(const DataType& data) const noexcept { @@ -92,7 +92,7 @@ class ItemValue // Following Kokkos logic, these classes are view and const view does allow // changes in data - PASTIS_FORCEINLINE + PUGS_FORCEINLINE DataType& operator[](const ItemId& i) const noexcept(NO_ASSERT) { Assert(this->isBuilt()); @@ -106,7 +106,7 @@ class ItemValue "ItemValue must be indexed by ItemId"); } - PASTIS_INLINE + PUGS_INLINE size_t numberOfItems() const noexcept(NO_ASSERT) { @@ -115,7 +115,7 @@ class ItemValue } template <typename DataType2> - PASTIS_INLINE ItemValue& + PUGS_INLINE ItemValue& operator=(const Array<DataType2>& values) noexcept(NO_ASSERT) { // ensures that DataType is the same as source DataType2 @@ -139,7 +139,7 @@ class ItemValue } template <typename DataType2, typename ConnectivityPtr2> - PASTIS_INLINE ItemValue& + PUGS_INLINE ItemValue& operator=(const ItemValue<DataType2, item_type, ConnectivityPtr2>& value_per_item) noexcept { @@ -164,17 +164,17 @@ class ItemValue } template <typename DataType2, typename ConnectivityPtr2> - PASTIS_INLINE + PUGS_INLINE ItemValue(const ItemValue<DataType2, item_type, ConnectivityPtr2>& value_per_item) noexcept { this->operator=(value_per_item); } - PASTIS_INLINE + PUGS_INLINE ItemValue() = default; - PASTIS_INLINE + PUGS_INLINE ItemValue(const IConnectivity& connectivity) noexcept : m_connectivity_ptr{connectivity.shared_ptr()}, m_values{connectivity.numberOf<item_type>()} @@ -185,7 +185,7 @@ class ItemValue ; } - PASTIS_INLINE + PUGS_INLINE ~ItemValue() = default; }; diff --git a/src/mesh/ItemValueUtils.hpp b/src/mesh/ItemValueUtils.hpp index 88f281889e6f79c4ec46755a7ddae050c2ba93f0..2013dcc2ae44ecbaf818c3a8ade0a6cf16d8e776 100644 --- a/src/mesh/ItemValueUtils.hpp +++ b/src/mesh/ItemValueUtils.hpp @@ -56,7 +56,7 @@ min(const ItemValue<DataType, item_type>& item_value) const IsOwnedType& m_is_owned; public: - PASTIS_INLINE + PUGS_INLINE operator data_type() { data_type reduced_value; @@ -64,7 +64,7 @@ min(const ItemValue<DataType, item_type>& item_value) return reduced_value; } - PASTIS_INLINE + PUGS_INLINE void operator()(const index_type& i, data_type& data) const { @@ -73,7 +73,7 @@ min(const ItemValue<DataType, item_type>& item_value) } } - PASTIS_INLINE + PUGS_INLINE void join(volatile data_type& dst, const volatile data_type& src) const { @@ -82,21 +82,21 @@ min(const ItemValue<DataType, item_type>& item_value) } } - PASTIS_INLINE + PUGS_INLINE void init(data_type& value) const { value = std::numeric_limits<data_type>::max(); } - PASTIS_INLINE + PUGS_INLINE ItemValueMin(const ItemValueType& item_value, const IsOwnedType& is_owned) : m_item_value(item_value), m_is_owned(is_owned) { ; } - PASTIS_INLINE + PUGS_INLINE ~ItemValueMin() = default; }; @@ -151,7 +151,7 @@ max(const ItemValue<DataType, item_type>& item_value) const IsOwnedType& m_is_owned; public: - PASTIS_INLINE + PUGS_INLINE operator data_type() { data_type reduced_value; @@ -159,7 +159,7 @@ max(const ItemValue<DataType, item_type>& item_value) return reduced_value; } - PASTIS_INLINE + PUGS_INLINE void operator()(const index_type& i, data_type& data) const { @@ -168,7 +168,7 @@ max(const ItemValue<DataType, item_type>& item_value) } } - PASTIS_INLINE + PUGS_INLINE void join(volatile data_type& dst, const volatile data_type& src) const { @@ -177,21 +177,21 @@ max(const ItemValue<DataType, item_type>& item_value) } } - PASTIS_INLINE + PUGS_INLINE void init(data_type& value) const { value = std::numeric_limits<data_type>::min(); } - PASTIS_INLINE + PUGS_INLINE ItemValueMax(const ItemValueType& item_value, const IsOwnedType& is_owned) : m_item_value(item_value), m_is_owned(is_owned) { ; } - PASTIS_INLINE + PUGS_INLINE ~ItemValueMax() = default; }; @@ -246,7 +246,7 @@ sum(const ItemValue<DataType, item_type>& item_value) const IsOwnedType& m_is_owned; public: - PASTIS_INLINE + PUGS_INLINE operator data_type() { data_type reduced_value; @@ -254,7 +254,7 @@ sum(const ItemValue<DataType, item_type>& item_value) return reduced_value; } - PASTIS_INLINE + PUGS_INLINE void operator()(const index_type& i, data_type& data) const { @@ -263,14 +263,14 @@ sum(const ItemValue<DataType, item_type>& item_value) } } - PASTIS_INLINE + PUGS_INLINE void join(volatile data_type& dst, const volatile data_type& src) const { dst += src; } - PASTIS_INLINE + PUGS_INLINE void init(data_type& value) const { @@ -281,14 +281,14 @@ sum(const ItemValue<DataType, item_type>& item_value) } } - PASTIS_INLINE + PUGS_INLINE ItemValueSum(const ItemValueType& item_value, const IsOwnedType& is_owned) : m_item_value(item_value), m_is_owned(is_owned) { ; } - PASTIS_INLINE + PUGS_INLINE ~ItemValueSum() = default; }; diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index c9ee9b15a930fc2995cd2fa98674d648d050c378..af76417d50e1ea686548e6270147c2f0480cebe8 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -29,56 +29,56 @@ class Mesh final : public IMesh NodeValue<Rd> m_mutable_xr; public: - PASTIS_INLINE + PUGS_INLINE size_t dimension() const { return Dimension; } - PASTIS_INLINE + PUGS_INLINE const Connectivity& connectivity() const { return *m_connectivity; } - PASTIS_INLINE + PUGS_INLINE size_t numberOfNodes() const { return m_connectivity->numberOfNodes(); } - PASTIS_INLINE + PUGS_INLINE size_t numberOfFaces() const { return m_connectivity->numberOfFaces(); } - PASTIS_INLINE + PUGS_INLINE size_t numberOfCells() const { return m_connectivity->numberOfCells(); } - PASTIS_INLINE + PUGS_INLINE const NodeValue<const Rd>& xr() const { return m_xr; } - PASTIS_INLINE + PUGS_INLINE NodeValue<Rd> mutableXr() const { return m_mutable_xr; } - PASTIS_INLINE + PUGS_INLINE Mesh(const std::shared_ptr<const Connectivity>& connectivity, NodeValue<Rd>& xr) : m_connectivity{connectivity}, m_xr{xr}, m_mutable_xr{xr} diff --git a/src/mesh/MeshData.hpp b/src/mesh/MeshData.hpp index 7f307d0db2ac7774da915d34c51294ea5cf02029..0c512e4d14b1d862721431089d3a8a4d708a2a6a 100644 --- a/src/mesh/MeshData.hpp +++ b/src/mesh/MeshData.hpp @@ -1,7 +1,7 @@ #ifndef MESH_DATA_HPP #define MESH_DATA_HPP -#include <PastisUtils.hpp> +#include <PugsUtils.hpp> #include <TinyVector.hpp> #include <ItemValue.hpp> @@ -30,7 +30,7 @@ class MeshData CellValue<const Rd> m_xj; CellValue<const double> m_Vj; - PASTIS_INLINE + PUGS_INLINE void _updateCenter() { // Computes vertices isobarycenter @@ -41,7 +41,7 @@ class MeshData m_mesh.connectivity().cellToNodeMatrix(); CellValue<Rd> xj(m_mesh.connectivity()); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { const auto& cell_nodes = cell_to_node_matrix[j]; xj[j] = 0.5 * (xr[cell_nodes[0]] + xr[cell_nodes[1]]); }); @@ -55,7 +55,7 @@ class MeshData const auto& cell_to_node_matrix = m_mesh.connectivity().cellToNodeMatrix(); CellValue<Rd> xj(m_mesh.connectivity()); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { Rd X = zero; const auto& cell_nodes = cell_to_node_matrix[j]; for (size_t R = 0; R < cell_nodes.size(); ++R) { @@ -67,7 +67,7 @@ class MeshData } } - PASTIS_INLINE + PUGS_INLINE void _updateVolume() { @@ -75,7 +75,7 @@ class MeshData const auto& cell_to_node_matrix = m_mesh.connectivity().cellToNodeMatrix(); CellValue<double> Vj(m_mesh.connectivity()); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { double sum_cjr_xr = 0; const auto& cell_nodes = cell_to_node_matrix[j]; @@ -87,7 +87,7 @@ class MeshData m_Vj = Vj; } - PASTIS_INLINE + PUGS_INLINE void _updateCjr() { @@ -100,7 +100,7 @@ class MeshData { NodeValuePerCell<Rd> Cjr(m_mesh.connectivity()); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { const auto& cell_nodes = cell_to_node_matrix[j]; for (size_t R = 0; R < cell_nodes.size(); ++R) { int Rp1 = (R + 1) % cell_nodes.size(); @@ -114,7 +114,7 @@ class MeshData { NodeValuePerCell<double> ljr(m_mesh.connectivity()); - parallel_for(m_Cjr.numberOfValues(), PASTIS_LAMBDA(const size_t& jr) { + parallel_for(m_Cjr.numberOfValues(), PUGS_LAMBDA(const size_t& jr) { ljr[jr] = l2Norm(m_Cjr[jr]); }); m_ljr = ljr; @@ -122,7 +122,7 @@ class MeshData { NodeValuePerCell<Rd> njr(m_mesh.connectivity()); - parallel_for(m_Cjr.numberOfValues(), PASTIS_LAMBDA(const size_t& jr) { + parallel_for(m_Cjr.numberOfValues(), PUGS_LAMBDA(const size_t& jr) { njr[jr] = (1. / m_ljr[jr]) * m_Cjr[jr]; }); m_njr = njr; @@ -134,7 +134,7 @@ class MeshData const auto& face_to_node_matrix = m_mesh.connectivity().faceToNodeMatrix(); - parallel_for(m_mesh.numberOfFaces(), PASTIS_LAMBDA(const FaceId& l) { + parallel_for(m_mesh.numberOfFaces(), PUGS_LAMBDA(const FaceId& l) { const auto& face_nodes = face_to_node_matrix[l]; const size_t nb_nodes = face_nodes.size(); std::vector<Rd> dxr(nb_nodes); @@ -167,9 +167,9 @@ class MeshData { NodeValuePerCell<Rd> Cjr(m_mesh.connectivity()); parallel_for(Cjr.numberOfValues(), - PASTIS_LAMBDA(const size_t& jr) { Cjr[jr] = zero; }); + PUGS_LAMBDA(const size_t& jr) { Cjr[jr] = zero; }); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { const auto& cell_nodes = cell_to_node_matrix[j]; const auto& cell_faces = cell_to_face_matrix[j]; @@ -207,7 +207,7 @@ class MeshData { NodeValuePerCell<double> ljr(m_mesh.connectivity()); - parallel_for(m_Cjr.numberOfValues(), PASTIS_LAMBDA(const size_t& jr) { + parallel_for(m_Cjr.numberOfValues(), PUGS_LAMBDA(const size_t& jr) { ljr[jr] = l2Norm(m_Cjr[jr]); }); m_ljr = ljr; @@ -215,7 +215,7 @@ class MeshData { NodeValuePerCell<Rd> njr(m_mesh.connectivity()); - parallel_for(m_Cjr.numberOfValues(), PASTIS_LAMBDA(const size_t& jr) { + parallel_for(m_Cjr.numberOfValues(), PUGS_LAMBDA(const size_t& jr) { njr[jr] = (1. / m_ljr[jr]) * m_Cjr[jr]; }); m_njr = njr; @@ -225,42 +225,42 @@ class MeshData } public: - PASTIS_INLINE + PUGS_INLINE const MeshType& mesh() const { return m_mesh; } - PASTIS_INLINE + PUGS_INLINE const NodeValuePerCell<const Rd>& Cjr() const { return m_Cjr; } - PASTIS_INLINE + PUGS_INLINE const NodeValuePerCell<const double>& ljr() const { return m_ljr; } - PASTIS_INLINE + PUGS_INLINE const NodeValuePerCell<const Rd>& njr() const { return m_njr; } - PASTIS_INLINE + PUGS_INLINE const CellValue<const Rd>& xj() const { return m_xj; } - PASTIS_INLINE + PUGS_INLINE const CellValue<const double>& Vj() const { @@ -281,7 +281,7 @@ class MeshData // in 1d Cjr are computed once for all { NodeValuePerCell<Rd> Cjr(m_mesh.connectivity()); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { Cjr(j, 0) = -1; Cjr(j, 1) = 1; }); @@ -292,7 +292,7 @@ class MeshData { NodeValuePerCell<double> ljr(m_mesh.connectivity()); parallel_for(ljr.numberOfValues(), - PASTIS_LAMBDA(const size_t& jr) { ljr[jr] = 1; }); + PUGS_LAMBDA(const size_t& jr) { ljr[jr] = 1; }); m_ljr = ljr; } } diff --git a/src/mesh/MeshNodeBoundary.hpp b/src/mesh/MeshNodeBoundary.hpp index f95a2941b93129ba8c02993c82f7611a374b9f40..2e5a41610d19b77b033a50bbfb99fcfe15e71a6c 100644 --- a/src/mesh/MeshNodeBoundary.hpp +++ b/src/mesh/MeshNodeBoundary.hpp @@ -38,7 +38,7 @@ class MeshNodeBoundary const auto& face_to_cell_matrix = mesh.connectivity().faceToCellMatrix(); const Array<const FaceId>& face_list = ref_face_list.list(); - parallel_for(face_list.size(), PASTIS_LAMBDA(const int& l) { + parallel_for(face_list.size(), PUGS_LAMBDA(const int& l) { const auto& face_cells = face_to_cell_matrix[face_list[l]]; if (face_cells.size() > 1) { perr() << "internal faces cannot be used to define mesh boundaries\n"; @@ -65,7 +65,7 @@ class MeshNodeBoundary Array<NodeId> node_list(node_ids.size()); parallel_for(node_ids.size(), - PASTIS_LAMBDA(const int& r) { node_list[r] = node_ids[r]; }); + PUGS_LAMBDA(const int& r) { node_list[r] = node_ids[r]; }); m_node_list = node_list; } @@ -92,16 +92,16 @@ class MeshFlatNodeBoundary : public MeshNodeBoundary<Dimension> const Rd m_outgoing_normal; template <typename MeshType> - PASTIS_INLINE Rd _getNormal(const MeshType& mesh); + PUGS_INLINE Rd _getNormal(const MeshType& mesh); template <typename MeshType> - PASTIS_INLINE void _checkBoundaryIsFlat(const TinyVector<2, double>& normal, + PUGS_INLINE void _checkBoundaryIsFlat(const TinyVector<2, double>& normal, const TinyVector<2, double>& xmin, const TinyVector<2, double>& xmax, const MeshType& mesh) const; template <typename MeshType> - PASTIS_INLINE Rd _getOutgoingNormal(const MeshType& mesh); + PUGS_INLINE Rd _getOutgoingNormal(const MeshType& mesh); public: const Rd& @@ -152,7 +152,7 @@ MeshFlatNodeBoundary<2>::_checkBoundaryIsFlat( const NodeValue<const R2>& xr = mesh.xr(); - parallel_for(m_node_list.size(), PASTIS_LAMBDA(const size_t& r) { + parallel_for(m_node_list.size(), PUGS_LAMBDA(const size_t& r) { const R2& x = xr[m_node_list[r]]; if ((x - origin, normal) > 1E-13 * length) { perr() << "this FlatBoundary is not flat!\n"; @@ -163,7 +163,7 @@ MeshFlatNodeBoundary<2>::_checkBoundaryIsFlat( template <> template <typename MeshType> -PASTIS_INLINE TinyVector<1, double> +PUGS_INLINE TinyVector<1, double> MeshFlatNodeBoundary<1>::_getNormal(const MeshType&) { static_assert(MeshType::Dimension == 1); @@ -179,7 +179,7 @@ MeshFlatNodeBoundary<1>::_getNormal(const MeshType&) template <> template <typename MeshType> -PASTIS_INLINE TinyVector<2, double> +PUGS_INLINE TinyVector<2, double> MeshFlatNodeBoundary<2>::_getNormal(const MeshType& mesh) { static_assert(MeshType::Dimension == 2); @@ -236,7 +236,7 @@ MeshFlatNodeBoundary<2>::_getNormal(const MeshType& mesh) template <> template <typename MeshType> -PASTIS_INLINE TinyVector<3, double> +PUGS_INLINE TinyVector<3, double> MeshFlatNodeBoundary<3>::_getNormal(const MeshType& mesh) { static_assert(MeshType::Dimension == 3); @@ -360,7 +360,7 @@ MeshFlatNodeBoundary<3>::_getNormal(const MeshType& mesh) template <> template <typename MeshType> -PASTIS_INLINE TinyVector<1, double> +PUGS_INLINE TinyVector<1, double> MeshFlatNodeBoundary<1>::_getOutgoingNormal(const MeshType& mesh) { static_assert(MeshType::Dimension == 1); @@ -405,7 +405,7 @@ MeshFlatNodeBoundary<1>::_getOutgoingNormal(const MeshType& mesh) template <> template <typename MeshType> -PASTIS_INLINE TinyVector<2, double> +PUGS_INLINE TinyVector<2, double> MeshFlatNodeBoundary<2>::_getOutgoingNormal(const MeshType& mesh) { static_assert(MeshType::Dimension == 2); @@ -449,7 +449,7 @@ MeshFlatNodeBoundary<2>::_getOutgoingNormal(const MeshType& mesh) template <> template <typename MeshType> -PASTIS_INLINE TinyVector<3, double> +PUGS_INLINE TinyVector<3, double> MeshFlatNodeBoundary<3>::_getOutgoingNormal(const MeshType& mesh) { static_assert(MeshType::Dimension == 3); diff --git a/src/mesh/SubItemValuePerItem.hpp b/src/mesh/SubItemValuePerItem.hpp index 1c70ab8d0c13e920ff585810969d7b311f8864f5..6f350feb8aac001cfafe16ab53fe5de1de0a5abd 100644 --- a/src/mesh/SubItemValuePerItem.hpp +++ b/src/mesh/SubItemValuePerItem.hpp @@ -3,7 +3,7 @@ #include <Kokkos_StaticCrsGraph.hpp> -#include <PastisAssert.hpp> +#include <PugsAssert.hpp> #include <Array.hpp> @@ -63,25 +63,25 @@ class SubItemValuePerItem using data_type = DataType; private: - PASTIS_RESTRICT DataType* const m_sub_values; + PUGS_RESTRICT DataType* const m_sub_values; const size_t m_size; public: - PASTIS_INLINE + PUGS_INLINE const DataType& operator[](const size_t& i) const noexcept(NO_ASSERT) { Assert(i < m_size); return m_sub_values[i]; } - PASTIS_FORCEINLINE + PUGS_FORCEINLINE DataType& operator[](const size_t& i) noexcept(NO_ASSERT) { Assert(i < m_size); return m_sub_values[i]; } - PASTIS_INLINE + PUGS_INLINE size_t size() const noexcept { @@ -90,10 +90,10 @@ class SubItemValuePerItem SubView(const SubView&) = delete; - PASTIS_INLINE + PUGS_INLINE SubView(SubView&&) noexcept = default; - PASTIS_INLINE + PUGS_INLINE SubView(const Array<DataType>& values, const size_t& begin, const size_t& end) noexcept(NO_ASSERT) @@ -104,7 +104,7 @@ class SubItemValuePerItem } }; - PASTIS_INLINE + PUGS_INLINE bool isBuilt() const noexcept { @@ -113,7 +113,7 @@ class SubItemValuePerItem // Following Kokkos logic, these classes are view and const view does allow // changes in data - PASTIS_FORCEINLINE + PUGS_FORCEINLINE DataType& operator()(const ItemId& j, const size_t& r) const noexcept(NO_ASSERT) { @@ -122,7 +122,7 @@ class SubItemValuePerItem } template <typename IndexType> - PASTIS_FORCEINLINE DataType& + PUGS_FORCEINLINE DataType& operator()(const IndexType& j, const size_t& r) const noexcept(NO_ASSERT) { static_assert(std::is_same_v<IndexType, ItemId>, @@ -131,7 +131,7 @@ class SubItemValuePerItem return m_values[m_host_row_map(size_t{j}) + r]; } - PASTIS_INLINE + PUGS_INLINE size_t numberOfValues() const noexcept(NO_ASSERT) { @@ -141,7 +141,7 @@ class SubItemValuePerItem // Following Kokkos logic, these classes are view and const view does allow // changes in data - PASTIS_FORCEINLINE + PUGS_FORCEINLINE DataType& operator[](const size_t& i) const noexcept(NO_ASSERT) { Assert(this->isBuilt()); @@ -158,7 +158,7 @@ class SubItemValuePerItem return m_values[i]; } - PASTIS_INLINE + PUGS_INLINE size_t numberOfItems() const noexcept(NO_ASSERT) { @@ -167,7 +167,7 @@ class SubItemValuePerItem return m_host_row_map.extent(0); } - PASTIS_INLINE + PUGS_INLINE size_t numberOfSubValues(const size_t& i_cell) const noexcept(NO_ASSERT) { @@ -175,7 +175,7 @@ class SubItemValuePerItem return m_host_row_map(i_cell + 1) - m_host_row_map(i_cell); } - PASTIS_INLINE + PUGS_INLINE SubView itemValues(const size_t& i_cell) noexcept(NO_ASSERT) { @@ -187,7 +187,7 @@ class SubItemValuePerItem // Following Kokkos logic, these classes are view and const view does allow // changes in data - PASTIS_INLINE + PUGS_INLINE SubView itemValues(const size_t& i_cell) const noexcept(NO_ASSERT) { @@ -198,7 +198,7 @@ class SubItemValuePerItem } template <typename DataType2, typename ConnectivityPtr2> - PASTIS_INLINE SubItemValuePerItem& + PUGS_INLINE SubItemValuePerItem& operator=(const SubItemValuePerItem<DataType2, ItemOfItem, ConnectivityPtr2>& sub_item_value_per_item) noexcept { @@ -225,7 +225,7 @@ class SubItemValuePerItem } template <typename DataType2, typename ConnectivityPtr2> - PASTIS_INLINE + PUGS_INLINE SubItemValuePerItem( const SubItemValuePerItem<DataType2, ItemOfItem, ConnectivityPtr2>& sub_item_value_per_item) noexcept diff --git a/src/mesh/Synchronizer.hpp b/src/mesh/Synchronizer.hpp index e78ca2be74287139f2deec12140ef057c3670ab1..469f0a29942efeead492f0d40acc296744832c5f 100644 --- a/src/mesh/Synchronizer.hpp +++ b/src/mesh/Synchronizer.hpp @@ -24,7 +24,7 @@ class Synchronizer ExchangeItemTypeInfo<ItemType::node> m_provided_node_info; template <ItemType item_type> - PASTIS_INLINE constexpr auto& + PUGS_INLINE constexpr auto& _getRequestedItemInfo() { if constexpr (item_type == ItemType::cell) { @@ -39,7 +39,7 @@ class Synchronizer } template <ItemType item_type> - PASTIS_INLINE constexpr auto& + PUGS_INLINE constexpr auto& _getProvidedItemInfo() { if constexpr (item_type == ItemType::cell) { @@ -94,7 +94,7 @@ class Synchronizer const auto& requested_item_info_from_rank = requested_item_info[i_rank]; Array<int> item_number_list{requested_item_info_from_rank.size()}; parallel_for(requested_item_info_from_rank.size(), - PASTIS_LAMBDA(size_t i_item) { + PUGS_LAMBDA(size_t i_item) { item_number_list[i_item] = item_number[requested_item_info_from_rank[i_item]]; }); @@ -138,7 +138,7 @@ class Synchronizer typename DataType, ItemType item_type, typename ConnectivityPtr> - PASTIS_INLINE void + PUGS_INLINE void _synchronize(const ConnectivityType& connectivity, ItemValue<DataType, item_type, ConnectivityPtr>& item_value) { @@ -161,7 +161,7 @@ class Synchronizer const Array<const ItemId>& provided_item_info_to_rank = provided_item_info[i_rank]; Array<DataType> provided_data{provided_item_info_to_rank.size()}; - parallel_for(provided_item_info_to_rank.size(), PASTIS_LAMBDA(size_t i) { + parallel_for(provided_item_info_to_rank.size(), PUGS_LAMBDA(size_t i) { provided_data[i] = item_value[provided_item_info_to_rank[i]]; }); provided_data_list[i_rank] = provided_data; @@ -180,7 +180,7 @@ class Synchronizer const auto& requested_item_info_from_rank = requested_item_info[i_rank]; const auto& requested_data = requested_data_list[i_rank]; parallel_for( - requested_item_info_from_rank.size(), PASTIS_LAMBDA(size_t i) { + requested_item_info_from_rank.size(), PUGS_LAMBDA(size_t i) { item_value[requested_item_info_from_rank[i]] = requested_data[i]; }); } @@ -188,7 +188,7 @@ class Synchronizer public: template <typename DataType, ItemType item_type, typename ConnectivityPtr> - PASTIS_INLINE void + PUGS_INLINE void synchronize(ItemValue<DataType, item_type, ConnectivityPtr>& item_value) { Assert(item_value.connectivity_ptr().use_count() > 0, @@ -218,7 +218,7 @@ class Synchronizer } } - PASTIS_INLINE + PUGS_INLINE Synchronizer() { ; diff --git a/src/mesh/SynchronizerManager.cpp b/src/mesh/SynchronizerManager.cpp index 27f681bbceaccf3925226ac922ce9ffa7c164a9b..7854eb768be58ac4881c95c66ddddd38f80784f4 100644 --- a/src/mesh/SynchronizerManager.cpp +++ b/src/mesh/SynchronizerManager.cpp @@ -1,4 +1,4 @@ -#include <PastisAssert.hpp> +#include <PugsAssert.hpp> #include <SynchronizerManager.hpp> #include <Messenger.hpp> diff --git a/src/mesh/SynchronizerManager.hpp b/src/mesh/SynchronizerManager.hpp index cdc69f7b815ad3c7b59a297e6eb7e97c0ff3723f..4ba1911d3e7d57c4fd48957c4abe742434098925 100644 --- a/src/mesh/SynchronizerManager.hpp +++ b/src/mesh/SynchronizerManager.hpp @@ -1,8 +1,8 @@ #ifndef SYNCHRONIZER_MANAGER_HPP #define SYNCHRONIZER_MANAGER_HPP -#include <PastisAssert.hpp> -#include <PastisMacros.hpp> +#include <PugsAssert.hpp> +#include <PugsMacros.hpp> #include <map> #include <memory> @@ -24,7 +24,7 @@ class SynchronizerManager static void create(); static void destroy(); - PASTIS_INLINE + PUGS_INLINE static SynchronizerManager& instance() { diff --git a/src/output/OutputNamedItemValueSet.hpp b/src/output/OutputNamedItemValueSet.hpp index 290a53db2153501af691377e477774625a1acbaa..301652cf0326c0b7550c2eb0f31fca26a7b9d4c5 100644 --- a/src/output/OutputNamedItemValueSet.hpp +++ b/src/output/OutputNamedItemValueSet.hpp @@ -74,7 +74,7 @@ class OutputNamedItemValueSet std::map<std::string, ItemValueVariant> m_name_itemvariant_map; template <typename DataType, ItemType item_type> - PASTIS_FORCEINLINE constexpr void + PUGS_FORCEINLINE constexpr void _doInsert(const NamedItemValue<DataType, item_type>& named_itemvalue) { if (m_name_itemvariant_map.find(named_itemvalue.name()) == @@ -85,7 +85,7 @@ class OutputNamedItemValueSet } template <typename DataType, ItemType item_type, typename... Args> - PASTIS_FORCEINLINE constexpr void + PUGS_FORCEINLINE constexpr void _unpackVariadicInput( const NamedItemValue<DataType, item_type>& named_itemvalue, Args&&... args) diff --git a/src/output/VTKWriter.hpp b/src/output/VTKWriter.hpp index 343281d77c0798131bee076fcf9c1fac2e40dda6..5a5fe82cbcbdf606981c7a6f0d87b7008d6fa68b 100644 --- a/src/output/VTKWriter.hpp +++ b/src/output/VTKWriter.hpp @@ -316,7 +316,7 @@ class VTKWriter using Rd = TinyVector<MeshType::Dimension>; const NodeValue<const Rd>& xr = mesh.xr(); Array<TinyVector<3>> positions(mesh.numberOfNodes()); - parallel_for(mesh.numberOfNodes(), PASTIS_LAMBDA(NodeId r) { + parallel_for(mesh.numberOfNodes(), PUGS_LAMBDA(NodeId r) { for (unsigned short i = 0; i < MeshType::Dimension; ++i) { positions[r][i] = xr[r][i]; } @@ -352,7 +352,7 @@ class VTKWriter { Array<int8_t> types(mesh.numberOfCells()); const auto& cell_type = mesh.connectivity().cellType(); - parallel_for(mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { switch (cell_type[j]) { case CellType::Line: { types[j] = 3; diff --git a/src/scheme/AcousticSolver.hpp b/src/scheme/AcousticSolver.hpp index cea444e84a838fee82d1c43228ceac052363cc74..d2bf0bf93e1492d1f361944b1a8eee582d7cf08f 100644 --- a/src/scheme/AcousticSolver.hpp +++ b/src/scheme/AcousticSolver.hpp @@ -6,7 +6,7 @@ #include <ArrayUtils.hpp> #include <BlockPerfectGas.hpp> -#include <PastisAssert.hpp> +#include <PugsAssert.hpp> #include <BoundaryCondition.hpp> #include <FiniteVolumesEulerUnknowns.hpp> @@ -36,25 +36,25 @@ class AcousticSolver using Rdd = TinyMatrix<Dimension>; private: - PASTIS_INLINE + PUGS_INLINE const CellValue<const double> computeRhoCj(const CellValue<const double>& rhoj, const CellValue<const double>& cj) { - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { m_rhocj[j] = rhoj[j] * cj[j]; }); return m_rhocj; } - PASTIS_INLINE + PUGS_INLINE void computeAjr(const CellValue<const double>& rhocj, const NodeValuePerCell<const Rd>& Cjr, const NodeValuePerCell<const double>& /* ljr */, const NodeValuePerCell<const Rd>& njr) { - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { const size_t& nb_nodes = m_Ajr.numberOfSubValues(j); const double& rho_c = rhocj[j]; for (size_t r = 0; r < nb_nodes; ++r) { @@ -63,7 +63,7 @@ class AcousticSolver }); } - PASTIS_INLINE + PUGS_INLINE const NodeValue<const Rdd> computeAr(const NodeValuePerCell<const Rdd>& Ajr) { @@ -71,7 +71,7 @@ class AcousticSolver const auto& node_local_numbers_in_their_cells = m_connectivity.nodeLocalNumbersInTheirCells(); - parallel_for(m_mesh.numberOfNodes(), PASTIS_LAMBDA(const NodeId& r) { + parallel_for(m_mesh.numberOfNodes(), PUGS_LAMBDA(const NodeId& r) { Rdd sum = zero; const auto& node_to_cell = node_to_cell_matrix[r]; const auto& node_local_number_in_its_cells = @@ -88,7 +88,7 @@ class AcousticSolver return m_Ar; } - PASTIS_INLINE + PUGS_INLINE const NodeValue<const Rd> computeBr(const NodeValuePerCell<Rdd>& Ajr, const NodeValuePerCell<const Rd>& Cjr, @@ -99,7 +99,7 @@ class AcousticSolver const auto& node_local_numbers_in_their_cells = m_connectivity.nodeLocalNumbersInTheirCells(); - parallel_for(m_mesh.numberOfNodes(), PASTIS_LAMBDA(const NodeId& r) { + parallel_for(m_mesh.numberOfNodes(), PUGS_LAMBDA(const NodeId& r) { Rd& br = m_br[r]; br = zero; const auto& node_to_cell = node_to_cell_matrix[r]; @@ -150,7 +150,7 @@ class AcousticSolver const Array<const NodeId>& node_list = symmetry_bc.nodeList(); parallel_for(symmetry_bc.numberOfNodes(), - PASTIS_LAMBDA(const int& r_number) { + PUGS_LAMBDA(const int& r_number) { const NodeId r = node_list[r_number]; m_Ar[r] = P * m_Ar[r] * P + nxn; @@ -167,7 +167,7 @@ class AcousticSolver { inverse(Ar, m_inv_Ar); const NodeValue<const Rdd> invAr = m_inv_Ar; - parallel_for(m_mesh.numberOfNodes(), PASTIS_LAMBDA(const NodeId& r) { + parallel_for(m_mesh.numberOfNodes(), PUGS_LAMBDA(const NodeId& r) { m_ur[r] = invAr[r] * br[r]; }); @@ -183,7 +183,7 @@ class AcousticSolver { const auto& cell_to_node_matrix = m_mesh.connectivity().cellToNodeMatrix(); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { const auto& cell_nodes = cell_to_node_matrix[j]; for (size_t r = 0; r < cell_nodes.size(); ++r) { @@ -196,12 +196,12 @@ class AcousticSolver void inverse(const NodeValue<const Rdd>& A, NodeValue<Rdd>& inv_A) const { - parallel_for(m_mesh.numberOfNodes(), PASTIS_LAMBDA(const NodeId& r) { + parallel_for(m_mesh.numberOfNodes(), PUGS_LAMBDA(const NodeId& r) { inv_A[r] = ::inverse(A[r]); }); } - PASTIS_INLINE + PUGS_INLINE void computeExplicitFluxes(const CellValue<const double>& rhoj, const CellValue<const Rd>& uj, @@ -256,7 +256,7 @@ class AcousticSolver ; } - PASTIS_INLINE + PUGS_INLINE double acoustic_dt(const CellValue<const double>& Vj, const CellValue<const double>& cj) const @@ -264,7 +264,7 @@ class AcousticSolver const NodeValuePerCell<const double>& ljr = m_mesh_data.ljr(); const auto& cell_to_node_matrix = m_mesh.connectivity().cellToNodeMatrix(); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { const auto& cell_nodes = cell_to_node_matrix[j]; double S = 0; @@ -300,7 +300,7 @@ class AcousticSolver const auto& cell_to_node_matrix = m_mesh.connectivity().cellToNodeMatrix(); const CellValue<const double> inv_mj = unknowns.invMj(); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { const auto& cell_nodes = cell_to_node_matrix[j]; Rd momentum_fluxes = zero; @@ -314,19 +314,19 @@ class AcousticSolver Ej[j] -= (dt * inv_mj[j]) * energy_fluxes; }); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { ej[j] = Ej[j] - 0.5 * (uj[j], uj[j]); }); NodeValue<Rd> mutable_xr = m_mesh.mutableXr(); - parallel_for(m_mesh.numberOfNodes(), PASTIS_LAMBDA(const NodeId& r) { + parallel_for(m_mesh.numberOfNodes(), PUGS_LAMBDA(const NodeId& r) { mutable_xr[r] += dt * ur[r]; }); m_mesh_data.updateAllData(); const CellValue<const double> mj = unknowns.mj(); parallel_for(m_mesh.numberOfCells(), - PASTIS_LAMBDA(const CellId& j) { rhoj[j] = mj[j] / Vj[j]; }); + PUGS_LAMBDA(const CellId& j) { rhoj[j] = mj[j] / Vj[j]; }); } }; diff --git a/src/scheme/BlockPerfectGas.hpp b/src/scheme/BlockPerfectGas.hpp index 5c51a4fa001f29c6abb8e10ed6667d9c0a74d705..1ae68273247ac8bd9f3fe310a163fed209f15b5a 100644 --- a/src/scheme/BlockPerfectGas.hpp +++ b/src/scheme/BlockPerfectGas.hpp @@ -31,7 +31,7 @@ struct BlockPerfectGas const CellValue<const double>& e = m_ej; const CellValue<const double>& gamma = m_gammaj; - parallel_for(nj, PASTIS_LAMBDA(const CellId& j) { + parallel_for(nj, PUGS_LAMBDA(const CellId& j) { const double gamma_minus_one = gamma[j] - 1; m_pj[j] = gamma_minus_one * rho[j] * e[j]; m_cj[j] = std::sqrt(gamma[j] * gamma_minus_one * e[j]); @@ -46,12 +46,12 @@ struct BlockPerfectGas const CellValue<const double>& p = m_pj; const CellValue<const double>& gamma = m_gammaj; - parallel_for(nj, PASTIS_LAMBDA(const CellId& j) { + parallel_for(nj, PUGS_LAMBDA(const CellId& j) { m_ej[j] = p[j] / (rho[j] * (gamma[j] - 1)); }); const CellValue<const double>& e = m_ej; - parallel_for(nj, PASTIS_LAMBDA(const CellId& j) { + parallel_for(nj, PUGS_LAMBDA(const CellId& j) { m_cj[j] = std::sqrt(gamma[j] * (gamma[j] - 1) * e[j]); }); } diff --git a/src/scheme/BoundaryCondition.hpp b/src/scheme/BoundaryCondition.hpp index 7e7f325f2311cac71e75e22b8d3a152bf5f3de5c..ae09c0271a12859581c461263c261d107e69546e 100644 --- a/src/scheme/BoundaryCondition.hpp +++ b/src/scheme/BoundaryCondition.hpp @@ -73,7 +73,7 @@ class PressureBoundaryCondition : public BoundaryCondition { Array<unsigned int> face_list(faces.size()); parallel_for(m_number_of_faces, - PASTIS_LAMBDA(const int& f) { face_list[f] = faces[f]; }); + PUGS_LAMBDA(const int& f) { face_list[f] = faces[f]; }); m_face_list = face_list; } @@ -131,16 +131,16 @@ class BoundaryConditionHandler return *m_boundary_condition; } - PASTIS_INLINE + PUGS_INLINE BoundaryConditionHandler& operator=(BoundaryConditionHandler&) = default; - PASTIS_INLINE + PUGS_INLINE BoundaryConditionHandler(const BoundaryConditionHandler&) = default; - PASTIS_INLINE + PUGS_INLINE BoundaryConditionHandler(BoundaryConditionHandler&&) = default; - PASTIS_INLINE + PUGS_INLINE BoundaryConditionHandler( std::shared_ptr<BoundaryCondition> boundary_condition) : m_boundary_condition(boundary_condition) diff --git a/src/scheme/FiniteVolumesEulerUnknowns.hpp b/src/scheme/FiniteVolumesEulerUnknowns.hpp index 6dbe344db01024f4095974266d37e81638d2f02f..9008516d78a5e06d9b88837ced21e385b41f6209 100644 --- a/src/scheme/FiniteVolumesEulerUnknowns.hpp +++ b/src/scheme/FiniteVolumesEulerUnknowns.hpp @@ -143,7 +143,7 @@ class FiniteVolumesEulerUnknowns { const CellValue<const Rd>& xj = m_mesh_data.xj(); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { if (xj[j][0] < 0.5) { m_rhoj[j] = 1; } else { @@ -151,7 +151,7 @@ class FiniteVolumesEulerUnknowns } }); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { if (xj[j][0] < 0.5) { m_pj[j] = 1; } else { @@ -160,24 +160,24 @@ class FiniteVolumesEulerUnknowns }); parallel_for(m_mesh.numberOfCells(), - PASTIS_LAMBDA(const CellId& j) { m_uj[j] = zero; }); + PUGS_LAMBDA(const CellId& j) { m_uj[j] = zero; }); parallel_for(m_mesh.numberOfCells(), - PASTIS_LAMBDA(const CellId& j) { m_gammaj[j] = 1.4; }); + PUGS_LAMBDA(const CellId& j) { m_gammaj[j] = 1.4; }); BlockPerfectGas block_eos(m_rhoj, m_ej, m_pj, m_gammaj, m_cj); block_eos.updateEandCFromRhoP(); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { m_Ej[j] = m_ej[j] + 0.5 * (m_uj[j], m_uj[j]); }); const CellValue<const double>& Vj = m_mesh_data.Vj(); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { m_mj[j] = m_rhoj[j] * Vj[j]; }); - parallel_for(m_mesh.numberOfCells(), PASTIS_LAMBDA(const CellId& j) { + parallel_for(m_mesh.numberOfCells(), PUGS_LAMBDA(const CellId& j) { m_inv_mj[j] = 1. / m_mj[j]; }); } diff --git a/src/utils/Array.hpp b/src/utils/Array.hpp index e3b631ccf569bbc822419d5c6996892db7f6c432..84ea65aa1edc5b1ee67ea798691dc403603aec04 100644 --- a/src/utils/Array.hpp +++ b/src/utils/Array.hpp @@ -1,10 +1,10 @@ #ifndef ARRAY_HPP #define ARRAY_HPP -#include <PastisMacros.hpp> -#include <PastisUtils.hpp> +#include <PugsMacros.hpp> +#include <PugsUtils.hpp> -#include <PastisAssert.hpp> +#include <PugsAssert.hpp> #include <Kokkos_CopyViews.hpp> #include <algorithm> @@ -23,14 +23,14 @@ class Array friend Array<std::add_const_t<DataType>>; public: - PASTIS_INLINE + PUGS_INLINE size_t size() const noexcept { return m_values.extent(0); } - friend PASTIS_INLINE Array<std::remove_const_t<DataType>> + friend PUGS_INLINE Array<std::remove_const_t<DataType>> copy(const Array<DataType>& source) { Array<std::remove_const_t<DataType>> image(source.size()); @@ -40,17 +40,17 @@ class Array } template <typename DataType2, typename... RT> - friend PASTIS_INLINE Array<DataType2> encapsulate( + friend PUGS_INLINE Array<DataType2> encapsulate( const Kokkos::View<DataType2*, RT...>& values); - PASTIS_INLINE + PUGS_INLINE DataType& operator[](const index_type& i) const noexcept(NO_ASSERT) { Assert(i < m_values.extent(0)); return m_values[i]; } - PASTIS_INLINE + PUGS_INLINE void fill(const DataType& data) const { @@ -59,11 +59,11 @@ class Array // could consider to use std::fill parallel_for(this->size(), - PASTIS_LAMBDA(const index_type& i) { m_values[i] = data; }); + PUGS_LAMBDA(const index_type& i) { m_values[i] = data; }); } template <typename DataType2> - PASTIS_INLINE Array& + PUGS_INLINE Array& operator=(const Array<DataType2>& array) noexcept { // ensures that DataType is the same as source DataType2 @@ -78,13 +78,13 @@ class Array return *this; } - PASTIS_INLINE + PUGS_INLINE Array& operator=(const Array&) = default; - PASTIS_INLINE + PUGS_INLINE Array& operator=(Array&&) = default; - PASTIS_INLINE + PUGS_INLINE Array(const size_t& size) : m_values("anonymous", size) { static_assert( @@ -92,28 +92,28 @@ class Array "Cannot allocate Array of const data: only view is supported"); } - PASTIS_INLINE + PUGS_INLINE Array() = default; - PASTIS_INLINE + PUGS_INLINE Array(const Array&) = default; template <typename DataType2> - PASTIS_INLINE + PUGS_INLINE Array(const Array<DataType2>& array) noexcept { this->operator=(array); } - PASTIS_INLINE + PUGS_INLINE Array(Array&&) = default; - PASTIS_INLINE + PUGS_INLINE ~Array() = default; }; template <typename DataType, typename... RT> -PASTIS_INLINE Array<DataType> +PUGS_INLINE Array<DataType> encapsulate(const Kokkos::View<DataType*, RT...>& values) { Array<DataType> array; @@ -123,7 +123,7 @@ encapsulate(const Kokkos::View<DataType*, RT...>& values) // map, multimap, unordered_map and stack cannot be copied this way template <typename Container> -PASTIS_INLINE Array<std::remove_const_t<typename Container::value_type>> +PUGS_INLINE Array<std::remove_const_t<typename Container::value_type>> convert_to_array(const Container& given_container) { using DataType = typename Container::value_type; diff --git a/src/utils/ArrayUtils.hpp b/src/utils/ArrayUtils.hpp index 30cd1143b861e5da572413b69ba264259f659a7a..f07b07d525a8b1c2dd0461893411883aa29082b9 100644 --- a/src/utils/ArrayUtils.hpp +++ b/src/utils/ArrayUtils.hpp @@ -1,8 +1,8 @@ #ifndef ARRAY_UTILS_HPP #define ARRAY_UTILS_HPP -#include <PastisMacros.hpp> -#include <PastisUtils.hpp> +#include <PugsMacros.hpp> +#include <PugsUtils.hpp> #include <Types.hpp> @@ -20,7 +20,7 @@ min(const ArrayT<DataType>& array) const ArrayType m_array; public: - PASTIS_INLINE + PUGS_INLINE operator data_type() { data_type reduced_value; @@ -28,7 +28,7 @@ min(const ArrayT<DataType>& array) return reduced_value; } - PASTIS_INLINE + PUGS_INLINE void operator()(const index_type& i, data_type& data) const { @@ -37,7 +37,7 @@ min(const ArrayT<DataType>& array) } } - PASTIS_INLINE + PUGS_INLINE void join(volatile data_type& dst, const volatile data_type& src) const { @@ -46,20 +46,20 @@ min(const ArrayT<DataType>& array) } } - PASTIS_INLINE + PUGS_INLINE void init(data_type& value) const { value = std::numeric_limits<data_type>::max(); } - PASTIS_INLINE + PUGS_INLINE ArrayMin(const ArrayType& array) : m_array(array) { ; } - PASTIS_INLINE + PUGS_INLINE ~ArrayMin() = default; }; @@ -80,7 +80,7 @@ max(const ArrayT<DataType>& array) const ArrayType m_array; public: - PASTIS_INLINE + PUGS_INLINE operator data_type() { data_type reduced_value; @@ -88,7 +88,7 @@ max(const ArrayT<DataType>& array) return reduced_value; } - PASTIS_INLINE + PUGS_INLINE void operator()(const index_type& i, data_type& data) const { @@ -97,7 +97,7 @@ max(const ArrayT<DataType>& array) } } - PASTIS_INLINE + PUGS_INLINE void join(volatile data_type& dst, const volatile data_type& src) const { @@ -106,20 +106,20 @@ max(const ArrayT<DataType>& array) } } - PASTIS_INLINE + PUGS_INLINE void init(data_type& value) const { value = std::numeric_limits<data_type>::min(); } - PASTIS_INLINE + PUGS_INLINE ArrayMax(const ArrayType& array) : m_array(array) { ; } - PASTIS_INLINE + PUGS_INLINE ~ArrayMax() = default; }; @@ -140,7 +140,7 @@ sum(const ArrayT<DataType>& array) const ArrayType& m_array; public: - PASTIS_INLINE + PUGS_INLINE operator data_type() { data_type reduced_value; @@ -148,21 +148,21 @@ sum(const ArrayT<DataType>& array) return reduced_value; } - PASTIS_INLINE + PUGS_INLINE void operator()(const index_type& i, data_type& data) const { data += m_array[i]; } - PASTIS_INLINE + PUGS_INLINE void join(volatile data_type& dst, const volatile data_type& src) const { dst += src; } - PASTIS_INLINE + PUGS_INLINE void init(data_type& value) const { @@ -173,13 +173,13 @@ sum(const ArrayT<DataType>& array) } } - PASTIS_INLINE + PUGS_INLINE ArraySum(const ArrayType& array) : m_array(array) { ; } - PASTIS_INLINE + PUGS_INLINE ~ArraySum() = default; }; @@ -204,7 +204,7 @@ value_copy(const SourceArray<SourceT...>& source_array, Assert(source_array.size() == image_array.size()); - parallel_for(source_array.size(), PASTIS_LAMBDA(const size_t& i) { + parallel_for(source_array.size(), PUGS_LAMBDA(const size_t& i) { image_array[i] = source_array[i]; }); } diff --git a/src/utils/BuildInfo.cpp b/src/utils/BuildInfo.cpp index d8db0d43eec13167e8b935fc6d6e0851134bec21..1c6136bbf914d9c26c4c616f8f81fc98166df528 100644 --- a/src/utils/BuildInfo.cpp +++ b/src/utils/BuildInfo.cpp @@ -1,38 +1,38 @@ #include <BuildInfo.hpp> -#include <pastis_build_info.hpp> -#include <pastis_config.hpp> +#include <pugs_build_info.hpp> +#include <pugs_config.hpp> #include <sstream> -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI #include <mpi.h> -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI std::string BuildInfo::type() { - return PASTIS_BUILD_TYPE; + return PUGS_BUILD_TYPE; } std::string BuildInfo::compiler() { std::stringstream compiler_info; - compiler_info << PASTIS_BUILD_COMPILER << " (" - << PASTIS_BUILD_COMPILER_VERSION << ")" << std::ends; + compiler_info << PUGS_BUILD_COMPILER << " (" + << PUGS_BUILD_COMPILER_VERSION << ")" << std::ends; return compiler_info.str(); } std::string BuildInfo::kokkosDevices() { - return PASTIS_BUILD_KOKKOS_DEVICES; + return PUGS_BUILD_KOKKOS_DEVICES; } std::string BuildInfo::mpiLibrary() { -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI return []() { int length; char mpi_version[MPI_MAX_LIBRARY_VERSION_STRING]; @@ -41,5 +41,5 @@ BuildInfo::mpiLibrary() }(); #else return "none"; -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index 0c89bb3efabb8e68d77b820fcd512d759c28a29a..9859671af16ff0eae47582587c887ad3bcac8b8d 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -4,15 +4,15 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) # ------------------- Source files -------------------- add_library( - PastisUtils + PugsUtils BuildInfo.cpp BacktraceManager.cpp ConsoleManager.cpp FPEManager.cpp Messenger.cpp Partitioner.cpp - PastisOStream.cpp - PastisUtils.cpp + PugsOStream.cpp + PugsUtils.cpp RevisionInfo.cpp SignalManager.cpp) @@ -20,13 +20,13 @@ add_library( # Generates revision header file add_custom_target( - PastisGitRevison + PugsGitRevison ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision.hpp + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pugs_git_revision.hpp ) set_source_files_properties( - ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision.hpp + ${CMAKE_CURRENT_BINARY_DIR}/pugs_git_revision.hpp PROPERTIES GENERATED TRUE HEADER_FILE_ONLY TRUE @@ -34,59 +34,59 @@ set_source_files_properties( # --------- check git revision info at build ---------- -add_custom_command(TARGET PastisGitRevison +add_custom_command(TARGET PugsGitRevison COMMAND ${CMAKE_COMMAND} -E remove -f - ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision.hpp + ${CMAKE_CURRENT_BINARY_DIR}/pugs_git_revision + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pugs_git_revision.hpp COMMENT "" ) -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision.hpp +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pugs_git_revision.hpp PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision - ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision.hpp + ${CMAKE_CURRENT_BINARY_DIR}/pugs_git_revision + ${CMAKE_CURRENT_BINARY_DIR}/pugs_git_revision.hpp COMMENT "" - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pugs_git_revision VERBATIM ) -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pugs_git_revision PRE_BUILD - COMMAND ${CMAKE_COMMAND} -DPASTIS_VERSION=${PASTIS_VERSION} -DPASTIS_SOURCE_DIR=${PASTIS_SOURCE_DIR} -P ${PASTIS_SOURCE_DIR}/cmake/GetPastisGitRevision.cmake - COMMENT "Check pastis git status" + COMMAND ${CMAKE_COMMAND} -DPUGS_VERSION=${PUGS_VERSION} -DPUGS_SOURCE_DIR=${PUGS_SOURCE_DIR} -P ${PUGS_SOURCE_DIR}/cmake/GetPugsGitRevision.cmake + COMMENT "Check pugs git status" VERBATIM ) # ----------------- get version info ------------------ -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pastis_version.hpp.in" - "${CMAKE_CURRENT_BINARY_DIR}/pastis_version.hpp" +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pugs_version.hpp.in" + "${CMAKE_CURRENT_BINARY_DIR}/pugs_version.hpp" @ONLY) list( APPEND SOURCES - ${CMAKE_CURRENT_BINARY_DIR}/pastis_git_revision.hpp - ${CMAKE_CURRENT_BINARY_DIR}/pastis_version.hpp - ${PASTIS_BINARY_DIR}/pastis_config.hpp + ${CMAKE_CURRENT_BINARY_DIR}/pugs_git_revision.hpp + ${CMAKE_CURRENT_BINARY_DIR}/pugs_version.hpp + ${PUGS_BINARY_DIR}/pugs_config.hpp ) include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${PASTIS_BINARY_DIR}) -include_directories(${PASTIS_SOURCE_DIR}/packages/rang/include) +include_directories(${PUGS_BINARY_DIR}) +include_directories(${PUGS_SOURCE_DIR}/packages/rang/include) # Additional dependencies add_dependencies( - PastisUtils - PastisGitRevison) + PugsUtils + PugsGitRevison) # ---------------- Checks for includes ---------------- # Checks for FPE include(CheckIncludeFile) -check_include_file(fenv.h PASTIS_HAS_FENV_H) +check_include_file(fenv.h PUGS_HAS_FENV_H) # Checks for host system name if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") @@ -99,12 +99,12 @@ else() message(WARNMSG "Your system is ${CMAKE_HOST_SYSTEM_NAME} which may not be managed!") endif() -# Generates pastis_config.hpp -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pastis_config.hpp.in" - "${CMAKE_CURRENT_BINARY_DIR}/pastis_config.hpp" +# Generates pugs_config.hpp +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pugs_config.hpp.in" + "${CMAKE_CURRENT_BINARY_DIR}/pugs_config.hpp" @ONLY) -# Generates pastis_build_info.hpp -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pastis_build_info.hpp.in" - "${CMAKE_CURRENT_BINARY_DIR}/pastis_build_info.hpp" +# Generates pugs_build_info.hpp +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pugs_build_info.hpp.in" + "${CMAKE_CURRENT_BINARY_DIR}/pugs_build_info.hpp" @ONLY) diff --git a/src/utils/CastArray.hpp b/src/utils/CastArray.hpp index 5f22611a7cca8095341617376eaaa14ff4ba794f..8720117858a4db4fb8f085b20bca5930dce4d745 100644 --- a/src/utils/CastArray.hpp +++ b/src/utils/CastArray.hpp @@ -2,7 +2,7 @@ #define CAST_ARRAY_HPP #include <Array.hpp> -#include <PastisTraits.hpp> +#include <PugsTraits.hpp> template <typename DataType, typename CastDataType> class CastArray @@ -16,33 +16,33 @@ class CastArray CastDataType* const m_values; public: - PASTIS_INLINE + PUGS_INLINE const size_t& size() const { return m_size; } - PASTIS_INLINE + PUGS_INLINE CastDataType& operator[](const size_t& i) const { Assert(i < m_size); return m_values[i]; } - PASTIS_INLINE + PUGS_INLINE CastArray& operator=(const CastArray&) = default; - PASTIS_INLINE + PUGS_INLINE CastArray& operator=(CastArray&&) = default; - PASTIS_INLINE + PUGS_INLINE CastArray() : m_size(0), m_values(nullptr) { ; } - PASTIS_INLINE + PUGS_INLINE CastArray(const Array<DataType>& array) : m_array(array), m_size(sizeof(DataType) * array.size() / sizeof(CastDataType)), @@ -61,7 +61,7 @@ class CastArray } } - PASTIS_INLINE + PUGS_INLINE CastArray(DataType& value) : m_size(sizeof(DataType) / sizeof(CastDataType)), m_values(reinterpret_cast<CastDataType*>(&(value))) @@ -75,16 +75,16 @@ class CastArray "Defining CastArray from non trivially castable type is not allowed"); } - PASTIS_INLINE + PUGS_INLINE CastArray(DataType&& value) = delete; - PASTIS_INLINE + PUGS_INLINE CastArray(const CastArray&) = default; - PASTIS_INLINE + PUGS_INLINE CastArray(CastArray&&) = default; - PASTIS_INLINE + PUGS_INLINE ~CastArray() = default; }; @@ -92,7 +92,7 @@ template <typename CastDataType> struct cast_array_to { template <typename DataType> - PASTIS_INLINE static CastArray<DataType, CastDataType> + PUGS_INLINE static CastArray<DataType, CastDataType> from(const Array<DataType>& array) { return CastArray<DataType, CastDataType>(array); @@ -103,7 +103,7 @@ template <typename CastDataType> struct cast_value_to { template <typename DataType> - PASTIS_INLINE static CastArray<DataType, CastDataType> + PUGS_INLINE static CastArray<DataType, CastDataType> from(DataType& value) { return CastArray<DataType, CastDataType>(value); diff --git a/src/utils/ConsoleManager.cpp b/src/utils/ConsoleManager.cpp index 92de4e8ef1f97564666c181e13741707ab80e1f2..2f819f27b7ccdcf2d65f44e266e6e3378f81a377 100644 --- a/src/utils/ConsoleManager.cpp +++ b/src/utils/ConsoleManager.cpp @@ -1,5 +1,5 @@ #include <ConsoleManager.hpp> -#include <PastisOStream.hpp> +#include <PugsOStream.hpp> #include <rang.hpp> diff --git a/src/utils/FPEManager.cpp b/src/utils/FPEManager.cpp index 72a275f807aa7597324ad8b818ff94e2e9c615fc..543357f22293b316dd1a246f30f84943608fa807 100644 --- a/src/utils/FPEManager.cpp +++ b/src/utils/FPEManager.cpp @@ -1,11 +1,11 @@ #include <FPEManager.hpp> -#include <PastisMacros.hpp> -#include <PastisOStream.hpp> +#include <PugsMacros.hpp> +#include <PugsOStream.hpp> -#include <pastis_config.hpp> +#include <pugs_config.hpp> #include <rang.hpp> -#ifdef PASTIS_HAS_FENV_H +#ifdef PUGS_HAS_FENV_H #include <fenv.h> #define MANAGED_FPE (FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) @@ -15,7 +15,7 @@ // Public domain polyfill for feenableexcept on OS X // http://www-personal.umich.edu/~williams/archive/computation/fe-handling-example.c -PASTIS_INLINE +PUGS_INLINE int feenableexcept(unsigned int excepts) { @@ -36,7 +36,7 @@ feenableexcept(unsigned int excepts) return fesetenv(&fenv) ? -1 : old_excepts; } -PASTIS_INLINE +PUGS_INLINE int fedisableexcept(unsigned int excepts) { @@ -75,7 +75,7 @@ FPEManager::disable() ::fedisableexcept(MANAGED_FPE); } -#else // PASTIS_HAS_FENV_H +#else // PUGS_HAS_FENV_H void FPEManager::enable() @@ -91,7 +91,7 @@ FPEManager::disable() << rang::fg::reset << '\n'; } -#endif // PASTIS_HAS_FENV_H +#endif // PUGS_HAS_FENV_H void FPEManager::init(const bool& enable) diff --git a/src/utils/Messenger.cpp b/src/utils/Messenger.cpp index 8562c9453a0c6aff6b2f87e14fbd176a700769a4..1e0984a8eac88603d7002fec8b9558f04afbd1cd 100644 --- a/src/utils/Messenger.cpp +++ b/src/utils/Messenger.cpp @@ -1,5 +1,5 @@ #include <Messenger.hpp> -#include <PastisOStream.hpp> +#include <PugsOStream.hpp> namespace parallel { @@ -28,7 +28,7 @@ Messenger::destroy() Messenger::Messenger([[maybe_unused]] int& argc, [[maybe_unused]] char* argv[]) { -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI MPI_Init(&argc, &argv); m_rank = []() { @@ -49,22 +49,22 @@ Messenger::Messenger([[maybe_unused]] int& argc, [[maybe_unused]] char* argv[]) perr.setOutput(null_stream); // LCOV_EXCL_STOP } -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } Messenger::~Messenger() { -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI MPI_Finalize(); -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } void Messenger::barrier() const { -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI MPI_Barrier(MPI_COMM_WORLD); -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } } // namespace parallel diff --git a/src/utils/Messenger.hpp b/src/utils/Messenger.hpp index f188d68377812f88d94dda3220a6c3eeade50ba9..ecdab71d1d73c2d653c607b5ab3ca141cb12b6ba 100644 --- a/src/utils/Messenger.hpp +++ b/src/utils/Messenger.hpp @@ -1,9 +1,9 @@ #ifndef MESSENGER_HPP #define MESSENGER_HPP -#include <PastisAssert.hpp> -#include <PastisMacros.hpp> -#include <PastisOStream.hpp> +#include <PugsAssert.hpp> +#include <PugsMacros.hpp> +#include <PugsOStream.hpp> #include <Array.hpp> #include <ArrayUtils.hpp> @@ -12,12 +12,12 @@ #include <type_traits> #include <vector> -#include <pastis_config.hpp> -#ifdef PASTIS_HAS_MPI +#include <pugs_config.hpp> +#ifdef PUGS_HAS_MPI #include <mpi.h> -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI -#include <PastisTraits.hpp> +#include <PugsTraits.hpp> namespace parallel { @@ -26,9 +26,9 @@ class Messenger private: struct helper { -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI template <typename DataType> - static PASTIS_INLINE MPI_Datatype + static PUGS_INLINE MPI_Datatype mpiType() { if constexpr (std::is_const_v<DataType>) { @@ -41,7 +41,7 @@ class Messenger return MPI_Datatype(); } } -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI private: template <typename T, typename Allowed = void> @@ -103,14 +103,14 @@ class Messenger static_assert(std::is_arithmetic_v<DataType>); Assert(gather.size() == m_size); // LCOV_EXCL_LINE -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI MPI_Datatype mpi_datatype = Messenger::helper::mpiType<DataType>(); MPI_Allgather(&data, 1, mpi_datatype, &(gather[0]), 1, mpi_datatype, MPI_COMM_WORLD); -#else // PASTIS_HAS_MPI +#else // PUGS_HAS_MPI gather[0] = data; -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } template <template <typename... SendT> typename SendArrayType, @@ -132,15 +132,15 @@ class Messenger std::is_same_v<std::remove_const_t<SendDataType>, RecvDataType>); static_assert(std::is_arithmetic_v<SendDataType>); -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI MPI_Datatype mpi_datatype = Messenger::helper::mpiType<RecvDataType>(); MPI_Allgather(&(data_array[0]), data_array.size(), mpi_datatype, &(gather_array[0]), data_array.size(), mpi_datatype, MPI_COMM_WORLD); -#else // PASTIS_HAS_MPI +#else // PUGS_HAS_MPI value_copy(data_array, gather_array); -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } template <typename DataType> @@ -151,11 +151,11 @@ class Messenger static_assert(not std::is_const_v<DataType>); static_assert(std::is_arithmetic_v<DataType>); -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI MPI_Datatype mpi_datatype = Messenger::helper::mpiType<DataType>(); MPI_Bcast(&data, 1, mpi_datatype, root_rank, MPI_COMM_WORLD); -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } template <typename ArrayType> @@ -167,11 +167,11 @@ class Messenger static_assert(not std::is_const_v<DataType>); static_assert(std::is_arithmetic_v<DataType>); -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI MPI_Datatype mpi_datatype = Messenger::helper::mpiType<DataType>(); MPI_Bcast(&(array[0]), array.size(), mpi_datatype, root_rank, MPI_COMM_WORLD); -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } template <template <typename... SendT> typename SendArrayType, @@ -183,7 +183,7 @@ class Messenger _allToAll(const SendArrayType<SendT...>& sent_array, RecvArrayType<RecvT...>& recv_array) const { -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI using SendDataType = typename SendArrayType<SendT...>::data_type; using RecvDataType = typename RecvArrayType<RecvT...>::data_type; @@ -200,9 +200,9 @@ class Messenger MPI_Alltoall(&(sent_array[0]), count, mpi_datatype, &(recv_array[0]), count, mpi_datatype, MPI_COMM_WORLD); -#else // PASTIS_HAS_MPI +#else // PUGS_HAS_MPI value_copy(sent_array, recv_array); -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI return recv_array; } @@ -222,7 +222,7 @@ class Messenger std::is_same_v<std::remove_const_t<SendDataType>, RecvDataType>); static_assert(std::is_arithmetic_v<SendDataType>); -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI std::vector<MPI_Request> request_list; MPI_Datatype mpi_datatype = Messenger::helper::mpiType<SendDataType>(); @@ -258,12 +258,12 @@ class Messenger } } -#else // PASTIS_HAS_MPI +#else // PUGS_HAS_MPI Assert(sent_array_list.size() == 1); Assert(recv_array_list.size() == 1); value_copy(sent_array_list[0], recv_array_list[0]); -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } template <typename DataType, typename CastDataType> @@ -291,7 +291,7 @@ class Messenger static void create(int& argc, char* argv[]); static void destroy(); - PASTIS_INLINE + PUGS_INLINE static Messenger& getInstance() { @@ -299,14 +299,14 @@ class Messenger return *m_instance; } - PASTIS_INLINE + PUGS_INLINE const size_t& rank() const { return m_rank; } - PASTIS_INLINE + PUGS_INLINE const size_t& size() const { @@ -319,7 +319,7 @@ class Messenger DataType allReduceMin(const DataType& data) const { -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI static_assert(not std::is_const_v<DataType>); static_assert(std::is_arithmetic_v<DataType>); @@ -329,16 +329,16 @@ class Messenger MPI_Allreduce(&data, &min_data, 1, mpi_datatype, MPI_MIN, MPI_COMM_WORLD); return min_data; -#else // PASTIS_HAS_MPI +#else // PUGS_HAS_MPI return data; -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } template <typename DataType> DataType allReduceMax(const DataType& data) const { -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI static_assert(not std::is_const_v<DataType>); static_assert(std::is_arithmetic_v<DataType>); @@ -348,16 +348,16 @@ class Messenger MPI_Allreduce(&data, &max_data, 1, mpi_datatype, MPI_MAX, MPI_COMM_WORLD); return max_data; -#else // PASTIS_HAS_MPI +#else // PUGS_HAS_MPI return data; -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } template <typename DataType> DataType allReduceSum(const DataType& data) const { -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI static_assert(not std::is_const_v<DataType>); if constexpr (std::is_arithmetic_v<DataType>) { MPI_Datatype mpi_datatype = Messenger::helper::mpiType<DataType>(); @@ -377,13 +377,13 @@ class Messenger return data_sum; } -#else // PASTIS_HAS_MPI +#else // PUGS_HAS_MPI return data; -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } template <typename DataType> - PASTIS_INLINE Array<DataType> + PUGS_INLINE Array<DataType> allGather(const DataType& data) const { static_assert(not std::is_const_v<DataType>); @@ -406,7 +406,7 @@ class Messenger } template <typename DataType> - PASTIS_INLINE Array<std::remove_const_t<DataType>> + PUGS_INLINE Array<std::remove_const_t<DataType>> allGather(const Array<DataType>& array) const { using MutableDataType = std::remove_const_t<DataType>; @@ -430,7 +430,7 @@ class Messenger } template <typename SendDataType> - PASTIS_INLINE Array<std::remove_const_t<SendDataType>> + PUGS_INLINE Array<std::remove_const_t<SendDataType>> allToAll(const Array<SendDataType>& sent_array) const { #ifndef NDEBUG @@ -458,7 +458,7 @@ class Messenger } template <typename DataType> - PASTIS_INLINE void + PUGS_INLINE void broadcast(DataType& data, const size_t& root_rank) const { static_assert(not std::is_const_v<DataType>, "cannot broadcast const data"); @@ -479,7 +479,7 @@ class Messenger } template <typename DataType> - PASTIS_INLINE void + PUGS_INLINE void broadcast(Array<DataType>& array, const size_t& root_rank) const { static_assert(not std::is_const_v<DataType>, @@ -507,7 +507,7 @@ class Messenger } template <typename SendDataType, typename RecvDataType> - PASTIS_INLINE void + PUGS_INLINE void exchange(const std::vector<Array<SendDataType>>& send_array_list, std::vector<Array<RecvDataType>>& recv_array_list) const { @@ -548,28 +548,28 @@ class Messenger ~Messenger(); }; -PASTIS_INLINE +PUGS_INLINE const Messenger& messenger() { return Messenger::getInstance(); } -PASTIS_INLINE +PUGS_INLINE const size_t& rank() { return messenger().rank(); } -PASTIS_INLINE +PUGS_INLINE const size_t& size() { return messenger().size(); } -PASTIS_INLINE +PUGS_INLINE void barrier() { @@ -577,63 +577,63 @@ barrier() } template <typename DataType> -PASTIS_INLINE DataType +PUGS_INLINE DataType allReduceMax(const DataType& data) { return messenger().allReduceMax(data); } template <typename DataType> -PASTIS_INLINE DataType +PUGS_INLINE DataType allReduceMin(const DataType& data) { return messenger().allReduceMin(data); } template <typename DataType> -PASTIS_INLINE DataType +PUGS_INLINE DataType allReduceSum(const DataType& data) { return messenger().allReduceSum(data); } template <typename DataType> -PASTIS_INLINE Array<DataType> +PUGS_INLINE Array<DataType> allGather(const DataType& data) { return messenger().allGather(data); } template <typename DataType> -PASTIS_INLINE Array<std::remove_const_t<DataType>> +PUGS_INLINE Array<std::remove_const_t<DataType>> allGather(const Array<DataType>& array) { return messenger().allGather(array); } template <typename DataType> -PASTIS_INLINE Array<std::remove_const_t<DataType>> +PUGS_INLINE Array<std::remove_const_t<DataType>> allToAll(const Array<DataType>& array) { return messenger().allToAll(array); } template <typename DataType> -PASTIS_INLINE void +PUGS_INLINE void broadcast(DataType& data, const size_t& root_rank) { messenger().broadcast(data, root_rank); } template <typename DataType> -PASTIS_INLINE void +PUGS_INLINE void broadcast(Array<DataType>& array, const size_t& root_rank) { messenger().broadcast(array, root_rank); } template <typename SendDataType, typename RecvDataType> -PASTIS_INLINE void +PUGS_INLINE void exchange(const std::vector<Array<SendDataType>>& sent_array_list, std::vector<Array<RecvDataType>>& recv_array_list) { @@ -645,121 +645,121 @@ exchange(const std::vector<Array<SendDataType>>& sent_array_list, messenger().exchange(sent_array_list, recv_array_list); } -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<char>() { return MPI_CHAR; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<int8_t>() { return MPI_INT8_T; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<int16_t>() { return MPI_INT16_T; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<int32_t>() { return MPI_INT32_T; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<int64_t>() { return MPI_INT64_T; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<uint8_t>() { return MPI_UINT8_T; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<uint16_t>() { return MPI_UINT16_T; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<uint32_t>() { return MPI_UINT32_T; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<uint64_t>() { return MPI_UINT64_T; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<signed long long int>() { return MPI_LONG_LONG_INT; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<unsigned long long int>() { return MPI_UNSIGNED_LONG_LONG; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<float>() { return MPI_FLOAT; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<double>() { return MPI_DOUBLE; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<long double>() { return MPI_LONG_DOUBLE; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<wchar_t>() { return MPI_WCHAR; } template <> -PASTIS_INLINE MPI_Datatype +PUGS_INLINE MPI_Datatype Messenger::helper::mpiType<bool>() { return MPI_CXX_BOOL; } -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI } // namespace parallel diff --git a/src/utils/Partitioner.cpp b/src/utils/Partitioner.cpp index 1ab81ef01f977ee769136171dfd5aed9925095f0..7d6cd98cd1e54451988dfc1209c49fd2da5050e4 100644 --- a/src/utils/Partitioner.cpp +++ b/src/utils/Partitioner.cpp @@ -1,10 +1,10 @@ #include <Messenger.hpp> #include <Partitioner.hpp> -#include <pastis_config.hpp> +#include <pugs_config.hpp> -#include <PastisOStream.hpp> +#include <PugsOStream.hpp> -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI #define IDXTYPEWIDTH 64 #define REALTYPEWIDTH 64 @@ -78,7 +78,7 @@ Partitioner::partition(const CSRGraph& graph) return part; } -#else // PASTIS_HAS_MPI +#else // PUGS_HAS_MPI Array<int> Partitioner::partition(const CSRGraph&) @@ -86,4 +86,4 @@ Partitioner::partition(const CSRGraph&) return Array<int>(0); } -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI diff --git a/src/utils/PastisOStream.cpp b/src/utils/PastisOStream.cpp deleted file mode 100644 index 180570f80d622cf9e4e9f49007c52cb558042cc3..0000000000000000000000000000000000000000 --- a/src/utils/PastisOStream.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include <PastisOStream.hpp> - -#include <iomanip> -#include <sstream> - -PastisOStream pout(std::cout); -PastisOStream perr(std::cerr); - -std::stringstream null_stream; -const PastisOStream _null_stream_initializer([]() -> std::stringstream& { - null_stream.setstate(std::ios::badbit); - return null_stream; -}()); diff --git a/src/utils/PastisOStream.hpp b/src/utils/PastisOStream.hpp deleted file mode 100644 index 3945f970501f9c59a37ef3d7ad07eb85b9dc1b15..0000000000000000000000000000000000000000 --- a/src/utils/PastisOStream.hpp +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef PASTIS_OSTREAM_HPP -#define PASTIS_OSTREAM_HPP - -#include <PastisMacros.hpp> -#include <iostream> -#include <sstream> - -extern std::stringstream null_stream; - -class PastisOStream -{ - private: - std::ostream* m_os = nullptr; - - public: - PASTIS_INLINE - std::ostream& - operator()() - { - return *m_os; - } - - void - setOutput(std::ostream& os) - { - m_os = &os; - } - - PastisOStream(std::ostream& os) : m_os(&os) - { - ; - } - - PastisOStream& operator=(const PastisOStream&) = delete; - PastisOStream& operator=(PastisOStream&&) = delete; - PastisOStream(const PastisOStream&) = delete; - PastisOStream(PastisOStream&&) = delete; - - ~PastisOStream() = default; -}; - -extern PastisOStream pout; -extern PastisOStream perr; -extern const PastisOStream _null_stream_initializer; - -#endif // PASTIS_OSTREAM_HPP diff --git a/src/utils/PastisAssert.hpp b/src/utils/PugsAssert.hpp similarity index 90% rename from src/utils/PastisAssert.hpp rename to src/utils/PugsAssert.hpp index 2c8bd74ce56693563bb46c8eca4634f60b5d80a1..88b748f49639c3c7f151fbac7472e1250f402039 100644 --- a/src/utils/PastisAssert.hpp +++ b/src/utils/PugsAssert.hpp @@ -1,7 +1,7 @@ -#ifndef PASTIS_ASSERT_HPP -#define PASTIS_ASSERT_HPP +#ifndef PUGS_ASSERT_HPP +#define PUGS_ASSERT_HPP -#include <PastisMacros.hpp> +#include <PugsMacros.hpp> #include <iostream> #include <rang.hpp> @@ -63,7 +63,7 @@ class AssertError PRAGMA_DIAGNOSTIC_IGNORED_WATTRIBUTES inline bool __attribute__((analyzer_noreturn)) -_pastis_assert(const bool& assert) +_pugs_assert(const bool& assert) { return assert; } @@ -73,7 +73,7 @@ PRAGMA_DIAGNOSTIC_POP // Useless test is there to check syntax even in optimized mode. Costs nothing. #define Assert(assertion, ...) \ - if (not _pastis_assert(assertion)) { \ + if (not _pugs_assert(assertion)) { \ using vargs_t = decltype(std::make_tuple(__VA_ARGS__)); \ static_assert(std::tuple_size_v<vargs_t> <= 1, "too many arguments"); \ } @@ -81,7 +81,7 @@ PRAGMA_DIAGNOSTIC_POP #else // NDEBUG #define Assert(assertion, ...) \ - if (not _pastis_assert(assertion)) { \ + if (not _pugs_assert(assertion)) { \ using vargs_t = decltype(std::make_tuple(__VA_ARGS__)); \ static_assert(std::tuple_size_v<vargs_t> <= 1, "too many arguments"); \ if constexpr (std::tuple_size_v<vargs_t> == 0) { \ @@ -103,4 +103,4 @@ PRAGMA_DIAGNOSTIC_POP #define NO_ASSERT false #endif // NDEBUG -#endif // PASTIS_ASSERT_HPP +#endif // PUGS_ASSERT_HPP diff --git a/src/utils/PastisMacros.hpp b/src/utils/PugsMacros.hpp similarity index 62% rename from src/utils/PastisMacros.hpp rename to src/utils/PugsMacros.hpp index efb492440fadae8120f20cf51a236a8785ebb4e8..94ac59789b214965c97fc1b2ecb417866aaf64f6 100644 --- a/src/utils/PastisMacros.hpp +++ b/src/utils/PugsMacros.hpp @@ -1,14 +1,14 @@ -#ifndef PASTIS_MACROS_HPP -#define PASTIS_MACROS_HPP +#ifndef PUGS_MACROS_HPP +#define PUGS_MACROS_HPP #include <Kokkos_Macros.hpp> -#define PASTIS_RESTRICT KOKKOS_RESTRICT +#define PUGS_RESTRICT KOKKOS_RESTRICT -#define PASTIS_INLINE KOKKOS_INLINE_FUNCTION -#define PASTIS_FORCEINLINE KOKKOS_FORCEINLINE_FUNCTION +#define PUGS_INLINE KOKKOS_INLINE_FUNCTION +#define PUGS_FORCEINLINE KOKKOS_FORCEINLINE_FUNCTION -#define PASTIS_LAMBDA KOKKOS_LAMBDA +#define PUGS_LAMBDA KOKKOS_LAMBDA // Sets macro to ignore unknown pragma @@ -25,4 +25,4 @@ #endif -#endif // PASTIS_MACROS_HPP +#endif // PUGS_MACROS_HPP diff --git a/src/utils/PugsOStream.cpp b/src/utils/PugsOStream.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e321f50d722a1c6b3cb4f25a2dbd51e8c20af267 --- /dev/null +++ b/src/utils/PugsOStream.cpp @@ -0,0 +1,13 @@ +#include <PugsOStream.hpp> + +#include <iomanip> +#include <sstream> + +PugsOStream pout(std::cout); +PugsOStream perr(std::cerr); + +std::stringstream null_stream; +const PugsOStream _null_stream_initializer([]() -> std::stringstream& { + null_stream.setstate(std::ios::badbit); + return null_stream; +}()); diff --git a/src/utils/PugsOStream.hpp b/src/utils/PugsOStream.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e5d986186917b3ca949d46658e175c9adcfb6ff5 --- /dev/null +++ b/src/utils/PugsOStream.hpp @@ -0,0 +1,46 @@ +#ifndef PUGS_OSTREAM_HPP +#define PUGS_OSTREAM_HPP + +#include <PugsMacros.hpp> +#include <iostream> +#include <sstream> + +extern std::stringstream null_stream; + +class PugsOStream +{ + private: + std::ostream* m_os = nullptr; + + public: + PUGS_INLINE + std::ostream& + operator()() + { + return *m_os; + } + + void + setOutput(std::ostream& os) + { + m_os = &os; + } + + PugsOStream(std::ostream& os) : m_os(&os) + { + ; + } + + PugsOStream& operator=(const PugsOStream&) = delete; + PugsOStream& operator=(PugsOStream&&) = delete; + PugsOStream(const PugsOStream&) = delete; + PugsOStream(PugsOStream&&) = delete; + + ~PugsOStream() = default; +}; + +extern PugsOStream pout; +extern PugsOStream perr; +extern const PugsOStream _null_stream_initializer; + +#endif // PUGS_OSTREAM_HPP diff --git a/src/utils/PastisTraits.hpp b/src/utils/PugsTraits.hpp similarity index 90% rename from src/utils/PastisTraits.hpp rename to src/utils/PugsTraits.hpp index 2192c8b4783630fe67b9c3522743c9997059cafb..0699c209d7003ed70f9a4a631bd487f031a06a9d 100644 --- a/src/utils/PastisTraits.hpp +++ b/src/utils/PugsTraits.hpp @@ -1,5 +1,5 @@ -#ifndef PASTIS_TRAITS_HPP -#define PASTIS_TRAITS_HPP +#ifndef PUGS_TRAITS_HPP +#define PUGS_TRAITS_HPP #include <type_traits> @@ -28,4 +28,4 @@ inline constexpr bool is_trivially_castable<const TinyMatrix<N, T>> = template <typename T> inline constexpr bool is_false_v = false; -#endif // PASTIS_TRAITS_HPP +#endif // PUGS_TRAITS_HPP diff --git a/src/utils/PastisUtils.cpp b/src/utils/PugsUtils.cpp similarity index 95% rename from src/utils/PastisUtils.cpp rename to src/utils/PugsUtils.cpp index 16bfe9dc534c1929887dba2addece9585a173774..e95105acc40402c445f3395fb670ce67fc15c3f3 100644 --- a/src/utils/PastisUtils.cpp +++ b/src/utils/PugsUtils.cpp @@ -1,5 +1,5 @@ -#include <PastisOStream.hpp> -#include <PastisUtils.hpp> +#include <PugsOStream.hpp> +#include <PugsUtils.hpp> #include <Kokkos_Core.hpp> @@ -24,7 +24,7 @@ initialize(int& argc, char* argv[]) long unsigned number = 10; std::string filename; - pout() << "Pastis version: " << rang::style::bold << RevisionInfo::version() + pout() << "Pugs version: " << rang::style::bold << RevisionInfo::version() << rang::style::reset << '\n'; pout() << "-------------------- " << rang::fg::green << "git info" @@ -54,7 +54,7 @@ initialize(int& argc, char* argv[]) << rang::style::reset << '\n'; pout() << "-------------------------------------------------------\n"; { - CLI::App app{"Pastis help"}; + CLI::App app{"Pugs help"}; app.add_option("-n,--number", number, "Number of cells"); //->required(); diff --git a/src/utils/PastisUtils.hpp b/src/utils/PugsUtils.hpp similarity index 79% rename from src/utils/PastisUtils.hpp rename to src/utils/PugsUtils.hpp index 33ae8a2fb16704cfd8d811ac13b618285507f0f9..f5a41609e3ba9ed5fda4bbb751a1f66e51c44ed8 100644 --- a/src/utils/PastisUtils.hpp +++ b/src/utils/PugsUtils.hpp @@ -1,14 +1,14 @@ -#ifndef PASTIS_UTILS_HPP -#define PASTIS_UTILS_HPP +#ifndef PUGS_UTILS_HPP +#define PUGS_UTILS_HPP #include <Kokkos_Core.hpp> -#include <PastisMacros.hpp> +#include <PugsMacros.hpp> #include <functional> #include <string> template <typename FunctionType> -PASTIS_FORCEINLINE void +PUGS_FORCEINLINE void parallel_for(const size_t& size, const FunctionType& lambda, const std::string& label = "") @@ -17,7 +17,7 @@ parallel_for(const size_t& size, } template <typename ArrayType, typename ReturnType> -PASTIS_FORCEINLINE void +PUGS_FORCEINLINE void parallel_reduce(const size_t& size, const ArrayType& array, ReturnType& value, @@ -30,4 +30,4 @@ std::string initialize(int& argc, char* argv[]); void finalize(); -#endif // PASTIS_UTILS_HPP +#endif // PUGS_UTILS_HPP diff --git a/src/utils/RevisionInfo.cpp b/src/utils/RevisionInfo.cpp index 97c99decad4cbf250fdf508ec0ed9ec8f2acffeb..4d3965b33d570a329d7c8ca8e3d1cd284ccb7fcf 100644 --- a/src/utils/RevisionInfo.cpp +++ b/src/utils/RevisionInfo.cpp @@ -1,17 +1,17 @@ #include <RevisionInfo.hpp> -#include <pastis_git_revision.hpp> -#include <pastis_version.hpp> +#include <pugs_git_revision.hpp> +#include <pugs_version.hpp> std::string RevisionInfo::version() { - return PASTIS_VERSION; + return PUGS_VERSION; } bool RevisionInfo::hasGitInfo() { -#ifdef HAS_PASTIS_GIT_INFO +#ifdef HAS_PUGS_GIT_INFO return true; #else return false; @@ -21,8 +21,8 @@ RevisionInfo::hasGitInfo() std::string RevisionInfo::gitTag() { -#ifdef HAS_PASTIS_GIT_INFO - return PASTIS_GIT_TAG; +#ifdef HAS_PUGS_GIT_INFO + return PUGS_GIT_TAG; #else return "unknown tag"; #endif @@ -31,8 +31,8 @@ RevisionInfo::gitTag() std::string RevisionInfo::gitHead() { -#ifdef HAS_PASTIS_GIT_INFO - return PASTIS_GIT_HEAD; +#ifdef HAS_PUGS_GIT_INFO + return PUGS_GIT_HEAD; #else return "unknown head"; #endif @@ -41,8 +41,8 @@ RevisionInfo::gitHead() std::string RevisionInfo::gitHash() { -#ifdef HAS_PASTIS_GIT_INFO - return PASTIS_GIT_HASH; +#ifdef HAS_PUGS_GIT_INFO + return PUGS_GIT_HASH; #else return "unknown hash"; #endif @@ -51,8 +51,8 @@ RevisionInfo::gitHash() bool RevisionInfo::gitIsClean() { -#ifdef HAS_PASTIS_GIT_INFO - return PASTIS_GIT_IS_CLEAN; +#ifdef HAS_PUGS_GIT_INFO + return PUGS_GIT_IS_CLEAN; #else return false; #endif diff --git a/src/utils/SignalManager.cpp b/src/utils/SignalManager.cpp index c7e70f23011592d24ebacb92cc17b4e4ee69de90..f258952ddf6101a3ad5282f74d0b5a7e30a8511d 100644 --- a/src/utils/SignalManager.cpp +++ b/src/utils/SignalManager.cpp @@ -1,7 +1,7 @@ #include <SignalManager.hpp> -#include <PastisAssert.hpp> -#include <PastisOStream.hpp> +#include <PugsAssert.hpp> +#include <PugsOStream.hpp> #include <BacktraceManager.hpp> #include <ConsoleManager.hpp> @@ -9,7 +9,7 @@ #include <csignal> #include <unistd.h> -#include <pastis_config.hpp> +#include <pugs_config.hpp> #include <rang.hpp> #include <Messenger.hpp> @@ -44,7 +44,7 @@ SignalManager::signalName(const int& signal) void SignalManager::pauseForDebug(const int& signal) { - if (std::string(PASTIS_BUILD_TYPE) != "Release") { + if (std::string(PUGS_BUILD_TYPE) != "Release") { if (s_pause_on_error == "yes") { std::cerr << "\n======================================\n" << rang::style::reset << rang::fg::reset << rang::style::bold diff --git a/src/utils/pastis_build_info.hpp.in b/src/utils/pastis_build_info.hpp.in deleted file mode 100644 index 86a2eff3dfe794b34a24c8722239c23bf4c21dce..0000000000000000000000000000000000000000 --- a/src/utils/pastis_build_info.hpp.in +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PASTIS_BUILD_INFO_HPP -#define PASTIS_BUILD_INFO_HPP - -#define PASTIS_BUILD_TYPE "@CMAKE_BUILD_TYPE@" -#define PASTIS_BUILD_COMPILER "@CMAKE_CXX_COMPILER@" -#define PASTIS_BUILD_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@" -#define PASTIS_BUILD_KOKKOS_DEVICES "@KOKKOS_GMAKE_DEVICES@" - -#endif // PASTIS_BUILD_INFO_HPP diff --git a/src/utils/pastis_config.hpp.in b/src/utils/pastis_config.hpp.in deleted file mode 100644 index 9cd9e145b0bbf7b9a0075f8ec5a22fdf9cf61fb7..0000000000000000000000000000000000000000 --- a/src/utils/pastis_config.hpp.in +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef PASTIS_CONFIG_HPP -#define PASTIS_CONFIG_HPP - -#cmakedefine PASTIS_HAS_FENV_H -#cmakedefine PASTIS_HAS_MPI - -#cmakedefine SYSTEM_IS_LINUX -#cmakedefine SYSTEM_IS_DARWIN -#cmakedefine SYSTEM_IS_WINDOWS - -#define PASTIS_BUILD_TYPE "@CMAKE_BUILD_TYPE@" - -#endif // PASTIS_CONFIG_HPP diff --git a/src/utils/pastis_git_revision.hpp.in b/src/utils/pastis_git_revision.hpp.in deleted file mode 100644 index 89f7c62f0ec0212fa22ac25bd0b7747d5ba36492..0000000000000000000000000000000000000000 --- a/src/utils/pastis_git_revision.hpp.in +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PASTIS_GIT_REVISION_HPP -#define PASTIS_GIT_REVISION_HPP - -#cmakedefine HAS_PASTIS_GIT_INFO - -#define PASTIS_GIT_TAG "@PASTIS_GIT_TAG@" -#define PASTIS_GIT_HEAD "@PASTIS_GIT_HEAD@" -#define PASTIS_GIT_HASH "@PASTIS_GIT_HASH@" -#define PASTIS_GIT_HAS_LOCAL_CHANGES "@PASTIS_GIT_HAS_LOCAL_CHANGES@" -#define PASTIS_GIT_IS_CLEAN @PASTIS_GIT_IS_CLEAN@ - -#endif // PASTIS_GIT_REVISION_HPP diff --git a/src/utils/pastis_version.hpp.in b/src/utils/pastis_version.hpp.in deleted file mode 100644 index f07da441fa893ebc7da844dfde6379c040c71af2..0000000000000000000000000000000000000000 --- a/src/utils/pastis_version.hpp.in +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef PASTIS_VERSION_HPP -#define PASTIS_VERSION_HPP - -#define PASTIS_VERSION "@PASTIS_VERSION@" - -#endif // PASTIS_VERSION_HPP diff --git a/src/utils/pugs_build_info.hpp.in b/src/utils/pugs_build_info.hpp.in new file mode 100644 index 0000000000000000000000000000000000000000..57f1672cf51be9e6b5cd09dbcd068082517cf9c5 --- /dev/null +++ b/src/utils/pugs_build_info.hpp.in @@ -0,0 +1,9 @@ +#ifndef PUGS_BUILD_INFO_HPP +#define PUGS_BUILD_INFO_HPP + +#define PUGS_BUILD_TYPE "@CMAKE_BUILD_TYPE@" +#define PUGS_BUILD_COMPILER "@CMAKE_CXX_COMPILER@" +#define PUGS_BUILD_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@" +#define PUGS_BUILD_KOKKOS_DEVICES "@KOKKOS_GMAKE_DEVICES@" + +#endif // PUGS_BUILD_INFO_HPP diff --git a/src/utils/pugs_config.hpp.in b/src/utils/pugs_config.hpp.in new file mode 100644 index 0000000000000000000000000000000000000000..45878e64327797cd6549b18f4d6922f8cde8a29d --- /dev/null +++ b/src/utils/pugs_config.hpp.in @@ -0,0 +1,13 @@ +#ifndef PUGS_CONFIG_HPP +#define PUGS_CONFIG_HPP + +#cmakedefine PUGS_HAS_FENV_H +#cmakedefine PUGS_HAS_MPI + +#cmakedefine SYSTEM_IS_LINUX +#cmakedefine SYSTEM_IS_DARWIN +#cmakedefine SYSTEM_IS_WINDOWS + +#define PUGS_BUILD_TYPE "@CMAKE_BUILD_TYPE@" + +#endif // PUGS_CONFIG_HPP diff --git a/src/utils/pugs_git_revision.hpp.in b/src/utils/pugs_git_revision.hpp.in new file mode 100644 index 0000000000000000000000000000000000000000..3fcb2796265d7b89af3696e4b37047aa03ffd052 --- /dev/null +++ b/src/utils/pugs_git_revision.hpp.in @@ -0,0 +1,12 @@ +#ifndef PUGS_GIT_REVISION_HPP +#define PUGS_GIT_REVISION_HPP + +#cmakedefine HAS_PUGS_GIT_INFO + +#define PUGS_GIT_TAG "@PUGS_GIT_TAG@" +#define PUGS_GIT_HEAD "@PUGS_GIT_HEAD@" +#define PUGS_GIT_HASH "@PUGS_GIT_HASH@" +#define PUGS_GIT_HAS_LOCAL_CHANGES "@PUGS_GIT_HAS_LOCAL_CHANGES@" +#define PUGS_GIT_IS_CLEAN @PUGS_GIT_IS_CLEAN@ + +#endif // PUGS_GIT_REVISION_HPP diff --git a/src/utils/pugs_version.hpp.in b/src/utils/pugs_version.hpp.in new file mode 100644 index 0000000000000000000000000000000000000000..9d908c2e700f3e61a690fcbb7e246eb86b7a4038 --- /dev/null +++ b/src/utils/pugs_version.hpp.in @@ -0,0 +1,6 @@ +#ifndef PUGS_VERSION_HPP +#define PUGS_VERSION_HPP + +#define PUGS_VERSION "@PUGS_VERSION@" + +#endif // PUGS_VERSION_HPP diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 394e2c339c952c745e90aead7587631b2d3404f3..24a4f19727721613a4bca0c70744c29b4523fc54 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,13 +1,13 @@ include_directories("${CATCH_INCLUDE_PATH}") -include_directories("${PASTIS_BINARY_DIR}/src/utils") -set(EXECUTABLE_OUTPUT_PATH ${PASTIS_BINARY_DIR}) +include_directories("${PUGS_BINARY_DIR}/src/utils") +set(EXECUTABLE_OUTPUT_PATH ${PUGS_BINARY_DIR}) add_executable (unit_tests test_main.cpp test_Array.cpp test_ArrayUtils.cpp test_ItemType.cpp - test_PastisAssert.cpp + test_PugsAssert.cpp test_RevisionInfo.cpp test_TinyMatrix.cpp test_TinyVector.cpp @@ -21,13 +21,13 @@ add_executable (mpi_unit_tests target_include_directories(Catch2 INTERFACE ${CATCH_INCLUDE_DIR}) target_link_libraries (unit_tests - PastisUtils + PugsUtils kokkos Catch2 ) target_link_libraries (mpi_unit_tests - PastisUtils + PugsUtils kokkos ${PARMETIS_LIBRARIES} ${MPI_CXX_LINK_FLAGS} ${MPI_CXX_LIBRARIES} @@ -39,8 +39,8 @@ enable_testing() #parse catch tests ParseAndAddCatchTests(unit_tests) -if(${PASTIS_HAS_MPI}) -set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 3 --oversubscribe --path ${PASTIS_BINARY_DIR}) +if(${PUGS_HAS_MPI}) +set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 3 --oversubscribe --path ${PUGS_BINARY_DIR}) endif() ParseAndAddCatchTests(mpi_unit_tests) unset(OptionalCatchTestLauncher) diff --git a/tests/mpi_test_Messenger.cpp b/tests/mpi_test_Messenger.cpp index 94bf36f1305380cab53c1884330dd03be01a2025..6f634d60cda03496a9f452af163b2e624c85e432 100644 --- a/tests/mpi_test_Messenger.cpp +++ b/tests/mpi_test_Messenger.cpp @@ -4,14 +4,14 @@ #include <Messenger.hpp> #include <fstream> -#include <pastis_config.hpp> +#include <pugs_config.hpp> -#ifdef PASTIS_HAS_MPI +#ifdef PUGS_HAS_MPI #include <mpi.h> #define IF_MPI(INSTRUCTION) INSTRUCTION #else #define IF_MPI(INSTRUCTION) -#endif // PASTIS_HAS_MPI +#endif // PUGS_HAS_MPI namespace mpi_check { struct integer diff --git a/tests/test_Array.cpp b/tests/test_Array.cpp index 6ddd5e7f21630fa7dd3e6fcf0ddb8b6a304c0b76..445edd890a1fe08374793598d499fed587762bab 100644 --- a/tests/test_Array.cpp +++ b/tests/test_Array.cpp @@ -1,7 +1,7 @@ #include <catch.hpp> #include <Array.hpp> -#include <PastisAssert.hpp> +#include <PugsAssert.hpp> #include <Types.hpp> #include <deque> diff --git a/tests/test_ArrayUtils.cpp b/tests/test_ArrayUtils.cpp index 64582023f371e6726de1abf3b8fcee66a252d17c..8528d724ec32aa965fdd06242771b27fcc7e48b0 100644 --- a/tests/test_ArrayUtils.cpp +++ b/tests/test_ArrayUtils.cpp @@ -2,7 +2,7 @@ #include <Array.hpp> #include <ArrayUtils.hpp> -#include <PastisAssert.hpp> +#include <PugsAssert.hpp> #include <TinyMatrix.hpp> #include <TinyVector.hpp> diff --git a/tests/test_ItemType.cpp b/tests/test_ItemType.cpp index 80ba82920f66153a3a48537c9195734b5148613d..e1164ee99c6ec28b8da2b8ea620e00b7240849bf 100644 --- a/tests/test_ItemType.cpp +++ b/tests/test_ItemType.cpp @@ -1,4 +1,4 @@ -#include <PastisMacros.hpp> +#include <PugsMacros.hpp> #include <catch.hpp> #include <ItemType.hpp> diff --git a/tests/test_PastisAssert.cpp b/tests/test_PugsAssert.cpp similarity index 94% rename from tests/test_PastisAssert.cpp rename to tests/test_PugsAssert.cpp index e6230e41921e5ea93c7d78bdc3711004f1a629dd..570763b0a3bab52c4a6eaaefd78c44a77bfee94d 100644 --- a/tests/test_PastisAssert.cpp +++ b/tests/test_PugsAssert.cpp @@ -1,9 +1,9 @@ #include <catch.hpp> -#include <PastisAssert.hpp> +#include <PugsAssert.hpp> #include <string> -TEST_CASE("PastisAssert", "[utils]") +TEST_CASE("PugsAssert", "[utils]") { SECTION("checking for assert error") { diff --git a/tests/test_RevisionInfo.cpp b/tests/test_RevisionInfo.cpp index 7906f9e36fb0868a736547e56586f6cba256a269..fafde85b4c1e36f7f38b4645a84159bfe588daba 100644 --- a/tests/test_RevisionInfo.cpp +++ b/tests/test_RevisionInfo.cpp @@ -2,28 +2,28 @@ #include <RevisionInfo.hpp> -#include <pastis_git_revision.hpp> -#include <pastis_version.hpp> +#include <pugs_git_revision.hpp> +#include <pugs_version.hpp> TEST_CASE("RevisionInfo", "[utils]") { - SECTION("checking pastis version") + SECTION("checking pugs version") { - REQUIRE((RevisionInfo::version() == PASTIS_VERSION)); + REQUIRE((RevisionInfo::version() == PUGS_VERSION)); } SECTION("checking git info") { -#ifdef HAS_PASTIS_GIT_INFO +#ifdef HAS_PUGS_GIT_INFO REQUIRE((RevisionInfo::hasGitInfo() == true)); - REQUIRE((RevisionInfo::gitTag() == PASTIS_GIT_TAG)); - REQUIRE((RevisionInfo::gitHead() == PASTIS_GIT_HEAD)); - REQUIRE((RevisionInfo::gitHash() == PASTIS_GIT_HASH)); - REQUIRE((RevisionInfo::gitIsClean() == PASTIS_GIT_IS_CLEAN)); + REQUIRE((RevisionInfo::gitTag() == PUGS_GIT_TAG)); + REQUIRE((RevisionInfo::gitHead() == PUGS_GIT_HEAD)); + REQUIRE((RevisionInfo::gitHash() == PUGS_GIT_HASH)); + REQUIRE((RevisionInfo::gitIsClean() == PUGS_GIT_IS_CLEAN)); SECTION("checking tag") { std::string tag_from_version = "v"; - tag_from_version += std::string(PASTIS_VERSION); + tag_from_version += std::string(PUGS_VERSION); REQUIRE(tag_from_version == RevisionInfo::gitTag()); } #else diff --git a/tests/test_TinyMatrix.cpp b/tests/test_TinyMatrix.cpp index 6cbefa138afd49e622183f962a4ac1b7e6fe60ed..a12c9a462bcb0f5fdcb194729d7d7a8fdc96cc44 100644 --- a/tests/test_TinyMatrix.cpp +++ b/tests/test_TinyMatrix.cpp @@ -1,7 +1,7 @@ #include <catch.hpp> #include <Kokkos_Core.hpp> -#include <PastisAssert.hpp> +#include <PugsAssert.hpp> #include <TinyMatrix.hpp> #include <Types.hpp> diff --git a/tests/test_TinyVector.cpp b/tests/test_TinyVector.cpp index 558ea37723828bf2a5ab1dc655e82906fae05bba..1988bb6bbec9c2f84a33e0310b56ea8a336e888c 100644 --- a/tests/test_TinyVector.cpp +++ b/tests/test_TinyVector.cpp @@ -1,6 +1,6 @@ #include <catch.hpp> -#include <PastisAssert.hpp> +#include <PugsAssert.hpp> #include <TinyVector.hpp> // Instantiate to ensure full coverage is performed