diff --git a/.github/workflows/dbg.yml b/.github/workflows/dbg.yml index 3b57bfee0..bfd7548c9 100644 --- a/.github/workflows/dbg.yml +++ b/.github/workflows/dbg.yml @@ -2,16 +2,17 @@ name: Dbg on: workflow_dispatch: - # Inputs the workflow accepts. + # Inputs the workflow accepts. inputs: cmake_build_type: description: 'Value for CMAKE_BUILD_TYPE' type: string - default: Release + default: Debug required: true add_cmake_cfg_args: description: 'Additional arguments for configuration step' + default: -D LONG_TESTS=ON required: false type: string @@ -28,7 +29,7 @@ on: os: description: 'os' required: true - default: 'ubuntu-20.04' + default: 'windows-2019' options: - 'ubuntu-20.04' - 'macos-10.15' @@ -58,12 +59,21 @@ on: - 'on' - 'off' + debug_enabled: + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + required: false + default: false # job jobs: ci: runs-on: ${{ github.event.inputs.os }} steps: + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} + timeout-minutes: 150 + - name: Print options and set environment variables run: | echo "${{ github.event.inputs.name }}: @@ -88,7 +98,7 @@ jobs: echo "BUILD_CMD=cmake --build . --config ${{ github.event.inputs.cmake_build_type }}" >> "$GITHUB_ENV" echo "TEST_FLG=-C ${{ github.event.inputs.cmake_build_type }} ${{ github.event.inputs.add_ctest_args }}" >> "$GITHUB_ENV" fi - + echo "CMAKE_FLG: ${{ github.event.inputs.add_cmake_cfg_args }} " # Remark: we can't print env variable value in this context env: NJOBS: "2" @@ -96,15 +106,21 @@ jobs: shell: bash # checkout the provided branch name if workflow is manually run - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 if: inputs.branch_name with: ref: ${{ github.event.inputs.branch }} # checkout the event branch for automatic workflows - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 if: inputs.branch_name == '' + - name: Print windows arch info + if: runner.os == 'windows' + run: | + WMIC CPU Get DeviceID, NumberOfCores, NumberOfLogicalProcessors + wmic OS get Caption,CSDVersion,OSArchitecture,Version + - name: Install VTK # Download vtk only if used if: github.event.inputs.vtk == 'on' @@ -134,7 +150,7 @@ jobs: - name: Install LibCommons # LinearElasticity don't build with MSVC - if: github.event.inputs.os != 'windows-2022' + if: runner.os != 'windows' run: | git clone https://github.com/ISCDtoolbox/Commons.git cd Commons @@ -145,7 +161,7 @@ jobs: - name: Install LinearElasticity # LinearElasticity don't build with MSVC - if: github.event.inputs.os != 'windows-2022' + if: runner.os != 'windows' run: | git clone https://github.com/ISCDtoolbox/LinearElasticity.git cd LinearElasticity @@ -162,15 +178,15 @@ jobs: cmake ${{ env.FORT_FLG }} \ -DCI_CONTEXT=ON \ -DBUILD_TESTING=ON \ - -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} \ - -DPATTERN=${{ matrix.pattern }} \ - -DUSE_SCOTCH=${{ matrix.scotch }} \ - -DUSE_VTK=${{ matrix.vtk }} \ + -DCMAKE_BUILD_TYPE=${{ github.event.inputs.cmake_build_type }} \ + -DMMG_PATTERN=${{ github.event.inputs.pattern }} \ + -DUSE_SCOTCH=${{ github.event.inputs.scotch }} \ + -DUSE_VTK=${{ github.event.inputs.vtk }} \ -DTEST_LIBMMG=ON \ -DTEST_LIBMMGS=ON \ -DTEST_LIBMMG2D=ON \ -DTEST_LIBMMG3D=ON \ - ${{ github.events.inputs.add_cmake_cfg_args }} .. + ${{ github.event.inputs.add_cmake_cfg_args }} .. shell: bash - name: Build Mmg @@ -178,14 +194,14 @@ jobs: cd build ${{env.BUILD_CMD}} - - name: Test Mmg - if: github.event.inputs.vtk == 'off' - run: | - cd build - ctest -VV ${{ env.TEST_FLG }} + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: Mmg-bin + path: | + build/bin - - name: Test non native I/Os of Mmg - if: github.event.inputs.vtk == 'on' + - name: Test Mmg run: | cd build - ctest -R "msh|vtk" -VV ${{ env.TEST_FLG }} + ctest ${{ env.TEST_FLG }} diff --git a/.github/workflows/ccpp.yml b/.github/workflows/fast-check.yml similarity index 71% rename from .github/workflows/ccpp.yml rename to .github/workflows/fast-check.yml index 367c8f036..4ea3b84bc 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/fast-check.yml @@ -1,6 +1,10 @@ -name: C/C++ CI +name: Fast check without dependencies -on: [push] +on: + push: + # run tests on PR events + pull_request: + types: [synchronize] jobs: build: diff --git a/.github/workflows/long-tests.yml b/.github/workflows/long-tests.yml new file mode 100644 index 000000000..e160afbc3 --- /dev/null +++ b/.github/workflows/long-tests.yml @@ -0,0 +1,28 @@ +name: Long tests + +on: + # run tests on push events + push: + # run tests on PR events + pull_request: + types: [synchronize] + + # run tests manually on a given branch (default is master) + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + branch: + # branch to test + description: 'branch to test' + # Default value if no value is explicitly provided + default: 'master' + required: false + +# job +jobs: + mmg-debug: + uses: ./.github/workflows/main-job.yml + with: + cmake_build_type: RelWithAssert + add_cmake_cfg_args: -D LONG_TESTS=ON + branch_name: ${{github.event.inputs.branch}} diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml new file mode 100644 index 000000000..57d107182 --- /dev/null +++ b/.github/workflows/main-job.yml @@ -0,0 +1,321 @@ +on: + workflow_call: + inputs: + cmake_build_type: + description: 'Value for CMAKE_BUILD_TYPE' + type: string + default: Release + required: true + + add_cmake_cfg_args: + description: 'Additional arguments for configuration step' + required: false + type: string + + branch_name: + description: 'Branch to checkout when tests are manually triggered' + required: false + type: string + +# job +jobs: + ci: + if: "! contains(github.event.head_commit.message, '[skip ci]')" + runs-on: ${{ matrix.os }} + + # Launch a matrix of jobs + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04,macos-12] + pattern: [on,off] + pointmap: [off] + scotch: [on,off] + vtk: [off] + int: [int32_t] + + include: + # test vtk only without scotch and with delaunay insertion (more + # tests are useless) + - os: ubuntu-20.04 + pattern: off + pointmap: off + scotch: off + vtk: on + int: int32_t + + - os: macos-12 + pattern: off + pointmap: off + scotch: off + vtk: on + int: int32_t + + # Test pointmap with scotch except on windows + - os: ubuntu-20.04 + pattern: off + pointmap: on + scotch: on + vtk: off + int: int32_t + + - os: macos-12 + pattern: off + pointmap: on + scotch: on + vtk: off + int: int32_t + + # Add windows basic test (matrix is not testable as dependencies + # don't build with MSVC) + - os: windows-2022 + pattern: off + pointmap: off + scotch: off + vtk: off + int: int32_t + + - os: windows-2022 + pattern: on + pointmap: off + scotch: off + vtk: off + int: int32_t + + # Add test for pointmap only if pattern off + - os: windows-2022 + pattern: off + pointmap: on + scotch: off + vtk: off + int: int32_t + + # Test int64_t build on all archi, and try to cover all code + - os: ubuntu-20.04 + pattern: on + pointmap: on + scotch: on + vtk: on + int: int64_t + + - os: ubuntu-20.04 + pattern: off + pointmap: off + scotch: off + vtk: off + int: int64_t + + - os: macos-12 + pattern: on + pointmap: on + scotch: on + vtk: on + int: int64_t + + - os: macos-12 + pattern: off + pointmap: off + scotch: off + vtk: off + int: int64_t + + - os: windows-2022 + pattern: on + pointmap: on + scotch: off + vtk: off + int: int64_t + + - os: windows-2022 + pattern: off + pointmap: off + scotch: off + vtk: off + int: int64_t + + steps: + - name: Print options and set environment variables + run: | + echo "${{ github.event.inputs.name }}: + Os: ${{ matrix.os }}, + Pattern: ${{ matrix.pattern }}, + Scotch: ${{ matrix.scotch }}, + VTK: ${{ matrix.vtk }}, + int: ${{ matrix.int }}, + Build: ${{ inputs.cmake_build_type }}" + + # gfortran compiler and scotch makefile depends on the os + if [ "$RUNNER_OS" == "macOS" ]; then + echo "SCOTCH_MAKE=Make.inc/Makefile.inc.i686_mac_darwin10" >> "$GITHUB_ENV" + echo "FORT_FLG=\"-DCMAKE_Fortran_COMPILER=gfortran-11\"" >> "$GITHUB_ENV" + + elif [ "$RUNNER_OS" == "Linux" ]; then + echo "SCOTCH_MAKE=Make.inc/Makefile.inc.x86-64_pc_linux2" >> "$GITHUB_ENV" + echo "FORT_FLG=\"-DCMAKE_Fortran_COMPILER=gfortran-9\"" >> "$GITHUB_ENV" + fi + echo "NJOBS=$NJOBS" >> "$GITHUB_ENV" + # Remark: variable values are still empty inside this context + + shell: bash + env: + NJOBS: "2" + + - name: Set environment variables for output comparison + if: "! contains(github.event.head_commit.message, '[skip output comparison]')" + run: | + echo "C_FLG=\"-DCMAKE_C_FLAGS=-DMMG_COMPARABLE_OUTPUT\"" >> "$GITHUB_ENV" + echo "MMG_ERROR_RULE=\"COMMAND_ERROR_IS_FATAL ANY\"" >> "$GITHUB_ENV" + + - name: Install VTK + # Download vtk only if used + if: matrix.vtk == 'on' + run: | + if [ "$RUNNER_OS" == "macOS" ]; then + brew install vtk + elif [ "$RUNNER_OS" == "Linux" ]; then + sudo sed -i 's/azure\.//' /etc/apt/sources.list + sudo apt-get update + sudo apt-get install -y libvtk7-dev + fi + + - name: Install Sctoch + # Download scotch only if used + if: matrix.scotch == 'on' + run: | + git clone https://gitlab.inria.fr/scotch/scotch.git + cd scotch + git checkout v6.1.3 + cd src + cp ${{ env.SCOTCH_MAKE }} Makefile.inc + make scotch -j ${{ env.NJOBS }} + make install scotch -j ${{ env.NJOBS }} + + - name: Install LibCommons + # LinearElasticity don't build with MSVC + if: runner.os != 'windows' + run: | + git clone https://github.com/ISCDtoolbox/Commons.git + cd Commons + mkdir build + cd build + cmake .. + make install + + - name: Install LinearElasticity + # LinearElasticity don't build with MSVC + if: runner.os != 'windows' + run: | + git clone https://github.com/ISCDtoolbox/LinearElasticity.git + cd LinearElasticity + mkdir build + cd build + cmake .. + make install + + # checkout the provided branch name if workflow is manually run + - uses: actions/checkout@v3 + if: inputs.branch_name + with: + ref: ${{github.event.inputs.branch}} + path: mmg + + # checkout the event branch for automatic workflows + - uses: actions/checkout@v3 + if: inputs.branch_name == '' + with: + path: mmg + + - name: Test compilation with shared libs linkage + run: | + cmake -Smmg -Bbuild_shared \ + ${{ env.C_FLG }} \ + ${{ env.FORT_FLG }} \ + -DCI_CONTEXT=ON \ + -DBUILD_TESTING=ON \ + -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} \ + -DMMG_PATTERN=${{ matrix.pattern }} \ + -DUSE_SCOTCH=${{ matrix.scotch }} \ + -DSCOTCH_DIR=scotch \ + -DUSE_VTK=${{ matrix.vtk }} \ + -DMMG5_INT=${{ matrix.int }} \ + -DBUILD_SHARED_LIBS=ON \ + -DTEST_LIBMMG=ON \ + -DTEST_LIBMMGS=ON \ + -DTEST_LIBMMG2D=ON \ + -DTEST_LIBMMG3D=ON \ + ${{ inputs.add_cmake_cfg_args }} + cmake --build build_shared --config ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }} + shell: bash + + - name: Test compilation without library linkage + run: | + cmake -Smmg -Bbuild_nolibs \ + ${{ env.C_FLG }} \ + ${{ env.FORT_FLG }} \ + -DCI_CONTEXT=ON \ + -DBUILD_TESTING=ON \ + -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} \ + -DMMG_PATTERN=${{ matrix.pattern }} \ + -DUSE_SCOTCH=${{ matrix.scotch }} \ + -DSCOTCH_DIR=scotch \ + -DUSE_VTK=${{ matrix.vtk }} \ + -DMMG5_INT=${{ matrix.int }} \ + -DLIBMMG_STATIC=OFF \ + -DLIBMMGS_STATIC=OFF \ + -DLIBMMG2D_STATIC=OFF \ + -DLIBMMG3D_STATIC=OFF \ + ${{ inputs.add_cmake_cfg_args }} + cmake --build build_nolibs --config ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }} + shell: bash + + - name: Configure Mmg with static libs (default behaviour) + run: | + cmake -Smmg -Bbuild \ + ${{ env.C_FLG }} \ + ${{ env.FORT_FLG }} \ + -DCI_CONTEXT=ON \ + -DBUILD_TESTING=ON \ + -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} \ + -DMMG_PATTERN=${{ matrix.pattern }} \ + -DUSE_SCOTCH=${{ matrix.scotch }} \ + -DSCOTCH_DIR=scotch \ + -DUSE_VTK=${{ matrix.vtk }} \ + -DMMG5_INT=${{ matrix.int }} \ + -DTEST_LIBMMG=ON \ + -DTEST_LIBMMGS=ON \ + -DTEST_LIBMMG2D=ON \ + -DTEST_LIBMMG3D=ON \ + ${{ inputs.add_cmake_cfg_args }} + shell: bash + + - name: Build Mmg + run: | + cmake --build build --config ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }} + + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: Mmg-bin + path: | + build/bin + + - name: Test Mmg with in32_t integers + # Run long tests only with vtk off and int32_t integers + if: matrix.vtk == 'off' && matrix.int == 'int32_t' + run: | + cd build + ctest --timeout 7200 -VV -C ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }} + + - name: Test non native I/Os of Mmg + if: matrix.vtk == 'on' + run: | + cd build + ctest -R "msh|vtk" -VV -C ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }} + + # - name: Archive production artifacts for tests + # if: success() || failure() + # uses: actions/upload-artifact@v2 + # with: + # name: Mmg-tests + # path: | + # build/TEST_OUTPUTS diff --git a/.gitignore b/.gitignore index 3443157f7..4e10d3973 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ src/common/mmg.h include/* *.o + +.DS_Store diff --git a/CMakeLists.txt b/CMakeLists.txt index ee6c3df6a..b50615a4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,16 +28,21 @@ if(DEFINED PROJECT_NAME) endif() INCLUDE(CMakeDependentOption) -INCLUDE(cmake/modules/macros.cmake) PROJECT (mmg) +LIST(APPEND CMAKE_MODULE_PATH + ${PROJECT_SOURCE_DIR}/cmake/modules + ${PROJECT_SOURCE_DIR}/cmake/testing ) + +INCLUDE(macros) + # Executable path SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) -SET(COMMON_SOURCE_DIR ${PROJECT_SOURCE_DIR}/src/common) -SET(COMMON_BINARY_DIR ${PROJECT_BINARY_DIR}/src/common) +SET(MMGCOMMON_SOURCE_DIR ${PROJECT_SOURCE_DIR}/src/common) +SET(MMGCOMMON_BINARY_DIR ${PROJECT_BINARY_DIR}/src/common) -FILE(MAKE_DIRECTORY ${COMMON_BINARY_DIR}) +FILE(MAKE_DIRECTORY ${MMGCOMMON_BINARY_DIR}) # Path toward the continuous integration directory SET ( CI_DIR ${PROJECT_SOURCE_DIR}/ci_tests @@ -57,103 +62,116 @@ include(GNUInstallDirs) ############################################################################### SET (CMAKE_RELEASE_VERSION_MAJOR "5" ) -SET (CMAKE_RELEASE_VERSION_MINOR "6" ) +SET (CMAKE_RELEASE_VERSION_MINOR "7" ) SET (CMAKE_RELEASE_VERSION_PATCH "0" ) -SET (CMAKE_RELEASE_DATE "Nov. 05, 2021" ) +SET (CMAKE_RELEASE_DATE "Dec. 13, 2023" ) SET (CMAKE_RELEASE_VERSION "${CMAKE_RELEASE_VERSION_MAJOR}.${CMAKE_RELEASE_VERSION_MINOR}.${CMAKE_RELEASE_VERSION_PATCH}") ############################################################################### ##### -##### Set preprocessor flag to detect windows architecture and MinGW +##### Set preprocessor flags and manage automatically generated headers data ##### ############################################################################### +# Architecture detection IF (NOT WIN32) - # Set preprocessor flags to say that we are posix and gnu compatible +# Set preprocessor flags to say that we are posix and gnu compatible SET (DEF_POSIX "#define MMG_POSIX") SET (DEF_GNU "#define MMG_GNU") ELSEIF(MINGW) SET (DEF_GNU "#define MMG_GNU") ENDIF () -# Do not print warnings about the use of secure function with MSVC -if ( MSVC ) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) - add_definitions(-Dstrdup=_strdup) -endif() +############################################################################ +##### +##### Integer type +##### +############################################################################ -# Create mmgcmakedefines.h file with the architecture infos and -# the definition ot the USE_POINTMAP flag. +# type of integer +SET (MMG5_INT "int32_t" CACHE STRING "Integer type") +IF (${MMG5_INT} STREQUAL "int64_t") + SET ( DEF_MMG5_INT "#define MMG5_int int64_t") + SET ( DEF_MMG5_PRId "#define MMG5_PRId PRId64") + SET ( DEF_MMG5F_INT "#define MMG5F_INT SELECTED_INT_KIND(18)") + SET ( DEF_MMG_SWPBIN "#define MMG5_SWAPBIN(x) MMG5_swapbin_int(x)") + SET ( DEF_MMG_ABS "#define MMG5_abs(x) (int64_t)labs((int64_t)x)") +ELSE () + SET ( DEF_MMG5_INT "#define MMG5_int int32_t") + SET ( DEF_MMG5_PRId "#define MMG5_PRId PRId32") + SET ( DEF_MMG5F_INT "#define MMG5F_INT SELECTED_INT_KIND(9)") + SET ( DEF_MMG_SWPBIN "#define MMG5_SWAPBIN(x) MMG5_swapbin(x)") + SET ( DEF_MMG_ABS "#define MMG5_abs(x) abs(x)") +ENDIF () + +# Create mmgcmakedefines.h file with the architecture infos and the definition +# ot the USE_POINTMAP flag. Create also mmgcmakedefinesf.h file for automatic +# definition of integer size for Fortran API +############################################################################### +SET(MMG_DYN_LIB ${BUILD_SHARED_LIBS} CACHE INTERNAL "" FORCE) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/common/mmgcmakedefines.h.in ${PROJECT_BINARY_DIR}/src/common/mmgcmakedefines.h @ONLY) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/common/mmgcmakedefinesf.h.in + ${PROJECT_BINARY_DIR}/src/common/mmgcmakedefinesf.h @ONLY) + # Create mmgversion.h file with the release infos CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/common/mmgversion.h.in ${PROJECT_BINARY_DIR}/src/common/mmgversion.h @ONLY) +# Print git hash to source file +IF (NOT WIN32 OR MINGW) + + ADD_CUSTOM_TARGET(GenerateGitHashMmg + COMMAND ./git_log_mmg.sh ${PROJECT_SOURCE_DIR} ${MMGCOMMON_BINARY_DIR} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/scripts/ + COMMENT "Getting git commit hash" + BYPRODUCTS ${MMGCOMMON_BINARY_DIR}/git_log_mmg.h + ) +ENDIF () + ############################################################################### ##### -##### Main CMake compilation variables +##### CMake flags / variables ##### ############################################################################### - -# Find "exotic" compilers -IF (${CMAKE_C_COMPILER} MATCHES Clang OR ${CMAKE_C_COMPILER} MATCHES clang) - # using clang - SET(CMAKE_COMPILER_IS_CLANG TRUE) -ELSEIF(${CMAKE_C_COMPILER} MATCHES Icc OR ${CMAKE_C_COMPILER} MATCHES icc) - # using icc - SET(CMAKE_COMPILER_IS_INTEL TRUE) -ENDIF() - # Hide some options MARK_AS_ADVANCED(CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET CMAKE_OSX_SYSROOT) -IF(CMAKE_COMPILER_IS_GNUCC) - IF(APPLE) - # Add flags to the compiler to work on old mac - ADD_DEFINITIONS( -mmacosx-version-min=10.4 -arch x86_64) - - # To avoid pbs with binary files... - SET(CMAKE_EXE_LINKER_FLAGS "-arch x86_64 ${CMAKE_EXE_LINKER_FLAGS}") - - # Determine if the processor supports 64bit execution - EXECUTE_PROCESS( - COMMAND sysctl hw.cpu64bit_capable - ERROR_QUIET - OUTPUT_VARIABLE 64_CMD - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - STRING(REGEX REPLACE "^hw.cpu64bit_capable: (.*)" "\\1" 64_BIT "${64_CMD}") - # ELSEIF(UNIX)# UNIX must be after APPLE becaus APPLE is UNIX too - ENDIF() +include(add_build_types) + +# List CMake build types +IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + MESSAGE(STATUS "Setting build type to 'Release' as none was specified.") + SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + "MinSizeRel" "RelWithDebInfo" "Maintainer" "RelWithAssert") +ELSEIF( CMAKE_CONFIGURATION_TYPES ) + LIST(APPEND CMAKE_CONFIGURATION_TYPES Maintainer RelWithAssert ) ENDIF() -CMAKE_DEPENDENT_OPTION ( PROFILING "Enable/Disable PROFILING" OFF - "CMAKE_COMPILER_IS_GNUCC" OFF ) +# Explicitly set the DNDEBUG flag in case the user or a parent project overrides +# it. +if (NOT CMAKE_BUILD_TYPE MATCHES Debug AND NOT CMAKE_BUILD_TYPE MATCHES RelWithAssert) + add_definitions(-DNDEBUG) +endif() -IF(PROFILING) - ADD_DEFINITIONS(-pg) - SET(CMAKE_EXE_LINKER_FLAGS "-pg ${CMAKE_EXE_LINKER_FLAGS}") -ENDIF(PROFILING) +# Do not print warnings about the use of secure function with MSVC and the use +# of POSIX strdup +if ( MSVC ) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + add_definitions(-Dstrdup=_strdup) +endif() ############################################################################### ##### ##### Choose executable target to compile ##### ############################################################################### -IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - MESSAGE(STATUS "Setting build type to 'Release' as none was specified.") - seT(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) - # Set the possible values of build type for cmake-gui - SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" - "MinSizeRel" "RelWithDebInfo") - SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE}) -ENDIF() - SET ( BUILD "MMG" CACHE STRING "\"MMG3D\", \"MMGS\",\"MMG2D\", or \"MMG\" to compile both MMGS, MMG3D and MMG2D" ) @@ -191,12 +209,10 @@ ELSE () SET(BUILD_MMGS3D OFF) ENDIF() -# Explicitly set the DNDEBUG flag in case the user or a parent project overrides -# it. -if (NOT CMAKE_BUILD_TYPE MATCHES Debug) - add_definitions(-DNDEBUG) -endif() - +FIND_PACKAGE(Perl) +IF (NOT PERL_FOUND) + message(WARNING "Perl not found -> we do not generate Fortran Headers") +ENDIF(NOT PERL_FOUND) ############################################################################ ##### ##### Fortran header: libmmgtypesf.h @@ -204,11 +220,13 @@ endif() ############################################################################ ADD_EXECUTABLE(genheader ${PROJECT_SOURCE_DIR}/scripts/genheader.c) TARGET_LINK_LIBRARIES ( genheader PRIVATE ${LIBRARIES} ) -GENERATE_FORTRAN_HEADER ( mmg - ${COMMON_SOURCE_DIR} libmmgtypes.h - ${COMMON_BINARY_DIR} - ${COMMON_BINARY_DIR} libmmgtypesf.h - ) +IF (PERL_FOUND) + GENERATE_FORTRAN_HEADER ( mmg + ${MMGCOMMON_SOURCE_DIR} libmmgtypes.h + ${MMGCOMMON_BINARY_DIR} + ${MMGCOMMON_BINARY_DIR} libmmgtypesf.h + ) +ENDIF (PERL_FOUND) ############################################################################### ##### @@ -228,6 +246,7 @@ IF ( NOT (WIN32 OR MINGW) ) SET( LIBRARIES ${M_LIB} ${LIBRARIES}) ENDIF() + ############################################################################ ##### ##### Point map @@ -239,60 +258,10 @@ OPTION ( USE_POINTMAP "Use map for point tracking" OFF ) ############################################################################ ##### -##### Scotch -##### -############################################################################ -# Find SCOTCH library? -SET(SCOTCH_DIR "" CACHE PATH "Installation directory for scotch") -LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules) - -# add Scotch library? -OPTION ( USE_SCOTCH "Use SCOTCH TOOL for renumbering" ON ) - -IF ( USE_SCOTCH ) - FIND_PACKAGE(SCOTCH) - - IF ( NOT SCOTCH_FOUND ) - MESSAGE ( WARNING "Scotch library not found:" - "Using scotch reduce the execution time of mmg3d " - "(see https://gforge.inria.fr/frs/?group_id=248 to download it)." - "If you have already installed Scotch and want to use it, " - "please set the CMake variable or environment variable SCOTCH_DIR " - "to your scotch directory.") - ENDIF ( ) -ENDIF ( ) - -# add LinearElasticity library? -SET(ELAS_DIR "" CACHE PATH "Installation directory for Elas") -OPTION ( - USE_ELAS "Use the Elas library for lagrangian motion option" ON ) - -IF ( USE_ELAS ) - INCLUDE(cmake/modules/FindElas.cmake) - IF ( NOT ELAS_FOUND ) - MESSAGE ( WARNING "Elas is a library to solve the linear elasticity " - "problem (see https://github.com/ISCDtoolbox/LinearElasticity to" - " download it). " - "This library is needed to use the lagrangian motion option. " - "If you have already installed Elas and want to use it, " - "please set the CMake variable or environment variable ELAS_DIR " - "to your Elas directory.") - ENDIF ( ) -ENDIF ( ) - -############################################################################ -##### -##### VTK (to parse (p)vtp/(p)vtu files ) +##### Search for optional libraries: scotch, vtk, linearelasticity ##### ############################################################################ -# add the VTK library ? -OPTION ( USE_VTK "Use VTK I/O" ON ) -IF ( USE_VTK ) - FIND_PACKAGE(VTK QUIET) - IF ( NOT VTK_FOUND ) - MESSAGE ( WARNING "VTK library not found: vtk I/O will not be available.") - ENDIF ( ) -ENDIF ( ) +INCLUDE(optional-dependencies) ############################################################################ ##### @@ -304,196 +273,25 @@ SET(CMAKE_MACOSX_RPATH 1) ############################################################################### ##### -##### Add dependent options +##### Add Mmg options ##### ############################################################################### -FUNCTION (INVERT_BOOL OUTVAR INVAR) - IF(${INVAR}) - SET(${OUTVAR} OFF PARENT_SCOPE) - ELSE() - SET(${OUTVAR} ON PARENT_SCOPE) - ENDIF() -ENDFUNCTION() - -OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF) -INVERT_BOOL("BUILD_STATIC_LIBS" ${BUILD_SHARED_LIBS}) -IF ( (${BUILD_STATIC_LIBS} EQUAL ON) AND NOT CMAKE_POSITION_INDEPENDENT_CODE) - SET(CMAKE_POSITION_INDEPENDENT_CODE ON) -ENDIF() - -#------------------------------- mmg2d -CMAKE_DEPENDENT_OPTION ( LIBMMG2D_STATIC "Compile the mmg2d static library" ${BUILD_STATIC_LIBS} - "BUILD_MMG2D" OFF) -CMAKE_DEPENDENT_OPTION ( LIBMMG2D_SHARED "Compile the mmg2d dynamic library" ${BUILD_SHARED_LIBS} - "BUILD_MMG2D" OFF ) -IF (LIBMMG2D_STATIC OR LIBMMG2D_SHARED) - SET(LIBMMG2D_INTERNAL ON ) -ELSE() - SET(LIBMMG2D_INTERNAL OFF ) -ENDIF() -CMAKE_DEPENDENT_OPTION ( - TEST_LIBMMG2D "Compile tests for the mmg2d library" OFF - "BUILD_MMG2D;LIBMMG2D_INTERNAL" OFF - ) - -CMAKE_DEPENDENT_OPTION( - MMG2D_CI "Enable/Disable continuous integration for mmg2d" ON - "BUILD_TESTING;BUILD_MMG2D" OFF) - -#------------------------------- mmgs -CMAKE_DEPENDENT_OPTION ( LIBMMGS_STATIC "Compile the mmgs static library" ${BUILD_STATIC_LIBS} - "BUILD_MMGS" OFF) -CMAKE_DEPENDENT_OPTION ( LIBMMGS_SHARED "Compile the mmgs dynamic library" ${BUILD_SHARED_LIBS} - "BUILD_MMGS" OFF) -IF (LIBMMGS_STATIC OR LIBMMGS_SHARED) - SET(LIBMMGS_INTERNAL ON ) -ELSE() - SET(LIBMMGS_INTERNAL OFF ) -ENDIF() -CMAKE_DEPENDENT_OPTION ( - TEST_LIBMMGS "Compile tests for the mmgs library" OFF - "LIBMMGS_INTERNAL;BUILD_MMGS" OFF - ) - -CMAKE_DEPENDENT_OPTION( - MMGS_CI "Enable/Disable continuous integration for mmgs" ON - "BUILD_TESTING;BUILD_MMGS" OFF ) - -#------------------------------- mmg3d -CMAKE_DEPENDENT_OPTION ( LIBMMG3D_STATIC "Compile the mmg3d static library" ${BUILD_STATIC_LIBS} - "BUILD_MMG3D" OFF) -CMAKE_DEPENDENT_OPTION ( LIBMMG3D_SHARED "Compile the mmg3d dynamic library" ${BUILD_SHARED_LIBS} - "BUILD_MMG3D" OFF ) -IF (LIBMMG3D_STATIC OR LIBMMG3D_SHARED) - SET(LIBMMG3D_INTERNAL ON ) -ELSE() - SET(LIBMMG3D_INTERNAL OFF ) -ENDIF() -CMAKE_DEPENDENT_OPTION ( - TEST_LIBMMG3D "Compile tests for the mmg3d library" OFF - "BUILD_MMG3D;LIBMMG3D_INTERNAL" OFF - ) -CMAKE_DEPENDENT_OPTION( - MMG3D_CI "Enable/Disable continuous integration for mmg3d" ON - "BUILD_TESTING;BUILD_MMG3D" OFF) - -CMAKE_DEPENDENT_OPTION ( PATTERN - "If ON, insertion by patterns, otherwise insertion by delaunay kernel" - OFF - "BUILD_MMG3D" OFF) -#-- Remove the next line to have this option visible in basic cmake mode -MARK_AS_ADVANCED(PATTERN) - - -IF( SCOTCH_FOUND ) - SET(CMAKE_C_FLAGS "-DUSE_SCOTCH ${CMAKE_C_FLAGS}") - - MESSAGE(STATUS - "Compilation with scotch: ${SCOTCH_LIBRARIES}") - SET( LIBRARIES ${SCOTCH_LIBRARIES} ${LIBRARIES}) -ENDIF() - - -IF ( VTK_FOUND ) - ADD_DEFINITIONS(-DUSE_VTK) - - MESSAGE ( STATUS "Compilation with VTK: add vtk, vtp and vtu I/O." ) - - IF( "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" LESS 8.90 ) - INCLUDE ( ${VTK_USE_FILE} ) - ENDIF() - - SET( LIBRARIES ${VTK_LIBRARIES} ${LIBRARIES} ) -ENDIF ( ) - -#---------------------------- mmg library gathering mmg2d, mmgs and mmg3d libs -CMAKE_DEPENDENT_OPTION ( LIBMMG_STATIC - "Compile the mmg static library (mmg2d + mmgs + mmg3d)" ${BUILD_STATIC_LIBS} - "BUILD_MMG" OFF) -CMAKE_DEPENDENT_OPTION ( LIBMMG_SHARED - "Compile the mmg dynamic library (mmg2d + mmgs + mmg3d)" ${BUILD_SHARED_LIBS} - "BUILD_MMG" OFF ) -IF (LIBMMG_STATIC OR LIBMMG_SHARED) - SET(LIBMMG_INTERNAL ON ) -ELSE() - SET(LIBMMG_INTERNAL OFF ) -ENDIF() -CMAKE_DEPENDENT_OPTION ( - TEST_LIBMMG "Compile tests for the mmg library" OFF - "BUILD_MMG;LIBMMG_INTERNAL" OFF - ) -CMAKE_DEPENDENT_OPTION( - MMG_CI "Enable/Disable continuous integration for mmg" ON - "BUILD_TESTING;BUILD_MMG" OFF) - +INCLUDE(add-mmg-options) ############################################################################### ##### ##### Build Targets and libmmg if needed ##### ############################################################################### -SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) - -# CTEST_OUTPUT_DIR MUST BE SETTED HERE TO AVOID UNINITIALIZATION FOR LIBRARY -# TESTS DEFS -OPTION ( BUILD_TESTING "Enable/Disable continuous integration" OFF ) - -IF( BUILD_TESTING ) - SET ( CTEST_OUTPUT_DIR ${PROJECT_BINARY_DIR}/TEST_OUTPUTS - CACHE PATH "Path toward the tests outputs" ) - MARK_AS_ADVANCED ( CTEST_OUTPUT_DIR ) - FILE ( MAKE_DIRECTORY ${CTEST_OUTPUT_DIR} ) -ENDIF ( ) - -IF ( BUILD_MMG2D ) - INCLUDE(cmake/modules/mmg2d.cmake) -ENDIF ( ) - -IF ( BUILD_MMGS ) - INCLUDE(cmake/modules/mmgs.cmake) -ENDIF ( ) - -IF ( BUILD_MMG3D ) - INCLUDE(cmake/modules/mmg3d.cmake) -ENDIF ( ) - -IF ( BUILD_MMG ) - INCLUDE(cmake/modules/mmg.cmake) -ENDIF ( ) - -IF( SCOTCH_FOUND ) - # Include Scotch Dir here to ensure that Mmg doesn't search it's own headers in /usr/local - INCLUDE_DIRECTORIES(${SCOTCH_INCLUDE_DIRS}) -ENDIF() - -IF ( MmgTargetsExported ) - set( MMG_CMAKE_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/mmg ) - configure_package_config_file(cmake/config/mmgConfig.cmake.in - ${PROJECT_BINARY_DIR}/mmgConfig.cmake - INSTALL_DESTINATION ${MMG_CMAKE_INSTALL_DIR} ) - - install(EXPORT MmgTargets - FILE MmgTargets.cmake - NAMESPACE Mmg:: - DESTINATION ${MMG_CMAKE_INSTALL_DIR} - ) - install(FILES ${PROJECT_BINARY_DIR}/mmgConfig.cmake - DESTINATION ${MMG_CMAKE_INSTALL_DIR} ) - - install(FILES - ${PROJECT_SOURCE_DIR}/cmake/modules/FindSCOTCH.cmake - ${PROJECT_SOURCE_DIR}/cmake/modules/FindElas.cmake - DESTINATION ${MMG_CMAKE_INSTALL_DIR} ) -ENDIF() +INCLUDE(build-targets) ############################################################################### ##### ##### Continuous integration ##### ############################################################################### - CMAKE_DEPENDENT_OPTION ( ONLY_VERY_SHORT_TESTS "Enable/Disable very short tests" OFF "BUILD_TESTING;NOT LONG_TESTS" OFF ) @@ -504,197 +302,41 @@ CMAKE_DEPENDENT_OPTION ( "BUILD_TESTING" OFF ) MARK_AS_ADVANCED(LONG_TESTS) -CMAKE_DEPENDENT_OPTION ( COVERAGE "Watch code coverage (Linux only)" OFF -"BUILD_TESTING;CMAKE_COMPILER_IS_GNUCC" OFF ) - IF( BUILD_TESTING ) IF ( NOT ONLY_VERY_SHORT_TESTS ) - ##-------------------------------------------------------------------## - ##------- Get the continuous integration tests ----------------------## - ##-------------------------------------------------------------------## - INCLUDE(cmake/modules/LoadCiTests.cmake) + # Get the continuous integration tests + INCLUDE(LoadCiTests) ENDIF ( ) - ##-------------------------------------------------------------------## - ##------- Set the continuous integration options --------------------## - ##-------------------------------------------------------------------## - + # Set the continuous integration options SET ( MMG_CI_TESTS ${CI_DIR}/mmg ) - # Remove the --show-reachable=yes option from the default valgrind command - SET(VALGRIND_COMMAND_OPTIONS "-q --tool=memcheck ") - SET(VALGRIND_COMMAND_OPTIONS "--leak-check=yes ${VALGRIND_COMMAND_OPTIONS}") - SET(VALGRIND_COMMAND_OPTIONS "--workaround-gcc296-bugs=yes ${VALGRIND_COMMAND_OPTIONS}") - SET(VALGRIND_COMMAND_OPTIONS "--num-callers=100 ${VALGRIND_COMMAND_OPTIONS}") - - # Ignore errors coming from the libmesh library - IF(APPLE) - # and errors from the libSystem.B library - SET(MEMORYCHECK_SUPPRESSIONS_FILE - "${PROJECT_SOURCE_DIR}/cmake/Supp/libSystem.supp") - ENDIF(APPLE) # Copy config file and custom file in the good directories CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/config/CTestCustom.cmake ./CTestCustom.cmake) - # Max time for test case - SET(DART_TESTING_TIMEOUT 2500 FORCE) - ENABLE_TESTING() INCLUDE(CTest) - IF ( COVERAGE ) - # Add coverage flags - SET(CMAKE_C_FLAGS_DEBUG " -fprofile-arcs ${CMAKE_C_FLAGS_DEBUG}") - SET(CMAKE_C_FLAGS_DEBUG " -ftest-coverage ${CMAKE_C_FLAGS_DEBUG}") - SET(CMAKE_C_FLAGS_DEBUG " --coverage ${CMAKE_C_FLAGS_DEBUG}") - SET(CMAKE_EXE_LINKER_FLAGS_DEBUG " -fprofile-arcs ${CMAKE_EXE_LINKER_FLAGS_DEBUG}") - SET(CMAKE_EXE_LINKER_FLAGS_DEBUG " -ftest-coverage ${CMAKE_EXE_LINKER_FLAGS_DEBUG}") - SET(CMAKE_EXE_LINKER_FLAGS_DEBUG " --coverage ${CMAKE_EXE_LINKER_FLAGS_DEBUG}") - ENDIF() - - IF ( CMAKE_COMPILER_IS_GNUCC ) - SET(CMAKE_C_FLAGS_DEBUG "-g -Wall ${CMAKE_C_FLAGS_DEBUG}") - SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g ${CMAKE_EXE_LINKER_FLAGS_DEBUG}") - ELSEIF( CMAKE_COMPILER_IS_CLANG ) - SET(CMAKE_C_FLAGS_DEBUG "-g -Weverything -Wno-sign-conversion") - SET(${CMAKE_C_FLAGS_DEBUG} "-Wno-char-subscripts -Wno-padded " - ${CMAKE_C_FLAGS_DEBUG}) - SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g ${CMAKE_EXE_LINKER_FLAGS_DEBUG}") - ENDIF ( ) - IF ( ( MMG3D_CI OR MMGS_CI ) AND NOT ONLY_VERY_SHORT_TESTS ) - SET(LISTEXEC_MMG ${LISTEXEC_MMGS} ${LISTEXEC_MMG3D}) - SET(EXECUT_MMG ${EXECUT_MMGS} ${EXECUT_MMG3D}) - - # Make some files not openable - IF ( EXISTS ${CTEST_OUTPUT_DIR}/unwrittable7.meshb - AND NOT IS_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable7.meshb ) - FILE ( REMOVE ${CTEST_OUTPUT_DIR}/unwrittable7.meshb ) - ENDIF () - IF ( NOT EXISTS ${CTEST_OUTPUT_DIR}/unwrittable7.meshb) - FILE(MAKE_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable7.meshb) - ENDIF() - - IF ( EXISTS ${CTEST_OUTPUT_DIR}/unwrittable8.sol - AND NOT IS_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable8.sol ) - FILE ( REMOVE ${CTEST_OUTPUT_DIR}/unwrittable8.sol ) - ENDIF () - IF ( NOT EXISTS ${CTEST_OUTPUT_DIR}/unwrittable8.sol) - FILE(MAKE_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable8.sol) - ENDIF() - # Add common tests for mmgs/3d appli - INCLUDE( ${PROJECT_SOURCE_DIR}/cmake/testing/mmg_tests.cmake ) + INCLUDE( mmg_tests ) ENDIF ( ) ENDIF ( BUILD_TESTING ) -############################################################################ -##### -##### Print git hash to source file -##### -############################################################################ - -IF (NOT WIN32 OR MINGW) - - ADD_CUSTOM_TARGET(GenerateGitHash - COMMAND ./git_log_mmg.sh ${PROJECT_SOURCE_DIR} ${COMMON_BINARY_DIR} - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/scripts/ - COMMENT "Getting git commit hash" - ) -ENDIF () - ############################################################################### ##### ##### Create API Documentation ##### ############################################################################### -FIND_PACKAGE(Doxygen) -IF(DOXYGEN_FOUND) - - # MMG2D Documentation - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg2d/Doxyfile.in - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg2d/Doxyfile @ONLY) - - SET(MMG2DDOC_DIR ${PROJECT_BINARY_DIR}/doc/mmg2d) - SET(MMGSDOC_DIR ${PROJECT_BINARY_DIR}/doc/mmgs) - SET(MMG3DDOC_DIR ${PROJECT_BINARY_DIR}/doc/mmg3d) - - FILE(MAKE_DIRECTORY ${MMG2DDOC_DIR}) - FILE(MAKE_DIRECTORY ${MMGSDOC_DIR}) - FILE(MAKE_DIRECTORY ${MMG3DDOC_DIR}) - - ADD_CUSTOM_TARGET(mmg2d_doc - COMMAND ${DOXYGEN_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg2d/Doxyfile - WORKING_DIRECTORY ${MMG2DDOC_DIR} - COMMENT "Generating MMG2D API - documentation with Doxygen. Open up the - ${MMG2DDOC_DIR}/html/index.html file to see - it." VERBATIM ) - - # MMGS Documentation - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmgs/Doxyfile.in - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmgs/Doxyfile @ONLY) - ADD_CUSTOM_TARGET(mmgs_doc - COMMAND ${DOXYGEN_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmgs/Doxyfile - WORKING_DIRECTORY ${MMGSDOC_DIR} - COMMENT "Generating MMGS API - documentation with Doxygen. Open up the - ${MMGSDOC_DIR}/html/index.html file to see - it." VERBATIM ) - - # MMG3D Documentation - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg3d/Doxyfile.in - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg3d/Doxyfile @ONLY) - ADD_CUSTOM_TARGET(mmg3d_doc - COMMAND ${DOXYGEN_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg3d/Doxyfile - WORKING_DIRECTORY ${MMG3DDOC_DIR} - COMMENT "Generating MMG3D API documentation with Doxygen. Open up the - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg3d/html/index.html file to see - it" VERBATIM ) - - if ( NOT TARGET doc ) - ADD_CUSTOM_TARGET(doc DEPENDS mmgs_doc mmg3d_doc mmg2d_doc COMMENT "Generating - MMG API documentation with Doxygen. Open up the - ${PROJECT_BINARY_DIR}/doc/mmg*/html/index.html file to see it" - VERBATIM ) - else() - add_dependencies( doc mmgs_doc mmg3d_doc mmg2d_doc ) - endif() -ENDIF ( DOXYGEN_FOUND ) +include(doxygen) ############################################################################### ##### ##### Create Package ##### ############################################################################### -INCLUDE(InstallRequiredSystemLibraries) -SET( CPACK_ARCHIVE_COMPONENT_INSTALL ON ) -SET( CPACK_COMPONENT_ALL appli ) -SET( CPACK_SOURCE_GENERATOR TGZ ) -SET( CPACK_GENERATOR TGZ ) - -SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) -SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1) -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MMG: 2d, surface and 3d remeshers") -SET(CPACK_PACKAGE_VENDOR "Cécile Dobrzynski, Pascal Frey, Charles Dapogny," - " Algiane Froehly") -SET(CPACK_PACKAGE_CONTACT "contact@mmgtools.org") -SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md") -SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") -SET(CPACK_PACKAGE_VERSION ${CMAKE_RELEASE_VERSION}) -SET(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_RELEASE_VERSION_MAJOR}) -SET(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_RELEASE_VERSION_MINOR}) -SET(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_RELEASE_VERSION_PATCH}) -SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") -SET(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_INSTALL_DIRECTORY}-${CMAKE_SYSTEM}) -SET(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}") -SET(CPACK_OUTPUT_FILE_PREFIX "../archives") - -INCLUDE(CPack) +include(packages) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32602d3a3..9a93aafc1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ Additionaly, it is a good practice to include text inside the routine to explain You can refer to the [Doxygen documentation](http://www.stack.nl/~dimitri/doxygen/) for a description of the **Doxygen** commands. #### API's functions -Because the library header for Fortran users is automatically generated from the C header, you must add to your documentation the interface of the fortran function. Each line of this interface must begin with the **>** symbol and end with the **\n** one. +Because the library header for Fortran users is automatically generated from the C header, you must add to your documentation the interface of the fortran function. Each line of this interface must begin with the `>` symbol and end with the `\n` one. For example, if the previous function is an API function, its documentation becames the following: ```c @@ -50,43 +50,45 @@ For example, if the previous function is an API function, its documentation beca ``` ### 2) Where -Please, comments only your functions in the **.c** file, except for the **API**'s functions that must be documentated in the suitable **_libmmg*.h_** file (and only here). +Please, comments only your functions in the `.c` file, except for the **API**'s functions that must be documentated in the suitable `libmmg.h` file (and only here). ## II/ Memory management: dynamic allocations and deallocations We need to control the memory consumption in our applications so the memory used by dynamic allocations is counted and updated at each allocation and deallocation. Note that with a high verbosity (at least 6), you can check that at the end of the process the memory count is 0. -To make the update of memory consumption easier, we have wrapped the **malloc**, **calloc**, **realloc** and **free** functions into macros that must be called in place of the matching function. +To make the update of memory consumption easier, we have wrapped the `malloc`, `calloc`, `realloc` and `free` functions into macros that must be called in place of the matching function. -| **_C function_** | **_Mmg macro_** | +| `C function` | `Mmg macro` | |----------------------|-----------------------------------| -| ``ptr = (type *) malloc(size*sizeof(type));`` | ``_MMG5_SAFE_MALLOC(ptr,size,type);`` | -| ``ptr = (type *) calloc(size,sizeof(type));`` | ``_MMG5_SAFE_CALLOC(ptr,size,type);`` | -| ``ptr = (type *) realloc(ptr,size*sizeof(type));``
``if ( high_verbosity )``
    ``printf(" ## Warning:%s:%d: %s reallocation.\n",__FILE__,__LINE__,tab_info);``| ``_MMG5_SAFE_REALLOC(ptr,size,type,tab_info);`` | -| ``Decrease_memory_count(size); ``
``free(ptr); ptr = NULL; ``| ``_MMG5_DEL_MEM(mesh,ptr,size)``| +| `ptr = (type *) malloc(size*sizeof(type));` | `MMG5_SAFE_MALLOC(ptr,size,type,law);` | +| `ptr = (type *) calloc(size,sizeof(type));` | `MMG5_SAFE_CALLOC(ptr,size,type,law);` | +| `ptr = (type *) realloc(ptr,size*sizeof(type));`
`if ( high_verbosity )`
    `printf(" ## Warning:%s:%d: %s reallocation.\n",__FILE__,__LINE__,tab_info);`| `MMG5_SAFE_REALLOC(ptr,prevSize,newSize,type,tab_name,law);` | +| `Decrease_memory_count(size); `
`free(ptr); ptr = NULL; `| `MMG5_DEL_MEM(mesh,ptr)`| + +Note that other macros which aims to help to manage the memory have been implemented. ### 1) Allocations -To check that we have enough memory to allocate a pointer of size **_siz_** and to increment the memory counter, you must precede your allocation by a call to the **_MMG5_ADD_MEM(mesh, siz, tab_info, law)** macro. +To check that we have enough memory to allocate a pointer of size `siz` and to increment the memory counter, you must precede your allocation by a call to the `MMG5_ADD_MEM(mesh, siz, "tab_name", law)` macro. For example, the following allocation: ```c Increase_memory_count(5*sizeof(double)); ptr = (double *) malloc (5*sizeof(double)); if ( !ptr ) { - fprintf(stdout," ## Error: unable to allocate ""table of double""."); + fprintf(stdout," ## Error: unable to allocate my array."); exit(EXIT_FAILURE); } ``` must be replaced by the following one in the **Mmg** code: -```c -_MMG5_ADD_MEM(mesh,5*sizeof(double),"table of double",exit(EXIT_FAILURE)); -_MMG5_SAFE_MALLOC(ptr,5,double); +```c +MMG5_ADD_MEM(mesh,5*sizeof(double),"my array",exit(EXIT_FAILURE)); +MMG5_SAFE_MALLOC(ptr,5,double,exit(EXIT_FAILURE)); ``` ### 2) Deallocations -To decrement the memory counter, to deallocate your pointer and to leave it pointing toward ``NULL``, you just need to call the ``MMG5_DEL_MEM(mesh,ptr,siz)`` macro. +To decrement the memory counter, to deallocate your pointer and to leave it pointing toward `NULL`, you just need to call the `MMG5_DEL_MEM(mesh,ptr)` macro. To deallocate the memory allocated in the previous example, instead of the following code: ```c @@ -96,7 +98,7 @@ ptr = NULL; ``` just write: ```c -MMG5_DEL_MEM(mesh,ptr,5*sizeof(double)); +MMG5_DEL_MEM(mesh,ptr); ``` ## III/ Coding style @@ -110,4 +112,4 @@ Besides, try to respect the following rules: * declaration of variables in the top of the function; * do not use exit(), use a return value instead; * do not implement void API function; - * the main library functions returns MMG*_SUCCESS if success, MMG*_LOWFAILURE if fails but we can save the mesh, MMG*_STRONGFAILURE if fails and we can't save a conform mesh; + * the main library functions returns `MMG_SUCCESS` if success, `MMG_LOWFAILURE` if fails but we can save the mesh, `MMG_STRONGFAILURE` if fails and we can't save a conform mesh; diff --git a/README.md b/README.md index 6e2b7f74b..8f465ed58 100644 --- a/README.md +++ b/README.md @@ -26,35 +26,35 @@ |**develop branch**|[![Build Status][dev-build]][dev-sq-build]|[![Quality Gate][dev-qual-gate]][dev-sq-qual-gate]|[![Vulnerabilities][dev-vulnerabilities]][dev-sq-vulnerabilities]|[![Coverage][dev-coverage]][dev-sq-coverage]|[![Duplication (%)][dev-code-dpl]][dev-sq-code-dpl]| -[master-build]: https://ci.inria.fr/mmg/buildStatus/icon?job=Mmg-multiConf-master -[master-sq-build]: https://ci.inria.fr/mmg/job/Mmg-multiConf-master +[master-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml/badge.svg?branch=master +[master-sq-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml?query=branch%3Amaster -[master-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/badges/gate?key=cardamom%3Ammg%3Agithub%3Amaster +[master-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Amaster&metric=alert_status [master-sq-qual-gate]: https://sonarqube.inria.fr/sonarqube/dashboard?id=cardamom%3Ammg%3Agithub%3Amaster -[master-vulnerabilities]: https://img.shields.io/sonar/vulnerabilities/cardamom:mmg:github:master?server=https%3A%2F%2Fsonarqube.inria.fr%2Fsonarqube -[master-sq-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=vulnerabilities +[master-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Amaster&metric=reliability_rating +[master-sq-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=reliability -[master-coverage]:https://img.shields.io/sonar/coverage/cardamom:mmg:github:master?server=https%3A%2F%2Fsonarqube.inria.fr%2Fsonarqube +[master-coverage]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Amaster&metric=coverage [master-sq-coverage]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=coverage -[master-code-dpl]:https://sonarqube.inria.fr/sonarqube/api/badges/measure?key=cardamom%3Ammg%3Agithub%3Amaster&metric=duplicated_lines_density +[master-code-dpl]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Amaster&metric=duplicated_lines_density [master-sq-code-dpl]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=duplications -[dev-build]: https://ci.inria.fr/mmg/buildStatus/icon?job=Mmg-multiConf -[dev-sq-build]: https://ci.inria.fr/mmg/job/Mmg-multiConf +[dev-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml/badge.svg?branch=develop +[dev-sq-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml?query=branch%3Adevelop -[dev-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/badges/gate?key=cardamom%3Ammg%3Agithub%3Adevelop +[dev-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=alert_status [dev-sq-qual-gate]: https://sonarqube.inria.fr/sonarqube/dashboard?id=cardamom%3Ammg%3Agithub%3Adevelop -[dev-vulnerabilities]: https://img.shields.io/sonar/vulnerabilities/cardamom:mmg:github:develop?server=https%3A%2F%2Fsonarqube.inria.fr%2Fsonarqube -[dev-sq-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Adevelop&metric=vulnerabilities +[dev-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=reliability_rating +[dev-sq-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Adevelop&metric=reliability -[dev-coverage]:https://img.shields.io/sonar/coverage/cardamom:mmg:github:develop?server=https%3A%2F%2Fsonarqube.inria.fr%2Fsonarqube +[dev-coverage]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=coverage [dev-sq-coverage]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Adevelop&metric=coverage -[dev-code-dpl]:https://sonarqube.inria.fr/sonarqube/api/badges/measure?key=cardamom%3Ammg%3Agithub%3Adevelop&metric=duplicated_lines_density +[dev-code-dpl]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=duplicated_lines_density [dev-sq-code-dpl]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Adevelop&metric=duplications --- @@ -83,7 +83,7 @@ To get and build Mmg, you will need: once CMake is installed, please do not forget to mark the option: ``` - "Add CMake to the system PATH for all users" + Add CMake to the system PATH for all users ``` @@ -91,22 +91,22 @@ To get and build Mmg, you will need: #### Unix-like OS (Linux, MacOS...) 1. Get the repository: - ```Shell +``` wget https://github.com/MmgTools/mmg/archive/master.zip ``` or - ```Shell +``` git clone https://github.com/MmgTools/mmg.git ``` - The project sources are available under the **_src/_** directory, see: - * **_src/mmg2d/_** for files related to the mmg2d application; - * **_src/mmgs/_** for files related to the mmgs application; - * **_src/mmg3d/_** for files related to the mmg3d application; - * **_src/common/_** for files related to the both. + The project sources are available under the **src/** directory, see: + * **src/mmg2d/** for files related to the mmg2d application; + * **src/mmgs/** for files related to the mmgs application; + * **src/mmg3d/** for files related to the mmg3d application; + * **src/common/** for files related to the both. 2. Fast compilation (build both **mmg2d**, **mmgs**, **mmg3d**, the mmg2d static library (**libmmg3d.a**), the mmgs static library (**libmmgs.a**), the mmg3d static library (**libmmg3d.a**) and the mmg static library (**libmmg.a**)): -```Shell +``` cd mmg mkdir build cd build @@ -132,15 +132,15 @@ commands in cmd, create directories, etc...). Universal windows platform development 1. Get the **Visual Studio** software: it can be downloaded [here](https://www.visualstudio.com/downloads/); - 2. if not done during the previous step, download **C/C++** compilers: in the Visual Studio searching zone, search **C compiler** and install the **"Visual C++ compilers and libraries"** (individual componant) and the MSBuild componant; + 2. if not done during the previous step, download **C/C++** compilers: in the Visual Studio searching zone, search **C compiler** and install the **Visual C++ compilers and libraries** (individual componant) and the MSBuild componant; - 3. in the Visual Studio searching zone, search the **git** word and select the installation of the **"GitHub extension for VisualStudio"**; + 3. in the Visual Studio searching zone, search the **git** word and select the installation of the **GitHub extension for VisualStudio**; 4. stay in VisualStudio and clone the Mmg repository from the following url: https://github.com/MmgTools/mmg.git; 5. Use **CMake** to configure and generate your project. It can be done either with the graphic mode of CMake (you have to select the "VisualStudio" generator) or with a command line. In this case, it is highly recommended to specify that you intent to build a VisualStudio project. For example, if you are using VisualStudio 2017: - ```Shell + ``` cmake -G "Visual Studio 15 2017 Win64" ^ configure ``` @@ -158,14 +158,14 @@ Universal windows platform development 1. Get a **C Compiler**: * **MinGW** can be downloaded [here](http://mingw.org/). We recommand to install the *mingw-developer-tools*, *mingw32-base*, *mingw32-gcc-fortran*, *mingw32-gcc-g++* and *msys-base* packages; * Edit the environment variables and add MinGW in your **PATH** variable. It can be done in the **advanced system settings** panel. (note that you must modify the **PATH** variable, not the **Path** one); - * **MinGW** binaries are probably in **C:\MinGW\bin** - * the MinGW terminal is in **C:\MinGW\msys\1.0\msys** + * **MinGW** binaries are probably in `C:\MinGW\bin` + * the MinGW terminal is in `C:\MinGW\msys\1.0\msys` 2. Clone the Mmg repository from the following url: https://github.com/MmgTools/mmg.git; 3. Quit and restart the *CMake* application to take the PATH modification into account then use CMake to configure and generate your project (select the MinGW Makefiles generator of CMake). If you have installed the scotch libraries, you will need to set explicitely the libraries paths; - 4. Build the Mmg applications: in the minGW prompt (**C:\MinGW\msys\1.0\msys**) run: -```Shell + 4. Build the Mmg applications: in the minGW prompt (`C:\MinGW\msys\1.0\msys`) run: +``` mingw32-make ``` @@ -175,23 +175,23 @@ Again, if you use some specific options and want to make the CMake configuration ### Project's web page Project's actualities and software tutorials can be found on the [mmgtools](http://www.mmgtools.org) web page. -### **Mmg**'s forum +### Mmg's forum Share your comments and issues with other members of the Mmg community on the [Mmg forum](https://forum.mmgtools.org/). ### GitHub's Wiki More detailed informations about the compilation and configuration of the mmg's applications are available on the project [wiki](https://github.com/MmgTools/mmg/wiki). ### Man-pages -Man pages are available inside the **_doc/man_** directory: +Man pages are available inside the **doc/man** directory: * To see the **mmg2d** man page, just tap `man ./doc/man/mmg2d.1.gz` * To see the **mmgs** man page, just tap `man ./doc/man/mmgs.1.gz` * To see the **mmg3d** man page, just tap `man ./doc/man/mmg3d.1.gz` ### Code documentation Run the `make doc` command to build the Doxygen documentation. - * To see the **mmg2d** documentation, open up the **_mmg/doc/mmg2d/html/index.html_** file; - * To see the **mmgs** documentation, open up the **_mmg/doc/mmgs/html/index.html_** file; - * To see the **mmg3d** documentation, open up the **_mmg/doc/mmg3d/html/index.html_** file. + * To see the **mmg2d** documentation, open up the **mmg/doc/mmg2d/html/index.html** file; + * To see the **mmgs** documentation, open up the **mmg/doc/mmgs/html/index.html** file; + * To see the **mmg3d** documentation, open up the **mmg/doc/mmg3d/html/index.html** file. ## Platforms The **mmg** applications are validated on OS X and on most of the Linux platforms. @@ -214,4 +214,6 @@ Code is under the [terms of the GNU Lesser General Public License](https://raw.g Copyright © Bx INP/Inria/UBordeaux/UPMC, 2004- . ## Reference +[Tetrahedral remeshing in the context of large-scale numerical simulation and high performance computing - _G. Balarac, F. Basile, P. Bénard, F. Bordeu, J.-B. Chapelier, L. Cirrottola, G. Caumon, C. Dapogny, P. Frey, A. Froehly, G. Ghigliotti, R. Laraufie, G. Lartigue, C. Legentil, R. Mercier, V. Moureau, C. Nardoni, S. Pertant and M. Zakari_ - submitted, (2021)](https://membres-ljk.imag.fr/Charles.Dapogny/publis/mmgapp2.pdf) + [Three-dimensional adaptive domain remeshing, implicit domain meshing, and applications to free and moving boundary problems - _C. Dapogny, C. Dobrzynski and P. Frey_ - April 1, 2014 - _JCP_](http://www.sciencedirect.com/science/article/pii/S0021999114000266) diff --git a/cmake/modules/LoadCiTests.cmake b/cmake/modules/LoadCiTests.cmake index 1719ca05b..3106a056e 100644 --- a/cmake/modules/LoadCiTests.cmake +++ b/cmake/modules/LoadCiTests.cmake @@ -25,6 +25,17 @@ ##### Download test cases for Mmg code ##### ############################################################################### +OPTION ( CI_CONTEXT "Disable network test and download progress bar for CI runs" OFF) + +# Continuous integration tests are hosted on the sync server of inria +# (sync.bordeaux.inria.fr) in the /web/users/html/mmg/ who is published in +# https://static.bordeaux.inria.fr/mmg/. +# +# To add new tests, you will have: +# 1. to be affiliated to Inria; +# 2. to ask for an account on the server (https://doc-si.inria.fr/display/SU/Sauvegardes#) +# 3. to be member of the sedbor group (or to ask to change the directory group) +# 3. to follow the /web/users/html/mmg/README advices. MACRO ( DOWNLOAD_TESTS x ) @@ -61,9 +72,15 @@ MACRO ( DOWNLOAD_TESTS x ) # Get tests IF ( GET_MMG_TESTS MATCHES "TRUE" ) MESSAGE("-- Mmg${x} test cases download. May take a while...") - FILE(DOWNLOAD https://static.bordeaux.inria.fr/mmg/mmg${x}.tgz - ${CI_DIR}/mmg${x}.tgz - SHOW_PROGRESS) + + IF ( NOT ${CI_CONTEXT} ) + FILE(DOWNLOAD https://static.bordeaux.inria.fr/mmg/mmg${x}.tgz + ${CI_DIR}/mmg${x}.tgz + SHOW_PROGRESS) + ELSE() + FILE(DOWNLOAD https://static.bordeaux.inria.fr/mmg/mmg${x}.tgz + ${CI_DIR}/mmg${x}.tgz) + ENDIF() IF ( NOT EXISTS ${CI_DIR}/mmg${x}.tgz ) MESSAGE("\n") @@ -97,28 +114,31 @@ ENDMACRO ( ) ##### Download test cases depending on user options ##### ############################################################################### +SET ( NO_CONNECTION 0 ) -if ( MSVC ) +IF ( NOT ${CI_CONTEXT} ) + if ( MSVC ) execute_process( - COMMAND ping www.mmgtools.org -n 2 - OUTPUT_QUIET - ERROR_QUIET - RESULT_VARIABLE NO_CONNECTION - ) -else ( ) + COMMAND ping www.mmgtools.org -n 2 + OUTPUT_QUIET + ERROR_QUIET + RESULT_VARIABLE NO_CONNECTION + ) + else ( ) execute_process( - COMMAND ping www.mmgtools.org -c 2 - OUTPUT_QUIET - ERROR_QUIET - RESULT_VARIABLE NO_CONNECTION - ) -endif ( ) - -if ( NOT NO_CONNECTION EQUAL 0 ) + COMMAND ping www.mmgtools.org -c 2 + OUTPUT_QUIET + ERROR_QUIET + RESULT_VARIABLE NO_CONNECTION + ) + endif ( ) + +ENDIF() +if ( NOT (NO_CONNECTION EQUAL 0 OR NO_CONNECTION EQUAL 2) ) set ( CONNECTED OFF ) message ( STATUS "Offline mode: requires already downloaded test cases") else() - set ( CONNECTED ON ) + set ( CONNECTED ON ) endif() IF ( CONNECTED ) diff --git a/cmake/modules/add-mmg-options.cmake b/cmake/modules/add-mmg-options.cmake new file mode 100644 index 000000000..11b379217 --- /dev/null +++ b/cmake/modules/add-mmg-options.cmake @@ -0,0 +1,122 @@ +## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +## Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +## +## mmg is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## mmg is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +## License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= + +#------------------------------- static or shared libs +FUNCTION (INVERT_BOOL OUTVAR INVAR) + IF(${INVAR}) + SET(${OUTVAR} OFF PARENT_SCOPE) + ELSE() + SET(${OUTVAR} ON PARENT_SCOPE) + ENDIF() +ENDFUNCTION() + +OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF) +INVERT_BOOL("BUILD_STATIC_LIBS" ${BUILD_SHARED_LIBS}) +IF ( (${BUILD_STATIC_LIBS} EQUAL ON) AND NOT CMAKE_POSITION_INDEPENDENT_CODE) + SET(CMAKE_POSITION_INDEPENDENT_CODE ON) +ENDIF() + +#------------------------------- mmg2d +CMAKE_DEPENDENT_OPTION ( LIBMMG2D_STATIC "Compile the mmg2d static library" ON + "BUILD_MMG2D;BUILD_STATIC_LIBS" OFF) +CMAKE_DEPENDENT_OPTION ( LIBMMG2D_SHARED "Compile the mmg2d dynamic library" ON + "BUILD_MMG2D;BUILD_SHARED_LIBS" OFF ) +IF (LIBMMG2D_STATIC OR LIBMMG2D_SHARED) + SET(LIBMMG2D_INTERNAL ON ) +ELSE() + SET(LIBMMG2D_INTERNAL OFF ) +ENDIF() +CMAKE_DEPENDENT_OPTION ( + TEST_LIBMMG2D "Build mmg2d library examples and tests" OFF + "BUILD_MMG2D;LIBMMG2D_INTERNAL" OFF) + +CMAKE_DEPENDENT_OPTION( + MMG2D_CI "Enable/Disabletest_execution for mmg2d" ON + "BUILD_TESTING;BUILD_MMG2D" OFF) + +#------------------------------- mmgs +CMAKE_DEPENDENT_OPTION ( LIBMMGS_STATIC "Compile the mmgs static library" ON + "BUILD_MMGS;BUILD_STATIC_LIBS" OFF) +CMAKE_DEPENDENT_OPTION ( LIBMMGS_SHARED "Compile the mmgs dynamic library" ON + "BUILD_MMGS;BUILD_SHARED_LIBS" OFF) +IF (LIBMMGS_STATIC OR LIBMMGS_SHARED) + SET(LIBMMGS_INTERNAL ON ) +ELSE() + SET(LIBMMGS_INTERNAL OFF ) +ENDIF() +CMAKE_DEPENDENT_OPTION ( + TEST_LIBMMGS "Build mmgs library examples and tests" OFF + "LIBMMGS_INTERNAL;BUILD_MMGS" OFF + ) + +CMAKE_DEPENDENT_OPTION( + MMGS_CI "Enable/Disable test_execution for mmgs" ON + "BUILD_TESTING;BUILD_MMGS" OFF ) + +#------------------------------- mmg3d +CMAKE_DEPENDENT_OPTION ( LIBMMG3D_STATIC "Compile the mmg3d static library" ON + "BUILD_MMG3D;BUILD_STATIC_LIBS" OFF ) +CMAKE_DEPENDENT_OPTION ( LIBMMG3D_SHARED "Compile the mmg3d dynamic library" ON + "BUILD_MMG3D;BUILD_SHARED_LIBS" OFF ) +IF (LIBMMG3D_STATIC OR LIBMMG3D_SHARED) + SET(LIBMMG3D_INTERNAL ON ) +ELSE() + SET(LIBMMG3D_INTERNAL OFF ) +ENDIF() +CMAKE_DEPENDENT_OPTION ( + TEST_LIBMMG3D "Build mmg3d library examples and tests" OFF + "BUILD_MMG3D;LIBMMG3D_INTERNAL" OFF + ) +CMAKE_DEPENDENT_OPTION( + MMG3D_CI "Enable/Disable test execution for mmg3d" ON + "BUILD_TESTING;BUILD_MMG3D" OFF) + +CMAKE_DEPENDENT_OPTION ( MMG_PATTERN + "If ON, insertion by patterns, otherwise insertion by delaunay kernel" + OFF + "BUILD_MMG3D" OFF) +#-- Remove the next line to have this option visible in basic cmake mode +MARK_AS_ADVANCED(MMG_PATTERN) + +#---------------------------- mmg library gathering mmg2d, mmgs and mmg3d libs +CMAKE_DEPENDENT_OPTION ( LIBMMG_STATIC + "Compile the mmg static library (mmg2d + mmgs + mmg3d)" ON + "BUILD_MMG;BUILD_STATIC_LIBS" OFF) +CMAKE_DEPENDENT_OPTION ( LIBMMG_SHARED + "Compile the mmg dynamic library (mmg2d + mmgs + mmg3d)" ON + "BUILD_MMG;BUILD_SHARED_LIBS" OFF ) +IF (LIBMMG_STATIC OR LIBMMG_SHARED) + SET(LIBMMG_INTERNAL ON ) +ELSE() + SET(LIBMMG_INTERNAL OFF ) +ENDIF() +CMAKE_DEPENDENT_OPTION ( + TEST_LIBMMG "Build mmg library examples and tests" OFF + "BUILD_MMG;LIBMMG_INTERNAL" OFF + ) +CMAKE_DEPENDENT_OPTION( + MMG_CI "Enable/Disable test execution for mmg library" ON + "BUILD_TESTING;BUILD_MMG" OFF) + +#---------------------- install provate headers for library built on top of Mmg +OPTION ( MMG_INSTALL_PRIVATE_HEADERS + "Install private headers of Mmg (use at your own risk)" OFF ) diff --git a/cmake/modules/add_build_types.cmake b/cmake/modules/add_build_types.cmake new file mode 100644 index 000000000..0186c40f4 --- /dev/null +++ b/cmake/modules/add_build_types.cmake @@ -0,0 +1,148 @@ +## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +##** Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +## +## mmg is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## mmg is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +## License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= + +# Create compilation modes: +# - Maintener: adds compiler warnings to Debug mode +# - RelWithAssert: RelWithDebInfo without NDEBUG precompiler flag + +# Add Maintener mode +if (CMAKE_C_COMPILER_ID STREQUAL "Clang") + set ( CLANG_FLAGS + "-O0 -g -Weverything -Wno-sign-conversion -Wno-char-subscripts -Wno-padded") + set(CMAKE_CXX_FLAGS_MAINTAINER "${CLANG_FLAGS}" + CACHE STRING + "Flags used by the CXX compiler during Maintainer builds." + FORCE) + set(CMAKE_C_FLAGS_MAINTAINER "${CLANG_FLAGS}" + CACHE STRING + "Flags used by the C compiler during Maintainer builds." + FORCE) + set(CMAKE_EXE_LINKER_FLAGS_MAINTAINER ${CMAKE_EXE_LINKER_FLAGS_DEBUG} + CACHE STRING + "Flags used for linking binaries during Maintainer builds." + FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_MAINTAINER ${CMAKE_SHARED_LINKER_FLAGS_DEBUG} + CACHE STRING + "Flags used by the shared libraries linker during Maintainer builds." + FORCE) + set(CMAKE_STATIC_LINKER_FLAGS_MAINTAINER ${CMAKE_STATIC_LINKER_FLAGS_DEBUG} + CACHE STRING + "Flags used by the static libraries linker during Maintainer builds." + FORCE) + +elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS_MAINTAINER "-O0 -g -Wall" CACHE STRING + "Flags used by the CXX compiler during Maintainer builds." + FORCE) + set(CMAKE_C_FLAGS_MAINTAINER "-O0 -g -Wall" CACHE STRING + "Flags used by the C compiler during Maintainer builds." + FORCE) + + set ( LD_LINKER_FLAGS "-Wl,--warn-unresolved-symbols,--warn-once" ) + + set(CMAKE_EXE_LINKER_FLAGS_MAINTAINER + ${LD_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG} + CACHE STRING + "Flags used for linking binaries during Maintainer builds." + FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_MAINTAINER + ${LD_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_DEBUG} + CACHE STRING + "Flags used by the shared libraries linker during Maintainer builds." + FORCE) + # Static lib linking uses ar and not ld: -Wl is not supported + set(CMAKE_STATIC_LINKER_FLAGS_MAINTAINER + ${CMAKE_STATIC_LINKER_FLAGS_DEBUG} + CACHE STRING + "Flags used by the static libraries linker during Maintainer builds." + FORCE) + +else () + # Not implemented: use Debug flags + set(CMAKE_CXX_FLAGS_MAINTAINER "${CMAKE_CXX_FLAGS_DEBUG}" + CACHE STRING + "Flags used by the CXX compiler during Maintainer builds." + FORCE) + set(CMAKE_C_FLAGS_MAINTAINER "${CMAKE_C_FLAGS_DEBUG}" + CACHE STRING + "Flags used by the C compiler during Maintainer builds." + FORCE) + set(CMAKE_EXE_LINKER_FLAGS_MAINTAINER "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" + CACHE STRING + "Flags used for linking binaries during Maintainer builds." + FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_MAINTAINER "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" + CACHE STRING + "Flags used by the shared libraries linker during Maintainer builds." + FORCE) + set(CMAKE_STATIC_LINKER_FLAGS_MAINTAINER "${CMAKE_STATIC_LINKER_FLAGS_DEBUG}" + CACHE STRING + "Flags used by the static libraries linker during Maintainer builds." + FORCE) + +endif() + +mark_as_advanced( + CMAKE_CXX_FLAGS_MAINTAINER + CMAKE_C_FLAGS_MAINTAINER + CMAKE_EXE_LINKER_FLAGS_MAINTAINER + CMAKE_SHARED_LINKER_FLAGS_MAINTAINER + CMAKE_STATIC_LINKER_FLAGS_MAINTAINER + ) + +# Add RelWithAssert mode +STRING(REGEX REPLACE ".DNDEBUG" " " + RELWITHASSERT_C_FLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}" ) + +STRING(REGEX REPLACE ".DNDEBUG" " " + RELWITHASSERT_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" ) + +set(CMAKE_CXX_FLAGS_RELWITHASSERT "${RELWITHASSERT_CXX_FLAGS}" + CACHE STRING + "Flags used by the CXX compiler during RelWithAssert builds." + FORCE) + +set(CMAKE_C_FLAGS_RELWITHASSERT "${RELWITHASSERT_C_FLAGS}" + CACHE STRING + "Flags used by the C compiler during RelWithAssert builds." + FORCE) + +set(CMAKE_EXE_LINKER_FLAGS_RELWITHASSERT "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}" + CACHE STRING + "Flags used for linking binaries during RelWithAssert builds." + FORCE) +set(CMAKE_SHARED_LINKER_FLAGS_RELWITHASSERT "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEINFO}" + CACHE STRING + "Flags used by the shared libraries linker during maintainer builds." + FORCE) +set(CMAKE_STATIC_LINKER_FLAGS_RELWITHASSERT "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEINFO}" + CACHE STRING + "Flags used by the static libraries linker during maintainer builds." + FORCE) + +mark_as_advanced( + CMAKE_CXX_FLAGS_RELWITHASSERT + CMAKE_C_FLAGS_RELWITHASSERT + CMAKE_EXE_LINKER_FLAGS_RELWITHASSERT + CMAKE_SHARED_LINKER_FLAGS_RELWITHASSERT + CMAKE_STATIC_LINKER_FLAGS_RELWITHASSERT + ) diff --git a/cmake/modules/build-targets.cmake b/cmake/modules/build-targets.cmake new file mode 100644 index 000000000..279be47ec --- /dev/null +++ b/cmake/modules/build-targets.cmake @@ -0,0 +1,73 @@ +## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +## Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +## +## mmg is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## mmg is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +## License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= + +SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + +# CTEST_OUTPUT_DIR MUST BE SETTED HERE TO AVOID UNINITIALIZATION FOR LIBRARY +# TESTS DEFS +OPTION ( BUILD_TESTING "Enable/Disable continuous integration" OFF ) + +IF( BUILD_TESTING ) + SET ( CTEST_OUTPUT_DIR ${PROJECT_BINARY_DIR}/TEST_OUTPUTS + CACHE PATH "Path toward the tests outputs" ) + MARK_AS_ADVANCED ( CTEST_OUTPUT_DIR ) + FILE ( MAKE_DIRECTORY ${CTEST_OUTPUT_DIR} ) +ENDIF ( ) + +INCLUDE(mmgcommon) + +IF ( BUILD_MMG2D ) + INCLUDE(mmg2d) +ENDIF ( ) + +IF ( BUILD_MMGS ) + INCLUDE(mmgs) +ENDIF ( ) + +IF ( BUILD_MMG3D ) + INCLUDE(mmg3d) +ENDIF ( ) + +IF ( BUILD_MMG ) + INCLUDE(mmg) +ENDIF ( ) + +IF ( MmgTargetsExported ) + set( MMG_CMAKE_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/mmg ) + + configure_package_config_file(cmake/config/mmgConfig.cmake.in + ${PROJECT_BINARY_DIR}/mmgConfig.cmake + INSTALL_DESTINATION ${MMG_CMAKE_INSTALL_DIR} ) + + install(EXPORT MmgTargets + FILE MmgTargets.cmake + NAMESPACE Mmg:: + DESTINATION ${MMG_CMAKE_INSTALL_DIR} + ) + install(FILES ${PROJECT_BINARY_DIR}/mmgConfig.cmake + DESTINATION ${MMG_CMAKE_INSTALL_DIR} ) + + install(FILES + ${PROJECT_SOURCE_DIR}/cmake/modules/FindSCOTCH.cmake + ${PROJECT_SOURCE_DIR}/cmake/modules/FindElas.cmake + DESTINATION ${MMG_CMAKE_INSTALL_DIR} ) +ENDIF() diff --git a/cmake/modules/doxygen.cmake b/cmake/modules/doxygen.cmake new file mode 100644 index 000000000..12b278d66 --- /dev/null +++ b/cmake/modules/doxygen.cmake @@ -0,0 +1,47 @@ +## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +##** Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +## +## mmg is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## mmg is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +## License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= + +# Build Doxygen doc if needed +OPTION ( BUILD_DOC "Enable/Disable Doxygen documentation target" OFF ) +IF ( BUILD_DOC ) + FIND_PACKAGE(Doxygen) + IF(DOXYGEN_FOUND) + + # MMG Documentation + SET( MMG_DOC_DIR ${PROJECT_BINARY_DIR}/doc/ CACHE PATH + "Path toward generated Doxygen doc.") + mark_as_advanced(MMG_DOC_DIR) + + FILE(MAKE_DIRECTORY ${MMG_DOC_DIR}) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/Doxyfile.in + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) + ADD_CUSTOM_TARGET(doc + COMMAND ${DOXYGEN_EXECUTABLE} + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${MMG_DOC_DIR} + COMMENT "Generating Mmg documentation with Doxygen. Open up the + ${MMG_DOC_DIR}/index.html file to see + it" VERBATIM ) + + ENDIF ( DOXYGEN_FOUND ) +ENDIF ( ) diff --git a/cmake/modules/macros.cmake b/cmake/modules/macros.cmake index 8c9ba56fd..07c0c7d6b 100644 --- a/cmake/modules/macros.cmake +++ b/cmake/modules/macros.cmake @@ -29,7 +29,7 @@ ENDMACRO ( ) ############################################################################### ##### -##### Copy an automatically generated header file to another place +##### Copy a header file to another place ##### ############################################################################### MACRO ( COPY_HEADER @@ -56,74 +56,70 @@ ENDMACRO ( ) ############################################################################### ##### -##### Copy an automatically generated header file to another place +##### Copy a header file to another place ##### and create the associated target ##### ############################################################################### -MACRO ( COPY_HEADERS_AND_CREATE_TARGET - source_dir binary_dir include_dir target_identifier ) - - ADD_CUSTOM_TARGET(mmg${target_identifier}types_header ALL - DEPENDS - ${COMMON_SOURCE_DIR}/libmmgtypes.h ) +MACRO ( COPY_1_HEADER_AND_CREATE_TARGET + source_dir name include_dir target_identifier ) - ADD_CUSTOM_TARGET(mmg${target_identifier}cmakedefines_header ALL + ADD_CUSTOM_TARGET(mmg${target_identifier}_${name}_header ALL DEPENDS - ${COMMON_BINARY_DIR}/mmgcmakedefines.h ) - - ADD_CUSTOM_TARGET(mmg${target_identifier}version_header ALL - DEPENDS - ${COMMON_BINARY_DIR}/mmgversion.h ) - - ADD_CUSTOM_TARGET(mmg${target_identifier}_header ALL - DEPENDS - ${source_dir}/libmmg${target_identifier}.h ) + ${source_dir}/${name}.h ) COPY_HEADER ( - ${COMMON_SOURCE_DIR} libmmgtypes.h - ${include_dir} libmmgtypes.h - mmg${target_identifier}types_header copy${target_identifier}_libmmgtypes ) + ${source_dir} ${name}.h + ${include_dir} ${name}.h + mmg${target_identifier}_${name}_header copy${target_identifier}_${name} ) - COPY_HEADER ( - ${COMMON_BINARY_DIR} mmgcmakedefines.h - ${include_dir} mmgcmakedefines.h - mmg${target_identifier}cmakedefines_header copy${target_identifier}_mmgcmakedefines ) - COPY_HEADER ( - ${COMMON_BINARY_DIR} mmgversion.h - ${include_dir} mmgversion.h - mmg${target_identifier}version_header copy${target_identifier}_mmgversion ) +ENDMACRO() - COPY_HEADER ( - ${source_dir} libmmg${target_identifier}.h - ${include_dir} libmmg${target_identifier}.h - mmg${target_identifier}_header copy_libmmg${target_identifier} ) +############################################################################### +##### +##### Copy an automatically generated header file to another place +##### and create the associated target +##### +############################################################################### +MACRO ( COPY_HEADERS_AND_CREATE_TARGET + source_dir binary_dir include_dir target_identifier ) - COPY_HEADER ( - ${COMMON_BINARY_DIR} libmmgtypesf.h - ${include_dir} libmmgtypesf.h - mmg_fortran_header copy${target_identifier}_libmmgtypesf ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${source_dir} libmmg${target_identifier} + ${include_dir} ${target_identifier}) - COPY_HEADER ( - ${binary_dir} libmmg${target_identifier}f.h - ${include_dir} libmmg${target_identifier}f.h - mmg${target_identifier}_fortran_header copy_libmmg${target_identifier}f ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${source_dir} mmg${target_identifier}_export + ${include_dir} ${target_identifier}) - SET ( tgt_list copy_libmmg${target_identifier}f copy${target_identifier}_libmmgtypesf - copy_libmmg${target_identifier} copy${target_identifier}_libmmgtypes - copy${target_identifier}_mmgcmakedefines copy${target_identifier}_mmgversion ) + SET ( tgt_list + copy${target_identifier}_libmmg${target_identifier} + copy${target_identifier}_mmg${target_identifier}_export ) - IF (NOT WIN32 OR MINGW) + if (PERL_FOUND) COPY_HEADER ( - ${COMMON_BINARY_DIR} git_log_mmg.h - ${include_dir} git_log_mmg.h - GenerateGitHash copy${target_identifier}_mmggithash ) - - LIST ( APPEND tgt_list copy${target_identifier}_mmggithash) - ENDIF () + ${binary_dir} libmmg${target_identifier}f.h + ${include_dir} libmmg${target_identifier}f.h + mmg${target_identifier}_fortran_header copy_libmmg${target_identifier}f ) + + LIST ( APPEND tgt_list copy_libmmg${target_identifier}f ) + endif (PERL_FOUND) + + IF ( MMG_INSTALL_PRIVATE_HEADERS ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${source_dir} libmmg${target_identifier}_private + ${include_dir} ${target_identifier}) + COPY_1_HEADER_AND_CREATE_TARGET( + ${source_dir} mmg${target_identifier}externs_private + ${include_dir} ${target_identifier}) + + LIST ( APPEND tgt_list copy${target_identifier}_libmmg${target_identifier}_private + copy${target_identifier}_mmg${target_identifier}externs_private + ) + ENDIF() ADD_CUSTOM_TARGET (copy_${target_identifier}_headers ALL - DEPENDS ${tgt_list} ) + DEPENDS ${tgt_list} ${tgt_opt_list} copy_mmgcommon_headers) ENDMACRO ( ) @@ -147,32 +143,29 @@ MACRO ( ADD_AND_INSTALL_LIBRARY ENDIF() IF (NOT WIN32 OR MINGW) - ADD_DEPENDENCIES(${target_name} GenerateGitHash) + ADD_DEPENDENCIES(${target_name} GenerateGitHashMmg) ENDIF() ADD_DEPENDENCIES( ${target_name} ${target_dependencies}) IF ( CMAKE_VERSION VERSION_LESS 2.8.12 ) - INCLUDE_DIRECTORIES ( - ${COMMON_BINARY_DIR} ${COMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR}) + INCLUDE_DIRECTORIES ( BEFORE + ${MMGCOMMON_BINARY_DIR} ${MMGCOMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR}) ELSE ( ) - target_include_directories( ${target_name} PUBLIC + target_include_directories( ${target_name} BEFORE PUBLIC $ - $ - $ - $ + $ + $ $ $ - $ - $ - $ - $ - $ ) + $ + ) ENDIF ( ) - if ( SCOTCH_FOUND ) + + if ( SCOTCH_FOUND AND NOT USE_SCOTCH MATCHES OFF ) message(STATUS "[mmg] add include scotch directories ${SCOTCH_INCLUDE_DIRS}") IF ( CMAKE_VERSION VERSION_LESS 2.8.12 ) - INCLUDE_DIRECTORIES (${SCOTCH_INCLUDE_DIRS} ) + INCLUDE_DIRECTORIES ( AFTER ${SCOTCH_INCLUDE_DIRS} ) ELSE ( ) target_include_directories( ${target_name} PUBLIC ${SCOTCH_INCLUDE_DIRS} ) endif() @@ -212,36 +205,53 @@ ENDMACRO ( ) MACRO ( ADD_AND_INSTALL_EXECUTABLE exec_name target_dependencies lib_files main_file ) - IF ( NOT TARGET lib${exec_name}_a AND NOT TARGET lib${exec_name}_so ) + # if one of the Mmg lib is built, use it instead of compiling whole sources + IF ( NOT TARGET lib${exec_name}_a AND NOT TARGET lib${exec_name}_so + AND NOT TARGET libmmg_a AND NOT TARGET libmmg_so ) ADD_EXECUTABLE ( ${exec_name} ${lib_files} ${main_file} ) ELSE ( ) ADD_EXECUTABLE ( ${exec_name} ${main_file}) SET_PROPERTY(TARGET ${exec_name} PROPERTY C_STANDARD 99) - IF ( NOT TARGET lib${exec_name}_a ) + # link libraries in order of simplicities and depending on built targets + IF ( TARGET lib${exec_name}_a ) + TARGET_LINK_LIBRARIES(${exec_name} PRIVATE lib${exec_name}_a) + ELSEIF ( TARGET libmmg_a ) + TARGET_LINK_LIBRARIES(${exec_name} PRIVATE libmmg_a) + ELSEIF ( TARGET lib${exec_name}_so ) TARGET_LINK_LIBRARIES(${exec_name} PRIVATE lib${exec_name}_so) ELSE ( ) - TARGET_LINK_LIBRARIES(${exec_name} PRIVATE lib${exec_name}_a) + TARGET_LINK_LIBRARIES(${exec_name} PRIVATE libmmg_so) ENDIF ( ) ENDIF ( ) IF (NOT WIN32 OR MINGW) - ADD_DEPENDENCIES(${exec_name} GenerateGitHash) + ADD_DEPENDENCIES(${exec_name} GenerateGitHashMmg) endif() ADD_DEPENDENCIES(${exec_name} ${target_dependencies}) - IF ( WIN32 AND NOT MINGW AND SCOTCH_FOUND ) + IF ( WIN32 AND NOT MINGW AND SCOTCH_FOUND AND NOT USE_SCOTCH MATCHES OFF ) my_add_link_flags ( ${exec_name} "/SAFESEH:NO") ENDIF ( ) IF ( CMAKE_VERSION VERSION_LESS 2.8.12 ) - INCLUDE_DIRECTORIES ( - ${COMMON_BINARY_DIR} ${COMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR} ) + INCLUDE_DIRECTORIES ( BEFORE + ${MMGCOMMON_BINARY_DIR} ${MMGCOMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR} ) + if ( SCOTCH_FOUND AND NOT USE_SCOTCH MATCHES OFF ) + message(STATUS "[mmg] add include scotch directories ${SCOTCH_INCLUDE_DIRS}") + INCLUDE_DIRECTORIES ( AFTER ${SCOTCH_INCLUDE_DIRS} ) + ENDIF() + ELSE ( ) - TARGET_INCLUDE_DIRECTORIES ( ${exec_name} PUBLIC - ${COMMON_BINARY_DIR} ${COMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR} ) + TARGET_INCLUDE_DIRECTORIES ( ${exec_name} BEFORE PUBLIC + ${MMGCOMMON_BINARY_DIR} ${MMGCOMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR} ) + if ( SCOTCH_FOUND AND NOT USE_SCOTCH MATCHES OFF ) + message(STATUS "[mmg] add include scotch directories ${SCOTCH_INCLUDE_DIRS}") + target_include_directories( ${exec_name} BEFORE PUBLIC ${SCOTCH_INCLUDE_DIRS} ) + ENDIF() + ENDIF ( ) TARGET_LINK_LIBRARIES ( ${exec_name} PRIVATE ${LIBRARIES} ) @@ -275,56 +285,30 @@ MACRO ( ADD_TARGET_POSTFIX target_name ) ENDIF ( ) ENDMACRO ( ) -############################################################################### -##### -##### Add Executable that must be tested by ci -##### -############################################################################### - -MACRO ( ADD_EXEC_TO_CI_TESTS exec_name list_name ) - - IF(${CMAKE_BUILD_TYPE} MATCHES "Debug") - SET(EXECUT ${EXECUTABLE_OUTPUT_PATH}/${exec_name}_debug) - SET(BUILDNAME ${BUILDNAME}_debug CACHE STRING "build name variable") - ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "Release") - SET(EXECUT ${EXECUTABLE_OUTPUT_PATH}/${exec_name}_O3) - SET(BUILDNAME ${BUILDNAME}_O3 CACHE STRING "build name variable") - ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "RelWithDebInfo") - SET(EXECUT ${EXECUTABLE_OUTPUT_PATH}/${exec_name}_O3d) - SET(BUILDNAME ${BUILDNAME}_O3d CACHE STRING "build name variable") - ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "MinSizeRel") - SET(EXECUT ${EXECUTABLE_OUTPUT_PATH}/${exec_name}_Os) - SET(BUILDNAME ${BUILDNAME}_Os CACHE STRING "build name variable") - ELSE() - SET(EXECUT ${EXECUTABLE_OUTPUT_PATH}/${exec_name}) - SET(BUILDNAME ${BUILDNAME} CACHE STRING "build name variable") - ENDIF() - - SET ( ${list_name} ${EXECUT} ) - -ENDMACRO ( ) - - ############################################################################### ##### ##### Add a library test ##### ############################################################################### -MACRO ( ADD_LIBRARY_TEST target_name main_path target_dependency lib_name ) +MACRO ( ADD_LIBRARY_TEST target_name main_path target_dependency lib_name lib_type ) ADD_EXECUTABLE ( ${target_name} ${main_path} ) ADD_DEPENDENCIES( ${target_name} ${target_dependency} ) IF ( CMAKE_VERSION VERSION_LESS 2.8.12 ) - INCLUDE_DIRECTORIES (${PROJECT_BINARY_DIR}/include ) + INCLUDE_DIRECTORIES ( BEFORE ${PROJECT_BINARY_DIR}/include ) ELSE ( ) - TARGET_INCLUDE_DIRECTORIES ( ${target_name} PUBLIC ${PROJECT_BINARY_DIR}/include ) + TARGET_INCLUDE_DIRECTORIES ( ${target_name} BEFORE PUBLIC ${PROJECT_BINARY_DIR}/include ) ENDIF ( ) - IF ( WIN32 AND ((NOT MINGW) AND SCOTCH_FOUND) ) + IF ( WIN32 AND ((NOT MINGW) AND SCOTCH_FOUND AND NOT USE_SCOTCH MATCHES OFF) ) MY_ADD_LINK_FLAGS ( ${target_name} "/SAFESEH:NO" ) ENDIF ( ) + IF ( "${lib_type}" STREQUAL "SHARED" ) + ADD_DEFINITIONS(-D${lib_name}_IMPORTS) + ENDIF() + TARGET_LINK_LIBRARIES ( ${target_name} PRIVATE ${lib_name} ) INSTALL(TARGETS ${target_name} RUNTIME DESTINATION bin COMPONENT appli ) diff --git a/cmake/modules/mmg.cmake b/cmake/modules/mmg.cmake index 470905f4f..709ab1cdf 100644 --- a/cmake/modules/mmg.cmake +++ b/cmake/modules/mmg.cmake @@ -45,7 +45,11 @@ FILE( ${MMG2D_SOURCE_DIR}/*.c ${MMG3D_SOURCE_DIR}/*.c ${MMGS_SOURCE_DIR}/*.c - ${COMMON_SOURCE_DIR}/*.c + ${MMGCOMMON_SOURCE_DIR}/*.c + ${MMG2D_SOURCE_DIR}/*.h + ${MMG3D_SOURCE_DIR}/*.h + ${MMGS_SOURCE_DIR}/*.h + ${MMGCOMMON_SOURCE_DIR}/*.h ) LIST(REMOVE_ITEM mmg_library_files ${MMG2D_SOURCE_DIR}/mmg2d.c @@ -53,9 +57,9 @@ LIST(REMOVE_ITEM mmg_library_files ${MMG3D_SOURCE_DIR}/mmg3d.c ${REMOVE_FILE} ) -IF ( VTK_FOUND ) +IF ( VTK_FOUND AND NOT USE_VTK MATCHES OFF) LIST(APPEND mmg_library_files - ${COMMON_SOURCE_DIR}/vtkparser.cpp ) + ${MMGCOMMON_SOURCE_DIR}/vtkparser.cpp ) ENDIF ( ) IF ( LIBMMG_STATIC ) @@ -75,28 +79,30 @@ ENDIF() IF ( LIBMMG_STATIC OR LIBMMG_SHARED ) # mmg header files needed for library + # + # Remark: header installation would need to be cleaned, for now, to allow + # independent build of each project and because mmgs and mmg2d have been added + # to mmg3d without rethinking the install architecture, the header files that + # are common between codes are copied in all include directories (mmg/, + # mmg/mmg3d/, mmg/mmgs/, mmg/mmg2d/). they are also copied in build directory + # to enable library call without installation. SET( mmg2d_headers + ${MMG2D_SOURCE_DIR}/mmg2d_export.h ${MMG2D_SOURCE_DIR}/libmmg2d.h ${MMG2D_BINARY_DIR}/libmmg2df.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h ) SET( mmg3d_headers + ${MMG3D_SOURCE_DIR}/mmg3d_export.h ${MMG3D_SOURCE_DIR}/libmmg3d.h ${MMG3D_BINARY_DIR}/libmmg3df.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h ) SET( mmgs_headers + ${MMGS_SOURCE_DIR}/mmgs_export.h ${MMGS_SOURCE_DIR}/libmmgs.h ${MMGS_BINARY_DIR}/libmmgsf.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h ) SET( mmg_headers + # ${PROJECT_SOURCE_DIR}/src/common/mmg_core_export.h ${PROJECT_SOURCE_DIR}/src/mmg/libmmg.h ${PROJECT_SOURCE_DIR}/src/mmg/libmmgf.h ) @@ -105,6 +111,11 @@ IF ( LIBMMG_STATIC OR LIBMMG_SHARED ) SET(MMG3D_INCLUDE ${PROJECT_BINARY_DIR}/include/mmg/mmg3d ) SET(MMG_INCLUDE ${PROJECT_BINARY_DIR}/include/mmg ) + # install man pages + INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg2d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg3d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmgs.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + # Install header files in /usr/local or equivalent INSTALL(FILES ${mmg2d_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/mmg2d) INSTALL(FILES ${mmgs_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/mmgs) @@ -133,19 +144,8 @@ IF ( LIBMMG_STATIC OR LIBMMG_SHARED ) copy_2d_headers copy_s_headers copy_3d_headers ${PROJECT_BINARY_DIR}/include/mmg/libmmgf.h ${PROJECT_BINARY_DIR}/include/mmg/libmmg.h - ${PROJECT_BINARY_DIR}/include/mmg/mmg3d/libmmgtypes.h - ${PROJECT_BINARY_DIR}/include/mmg/mmg3d/mmgcmakedefines.h) - -ENDIF() - -############################################################################ -##### -##### Compile program to test library -##### -############################################################################ + ) -IF ( TEST_LIBMMG ) - INCLUDE(cmake/testing/libmmg_tests.cmake) ENDIF() ############################################################################### @@ -154,37 +154,9 @@ ENDIF() ##### ############################################################################### -IF ( BUILD_TESTING ) - - ##-------------------------------------------------------------------## - ##--------------------------- Add tests and configure it ------------## - ##-------------------------------------------------------------------## - # Add runtime that we want to test for mmg - IF( MMG_CI ) - # Add libmmg tests - IF ( TEST_LIBMMG ) - SET(LIBMMG_EXEC0_a ${EXECUTABLE_OUTPUT_PATH}/libmmg_example0_a ) - SET(LIBMMG_CPP_a ${EXECUTABLE_OUTPUT_PATH}/libmmg_cpp_a ) - - ADD_TEST(NAME libmmg_example0_a COMMAND ${LIBMMG_EXEC0_a} - ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0/init - ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0/cube - "${CTEST_OUTPUT_DIR}/libmmg_Adaptation_0.o") - ADD_TEST(NAME libmmg_cpp_a COMMAND ${LIBMMG_CPP_a} - ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0_cpp/init - ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0_cpp/cube - "${CTEST_OUTPUT_DIR}/libmmg_Adaptation_0_cpp.o") - - IF ( CMAKE_Fortran_COMPILER) - SET(LIBMMG_FORTRAN_a ${EXECUTABLE_OUTPUT_PATH}/libmmg_fortran_a) - ADD_TEST(NAME libmmg_fortran COMMAND ${LIBMMG_FORTRAN_a} - ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0_fortran/init - ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0_fortran/cube - "${CTEST_OUTPUT_DIR}/libmmg_Adaptation_0_Fortran.o" - ) - ENDIF() - ENDIF () - - ENDIF( MMG_CI ) - -ENDIF ( BUILD_TESTING ) +##-------------------------------------------------------------------## +##-------------- Library examples and APIs ---------------------## +##-------------------------------------------------------------------## +IF ( TEST_LIBMMG ) + INCLUDE(libmmg_tests) +ENDIF() diff --git a/cmake/modules/mmg2d.cmake b/cmake/modules/mmg2d.cmake index 9e89764f2..b4c6b1e8c 100644 --- a/cmake/modules/mmg2d.cmake +++ b/cmake/modules/mmg2d.cmake @@ -39,12 +39,13 @@ FILE(MAKE_DIRECTORY ${MMG2D_BINARY_DIR}) ##### ############################################################################ -GENERATE_FORTRAN_HEADER ( mmg2d - ${MMG2D_SOURCE_DIR} libmmg2d.h - ${MMG2D_SHRT_INCLUDE} - ${MMG2D_BINARY_DIR} libmmg2df.h - ) - +if (PERL_FOUND) + GENERATE_FORTRAN_HEADER ( mmg2d + ${MMG2D_SOURCE_DIR} libmmg2d.h + mmg/common + ${MMG2D_BINARY_DIR} libmmg2df.h + ) +endif(PERL_FOUND) ############################################################################### ##### ##### Sources and libraries @@ -56,22 +57,27 @@ FILE( GLOB mmg2d_library_files ${MMG2D_SOURCE_DIR}/*.c - ${COMMON_SOURCE_DIR}/*.c + ${MMGCOMMON_SOURCE_DIR}/*.c + ${MMG2D_SOURCE_DIR}/*.h + ${MMGCOMMON_SOURCE_DIR}/*.h ${MMG2D_SOURCE_DIR}/inoutcpp_2d.cpp ) + LIST(REMOVE_ITEM mmg2d_library_files ${MMG2D_SOURCE_DIR}/mmg2d.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ${REMOVE_FILE} ) -IF ( VTK_FOUND ) +IF ( VTK_FOUND AND NOT USE_VTK MATCHES OFF ) LIST(APPEND mmg2d_library_files - ${COMMON_SOURCE_DIR}/vtkparser.cpp ) + ${MMGCOMMON_SOURCE_DIR}/vtkparser.cpp ) ENDIF ( ) FILE( GLOB mmg2d_main_file ${MMG2D_SOURCE_DIR}/mmg2d.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ) ############################################################################ @@ -80,18 +86,18 @@ FILE( ##### ############################################################################ -IF( ELAS_FOUND ) -# Set flags for building test program -INCLUDE_DIRECTORIES(${ELAS_INCLUDE_DIR}) +IF( ELAS_FOUND AND NOT USE_ELAS MATCHES OFF ) + # Set flags for building test program + INCLUDE_DIRECTORIES(AFTER ${ELAS_INCLUDE_DIR}) -SET(CMAKE_REQUIRED_INCLUDES ${ELAS_INCLUDE_DIR}) -SET(CMAKE_REQUIRED_LIBRARIES ${ELAS_LIBRARY}) + SET(CMAKE_REQUIRED_INCLUDES ${ELAS_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES ${ELAS_LIBRARY}) -SET(CMAKE_C_FLAGS "-DUSE_ELAS ${CMAKE_C_FLAGS}") -MESSAGE(STATUS -"Compilation with the Elas library: ${ELAS_LIBRARY} ") -SET( LIBRARIES ${ELAS_LINK_FLAGS} ${LIBRARIES}) -SET( LIBRARIES ${ELAS_LIBRARY} ${LIBRARIES}) + SET(CMAKE_C_FLAGS "-DUSE_ELAS ${CMAKE_C_FLAGS}") + MESSAGE(STATUS + "Compilation with the Elas library: ${ELAS_LIBRARY} ") + SET( LIBRARIES ${ELAS_LINK_FLAGS} ${LIBRARIES}) + SET( LIBRARIES ${ELAS_LIBRARY} ${LIBRARIES}) ENDIF ( ) @@ -101,18 +107,29 @@ ENDIF ( ) ##### ############################################################################ # mmg2d header files needed for library +# +# Remark: header installation would need to be cleaned, for now, to allow +# independent build of each project and because mmgs and mmg2d have been added +# to mmg3d without rethinking the install architecture, the header files that +# are common between codes are copied in all include directories (mmg/, +# mmg/mmg3d/, mmg/mmgs/, mmg/mmg2d/). they are also copied in build directory +# to enable library call without installation. SET( mmg2d_headers + ${MMG2D_SOURCE_DIR}/mmg2d_export.h ${MMG2D_SOURCE_DIR}/libmmg2d.h ${MMG2D_BINARY_DIR}/libmmg2df.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h - ${COMMON_BINARY_DIR}/mmgversion.h ) -IF (NOT WIN32 OR MINGW) - LIST(APPEND mmg2d_headers ${COMMON_BINARY_DIR}/git_log_mmg.h ) + +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + LIST ( APPEND mmg2d_headers + ${MMG2D_SOURCE_DIR}/libmmg2d_private.h + ${MMG2D_SOURCE_DIR}/mmg2dexterns_private.h + ) ENDIF() +# install man pages +INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg2d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + # Install header files in /usr/local or equivalent INSTALL(FILES ${mmg2d_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/mmg2d COMPONENT headers ) @@ -131,17 +148,6 @@ IF ( LIBMMG2D_SHARED ) "${mmg2d_library_files}" ${PROJECT_NAME}2d ) ENDIF() -############################################################################ -##### -##### Compile program to test library -##### -############################################################################ -SET(MMG2D_CI_TESTS ${CI_DIR}/mmg2d ) - -IF ( TEST_LIBMMG2D ) - INCLUDE(cmake/testing/libmmg2d_tests.cmake) -ENDIF ( ) - ############################################################################### ##### ##### Compile MMG2D executable @@ -149,7 +155,8 @@ ENDIF ( ) ############################################################################### ADD_AND_INSTALL_EXECUTABLE ( ${PROJECT_NAME}2d copy_2d_headers - "${mmg2d_library_files}" ${mmg2d_main_file} ) + "${mmg2d_library_files}" "${mmg2d_main_file}" ) + ############################################################################### ##### @@ -157,128 +164,28 @@ ADD_AND_INSTALL_EXECUTABLE ( ${PROJECT_NAME}2d copy_2d_headers ##### ############################################################################### +SET(MMG2D_CI_TESTS ${CI_DIR}/mmg2d ) + +##-------------------------------------------------------------------## +##-------------- Library examples and APIs ---------------------## +##-------------------------------------------------------------------## +IF ( TEST_LIBMMG2D ) + # Build library executables and add library tests if needed + INCLUDE(libmmg2d_tests) +ENDIF ( ) + +##-------------------------------------------------------------------## +##----------------------- Test Mmg2d executable ---------------------## +##-------------------------------------------------------------------## IF ( BUILD_TESTING ) - ##-------------------------------------------------------------------## - ##------- Set the continuous integration options --------------------## - ##-------------------------------------------------------------------## - ##-------------------------------------------------------------------## - ##--------------------------- Add tests and configure it ------------## - ##-------------------------------------------------------------------## # Add runtime that we want to test for mmg2d IF ( MMG2D_CI ) - ADD_EXEC_TO_CI_TESTS ( ${PROJECT_NAME}2d EXECUT_MMG2D ) - - IF ( TEST_LIBMMG2D ) - SET(LIBMMG2D_ADP0_a ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_adp_example0_a ) - SET(LIBMMG2D_ADP0_b ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_adp_example0_b ) - SET(LIBMMG2D_ADP1 ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_adp_example1 ) - SET(LIBMMG2D_ADP2 ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_adp_example2 ) - SET(LIBMMG2D_GENE0 ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_gene_example0 ) - SET(LIBMMG2D_LS0 ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_ls_example0 ) - SET(LIBMMG2D_LSONLY ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_lsOnly ) - SET(LIBMMG2D_LSANDMETRIC ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_lsAndMetric ) - SET(TEST_API2D_EXEC0 ${EXECUTABLE_OUTPUT_PATH}/test_api2d_0) - - - ADD_TEST(NAME libmmg2d_adp_example0_a COMMAND ${LIBMMG2D_ADP0_a} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example0/example0_a/init.mesh" - "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_0_a-init.o" - ) - ADD_TEST(NAME libmmg2d_adp_example0_b COMMAND ${LIBMMG2D_ADP0_b} - "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_0_b.o.mesh" - ) - ADD_TEST(NAME libmmg2d_adp_example1 COMMAND ${LIBMMG2D_ADP1} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example1/dom.mesh" - "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_1-dom.o" - ) - ADD_TEST(NAME libmmg2d_adp_example2 COMMAND ${LIBMMG2D_ADP2} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example1/dom.mesh" - "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_2-dom.o" - "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_2-dom-end.o" - ) - ADD_TEST(NAME libmmg2d_gene_example0 COMMAND ${LIBMMG2D_GENE0} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/squareGeneration_example0/carretest.mesh" - "${CTEST_OUTPUT_DIR}/libmmg2d_Generation_0-carre.o" - ) - ADD_TEST(NAME libmmg2d_ls0_io_0 COMMAND ${LIBMMG2D_LS0} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/io_multisols_example0/naca-multiSols.mesh" - "${CTEST_OUTPUT_DIR}/libmmg2d_io_0-naca.o" "0" - ) - ADD_TEST(NAME libmmg2d_ls0_io_1 COMMAND ${LIBMMG2D_LS0} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/io_multisols_example0/naca-multiSols.mesh" - "${CTEST_OUTPUT_DIR}/libmmg2d_io_0-naca.o" "1" - ) - ADD_TEST(NAME libmmg2d_lsOnly COMMAND ${LIBMMG2D_LSONLY} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" - "${CTEST_OUTPUT_DIR}/libmmg2d_lsOnly_multimat.o" - ) - ADD_TEST(NAME libmmg2d_lsAndMetric COMMAND ${LIBMMG2D_LSANDMETRIC} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" - "${CTEST_OUTPUT_DIR}/libmmg2d_lsAndMetric_multimat.o" - ) - ADD_TEST(NAME test_api2d_0 COMMAND ${TEST_API2D_EXEC0} - "${MMG2D_CI_TESTS}/API_tests/2dom.mesh" - "${CTEST_OUTPUT_DIR}/test_API2d.o" - ) - - - IF ( CMAKE_Fortran_COMPILER) - SET(LIBMMG2D_EXECFORTRAN_a ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_fortran_a ) - SET(LIBMMG2D_EXECFORTRAN_b ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_fortran_b ) - SET(LIBMMG2D_EXECFORTRAN_IO ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_fortran_io ) - SET(LIBMMG2D_EXECFORTRAN_LSONLY ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_fortran_lsOnly ) - SET(LIBMMG2D_EXECFORTRAN_LSANDMETRIC ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_fortran_lsAndMetric ) - SET(TEST_API2D_FORTRAN_EXEC0 ${EXECUTABLE_OUTPUT_PATH}/test_api2d_fortran_0) - SET(TEST_IO2D_FORTRAN_EXEC ${EXECUTABLE_OUTPUT_PATH}/test_io2d_fortran) - - - ADD_TEST(NAME libmmg2d_fortran_a COMMAND ${LIBMMG2D_EXECFORTRAN_a} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example0_fortran/example0_a/init.mesh" - "${CTEST_OUTPUT_DIR}/libmmg2d-Adaptation_Fortran_0_a-init.o" - ) - ADD_TEST(NAME libmmg2d_fortran_b COMMAND ${LIBMMG2D_EXECFORTRAN_b} - "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_Fortran_0_b.o" - ) - ADD_TEST(NAME libmmg2d_fortran_io_0 COMMAND ${LIBMMG2D_EXECFORTRAN_IO} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/io_multisols_example0/naca-multiSols.mesh" - "${CTEST_OUTPUT_DIR}/libmmg2d_Fortran_io-naca.o" "0" - ) - ADD_TEST(NAME libmmg2d_fortran_io_1 COMMAND ${LIBMMG2D_EXECFORTRAN_IO} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/io_multisols_example0/naca-multiSols.mesh" - "${CTEST_OUTPUT_DIR}/libmmg2d_Fortran_io-naca.o" "1" - ) - ADD_TEST(NAME libmmg2d_fortran_lsOnly COMMAND ${LIBMMG2D_EXECFORTRAN_LSONLY} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" - "${CTEST_OUTPUT_DIR}/libmmg2d_lsOnly_multimat.o" - ) - ADD_TEST(NAME libmmg2d_fortran_lsAndMetric COMMAND ${LIBMMG2D_EXECFORTRAN_LSANDMETRIC} - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" - "${CTEST_OUTPUT_DIR}/libmmg2d_lsAndMetric_multimat.o" - ) - ADD_TEST(NAME test_api2d_fortran_0 COMMAND ${TEST_API2D_FORTRAN_EXEC0} - "${MMG2D_CI_TESTS}/API_tests/2dom.mesh" - "${CTEST_OUTPUT_DIR}/test_API2d.o" - ) - ADD_TEST(NAME test_io2d_fortran_scalar COMMAND ${TEST_IO2D_FORTRAN_EXEC} - "${MMG2D_CI_TESTS}/Hybrid/hybrid.mesh" - "${CTEST_OUTPUT_DIR}/hybrid-2d-scal.o" 0 - ) - ADD_TEST(NAME test_io2d_fortran_array COMMAND ${TEST_IO2D_FORTRAN_EXEC} - "${MMG2D_CI_TESTS}/Hybrid/hybrid.mesh" - "${CTEST_OUTPUT_DIR}/hybrid-2d-array.o" 1 - ) - - ENDIF() - - ENDIF() + SET ( EXECUT_MMG2D $ ) IF ( ONLY_VERY_SHORT_TESTS ) + # Add tests that doesn't require to download meshes SET ( CTEST_OUTPUT_DIR ${PROJECT_BINARY_DIR}/TEST_OUTPUTS ) ADD_TEST(NAME mmg2d_very_short COMMAND ${EXECUT_MMG2D} @@ -286,8 +193,9 @@ IF ( BUILD_TESTING ) "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_0_a-init.o" ) ELSE ( ) - # Add mmg2d tests - INCLUDE( ${PROJECT_SOURCE_DIR}/cmake/testing/mmg2d_tests.cmake ) + # Add mmg2d tests that require to download meshes + INCLUDE( mmg2d_tests ) + ENDIF ( ) ENDIF( MMG2D_CI ) diff --git a/cmake/modules/mmg3d.cmake b/cmake/modules/mmg3d.cmake index d75f13ec1..0adab9aa7 100644 --- a/cmake/modules/mmg3d.cmake +++ b/cmake/modules/mmg3d.cmake @@ -40,11 +40,13 @@ FILE(MAKE_DIRECTORY ${MMG3D_BINARY_DIR}) ############################################################################ -GENERATE_FORTRAN_HEADER ( mmg3d - ${MMG3D_SOURCE_DIR} libmmg3d.h - ${MMG3D_SHRT_INCLUDE} - ${MMG3D_BINARY_DIR} libmmg3df.h - ) +if (PERL_FOUND) + GENERATE_FORTRAN_HEADER ( mmg3d + ${MMG3D_SOURCE_DIR} libmmg3d.h + mmg/common + ${MMG3D_BINARY_DIR} libmmg3df.h + ) +endif (PERL_FOUND) ############################################################################ ##### @@ -52,11 +54,11 @@ GENERATE_FORTRAN_HEADER ( mmg3d ##### ############################################################################ # Should we use patterns for insertion istead of delaunay kernel -IF ( NOT PATTERN ) +IF ( NOT MMG_PATTERN ) MESSAGE(STATUS "Vertex insertion by delaunay kernel") ELSE() MESSAGE(STATUS "Vertex insertion by patterns") - SET(CMAKE_C_FLAGS "-DPATTERN ${CMAKE_C_FLAGS}") + SET(CMAKE_C_FLAGS "-DMMG_PATTERN ${CMAKE_C_FLAGS}") ENDIF() ############################################################################### @@ -70,22 +72,26 @@ FILE( GLOB mmg3d_library_files ${MMG3D_SOURCE_DIR}/*.c - ${COMMON_SOURCE_DIR}/*.c + ${MMGCOMMON_SOURCE_DIR}/*.c + ${MMG3D_SOURCE_DIR}/*.h + ${MMGCOMMON_SOURCE_DIR}/*.h ${MMG3D_SOURCE_DIR}/inoutcpp_3d.cpp ) LIST(REMOVE_ITEM mmg3d_library_files - ${MMG3D_SOURCE_DIR}/${PROJECT_NAME}3d.c + ${MMG3D_SOURCE_DIR}/mmg3d.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ) -IF ( VTK_FOUND ) +IF ( VTK_FOUND AND NOT USE_VTK MATCHES OFF ) LIST(APPEND mmg3d_library_files - ${COMMON_SOURCE_DIR}/vtkparser.cpp) + ${MMGCOMMON_SOURCE_DIR}/vtkparser.cpp) ENDIF ( ) FILE( GLOB mmg3d_main_file ${MMG3D_SOURCE_DIR}/mmg3d.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ) ############################################################################ @@ -94,9 +100,9 @@ FILE( ##### ############################################################################ -IF( ELAS_FOUND ) +IF( ELAS_FOUND AND NOT USE_ELAS MATCHES OFF ) # Set flags for building test program - INCLUDE_DIRECTORIES(PUBLIC ${ELAS_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(AFTER ${ELAS_INCLUDE_DIR}) SET(CMAKE_REQUIRED_INCLUDES ${ELAS_INCLUDE_DIR}) SET(CMAKE_REQUIRED_LIBRARIES ${ELAS_LIBRARY}) @@ -128,44 +134,56 @@ IF ( LIBMMG3D_SHARED ) ENDIF() # mmg3d header files needed for library +# +# Remark: header installation would need to be cleaned, for now, to allow +# independent build of each project and because mmgs and mmg2d have been added +# to mmg3d without rethinking the install architecture, the header files that +# are common between codes are copied in all include directories (mmg/, +# mmg/mmg3d/, mmg/mmgs/, mmg/mmg2d/). they are also copied in build directory +# to enable library call without installation. SET( mmg3d_headers + ${MMG3D_SOURCE_DIR}/mmg3d_export.h ${MMG3D_SOURCE_DIR}/libmmg3d.h ${MMG3D_BINARY_DIR}/libmmg3df.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h - ${COMMON_BINARY_DIR}/mmgversion.h ) -IF (NOT WIN32 OR MINGW) - LIST(APPEND mmg3d_headers ${COMMON_BINARY_DIR}/git_log_mmg.h ) + +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + LIST ( APPEND mmg3d_headers + ${MMG3D_SOURCE_DIR}/libmmg3d_private.h + ${MMG3D_SOURCE_DIR}/inlined_functions_3d_private.h + ${MMG3D_SOURCE_DIR}/mmg3dexterns_private.h + ${MMG3D_SOURCE_DIR}/PRoctree_3d_private.h + ) ENDIF() +# install man pages +INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg3d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) # Install header files in /usr/local or equivalent INSTALL(FILES ${mmg3d_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/mmg3d COMPONENT headers) -# Copy header files in project directory at build step -COPY_HEADERS_AND_CREATE_TARGET ( ${MMG3D_SOURCE_DIR} ${MMG3D_BINARY_DIR} ${MMG3D_INCLUDE} 3d ) +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMG3D_SOURCE_DIR} inlined_functions_3d_private ${MMG3D_INCLUDE} 3d) -############################################################################ -##### -##### Compile program to test library -##### -############################################################################ -SET(MMG3D_CI_TESTS ${CI_DIR}/mmg3d ) -SET(MMG_CI_TESTS ${CI_DIR}/mmg ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMG3D_SOURCE_DIR} PRoctree_3d_private ${MMG3D_INCLUDE} 3d) + + LIST ( APPEND tgt_opt_list copy3d_inlined_functions_3d_private + copy3d_PRoctree_3d_private ) -IF ( TEST_LIBMMG3D ) - INCLUDE(cmake/testing/libmmg3d_tests.cmake) ENDIF() +# Copy header files in project directory at build step +COPY_HEADERS_AND_CREATE_TARGET ( ${MMG3D_SOURCE_DIR} ${MMG3D_BINARY_DIR} ${MMG3D_INCLUDE} 3d ) + ############################################################################### ##### ##### Compile MMG3D executable ##### ############################################################################### ADD_AND_INSTALL_EXECUTABLE ( ${PROJECT_NAME}3d copy_3d_headers - "${mmg3d_library_files}" ${mmg3d_main_file} ) + "${mmg3d_library_files}" "${mmg3d_main_file}" ) ############################################################################### ##### @@ -173,14 +191,22 @@ ADD_AND_INSTALL_EXECUTABLE ( ${PROJECT_NAME}3d copy_3d_headers ##### ############################################################################### +SET(MMG3D_CI_TESTS ${CI_DIR}/mmg3d ) +SET(MMG_CI_TESTS ${CI_DIR}/mmg ) + +##-------------------------------------------------------------------## +##-------------- Library examples and APIs ---------------------## +##-------------------------------------------------------------------## +IF ( TEST_LIBMMG3D ) + # Build executables for library examples and add related tests if needed + INCLUDE(libmmg3d_tests) +ENDIF() + +##-------------------------------------------------------------------## +##----------------------- Test Mmg3d executable ---------------------## +##-------------------------------------------------------------------## IF ( BUILD_TESTING ) - ##-------------------------------------------------------------------## - ##------- Set the continuous integration options --------------------## - ##-------------------------------------------------------------------## - ##-------------------------------------------------------------------## - ##--------------------------- Add tests and configure it ------------## - ##-------------------------------------------------------------------## # Add runtime that we want to test for mmg3d IF ( MMG3D_CI ) @@ -192,143 +218,11 @@ IF ( BUILD_TESTING ) SET ( RUN_AGAIN OFF ) ENDIF ( ) - ADD_EXEC_TO_CI_TESTS ( ${PROJECT_NAME}3d EXECUT_MMG3D ) - SET ( LISTEXEC_MMG ${EXECUT_MMG3D} ) - - IF ( TEST_LIBMMG3D ) - SET(LIBMMG3D_EXEC0_a ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example0_a) - SET(LIBMMG3D_EXEC0_b ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example0_b) - SET(LIBMMG3D_EXEC1 ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example1) - SET(LIBMMG3D_EXEC2 ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example2) - SET(LIBMMG3D_EXEC4 ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example4) - SET(LIBMMG3D_EXEC5 ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example5) - SET(LIBMMG3D_EXEC6 ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example6_io) - SET(LIBMMG3D_LSONLY ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_lsOnly ) - SET(LIBMMG3D_LSANDMETRIC ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_lsAndMetric ) - SET(TEST_API3D_EXEC0 ${EXECUTABLE_OUTPUT_PATH}/test_api3d_0) - SET(TEST_API3D_DOMSEL ${EXECUTABLE_OUTPUT_PATH}/test_api3d_domain-selection) - SET(TEST_API3D_VTK2MESH ${EXECUTABLE_OUTPUT_PATH}/test_api3d_vtk2mesh) - SET(TEST_COMPARE_PARA_TRIA ${EXECUTABLE_OUTPUT_PATH}/test_compare-para-tria) - - ADD_TEST(NAME libmmg3d_example0_a COMMAND ${LIBMMG3D_EXEC0_a} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/adaptation_example0/example0_a/cube.mesh" - "${CTEST_OUTPUT_DIR}/libmmg3d_Adaptation_0_a-cube.o" - ) - ADD_TEST(NAME libmmg3d_example0_b COMMAND ${LIBMMG3D_EXEC0_b} - "${CTEST_OUTPUT_DIR}/libmmg3d_Adaptation_0_b.o.mesh" - ) - ADD_TEST(NAME libmmg3d_example1 COMMAND ${LIBMMG3D_EXEC1} - "${CTEST_OUTPUT_DIR}/libmmg3d_Adaptation_1.o.mesh" - ) - ADD_TEST(NAME libmmg3d_example2 COMMAND ${LIBMMG3D_EXEC2} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/adaptation_example2/2spheres.mesh" - "${CTEST_OUTPUT_DIR}/libmmg3d_Adaptation_1-2spheres_1.o" - "${CTEST_OUTPUT_DIR}/libmmg3d_Adaptation_1-2spheres_2.o" - ) - IF ( ELAS_FOUND ) - ADD_TEST(NAME libmmg3d_example4 COMMAND ${LIBMMG3D_EXEC4} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/LagrangianMotion_example0/tinyBoxt" - "${CTEST_OUTPUT_DIR}/libmmg3d_LagrangianMotion_0-tinyBoxt.o" - ) - ENDIF () - ADD_TEST(NAME libmmg3d_example6_io_0 COMMAND ${LIBMMG3D_EXEC6} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_multisols_example6/torus.mesh" - "${CTEST_OUTPUT_DIR}/libmmg3d_io_6-naca.o" "0" - ) - ADD_TEST(NAME libmmg3d_example6_io_1 COMMAND ${LIBMMG3D_EXEC6} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_multisols_example6/torus.mesh" - "${CTEST_OUTPUT_DIR}/libmmg3d_io_6-naca.o" "1" - ) - ADD_TEST(NAME libmmg3d_lsOnly COMMAND ${LIBMMG3D_LSONLY} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/plane.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/m.sol" - "${CTEST_OUTPUT_DIR}/libmmg3d_lsOnly_multimat.o" - ) - ADD_TEST(NAME libmmg3d_lsAndMetric COMMAND ${LIBMMG3D_LSANDMETRIC} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/plane.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/m.sol" - "${CTEST_OUTPUT_DIR}/libmmg3d_lsAndMetric_multimat.o" - ) - ADD_TEST(NAME test_api3d_0 COMMAND ${TEST_API3D_EXEC0} - "${MMG3D_CI_TESTS}/API_tests/2dom.mesh" - "${CTEST_OUTPUT_DIR}/test_API3d.o" - ) - ADD_TEST(NAME test_api3d_domain-selection COMMAND ${TEST_API3D_DOMSEL} - "${MMG3D_CI_TESTS}/OptLs_plane/plane.mesh" - "${MMG3D_CI_TESTS}/OptLs_plane/p.sol" - "${CTEST_OUTPUT_DIR}/test_API3d-domsel-whole.o" - "${CTEST_OUTPUT_DIR}/test_API3d-domsel-dom2.o" - ) - ADD_TEST(NAME test_api3d_vtk2mesh COMMAND ${TEST_API3D_VTK2MESH} - "${MMG3D_CI_TESTS}/API_tests/cellsAndNode-data.vtk" - "${CTEST_OUTPUT_DIR}/test_API3d-vtk2mesh.o" - ) - - IF ( NOT VTK_FOUND ) - SET(expr "VTK library not founded") - SET_PROPERTY(TEST test_api3d_vtk2mesh - PROPERTY PASS_REGULAR_EXPRESSION "${expr}") - ENDIF ( ) - - ADD_TEST(NAME test_para_tria - COMMAND ${EXECUT_MMG3D} - -ar 0.02 -nofem -nosizreq -hgradreq -1 -hgrad -1 - ${MMG3D_CI_TESTS}/test_para_tria/proc0.mesh - -sol ${MMG3D_CI_TESTS}/test_para_tria/proc0.sol - ${CTEST_OUTPUT_DIR}/proc0.o.mesh - ) - - ADD_TEST(NAME test_compare_para_tria - COMMAND ${TEST_COMPARE_PARA_TRIA} - ${MMG3D_CI_TESTS}/test_para_tria/proc0.mesh - ${CTEST_OUTPUT_DIR}/proc0.o.mesh - ) - SET_TESTS_PROPERTIES ( test_compare_para_tria - PROPERTIES FIXTURES_REQUIRED test_para_tria ) - - IF ( CMAKE_Fortran_COMPILER) - SET(LIBMMG3D_EXECFORTRAN_a ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_fortran_a) - SET(LIBMMG3D_EXECFORTRAN_b ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_fortran_b) - SET(LIBMMG3D_EXECFORTRAN_IO ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_fortran_io) - SET(LIBMMG3D_EXECFORTRAN_LSONLY ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_fortran_lsOnly ) - SET(LIBMMG3D_EXECFORTRAN_LSANDMETRIC ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_fortran_lsAndMetric ) - SET(TEST_API3D_FORTRAN_EXEC0 ${EXECUTABLE_OUTPUT_PATH}/test_api3d_fortran_0) - - - ADD_TEST(NAME libmmg3d_fortran_a COMMAND ${LIBMMG3D_EXECFORTRAN_a} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/adaptation_example0_fortran/example0_a/cube.mesh" - "${CTEST_OUTPUT_DIR}/libmmg3d-Adaptation_Fortran_0_a-cube.o" - ) - ADD_TEST(NAME libmmg3d_fortran_b COMMAND ${LIBMMG3D_EXECFORTRAN_b} - "${CTEST_OUTPUT_DIR}/libmmg3d-Adaptation_Fortran_0_b-cube.o" - ) - ADD_TEST(NAME libmmg3d_fortran_io_0 COMMAND ${LIBMMG3D_EXECFORTRAN_IO} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_multisols_example6/torus.mesh" - "${CTEST_OUTPUT_DIR}/libmmg3d_Fortran_io-torus.o" "0" - ) - ADD_TEST(NAME libmmg3d_fortran_io_1 COMMAND ${LIBMMG3D_EXECFORTRAN_IO} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_multisols_example6/torus.mesh" - "${CTEST_OUTPUT_DIR}/libmmg3d_Fortran_io-torus.o" "1" - ) - ADD_TEST(NAME libmmg3d_fortran_lsOnly3d COMMAND ${LIBMMG3D_EXECFORTRAN_LSONLY} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/plane.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/m.sol" - "${CTEST_OUTPUT_DIR}/libmmg3d_lsOnly_multimat.o" ) - - ADD_TEST(NAME libmmg3d_fortran_lsAndMetric3d COMMAND ${LIBMMG3D_EXECFORTRAN_LSANDMETRIC} - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/plane.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/m.sol" - "${CTEST_OUTPUT_DIR}/libmmg3d_lsAndMetric_multimat.o" ) - ADD_TEST(NAME test_api3d_fortran_0 COMMAND ${TEST_API3D_FORTRAN_EXEC0} - "${MMG3D_CI_TESTS}/API_tests/2dom.mesh" - "${CTEST_OUTPUT_DIR}/test_API3d.o" - ) - - ENDIF() - - ENDIF ( TEST_LIBMMG3D ) + SET ( EXECUT_MMG3D $ ) + SET ( SHRT_EXECUT_MMG3D ${PROJECT_NAME}3d ) IF ( ONLY_VERY_SHORT_TESTS ) + # Add tests that doesn't require to download meshes SET ( CTEST_OUTPUT_DIR ${PROJECT_BINARY_DIR}/TEST_OUTPUTS ) ADD_TEST(NAME mmg3d_very_short COMMAND ${EXECUT_MMG3D} @@ -336,10 +230,9 @@ IF ( BUILD_TESTING ) "${CTEST_OUTPUT_DIR}/libmmg3d_Adaptation_0_a-cube.o" ) ELSE ( ) + # Add mmg3d tests that require to download meshes + INCLUDE( mmg3d_tests ) - # Add more tests - INCLUDE( ${PROJECT_SOURCE_DIR}/cmake/testing/mmg3d_tests.cmake ) - INCLUDE( ${PROJECT_SOURCE_DIR}/cmake/testing/mmg_tests.cmake ) ENDIF ( ) ENDIF ( MMG3D_CI ) diff --git a/cmake/modules/mmgcommon.cmake b/cmake/modules/mmgcommon.cmake new file mode 100644 index 000000000..9cac9fa4e --- /dev/null +++ b/cmake/modules/mmgcommon.cmake @@ -0,0 +1,163 @@ +## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +##** Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +## +## mmg is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## mmg is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +## License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= + +## ============================================================================= +## +## Installation and copy of common headers +## +## ============================================================================= + +SET(MMGCOMMON_SHRT_INCLUDE mmg/common ) +SET(MMGCOMMON_INCLUDE ${PROJECT_BINARY_DIR}/include/${MMGCOMMON_SHRT_INCLUDE} ) + + +############################################################################ +##### +##### Headers +##### +############################################################################ + +# common header files needed for mmg libraries +# +# Remark: header installation would need to be cleaned, for now, to allow +# independent build of each project and because mmgs and mmg2d have been added +# to mmg3d without rethinking the install architecture, the header files that +# are common between codes are copied in all include directories (mmg/, +# mmg/mmg3d/, mmg/mmgs/, mmg/mmg2d/). they are also copied in build directory +# to enable library call without installation. +SET( mmgcommon_headers + ${MMGCOMMON_SOURCE_DIR}/mmg_export.h + ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h + ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h + ${MMGCOMMON_BINARY_DIR}/mmgversion.h + ) +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + LIST ( APPEND mmgcommon_headers + ${MMGCOMMON_SOURCE_DIR}/libmmgcommon_private.h + ${MMGCOMMON_SOURCE_DIR}/mmgcommon_private.h + ${MMGCOMMON_SOURCE_DIR}/mmg_core_export_private.h + ${MMGCOMMON_SOURCE_DIR}/inlined_functions_private.h + ${MMGCOMMON_SOURCE_DIR}/mmgexterns_private.h + ${MMGCOMMON_SOURCE_DIR}/librnbg_private.h + ${MMGCOMMON_SOURCE_DIR}/chrono_private.h + ${MMGCOMMON_SOURCE_DIR}/eigenv_private.h + ${MMGCOMMON_SOURCE_DIR}/vtkparser.hpp + ) +ENDIF() + + +IF (NOT WIN32 OR MINGW) + LIST(APPEND mmgcommon_headers ${MMGCOMMON_BINARY_DIR}/git_log_mmg.h ) +ENDIF() + +# Install header files in /usr/local or equivalent +INSTALL(FILES ${mmgcommon_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/common COMPONENT headers) + +# Copy header files in project directory at build step +COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} libmmgtypes ${MMGCOMMON_INCLUDE} "mmgcommon") + +COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_BINARY_DIR} mmgcmakedefines ${MMGCOMMON_INCLUDE} "mmgcommon") + +COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} mmg_export + ${MMGCOMMON_INCLUDE} "mmgcommon") + +# Fortran generation +COPY_HEADER ( + ${MMGCOMMON_BINARY_DIR} mmgcmakedefinesf.h + ${MMGCOMMON_INCLUDE} mmgcmakedefinesf.h + mmgmmgcommon_mmgcmakedefines_header copymmgcommon_mmgcmakedefinesf ) + +COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_BINARY_DIR} mmgversion ${MMGCOMMON_INCLUDE} "mmgcommon") + +SET ( tgt_list copymmgcommon_libmmgtypes copymmgcommon_mmgcmakedefines + copymmgcommon_mmg_export copymmgcommon_mmgcmakedefinesf + copymmgcommon_mmgversion ) + +if (PERL_FOUND) + COPY_HEADER ( + ${MMGCOMMON_BINARY_DIR} libmmgtypesf.h + ${MMGCOMMON_INCLUDE} libmmgtypesf.h + mmg_fortran_header copymmgcommon_libmmgtypesf ) + + LIST ( APPEND tgt_list copymmgcommon_libmmgtypesf ) +endif() + +IF (NOT WIN32 OR MINGW) + COPY_HEADER ( + ${MMGCOMMON_BINARY_DIR} git_log_mmg.h + ${MMGCOMMON_INCLUDE} git_log_mmg.h + GenerateGitHashMmg copymmgcommon_mmggithash ) + + LIST ( APPEND tgt_list copymmgcommon_mmggithash) +ENDIF () + +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} libmmgcommon_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} mmgcommon_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} mmg_core_export_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} inlined_functions_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} mmgexterns_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} librnbg_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} chrono_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} eigenv_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + ADD_CUSTOM_TARGET(mmgcommon_vtkparser_header ALL + DEPENDS + ${MMGCOMMON_SOURCE_DIR}/vtkparser.hpp ) + + COPY_HEADER ( + ${MMGCOMMON_SOURCE_DIR} vtkparser.hpp + ${MMGCOMMON_INCLUDE} vtkparser.hpp + mmgcommon_vtkparser_header copymmgcommon_vtkparser ) + + + LIST ( APPEND tgt_list copymmgcommon_libmmgcommon_private + copymmgcommon_mmgcommon_private copymmgcommon_mmg_core_export_private + copymmgcommon_inlined_functions_private copymmgcommon_mmgexterns_private + copymmgcommon_librnbg_private copymmgcommon_chrono_private + copymmgcommon_eigenv_private copymmgcommon_vtkparser) + +ENDIF() + +ADD_CUSTOM_TARGET (copy_mmgcommon_headers ALL + DEPENDS ${tgt_list} ) diff --git a/cmake/modules/mmgs.cmake b/cmake/modules/mmgs.cmake index d89ce4d39..bc8957fc6 100644 --- a/cmake/modules/mmgs.cmake +++ b/cmake/modules/mmgs.cmake @@ -39,11 +39,13 @@ FILE(MAKE_DIRECTORY ${MMGS_BINARY_DIR}) ##### ############################################################################ -GENERATE_FORTRAN_HEADER ( mmgs - ${MMGS_SOURCE_DIR} libmmgs.h - ${MMGS_SHRT_INCLUDE} - ${MMGS_BINARY_DIR} libmmgsf.h - ) +if (PERL_FOUND) + GENERATE_FORTRAN_HEADER ( mmgs + ${MMGS_SOURCE_DIR} libmmgs.h + mmg/common + ${MMGS_BINARY_DIR} libmmgsf.h + ) +endif (PERL_FOUND) ############################################################################### ##### @@ -56,22 +58,26 @@ FILE( GLOB mmgs_library_files ${MMGS_SOURCE_DIR}/*.c - ${COMMON_SOURCE_DIR}/*.c + ${MMGCOMMON_SOURCE_DIR}/*.c + ${MMGS_SOURCE_DIR}/*.h + ${MMGCOMMON_SOURCE_DIR}/*.h ${MMGS_SOURCE_DIR}/inoutcpp_s.cpp ) LIST(REMOVE_ITEM mmgs_library_files ${MMGS_SOURCE_DIR}/mmgs.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ${REMOVE_FILE} ) IF ( VTK_FOUND ) LIST(APPEND mmgs_library_files - ${COMMON_SOURCE_DIR}/vtkparser.cpp ) + ${MMGCOMMON_SOURCE_DIR}/vtkparser.cpp ) ENDIF ( ) FILE( GLOB mmgs_main_file ${MMGS_SOURCE_DIR}/mmgs.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ) ############################################################################ @@ -93,41 +99,42 @@ IF ( LIBMMGS_SHARED ) ENDIF() # mmgs header files needed for library +# +# Remark: header installation would need to be cleaned, for now, to allow +# independent build of each project and because mmgs and mmg2d have been added +# to mmg3d without rethinking the install architecture, the header files that +# are common between codes are copied in all include directories (mmg/, +# mmg/mmg3d/, mmg/mmgs/, mmg/mmg2d/). they are also copied in build directory +# to enable library call without installation. SET( mmgs_headers + ${MMGS_SOURCE_DIR}/mmgs_export.h ${MMGS_SOURCE_DIR}/libmmgs.h ${MMGS_BINARY_DIR}/libmmgsf.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h - ${COMMON_BINARY_DIR}/mmgversion.h ) -IF (NOT WIN32 OR MINGW) - LIST(APPEND mmgs_headers ${COMMON_BINARY_DIR}/git_log_mmg.h ) + +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + LIST ( APPEND mmgs_headers + ${MMGS_SOURCE_DIR}/libmmgs_private.h + ${MMGS_SOURCE_DIR}/mmgsexterns_private.h + ) ENDIF() +# install man pages +INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmgs.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + # Install header files in /usr/local or equivalent INSTALL(FILES ${mmgs_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/mmgs COMPONENT headers) # Copy header files in project directory at build step COPY_HEADERS_AND_CREATE_TARGET ( ${MMGS_SOURCE_DIR} ${MMGS_BINARY_DIR} ${MMGS_INCLUDE} s ) -############################################################################ -##### -##### Compile program to test library -##### -############################################################################ - -IF ( TEST_LIBMMGS ) - INCLUDE(cmake/testing/libmmgs_tests.cmake) -ENDIF() - ############################################################################### ##### ##### Compile MMGS executable ##### ############################################################################### ADD_AND_INSTALL_EXECUTABLE ( ${PROJECT_NAME}s copy_s_headers - "${mmgs_library_files}" ${mmgs_main_file} ) + "${mmgs_library_files}" "${mmgs_main_file}" ) ############################################################################### ##### @@ -135,105 +142,31 @@ ADD_AND_INSTALL_EXECUTABLE ( ${PROJECT_NAME}s copy_s_headers ##### ############################################################################### -IF ( BUILD_TESTING ) - ##-------------------------------------------------------------------## - ##------- Set the continuous integration options --------------------## - ##-------------------------------------------------------------------## - SET(MMG2D_CI_TESTS ${CI_DIR}/mmg2d ) - SET(MMGS_CI_TESTS ${CI_DIR}/mmgs ) - SET(MMG_CI_TESTS ${CI_DIR}/mmg ) - - ##-------------------------------------------------------------------## - ##--------------------------- Add tests and configure it ------------## - ##-------------------------------------------------------------------## - # Add runtime that we want to test for mmgs - IF( MMGS_CI ) - - ADD_EXEC_TO_CI_TESTS ( ${PROJECT_NAME}s EXECUT_MMGS ) - SET ( LISTEXEC_MMG ${EXECUT_MMGS} ) +SET(MMG2D_CI_TESTS ${CI_DIR}/mmg2d ) +SET(MMGS_CI_TESTS ${CI_DIR}/mmgs ) +SET(MMG_CI_TESTS ${CI_DIR}/mmg ) - IF ( TEST_LIBMMGS ) - SET(LIBMMGS_EXEC0_a ${EXECUTABLE_OUTPUT_PATH}/libmmgs_example0_a) - SET(LIBMMGS_EXEC0_b ${EXECUTABLE_OUTPUT_PATH}/libmmgs_example0_b) - SET(LIBMMGS_EXEC1 ${EXECUTABLE_OUTPUT_PATH}/libmmgs_example1) - SET(LIBMMGS_EXEC2 ${EXECUTABLE_OUTPUT_PATH}/libmmgs_example2) - SET(LIBMMGS_EXEC3 ${EXECUTABLE_OUTPUT_PATH}/libmmgs_example3) - SET(LIBMMGS_LSONLY ${EXECUTABLE_OUTPUT_PATH}/libmmgs_lsOnly ) - SET(LIBMMGS_LSANDMETRIC ${EXECUTABLE_OUTPUT_PATH}/libmmgs_lsAndMetric ) +##-------------------------------------------------------------------## +##-------------- Library examples and APIs ---------------------## +##-------------------------------------------------------------------## +IF ( TEST_LIBMMGS ) + # Build executables for library examples and add library tests if needed + INCLUDE(libmmgs_tests) +ENDIF() +##-------------------------------------------------------------------## +##------------------------ Test Mmgs executable ---------------------## +##-------------------------------------------------------------------## +IF ( BUILD_TESTING ) - ADD_TEST(NAME libmmgs_example0_a COMMAND ${LIBMMGS_EXEC0_a} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/adaptation_example0/example0_a/cube.mesh" - "${CTEST_OUTPUT_DIR}/libmmgs_Adaptation_0_a-cube.o" - ) - ADD_TEST(NAME libmmgs_example0_b COMMAND ${LIBMMGS_EXEC0_b} - "${CTEST_OUTPUT_DIR}/libmmgs_Adaptation_0_b.o.mesh" - ) - ADD_TEST(NAME libmmgs_example1 COMMAND ${LIBMMGS_EXEC1} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/adaptation_example1/2spheres" - "${CTEST_OUTPUT_DIR}/libmmgs_Adaptation_1-2spheres_1.o" - "${CTEST_OUTPUT_DIR}/libmmgs_Adaptation_1-2spheres_2.o" - ) - ADD_TEST(NAME libmmgs_example2 COMMAND ${LIBMMGS_EXEC2} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_example0/teapot" - "${CTEST_OUTPUT_DIR}/libmmgs-IsosurfDiscretization_0-teapot.o" - ) - ADD_TEST(NAME libmmgs_example3_io_0 COMMAND ${LIBMMGS_EXEC3} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/io_multisols_example3/torus.mesh" - "${CTEST_OUTPUT_DIR}/libmmgs_io_3-naca.o" "0" - ) - ADD_TEST(NAME libmmgs_example3_io_1 COMMAND ${LIBMMGS_EXEC3} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/io_multisols_example3/torus.mesh" - "${CTEST_OUTPUT_DIR}/libmmgs_io_3-naca.o" "1" - ) - ADD_TEST(NAME libmmgs_lsOnly COMMAND ${LIBMMGS_LSONLY} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" - "${CTEST_OUTPUT_DIR}/libmmgs_lsOnly_multimat.o" - ) - ADD_TEST(NAME libmmgs_lsAndMetric COMMAND ${LIBMMGS_LSANDMETRIC} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" - "${CTEST_OUTPUT_DIR}/libmmgs_lsAndMetric_multimat.o" - ) + # Add runtime that we want to test for mmgs + IF( MMGS_CI ) - IF ( CMAKE_Fortran_COMPILER) - SET(LIBMMGS_EXECFORTRAN_a ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_a) - SET(LIBMMGS_EXECFORTRAN_b ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_b) - SET(LIBMMGS_EXECFORTRAN_IO ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_io) - SET(LIBMMGS_EXECFORTRAN_LSONLY ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_lsOnly ) - SET(LIBMMGS_EXECFORTRAN_LSANDMETRIC ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_lsAndMetric ) - - ADD_TEST(NAME libmmgs_fortran_a COMMAND ${LIBMMGS_EXECFORTRAN_a} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/adaptation_example0_fortran/example0_a/cube.mesh" - "${CTEST_OUTPUT_DIR}/libmmgs-Adaptation_Fortran_0_a-cube.o" - ) - ADD_TEST(NAME libmmgs_fortran_b COMMAND ${LIBMMGS_EXECFORTRAN_b} - "${CTEST_OUTPUT_DIR}/libmmgs_Adaptation_Fortran_0_b.o" - ) - ADD_TEST(NAME libmmgs_fortran_io_0 COMMAND ${LIBMMGS_EXECFORTRAN_IO} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/io_multisols_example3/torus.mesh" - "${CTEST_OUTPUT_DIR}/libmmgs_Fortran_io-torus.o" "0" - ) - ADD_TEST(NAME libmmgs_fortran_io_1 COMMAND ${LIBMMGS_EXECFORTRAN_IO} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/io_multisols_example3/torus.mesh" - "${CTEST_OUTPUT_DIR}/libmmgs_Fortran_io-torus.o" "1" - ) - ADD_TEST(NAME libmmgs_fortran_lsOnly COMMAND ${LIBMMGS_EXECFORTRAN_LSONLY} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" - "${CTEST_OUTPUT_DIR}/libmmgs_lsOnly_multimat.o" - ) - ADD_TEST(NAME libmmgs_fortran_lsAndMetric COMMAND ${LIBMMGS_EXECFORTRAN_LSANDMETRIC} - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat.mesh" - "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" - "${CTEST_OUTPUT_DIR}/libmmgs_lsAndMetric_multimat.o" - ) - ENDIF() - - ENDIF() + SET ( EXECUT_MMGS $ ) + SET ( SHRT_EXECUT_MMGS ${PROJECT_NAME}s) IF ( ONLY_VERY_SHORT_TESTS ) + # Add tests that doesn't require to download meshes SET ( CTEST_OUTPUT_DIR ${PROJECT_BINARY_DIR}/TEST_OUTPUTS ) ADD_TEST(NAME mmgs_very_short COMMAND ${EXECUT_MMGS} @@ -242,9 +175,8 @@ IF ( BUILD_TESTING ) ) ELSE ( ) - # Add mmgs tests - INCLUDE( ${PROJECT_SOURCE_DIR}/cmake/testing/mmgs_tests.cmake ) - INCLUDE( ${PROJECT_SOURCE_DIR}/cmake/testing/mmg_tests.cmake ) + # Add mmgs tests that require to download meshes + INCLUDE( mmgs_tests ) ENDIF ( ) ENDIF ( MMGS_CI ) diff --git a/cmake/modules/optional-dependencies.cmake b/cmake/modules/optional-dependencies.cmake new file mode 100644 index 000000000..6dee76df8 --- /dev/null +++ b/cmake/modules/optional-dependencies.cmake @@ -0,0 +1,150 @@ +## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +## Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +## +## mmg is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## mmg is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +## License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= + +############################################################################ +##### +##### Scotch +##### +############################################################################ +# Find SCOTCH library? +SET(SCOTCH_DIR "" CACHE PATH "Installation directory for scotch") + +# add Scotch library? +SET ( USE_SCOTCH "" CACHE STRING "Use SCOTCH tool for renumbering (ON, OFF or )" ) +SET_PROPERTY(CACHE USE_SCOTCH PROPERTY STRINGS "ON" "OFF" "") + +IF ( NOT DEFINED USE_SCOTCH OR USE_SCOTCH STREQUAL "" OR USE_SCOTCH MATCHES " +" ) + # Variable is not provided by user + FIND_PACKAGE(SCOTCH QUIET) + +ELSE () + IF ( USE_SCOTCH ) + # User wants to use scotch + FIND_PACKAGE(SCOTCH) + IF ( NOT SCOTCH_FOUND ) + MESSAGE ( FATAL_ERROR "Scotch library not found:" + "Using scotch reduce the execution time of mmg3d " + "(see https://gforge.inria.fr/frs/?group_id=248 to download it)." + "If you have already installed Scotch and want to use it, " + "please set the CMake variable or environment variable SCOTCH_DIR " + "to your scotch directory.") + ENDIF ( ) + ENDIF ( ) + +ENDIF ( ) + +If ( SCOTCH_FOUND AND NOT USE_SCOTCH MATCHES OFF) + add_definitions(-DUSE_SCOTCH) + + MESSAGE(STATUS + "Compilation with scotch: ${SCOTCH_LIBRARIES}") + SET( LIBRARIES ${SCOTCH_LIBRARIES} ${LIBRARIES}) +ENDIF() + + +############################################################################ +##### +##### LinearElasticity +##### +############################################################################ +# add LinearElasticity library? +SET(ELAS_DIR "" CACHE PATH "Installation directory for Elas") + +SET ( USE_ELAS "" CACHE STRING "Use the Elas library for lagrangian motion option (ON, OFF or )" ) +SET_PROPERTY(CACHE USE_ELAS PROPERTY STRINGS "ON" "OFF" "") + +IF ( NOT DEFINED USE_ELAS OR USE_ELAS STREQUAL "" OR USE_ELAS MATCHES " +" ) + INCLUDE(FindElas) + +ELSE() + IF ( USE_ELAS ) + # User wants to use elas + INCLUDE(FindElas) + IF ( NOT ELAS_FOUND ) + MESSAGE ( FATAL_ERROR "Elas is a library to solve the linear elasticity " + "problem (see https://github.com/ISCDtoolbox/LinearElasticity to" + " download it). " + "This library is needed to use the lagrangian motion option. " + "If you have already installed Elas and want to use it, " + "please set the CMake variable or environment variable ELAS_DIR " + "to your Elas directory.") + ENDIF ( ) + ENDIF ( ) + +ENDIF ( ) + +############################################################################ +##### +##### VTK (to parse (p)vtp/(p)vtu files ) +##### +############################################################################ +# add the VTK library ? +SET ( USE_VTK "" CACHE STRING "Use VTK I/O (ON, OFF or )" ) +SET_PROPERTY(CACHE USE_VTK PROPERTY STRINGS "ON" "OFF" "") + +IF ( NOT DEFINED USE_VTK OR USE_VTK STREQUAL "" OR USE_VTK MATCHES " +" OR USE_VTK ) + # Variable is not provided by the user or is setted to on + + # Handle vtk components name change between v8.2 and v9 + # Before v9 + FIND_PACKAGE(VTK QUIET) + IF ( VTK_FOUND ) + message (STATUS "VTK_VERSION: ${VTK_VERSION}") + IF (VTK_VERSION VERSION_LESS "9.0.0") + find_package(VTK COMPONENTS + vtkCommonCore + vtkCommonDataModel + vtkIOLegacy + vtkIOParallel + vtkIOParallelXML + vtkIOXML + QUIET) + ELSE() + # After v9 + FIND_PACKAGE(VTK COMPONENTS + CommonCore + CommonDataModel + IOLegacy + IOParallel + IOParallelXML + IOXML + QUIET) + ENDIF() + + ELSEIF ( USE_VTK ) + # USE_VTK is not empty so user explicitely ask for VTK... + # but it is not found: raise an error + MESSAGE(FATAL_ERROR "VTK library not found.") + ENDIF() +ENDIF() + +IF ( VTK_FOUND AND NOT USE_VTK MATCHES OFF) + add_definitions(-DUSE_VTK) + + MESSAGE ( STATUS "Compilation with VTK: add vtk, vtp and vtu I/O." ) + + IF( "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" LESS 8.90 ) + INCLUDE ( ${VTK_USE_FILE} ) + ENDIF() + + SET( LIBRARIES ${VTK_LIBRARIES} ${LIBRARIES} ) +ENDIF ( ) diff --git a/cmake/modules/packages.cmake b/cmake/modules/packages.cmake new file mode 100644 index 000000000..f064fd4be --- /dev/null +++ b/cmake/modules/packages.cmake @@ -0,0 +1,52 @@ +## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +## Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +## +## mmg is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## mmg is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +## License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= + +############################################################################### +##### +##### Create Package +##### +############################################################################### + +INCLUDE(InstallRequiredSystemLibraries) +SET( CPACK_ARCHIVE_COMPONENT_INSTALL ON ) +SET( CPACK_COMPONENT_ALL appli ) +SET( CPACK_SOURCE_GENERATOR TGZ ) +SET( CPACK_GENERATOR TGZ ) + +SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) +SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1) +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MMG: 2d, surface and 3d remeshers") +SET(CPACK_PACKAGE_VENDOR "Cécile Dobrzynski, Pascal Frey, Charles Dapogny," + " Algiane Froehly") +SET(CPACK_PACKAGE_CONTACT "contact@mmgtools.org") +SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md") +SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") +SET(CPACK_PACKAGE_VERSION ${CMAKE_RELEASE_VERSION}) +SET(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_RELEASE_VERSION_MAJOR}) +SET(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_RELEASE_VERSION_MINOR}) +SET(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_RELEASE_VERSION_PATCH}) +SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") +SET(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_INSTALL_DIRECTORY}-${CMAKE_SYSTEM}) +SET(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}") +SET(CPACK_OUTPUT_FILE_PREFIX "../archives") + +INCLUDE(CPack) diff --git a/cmake/supp/libSystem.supp b/cmake/supp/libSystem.supp deleted file mode 100644 index 48d3f531a..000000000 --- a/cmake/supp/libSystem.supp +++ /dev/null @@ -1,21 +0,0 @@ -{ - - Memcheck:Leak - fun:malloc - fun:__Balloc_D2A -} -{ - - Memcheck:Leak - fun:malloc - fun:__parsefloat_buf - fun:__svfscanf_l -} -{ - - Memcheck:Leak - fun:malloc - fun:__smakebuf - fun:__swsetup -} - diff --git a/cmake/testing/code/compare-para-tria.c b/cmake/testing/code/compare-para-tria.c index c8f63e54c..c61cc9c60 100644 --- a/cmake/testing/code/compare-para-tria.c +++ b/cmake/testing/code/compare-para-tria.c @@ -45,8 +45,8 @@ // if the header file is in the "include" directory // #include "libmmg3d.h" // if the header file is in "include/mmg/mmg3d" +#include "libmmg3d_private.h" #include "mmg/mmg3d/libmmg3d.h" -#include "mmg3d.h" #define TRIA_PARBDY(tag) ((tag[0] & MG_PARBDY) && (tag[1] & MG_PARBDY) && (tag[2] & MG_PARBDY) ) @@ -105,9 +105,9 @@ int main(int argc,char *argv[]) { } /** Hash parallel triangle using their reference as key */ - int k; - int maxref = 0; - int npar1 = 0; + MMG5_int k; + MMG5_int maxref = 0; + MMG5_int npar1 = 0; for ( k=1; k<=mesh1->nt; ++k ) { MMG5_pTria pt = &mesh1->tria[k]; if ( (!MG_EOK(pt)) || !(TRIA_PARBDY(pt->tag)) ) { @@ -118,7 +118,7 @@ int main(int argc,char *argv[]) { } /* Check data consistency with mesh2 */ - int npar2 = 0; + MMG5_int npar2 = 0; for ( k=1; k<=mesh2->nt; ++k ) { MMG5_pTria pt = &mesh2->tria[k]; if ( (!MG_EOK(pt)) || !(TRIA_PARBDY(pt->tag)) ) { @@ -128,7 +128,8 @@ int main(int argc,char *argv[]) { if ( pt->ref > maxref ) { fprintf(stderr,"Error: %s: %d:" " maximal reference of parallel boundaries mimatch:" - " max ref in mesh1 is %d while ref %d founded in mesh2.\n", + " max ref in mesh1 is %"MMG5_PRId" while ref %"MMG5_PRId" " + "founded in mesh2.\n", __func__,__LINE__,maxref,pt->ref); exit(EXIT_FAILURE); } @@ -136,7 +137,7 @@ int main(int argc,char *argv[]) { if ( npar2 != npar1 ) { fprintf(stderr,"Error: %s: %d:" - " number of parallel boundaries mimatch: %d versus %d.\n", + " number of parallel boundaries mimatch: %"MMG5_PRId" versus %"MMG5_PRId".\n", __func__,__LINE__,npar1,npar2); exit(EXIT_FAILURE); } @@ -164,17 +165,18 @@ int main(int argc,char *argv[]) { continue; } - int k1 = hash.geom[pt2->ref].a; + MMG5_int k1 = hash.geom[pt2->ref].a; if ( !k1 ) { fprintf(stderr,"Error: %s: %d:" - " face of parallel ref %d not found in hashtable.\n", + " face of parallel ref %"MMG5_PRId" not found in hashtable.\n", __func__,__LINE__,pt2->ref); exit(EXIT_FAILURE); } MMG5_pTria pt1 = &mesh1->tria[k1]; if ( (!MG_EOK(pt1)) || !(TRIA_PARBDY(pt1->tag)) ) { fprintf(stderr,"Error: %s: %d:" - " parallel tria %d in mesh2 (ref %d) is not valid in mesh1 (tria %d).\n", + " parallel tria %"MMG5_PRId" in mesh2 (ref %"MMG5_PRId") is not" + " valid in mesh1 (tria %"MMG5_PRId").\n", __func__,__LINE__,k,pt2->ref,k1); exit(EXIT_FAILURE); } @@ -195,10 +197,12 @@ int main(int argc,char *argv[]) { fprintf(stderr,"Error: %s: %d:" " ref of vertices mismatch.\n", __func__,__LINE__); - fprintf(stderr," Vertices of triangle %d in mesh1 have refs %d %d %d\n", + fprintf(stderr," Vertices of triangle %"MMG5_PRId" in mesh1 have refs" + " %"MMG5_PRId" %"MMG5_PRId" %"MMG5_PRId"\n", k1,mesh1->point[pt1->v[0]].ref,mesh1->point[pt1->v[1]].ref, mesh1->point[pt1->v[2]].ref); - fprintf(stderr," Vertices of triangle %d in mesh2 have refs %d %d %d\n", + fprintf(stderr," Vertices of triangle %"MMG5_PRId" in mesh2 have refs" + " %"MMG5_PRId" %"MMG5_PRId" %"MMG5_PRId"\n", k,mesh2->point[pt2->v[0]].ref,mesh2->point[pt2->v[1]].ref, mesh2->point[pt2->v[2]].ref); exit(EXIT_FAILURE); @@ -215,10 +219,12 @@ int main(int argc,char *argv[]) { fprintf(stderr,"Error: %s: %d:" " ref of vertices %d and %d mismatch.\n", __func__,__LINE__,i,i2); - fprintf(stderr," Vertices of triangle %d in mesh1 have refs %d %d %d\n", + fprintf(stderr," Vertices of triangle %"MMG5_PRId" in mesh1 have " + "refs %"MMG5_PRId" %"MMG5_PRId" %"MMG5_PRId"\n", k1,mesh1->point[pt1->v[0]].ref,mesh1->point[pt1->v[1]].ref, mesh1->point[pt1->v[2]].ref); - fprintf(stderr," Vertices of triangle %d in mesh2 have refs %d %d %d\n", + fprintf(stderr," Vertices of triangle %"MMG5_PRId" in mesh2 have " + "refs %"MMG5_PRId" %"MMG5_PRId" %"MMG5_PRId"\n", k,mesh2->point[pt2->v[0]].ref,mesh2->point[pt2->v[1]].ref, mesh2->point[pt2->v[2]].ref); exit(EXIT_FAILURE); @@ -228,7 +234,8 @@ int main(int argc,char *argv[]) { for (j=0; j<3; ++j) { if ( fabs(ppt1->c[j]-ppt2->c[j]) > 1e-5 ) { fprintf(stderr,"Error: %s: %d:" - " Elts %d and %d: coor %d of vertices %d and %d (ref %d)" + " Elts %"MMG5_PRId" and %"MMG5_PRId": coor %d of" + " vertices %d and %d (ref %"MMG5_PRId")" " differs: %15lf versus %15lf.\n",__func__,__LINE__, k1,k,j,i,i2,ppt1->ref,ppt1->c[j],ppt2->c[j]); exit(EXIT_FAILURE); diff --git a/cmake/testing/code/mmg2d_io.F90 b/cmake/testing/code/mmg2d_io.F90 index 1e2a1fb97..15404ca36 100644 --- a/cmake/testing/code/mmg2d_io.F90 +++ b/cmake/testing/code/mmg2d_io.F90 @@ -18,6 +18,8 @@ PROGRAM main MMG5_DATA_PTR_T :: mmgSol INTEGER :: ier,argc,by_array CHARACTER(len=300) :: exec_name,filein,fileout,option + !> to cast integers into MMG5F_INT integers + INTEGER,PARAMETER :: immg = MMG5F_INT PRINT*," -- TEST MMG2DLIB" @@ -56,7 +58,7 @@ PROGRAM main !> ------------------------------ STEP II -------------------------- !! Disable corner detection to check the corner setting - call mmg2d_set_iparameter(mmgMesh,mmgSol,MMG2D_IPARAM_angle,0,ier) + call mmg2d_set_iparameter(mmgMesh,mmgSol,MMG2D_IPARAM_angle,0_immg,ier) !! remesh function CALL MMG2D_mmg2dlib(mmgMesh,mmgSol,ier) @@ -88,10 +90,11 @@ subroutine loadmesh(mesh,filename,by_array) character(len=*), intent(in) :: filename integer, intent(in) :: by_array - INTEGER :: i,np,nc,ne,nt,nq,ier + INTEGER :: ier + INTEGER(MMG5F_INT) :: i,np,nc,ne,nt,nq REAL(KIND=8), DIMENSION(:,:), ALLOCATABLE :: vert - integer, dimension(:,:), allocatable :: edg,tri,quad - integer, dimension(:) , allocatable :: vert_ref,corner,edg_ref,tri_ref,quad_ref + INTEGER(MMG5F_INT), dimension(:,:), allocatable :: edg,tri,quad + INTEGER(MMG5F_INT), dimension(:) , allocatable :: vert_ref,edg_ref,tri_ref,quad_ref,corner !! Parse file @@ -238,16 +241,17 @@ subroutine loadmesh(mesh,filename,by_array) end subroutine loadmesh subroutine writemesh(mesh,filename,by_array) - implicit NONE MMG5_DATA_PTR_T, intent(inout) :: mesh character(len=*), intent(in) :: filename integer, intent(in) :: by_array - INTEGER :: k,np,nc,ne,nt,nq,inm=13,ier,nreq + INTEGER(MMG5F_INT) :: k,np,nc,ne,nt,nq,nreq + INTEGER :: inm=13,ier REAL(KIND=8), DIMENSION(:,:), ALLOCATABLE :: vert - integer, dimension(:,:), allocatable :: edg,tri,quad - integer, dimension(:) , allocatable :: vert_ref,corner,required,edg_ref,tri_ref,quad_ref + INTEGER(MMG5F_INT), dimension(:,:), allocatable :: edg,tri,quad + INTEGER(MMG5F_INT), dimension(:) , allocatable :: vert_ref,edg_ref,tri_ref,quad_ref + INTEGER, DIMENSION(:), ALLOCATABLE :: corner,required !> a) get the size of the mesh: vertices, tetra, triangles, edges CALL MMG2D_Get_meshSize(mesh,np,nt,nq,ne,ier) diff --git a/cmake/testing/code/ridge-preservation-in-ls-mode.c b/cmake/testing/code/ridge-preservation-in-ls-mode.c new file mode 100644 index 000000000..f8b65d755 --- /dev/null +++ b/cmake/testing/code/ridge-preservation-in-ls-mode.c @@ -0,0 +1,173 @@ +/* ============================================================================= +** This file is part of the mmg software package for the tetrahedral +** mesh modification. +** Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +** +** mmg is free software: you can redistribute it and/or modify it +** under the terms of the GNU Lesser General Public License as published +** by the Free Software Foundation, either version 3 of the License, or +** (at your option) any later version. +** +** mmg is distributed in the hope that it will be useful, but WITHOUT +** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +** License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License and of the GNU General Public License along with mmg (in +** files COPYING.LESSER and COPYING). If not, see +** . Please read their terms carefully and +** use this copy of the mmg distribution only if you accept them. +** ============================================================================= +*/ + +/** + * Example of use of the mmg3d library (basic use of mesh adaptation) + * + * \author Charles Dapogny (LJLL, UPMC) + * \author Cécile Dobrzynski (Inria / IMB, Université de Bordeaux) + * \author Pascal Frey (LJLL, UPMC) + * \author Algiane Froehly (Inria / IMB, Université de Bordeaux) + * \version 5 + * \copyright GNU Lesser General Public License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/** Include the mmg3d library hader file */ +// if the header file is in the "include" directory +// #include "libmmg3d.h" +// if the header file is in "include/mmg/mmg3d" +#include "libmmg3d_private.h" +#include "mmg/mmg3d/libmmg3d.h" + + +int main(int argc,char *argv[]) { + MMG5_pMesh mesh1,mesh2; + MMG5_pSol sol1,sol2; + char *file1, *file2; + + fprintf(stdout," -- CHECK FOR PRESERVATION OF INPUT RIDGES IN LS MODE \n"); + + if ( argc != 3 ) { + printf(" Usage: %s filein fileout \n",argv[0]); + printf(" filout has to come from the call of Mmg over the" + " filein mesh with -noinsert -noswap -rn 0 arguments.\n"); + return(1); + } + + /* Name and path of the mesh file */ + file1 = (char *) calloc(strlen(argv[1]) + 1, sizeof(char)); + if ( file1 == NULL ) { + perror(" ## Memory problem: calloc"); + exit(EXIT_FAILURE); + } + strcpy(file1,argv[1]); + + file2 = (char *) calloc(strlen(argv[2]) + 1, sizeof(char)); + if ( file2 == NULL ) { + perror(" ## Memory problem: calloc"); + exit(EXIT_FAILURE); + } + strcpy(file2,argv[2]); + + /** Read meshes */ + mesh1 = NULL; + mesh2 = NULL; + sol1 = NULL; + sol2 = NULL; + MMG3D_Init_mesh(MMG5_ARG_start, + MMG5_ARG_ppMesh,&mesh1, + MMG5_ARG_ppMet,&sol1, + MMG5_ARG_end); + + if ( MMG3D_loadMesh(mesh1,file1) != 1 ) { + fprintf(stderr,"Error: %s: %d: File not found %s\n.",__func__,__LINE__,file1); + exit(EXIT_FAILURE); + } + + + MMG3D_Init_mesh(MMG5_ARG_start, + MMG5_ARG_ppMesh,&mesh2, + MMG5_ARG_ppMet,&sol2, + MMG5_ARG_end); + + if ( MMG3D_loadMesh(mesh2,file2) != 1 ) { + fprintf(stderr,"Error: %s: %d: File not found %s\n.",__func__,__LINE__,file2); + exit(EXIT_FAILURE); + } + + /** We want to check that all ridges of input mesh are still ridges in the + * output of Mmg, that is, the second mesh of the current app) */ + + /* Step 1: Hash edges of mesh2 and store their tags */ + MMG5_int k; + MMG5_HGeom hash; + MMG5_hNew(mesh2,&hash,mesh2->na,3*mesh2->na); + + for ( k=1; k<=mesh2->na; ++k ) { + MMG5_pEdge ped = &mesh2->edge[k]; + if ( !MMG5_hEdge(mesh2,&hash,ped->a,ped->b,ped->ref,ped->tag) ) { + fprintf(stderr,"Error: %s: %d: Unable to hash edge %" MMG5_PRId + ": %" MMG5_PRId " %" MMG5_PRId ".\n", + __func__,__LINE__,k,ped->a,ped->b); + exit(EXIT_FAILURE); + } + } + + /* Step 2: Travel ridges of mesh1 and check that, if it is found in mesh2, it + * is a ridge too (as level-set splitting may splits boudary edges, we can't + * ensure that all ridges of input mesh will be present in the output mesh + * (they may have been splitted) */ + MMG5_int ier = 0; + for ( k=1; k<=mesh1->na; ++k ) { + MMG5_pEdge ped = &mesh1->edge[k]; + if ( ped->tag & MG_GEO ) { + MMG5_int ref; + int16_t tag; + if ( !MMG5_hGet(&hash,ped->a,ped->b,&ref,&tag) ) { + continue; + } + if ( ! (tag & MG_GEO) ) { + /* ridge of mesh1 exists in mesh2 but is not ridge anymore */ + fprintf(stderr,"Error: %s: %d: Ridge %" MMG5_PRId + " (%" MMG5_PRId " %" MMG5_PRId ") of first mesh is not" + " ridge in second mesh.\n",__func__,__LINE__,k,ped->a,ped->b); + ++ier; + } + } + } + + if ( ier ) { + fprintf(stderr,"Error: %s: %d: At least %" MMG5_PRId " missing ridges.\n", + __func__,__LINE__,ier); + exit(EXIT_FAILURE); + } + + MMG5_SAFE_FREE(hash.geom); + + /** 3) Free the MMG3D5 structures */ + MMG3D_Free_all(MMG5_ARG_start, + MMG5_ARG_ppMesh,&mesh1, + MMG5_ARG_ppMet,&sol1, + MMG5_ARG_end); + MMG3D_Free_all(MMG5_ARG_start, + MMG5_ARG_ppMesh,&mesh2, + MMG5_ARG_ppMet,&sol2, + MMG5_ARG_end); + + free(file1); + file1 = NULL; + + free(file2); + file2 = NULL; + + return 0; +} diff --git a/cmake/testing/code/test_met2d.c b/cmake/testing/code/test_met2d.c new file mode 100644 index 000000000..daccb93c3 --- /dev/null +++ b/cmake/testing/code/test_met2d.c @@ -0,0 +1,110 @@ +/** + * Test matrix algebra in 2D. + * + * \author Luca Cirrottola (Inria) + * \version 1 + * \copyright GNU Lesser General Public License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/** Include the mmg2d library header file */ +// if the header file is in the "include" directory +// #include "libmmg2d.h" +// if the header file is in "include/mmg/mmg2d" +#include "mmg/mmg2d/libmmg2d.h" +#include "mmgcommon_private.h" + +int main(int argc,char *argv[]) { + MMG5_pMesh mmgMesh; + MMG5_pSol mmgSol; + + fprintf(stdout," -- TEST MATRIX ALGEBRA IN 2D \n"); + + if ( argc != 1 ) { + printf(" Usage: %s\n",argv[0]); + return(1); + } + + + /** ------------------------------ STEP I -------------------------- */ + /** 1) Initialisation of mesh and sol structures */ + /* args of InitMesh: + * MMG5_ARG_start: we start to give the args of a variadic func + * MMG5_ARG_ppMesh: next arg will be a pointer over a MMG5_pMesh + * &mmgMesh: pointer toward your MMG5_pMesh (that store your mesh) + * MMG5_ARG_ppMet: next arg will be a pointer over a MMG5_pSol storing a metric + * &mmgSol: pointer toward your MMG5_pSol (that store your metric) */ + + mmgMesh = NULL; + mmgSol = NULL; + MMG2D_Init_mesh(MMG5_ARG_start, + MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol, + MMG5_ARG_end); + + /* Set inoffensive hmin and hmax for metric intersection */ + if( !MMG2D_Set_dparameter(mmgMesh,mmgSol,MMG2D_DPARAM_hmin,1.e-6) ) + return EXIT_FAILURE; + if( !MMG2D_Set_dparameter(mmgMesh,mmgSol,MMG2D_DPARAM_hmax,1.e+6) ) + return EXIT_FAILURE; + + + /** ------------------------------ STEP II -------------------------- */ + + /* matrix inversion test */ + if( !MMG5_test_invmat22() ) + return(EXIT_FAILURE); + + /* symmetric matrix eigendecomposition test */ + double m_sym[3] = {2.,1.,2.}; /* Test matrix, non-symmetric storage */ + double lambda_sym[2] = {1.,3.}; /* Exact eigenvalues */ + double vp_sym[2][2] = {{1./sqrt(2.),-1./sqrt(2.)}, + {1./sqrt(2.),1./sqrt(2.)}}; /* Exact eigenvectors */ + if( !MMG5_test_eigenvmatsym2d(mmgMesh,m_sym,lambda_sym,vp_sym) ) + return EXIT_FAILURE; + + /* non-symmetric matrix eigendecomposition test */ + double m_nonsym[4] = { -98., 99., + -198.,199.}; /* Test matrix, non-symmetric storage */ + double lambda_nonsym[2] = {1.,100.}; /* Exact eigenvalues */ + double vp_nonsym[2][2] = {{1./sqrt(2.),1./sqrt(2.)}, + {1./sqrt(5.),2./sqrt(5.)}}; /* Exact right eigenvectors */ + double ivp_nonsym[2][2] = {{2.*sqrt(2.),-sqrt(5.)}, + { -sqrt(2.), sqrt(5.)}}; /* Exact right eigenvectors inverse */ + if( !MMG5_test_eigenvmatnonsym2d(mmgMesh,m_nonsym,lambda_nonsym,vp_nonsym,ivp_nonsym) ) + return EXIT_FAILURE; + + /* simultaneous reduction test */ + double m[3] = { 508., -504, 502.}; /* Test matrix 1 */ + double n[3] = {4020.,-2020.,1020.}; /* Test matrix 2 */ + double dm[2] = { 1., 100. }; /* Exact cobasis projection 1 */ + double dn[2] = {500., 4. }; /* Exact cobasis projection 2 */ + double vp[2][2] = {{1./sqrt(2.),1./sqrt(2.)}, + {1./sqrt(5.),2./sqrt(5.)}}; /* Exact cobasis vectors */ + if( !MMG5_test_simred2d(mmgMesh,m,n,dm,dn,vp) ) + return EXIT_FAILURE; + + /* matrix inverse transformation test */ + if( !MMG5_test_updatemet2d_ani() ) + return EXIT_FAILURE; + + /* metrics intersection test */ + if( !MMG5_test_intersecmet22(mmgMesh) ) + return EXIT_FAILURE; + + /** ------------------------------ STEP III -------------------------- */ + + /** 3) Free the MMG2D structures */ + MMG2D_Free_all(MMG5_ARG_start, + MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol, + MMG5_ARG_end); + + return(0); +} diff --git a/cmake/testing/code/test_met3d.c b/cmake/testing/code/test_met3d.c new file mode 100644 index 000000000..c5ca460ff --- /dev/null +++ b/cmake/testing/code/test_met3d.c @@ -0,0 +1,184 @@ +/** + * Test matrix algebra in 3D. + * + * \author Luca Cirrottola (Inria) + * \version 1 + * \copyright GNU Lesser General Public License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/** Include the mmg3d library header file */ +// if the header file is in the "include" directory +// #include "libmmg3d.h" +// if the header file is in "include/mmg/mmg3d" +#include "mmg/mmg3d/libmmg3d.h" +#include "mmgcommon_private.h" + +int main(int argc,char *argv[]) { + MMG5_pMesh mmgMesh; + MMG5_pSol mmgSol; + + fprintf(stdout," -- TEST MATRIX ALGEBRA IN 3D \n"); + + if ( argc != 1 ) { + printf(" Usage: %s\n",argv[0]); + return(1); + } + + + /** ------------------------------ STEP I -------------------------- */ + /** 1) Initialisation of mesh and sol structures */ + /* args of InitMesh: + * MMG5_ARG_start: we start to give the args of a variadic func + * MMG5_ARG_ppMesh: next arg will be a pointer over a MMG5_pMesh + * &mmgMesh: pointer toward your MMG5_pMesh (that store your mesh) + * MMG5_ARG_ppMet: next arg will be a pointer over a MMG5_pSol storing a metric + * &mmgSol: pointer toward your MMG5_pSol (that store your metric) */ + + mmgMesh = NULL; + mmgSol = NULL; + MMG3D_Init_mesh(MMG5_ARG_start, + MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol, + MMG5_ARG_end); + + /* Set inoffensive hmin and hmax for metric intersection */ + if( !MMG3D_Set_dparameter(mmgMesh,mmgSol,MMG3D_DPARAM_hmin,1.e-6) ) + return EXIT_FAILURE; + if( !MMG3D_Set_dparameter(mmgMesh,mmgSol,MMG3D_DPARAM_hmax,1.e+6) ) + return EXIT_FAILURE; + + + /** ------------------------------ STEP II -------------------------- */ + + /* matrix inversion test */ + if( !MMG5_test_invmat33() ) + return(EXIT_FAILURE); + + /* symmetric matrix eigendecomposition test */ + double m_sym[4][6] = {{2.,0.,0.,3.,4.,9.}, + {1.,0.,0.,50.5,49.5,50.5}, + {0.,1.,1.,0.,1.,0.}, + {1.00495,-1.33511e-23,7.43048e-13,1.00495,-5.35377e-13,1.00502}}; /* Test matrices */ + double lambda_sym[4][3] = {{1.,2.,11.}, + {1.,1.,100.}, + {-1.,-1.,2.}, + {1.00495,1.00495,1.00502}}; /* Exact eigenvalues */ + double vp_sym[4][3][3] = {{{0.,-2./sqrt(5.),1./sqrt(5.)}, + {1.,0.,0.}, + {0.,1./sqrt(5.),2./sqrt(5.)}}, + {{1.,0.,0.}, + {0.,1./sqrt(2.),-1./sqrt(2.)}, + {0.,1./sqrt(2.),1./sqrt(2.)}}, + {{0.,-1./sqrt(2.), 1./sqrt(2.)}, + {2./sqrt(6.),-1./sqrt(6.),-1./sqrt(6.)}, + {1./sqrt(3.), 1./sqrt(3.), 1./sqrt(3.)}}, + {{1.,0.,0.}, + {0.,1.,0.}, + {0.,0.,1.}}}; /* Exact eigenvectors */ + for( int8_t i = 0; i < 3; i++ ) + if( !MMG5_test_eigenvmatsym3d(mmgMesh,m_sym[i],lambda_sym[i],vp_sym[i]) ) + return(EXIT_FAILURE); + + /* non-symmetric matrix eigendecomposition test */ + double m_nonsym[3][9] = {{500.5,-499.5,499.5, + -49.5, 50.5, 49.5, + 450., -450., 550.}, + {50.5,-49.5,49.5, + 0., 1., 0., + 49.5,-49.5,50.5}, + {1.00495,-1.33511e-23,7.43048e-13, + -1.33511e-23,1.00495,-5.35377e-13, + 7.43048e-13,-5.35377e-13,1.00502}}; /* Test matrices */ + double lambda_nonsym[3][3] = {{1.,100.,1000.}, + {1., 1., 100.}, + {1.00495,1.00495,1.00502}}; /* Exact eigenvalues */ + double vp_nonsym[3][3][3] = {{{1./sqrt(2.),1./sqrt(2.),0.}, + {0., 1./sqrt(2.),1./sqrt(2.)}, + {1./sqrt(2.), 0.,1./sqrt(2.)}}, + {{1./sqrt(2.),1./sqrt(2.),0.}, + {0., 1./sqrt(2.),1./sqrt(2.)}, + {1./sqrt(2.), 0.,1./sqrt(2.)}}, + {{1.,0.,0.}, + {0.,1.,0.}, + {0.,0.,1.}}}; /* Exact right eigenvectors */ + double ivp_nonsym[3][3][3] = {{{ 1./sqrt(2.),-1./sqrt(2.), 1./sqrt(2.)}, + { 1./sqrt(2.), 1./sqrt(2.),-1./sqrt(2.)}, + {-1./sqrt(2.), 1./sqrt(2.), 1./sqrt(2.)}}, + {{ 1./sqrt(2.),-1./sqrt(2.), 1./sqrt(2.)}, + { 1./sqrt(2.), 1./sqrt(2.),-1./sqrt(2.)}, + {-1./sqrt(2.), 1./sqrt(2.), 1./sqrt(2.)}}, + {{1.,0.,0.}, + {0.,1.,0.}, + {0.,0.,1.}}}; /* Exact right eigenvectors inverse */ + for( int8_t i = 0; i < 2; i++ ) + if( !MMG5_test_eigenvmatnonsym3d(mmgMesh,m_nonsym[i],lambda_nonsym[i],vp_nonsym[i],ivp_nonsym[i]) ) + return(EXIT_FAILURE); + + /* test 3x3 matrix transposition */ + if( !MMG5_test_transpose3d() ) + return(EXIT_FAILURE); + + /* test vector scalar product */ + if( !MMG5_test_dotprod() ) + return(EXIT_FAILURE); + + /* test vector product */ + if( !MMG5_test_crossprod3d() ) + return(EXIT_FAILURE); + + /* symmetric matrix multiplication test */ + if( !MMG5_test_mn() ) + return(EXIT_FAILURE); + + /* matrix linear transformation test */ + if( !MMG5_test_rmtr() ) + return(EXIT_FAILURE); + + /* rotation matrix test */ + if( !MMG5_test_rotmatrix() ) + return(EXIT_FAILURE); + + /* simultaneous reduction test */ + double m[2][6] = {{111./2.,-109./2., 89./2.,111./2.,-91./2.,111./2.}, + {370.15769255207715, 0., 0., 370.15769255207715, 0., 381.10501238659111}}; /* Test matrix 1 */ + double n[2][6] = {{409./2.,-393./2.,-407./2.,409./2.,391./2.,409./2.}, + {371.98959740363608, -4.9420191999593769E-21, 2.7504505534267797E-10, 371.98959740363608, -1.9817373851183142E-10, 383.0188865492878 }}; /* Test matrix 2 */ + double dm[2][3] = {{1., 10.,100.}, + {3.701532847548294e+02, 3.701621003493249e+02, 3.811050123865912e+02}}; /* Exact cobasis projection 1 */ + double dn[2][3] = {{8.,400., 1.}, + {3.719851677922659e+02, 3.719940270150061e+02, 3.830188865492879e+02}}; /* Exact cobasis projection 2 */ + double vp[2][3][3] = {{{1./sqrt(2.),1./sqrt(2.),0.}, + {0., 1./sqrt(2.),1./sqrt(2.)}, + {1./sqrt(2.), 0.,1./sqrt(2.)}}, + {{-7.070983648930086e-01, -7.071067772799207e-01, 1.959912696770420e-09}, + {-7.071151974800862e-01, 7.071067849929998e-01, 1.204549101753515e-08}, + {-1.018954010056916e-08, 7.341563327822146e-09, -1.000000000000000e+00}}}; /* Exact cobasis vectors */ + for( int8_t i = 0; i < 1; i++ ) + if( !MMG5_test_simred3d(mmgMesh,m[i],n[i],dm[i],dn[i],vp[i]) ) + return(EXIT_FAILURE); + + /* matrix inverse transformation test */ + if( !MMG5_test_updatemet3d_ani() ) + return EXIT_FAILURE; + + /* metrics intersection test */ + if( !MMG5_test_intersecmet33(mmgMesh) ) + return EXIT_FAILURE; + + /** ------------------------------ STEP III -------------------------- */ + + /** 3) Free the MMG3D structures */ + MMG3D_Free_all(MMG5_ARG_start, + MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol, + MMG5_ARG_end); + + return(0); +} diff --git a/cmake/testing/libmmg2d_tests.cmake b/cmake/testing/libmmg2d_tests.cmake index 4a7fa1a3d..025a747a5 100644 --- a/cmake/testing/libmmg2d_tests.cmake +++ b/cmake/testing/libmmg2d_tests.cmake @@ -23,7 +23,7 @@ ############################################################################### ##### -##### Mmg2d library examples +##### Build executables ##### ############################################################################### @@ -35,9 +35,18 @@ SET ( MMG2D_LIB_TESTS libmmg2d_gene_example0 libmmg2d_ls_example0 libmmg2d_lsOnly + libmmg2d_lsOnly_optim + libmmg2d_lsOnly_hsiz + libmmg2d_lsAndMetric_optim + libmmg2d_lsAndMetric_hsiz libmmg2d_lsAndMetric - test_api2d_0 ) + +# Additional tests that needs to download ci meshes +IF ( MMG2D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + LIST ( APPEND MMG2D_LIB_TESTS test_api2d_0 ) +ENDIF ( ) + SET ( MMG2D_LIB_TESTS_MAIN_PATH ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example0/example0_a/main.c ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example0/example0_b/main.c @@ -46,21 +55,40 @@ SET ( MMG2D_LIB_TESTS_MAIN_PATH ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/squareGeneration_example0/main.c ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/io_multisols_example0/main.c ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/main.c + ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/main_optim.c + ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/main_hsiz.c + ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsAndMetric/main_optim.c + ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsAndMetric/main_hsiz.c ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsAndMetric/main.c - ${MMG2D_CI_TESTS}/API_tests/2d.c ) +# Additional tests that needs to download ci meshes +# +# Remark: as they are piece of code, it would be probably better to keep it in +# the mmg repository (so we have versionning). Other pieces of code +# (compare-para-tria and ridge-preservation-in-ls-mode) are hosted in the repo, +# I don't think that there is a reason for the difference in the choice of +# hosting... + +IF ( MMG2D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + LIST ( APPEND MMG2D_LIB_TESTS_MAIN_PATH + ${MMG2D_CI_TESTS}/API_tests/2d.c + ) +ENDIF( ) + IF ( LIBMMG2D_STATIC ) SET ( lib_name lib${PROJECT_NAME}2d_a ) + SET ( lib_type "STATIC" ) ELSEIF ( LIBMMG2D_SHARED ) SET ( lib_name lib${PROJECT_NAME}2d_so ) + SET ( lib_type "SHARED" ) ELSE () MESSAGE(WARNING "You must activate the compilation of the static or" " shared ${PROJECT_NAME} library to compile this tests." ) ENDIF ( ) ##### Fortran Tests -IF ( CMAKE_Fortran_COMPILER ) +IF ( CMAKE_Fortran_COMPILER AND PERL_FOUND) ENABLE_LANGUAGE ( Fortran ) SET ( MMG2D_LIB_TESTS ${MMG2D_LIB_TESTS} @@ -68,22 +96,39 @@ IF ( CMAKE_Fortran_COMPILER ) libmmg2d_fortran_b libmmg2d_fortran_io libmmg2d_fortran_lsOnly + libmmg2d_fortran_lsOnly_optim + libmmg2d_fortran_lsOnly_hsiz + libmmg2d_fortran_lsAndMetric_optim + libmmg2d_fortran_lsAndMetric_hsiz libmmg2d_fortran_lsAndMetric - test_api2d_fortran_0 test_io2d_fortran ) + # Additional tests that needs to download ci meshes + IF ( MMG2D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + LIST ( APPEND MMG2D_LIB_TESTS test_api2d_fortran_0 ) + ENDIF( ) SET ( MMG2D_LIB_TESTS_MAIN_PATH ${MMG2D_LIB_TESTS_MAIN_PATH} ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example0_fortran/example0_a/main.F90 ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example0_fortran/example0_b/main.F90 ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/io_multisols_example0/main.F90 ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/main.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/main_optim.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/main_hsiz.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsAndMetric/main_optim.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsAndMetric/main_hsiz.F90 ${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsAndMetric/main.F90 - ${MMG2D_CI_TESTS}/API_tests/2d.F90 ${PROJECT_SOURCE_DIR}/cmake/testing/code/mmg2d_io.F90 ) + # Additional tests that needs to download ci meshes + IF ( MMG2D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + LIST ( APPEND MMG2D_LIB_TESTS_MAIN_PATH + ${MMG2D_CI_TESTS}/API_tests/2d.F90 + ) + ENDIF( ) + -ENDIF ( CMAKE_Fortran_COMPILER ) +ENDIF ( CMAKE_Fortran_COMPILER AND PERL_FOUND) LIST(LENGTH MMG2D_LIB_TESTS nbTests_tmp) MATH(EXPR nbTests "${nbTests_tmp} - 1") @@ -92,6 +137,136 @@ FOREACH ( test_idx RANGE ${nbTests} ) LIST ( GET MMG2D_LIB_TESTS ${test_idx} test_name ) LIST ( GET MMG2D_LIB_TESTS_MAIN_PATH ${test_idx} main_path ) - ADD_LIBRARY_TEST ( ${test_name} ${main_path} copy_2d_headers ${lib_name} ) + ADD_LIBRARY_TEST ( ${test_name} ${main_path} copy_2d_headers ${lib_name} ${lib_type}) ENDFOREACH ( ) + +SET ( src_test_met2d + ${PROJECT_SOURCE_DIR}/src/common/bezier.c + ${PROJECT_SOURCE_DIR}/src/common/eigenv.c + ${PROJECT_SOURCE_DIR}/src/common/mettools.c + ${PROJECT_SOURCE_DIR}/src/common/anisosiz.c + ${PROJECT_SOURCE_DIR}/src/common/isosiz.c + ${PROJECT_SOURCE_DIR}/src/common/tools.c + ${PROJECT_SOURCE_DIR}/src/common/mmgexterns.c + ${PROJECT_SOURCE_DIR}/cmake/testing/code/test_met2d.c + ) +ADD_LIBRARY_TEST ( test_met2d "${src_test_met2d}" copy_2d_headers ${lib_name} ${lib_type}) +TARGET_LINK_LIBRARIES ( test_met2d PRIVATE ${M_LIB} ) + +############################################################################### +##### +##### Add tests if needed +##### +############################################################################### + +ADD_TEST(NAME libmmg2d_adp_example0_a + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_adp_example0_a + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example0/example0_a/init.mesh" + "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_0_a-init.o" + ) +ADD_TEST(NAME libmmg2d_adp_example0_b + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_adp_example0_b + "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_0_b.o.mesh" + ) +ADD_TEST(NAME libmmg2d_adp_example1 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_adp_example1 + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example1/dom.mesh" + "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_1-dom.o" + ) +ADD_TEST(NAME libmmg2d_adp_example2 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_adp_example2 + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example1/dom.mesh" + "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_2-dom.o" + "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_2-dom-end.o" + ) +ADD_TEST(NAME libmmg2d_gene_example0 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_gene_example0 + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/squareGeneration_example0/carretest.mesh" + "${CTEST_OUTPUT_DIR}/libmmg2d_Generation_0-carre.o" + ) +ADD_TEST(NAME libmmg2d_ls0_io_0 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_ls_example0 + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/io_multisols_example0/naca-multiSols.mesh" + "${CTEST_OUTPUT_DIR}/libmmg2d_io_0-naca.o" "0" + ) +ADD_TEST(NAME libmmg2d_ls0_io_1 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_ls_example0 + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/io_multisols_example0/naca-multiSols.mesh" + "${CTEST_OUTPUT_DIR}/libmmg2d_io_0-naca.o" "1" + ) +ADD_TEST(NAME libmmg2d_lsOnly + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_lsOnly + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" + "${CTEST_OUTPUT_DIR}/libmmg2d_lsOnly_multimat.o" + ) +ADD_TEST(NAME libmmg2d_lsAndMetric + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_lsAndMetric + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" + "${CTEST_OUTPUT_DIR}/libmmg2d_lsAndMetric_multimat.o" + ) + +IF ( MMG2D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + ADD_TEST(NAME test_api2d_0 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_api2d_0 + "${MMG2D_CI_TESTS}/API_tests/2dom.mesh" + "${CTEST_OUTPUT_DIR}/test_API2d.o" + ) +ENDIF() + +ADD_TEST(NAME test_met2d COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_met2d ) + +IF ( CMAKE_Fortran_COMPILER AND PERL_FOUND) + ADD_TEST(NAME libmmg2d_fortran_a + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_fortran_a + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/adaptation_example0_fortran/example0_a/init.mesh" + "${CTEST_OUTPUT_DIR}/libmmg2d-Adaptation_Fortran_0_a-init.o" + ) + ADD_TEST(NAME libmmg2d_fortran_b + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_fortran_b + "${CTEST_OUTPUT_DIR}/libmmg2d_Adaptation_Fortran_0_b.o" + ) + ADD_TEST(NAME libmmg2d_fortran_io_0 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_fortran_io + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/io_multisols_example0/naca-multiSols.mesh" + "${CTEST_OUTPUT_DIR}/libmmg2d_Fortran_io-naca.o" "0" + ) + ADD_TEST(NAME libmmg2d_fortran_io_1 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_fortran_io + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/io_multisols_example0/naca-multiSols.mesh" + "${CTEST_OUTPUT_DIR}/libmmg2d_Fortran_io-naca.o" "1" + ) + ADD_TEST(NAME libmmg2d_fortran_lsOnly + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_fortran_lsOnly + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" + "${CTEST_OUTPUT_DIR}/libmmg2d_lsOnly_multimat.o" + ) + ADD_TEST(NAME libmmg2d_fortran_lsAndMetric + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg2d_fortran_lsAndMetric + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmg2d/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" + "${CTEST_OUTPUT_DIR}/libmmg2d_lsAndMetric_multimat.o" + ) + + IF ( MMG2D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + ADD_TEST(NAME test_api2d_fortran_0 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_api2d_fortran_0 + "${MMG2D_CI_TESTS}/API_tests/2dom.mesh" + "${CTEST_OUTPUT_DIR}/test_API2d.o" + ) + ADD_TEST(NAME test_io2d_fortran_scalar + COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_io2d_fortran + "${MMG2D_CI_TESTS}/Hybrid/hybrid.mesh" + "${CTEST_OUTPUT_DIR}/hybrid-2d-scal.o" 0 + ) + ADD_TEST(NAME test_io2d_fortran_array + COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_io2d_fortran + "${MMG2D_CI_TESTS}/Hybrid/hybrid.mesh" + "${CTEST_OUTPUT_DIR}/hybrid-2d-array.o" 1 + ) + ENDIF() + +ENDIF ( ) diff --git a/cmake/testing/libmmg3d_tests.cmake b/cmake/testing/libmmg3d_tests.cmake index 92af5936d..5e0922b5c 100644 --- a/cmake/testing/libmmg3d_tests.cmake +++ b/cmake/testing/libmmg3d_tests.cmake @@ -22,7 +22,7 @@ ############################################################################### ##### -##### Mmg3d library Examples +##### Build executables ##### ############################################################################### @@ -34,12 +34,28 @@ SET ( MMG3D_LIB_TESTS libmmg3d_example4 libmmg3d_example6_io libmmg3d_lsOnly + libmmg3d_lsOnly_optim + libmmg3d_lsOnly_hsiz + libmmg3d_lsAndMetric_optim + libmmg3d_lsAndMetric_hsiz libmmg3d_lsAndMetric - test_api3d_0 - test_api3d_domain-selection - test_api3d_vtk2mesh - test_compare-para-tria + libmmg3d_generic_io ) + +# Additional tests that needs to download ci meshes +IF ( MMG3D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + LIST ( APPEND MMG3D_LIB_TESTS + test_api3d_0 + test_api3d_domain-selection + test_api3d_vtk2mesh + # Remark: not clean -> next tests don't need the library in fact (moving them + # in app tests will ask to clean the installation of public and private + # headers, it will ask to sort the needed source files too). Added here, we + # can use the ADD_LIBRARY_TEST macro... + test_compare-para-tria + ) +ENDIF ( ) + SET ( MMG3D_LIB_TESTS_MAIN_PATH ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/adaptation_example0/example0_a/main.c ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/adaptation_example0/example0_b/main.c @@ -48,24 +64,44 @@ SET ( MMG3D_LIB_TESTS_MAIN_PATH ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/LagrangianMotion_example0/main.c ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_multisols_example6/main.c ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/main.c + ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/main_optim.c + ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/main_hsiz.c + ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsAndMetric/main_optim.c + ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsAndMetric/main_hsiz.c ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsAndMetric/main.c - ${MMG3D_CI_TESTS}/API_tests/3d.c - ${MMG3D_CI_TESTS}/API_tests/domain-selection.c - ${MMG3D_CI_TESTS}/API_tests/vtk2mesh.c - ${PROJECT_SOURCE_DIR}/cmake/testing/code/compare-para-tria.c + ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_generic_and_get_adja/genericIO.c ) +# Additional library tests that needs to download ci meshes to be run +# +# Remark: as they are piece of code, it would be probably better to keep it in +# the mmg repository (so we have versionning). Other pieces of code +# (compare-para-tria and ridge-preservation-in-ls-mode) are hosted in the repo, +# I don't think that there is a reason for the difference in the choice of +# hosting... +IF ( MMG3D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + LIST ( APPEND MMG3D_LIB_TESTS_MAIN_PATH + ${MMG3D_CI_TESTS}/API_tests/3d.c + ${MMG3D_CI_TESTS}/API_tests/domain-selection.c + ${MMG3D_CI_TESTS}/API_tests/vtk2mesh.c + # Following pieces of code are left in repo to take advantage of versionning + ${PROJECT_SOURCE_DIR}/cmake/testing/code/compare-para-tria.c + ) +ENDIF( ) + IF ( LIBMMG3D_STATIC ) SET ( lib_name lib${PROJECT_NAME}3d_a ) + SET ( lib_type "STATIC" ) ELSEIF ( LIBMMG3D_SHARED ) SET ( lib_name lib${PROJECT_NAME}3d_so ) + SET ( lib_type "SHARED" ) ELSE () MESSAGE(WARNING "You must activate the compilation of the static or" " shared ${PROJECT_NAME} library to compile this tests." ) ENDIF ( ) ##### Fortran Tests -IF ( CMAKE_Fortran_COMPILER ) +IF ( CMAKE_Fortran_COMPILER AND PERL_FOUND) ENABLE_LANGUAGE ( Fortran ) SET ( MMG3D_LIB_TESTS ${MMG3D_LIB_TESTS} @@ -73,20 +109,36 @@ IF ( CMAKE_Fortran_COMPILER ) libmmg3d_fortran_b libmmg3d_fortran_io libmmg3d_fortran_lsOnly + libmmg3d_fortran_lsOnly_optim + libmmg3d_fortran_lsOnly_hsiz + libmmg3d_fortran_lsAndMetric_optim + libmmg3d_fortran_lsAndMetric_hsiz libmmg3d_fortran_lsAndMetric - test_api3d_fortran_0 ) + # Additional tests that needs to download ci meshes + IF ( MMG3D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + LIST ( APPEND MMG3D_LIB_TESTS test_api3d_fortran_0 ) + ENDIF( ) SET ( MMG3D_LIB_TESTS_MAIN_PATH ${MMG3D_LIB_TESTS_MAIN_PATH} ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/adaptation_example0_fortran/example0_a/main.F90 ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/adaptation_example0_fortran/example0_b/main.F90 ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_multisols_example6/main.F90 ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/main.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/main_optim.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/main_hsiz.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsAndMetric/main_optim.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsAndMetric/main_hsiz.F90 ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsAndMetric/main.F90 - ${MMG3D_CI_TESTS}/API_tests/3d.F90 ) + # Additional tests that needs to download ci meshes + IF ( MMG3D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + LIST ( APPEND MMG3D_LIB_TESTS_MAIN_PATH + ${MMG3D_CI_TESTS}/API_tests/3d.F90 + ) + ENDIF( ) -ENDIF ( CMAKE_Fortran_COMPILER ) +ENDIF ( CMAKE_Fortran_COMPILER AND PERL_FOUND) LIST(LENGTH MMG3D_LIB_TESTS nbTests_tmp) MATH(EXPR nbTests "${nbTests_tmp} - 1") @@ -95,6 +147,208 @@ FOREACH ( test_idx RANGE ${nbTests} ) LIST ( GET MMG3D_LIB_TESTS ${test_idx} test_name ) LIST ( GET MMG3D_LIB_TESTS_MAIN_PATH ${test_idx} main_path ) - ADD_LIBRARY_TEST ( ${test_name} ${main_path} copy_3d_headers ${lib_name} ) + ADD_LIBRARY_TEST ( ${test_name} ${main_path} copy_3d_headers ${lib_name} ${lib_type} ) ENDFOREACH ( ) + +# Following source files are needed to find non exported symbols on windows +SET ( src_test_met3d + ${PROJECT_SOURCE_DIR}/src/common/bezier.c + ${PROJECT_SOURCE_DIR}/src/common/eigenv.c + ${PROJECT_SOURCE_DIR}/src/common/mettools.c + ${PROJECT_SOURCE_DIR}/src/common/anisosiz.c + ${PROJECT_SOURCE_DIR}/src/common/isosiz.c + ${PROJECT_SOURCE_DIR}/src/common/tools.c + ${PROJECT_SOURCE_DIR}/src/common/mmgexterns.c + ${PROJECT_SOURCE_DIR}/cmake/testing/code/test_met3d.c + ) +ADD_LIBRARY_TEST ( test_met3d "${src_test_met3d}" copy_3d_headers ${lib_name} ${lib_type}) +TARGET_LINK_LIBRARIES ( test_met3d PRIVATE ${M_LIB} ) + +IF ( MMG3D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + SET ( src_test_ridge_preservation_in_ls_mode + ${PROJECT_SOURCE_DIR}/src/common/boulep.c + ${PROJECT_SOURCE_DIR}/src/common/hash.c + ${PROJECT_SOURCE_DIR}/src/common/mmgexterns.c + ${PROJECT_SOURCE_DIR}/src/common/mmg2.c + ${PROJECT_SOURCE_DIR}/src/common/tools.c + ${PROJECT_SOURCE_DIR}/src/mmg3d/bezier_3d.c + ${PROJECT_SOURCE_DIR}/src/mmg3d/boulep_3d.c + ${PROJECT_SOURCE_DIR}/src/mmg3d/hash_3d.c + ${PROJECT_SOURCE_DIR}/src/mmg3d/tools_3d.c + ${PROJECT_SOURCE_DIR}/src/mmg3d/zaldy_3d.c + ${PROJECT_SOURCE_DIR}/cmake/testing/code/ridge-preservation-in-ls-mode.c ) + ADD_LIBRARY_TEST ( test_ridge_preservation_in_ls_mode "${src_test_ridge_preservation_in_ls_mode}" + copy_3d_headers ${lib_name} ${lib_type}) + TARGET_LINK_LIBRARIES ( test_ridge_preservation_in_ls_mode PRIVATE ${M_LIB} ) +ENDIF() + +############################################################################### +##### +##### Add tests if needed +##### +############################################################################### + +# Add tests +ADD_TEST(NAME libmmg3d_example0_a + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example0_a + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/adaptation_example0/example0_a/cube.mesh" + "${CTEST_OUTPUT_DIR}/libmmg3d_Adaptation_0_a-cube.o" + ) +ADD_TEST(NAME libmmg3d_example0_b + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example0_b + "${CTEST_OUTPUT_DIR}/libmmg3d_Adaptation_0_b.o.mesh" + ) +ADD_TEST(NAME libmmg3d_example1 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example1 + "${CTEST_OUTPUT_DIR}/libmmg3d_Adaptation_1.o.mesh" + ) +ADD_TEST(NAME libmmg3d_example2 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example2 + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/adaptation_example2/2spheres.mesh" + "${CTEST_OUTPUT_DIR}/libmmg3d_Adaptation_1-2spheres_1.o" + "${CTEST_OUTPUT_DIR}/libmmg3d_Adaptation_1-2spheres_2.o" + ) +IF ( ELAS_FOUND AND NOT USE_ELAS MATCHES OFF ) + ADD_TEST(NAME libmmg3d_example4 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example4 + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/LagrangianMotion_example0/tinyBoxt" + "${CTEST_OUTPUT_DIR}/libmmg3d_LagrangianMotion_0-tinyBoxt.o" + ) +ENDIF () + +ADD_TEST(NAME libmmg3d_example6_io_0 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example6_io + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_multisols_example6/torus.mesh" + "${CTEST_OUTPUT_DIR}/libmmg3d_io_6-naca.o" "0" + ) +ADD_TEST(NAME libmmg3d_example6_io_1 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example6_io + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_multisols_example6/torus.mesh" + "${CTEST_OUTPUT_DIR}/libmmg3d_io_6-naca.o" "1" + ) +ADD_TEST(NAME libmmg3d_lsOnly + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_lsOnly + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/plane.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/m.sol" + "${CTEST_OUTPUT_DIR}/libmmg3d_lsOnly_multimat.o" + ) +ADD_TEST(NAME libmmg3d_lsAndMetric + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_lsAndMetric + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/plane.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/m.sol" + "${CTEST_OUTPUT_DIR}/libmmg3d_lsAndMetric_multimat.o" + ) +ADD_TEST(NAME test_met3d COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_met3d) + +ADD_TEST(NAME libmmg3d_generic_io_msh + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_generic_io + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_generic_and_get_adja/cube.msh" + "${CTEST_OUTPUT_DIR}/cube.o.msh" "1" + ) +ADD_TEST(NAME libmmg3d_generic_io_mesh + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_generic_io + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_generic_and_get_adja/cube.mesh" + "${CTEST_OUTPUT_DIR}/cube.o.mesh" "1" + ) +ADD_TEST(NAME libmmg3d_generic_io_vtk + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_generic_io + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_generic_and_get_adja/cube.vtk" + "${CTEST_OUTPUT_DIR}/cube.o.vtk" "1" + ) +ADD_TEST(NAME libmmg3d_generic_io_vtu + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_generic_io + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_generic_and_get_adja/cube.vtu" + "${CTEST_OUTPUT_DIR}/cube.o.vtu" "1" + ) + +IF ( MMG3D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + ADD_TEST(NAME test_api3d_0 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_api3d_0 + "${MMG3D_CI_TESTS}/API_tests/2dom.mesh" + "${CTEST_OUTPUT_DIR}/test_API3d.o" + ) + ADD_TEST(NAME test_api3d_domain-selection + COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_api3d_domain-selection + "${MMG3D_CI_TESTS}/OptLs_plane/plane.mesh" + "${MMG3D_CI_TESTS}/OptLs_plane/p.sol" + "${CTEST_OUTPUT_DIR}/test_API3d-domsel-whole.o" + "${CTEST_OUTPUT_DIR}/test_API3d-domsel-dom2.o" + ) + ADD_TEST(NAME test_api3d_vtk2mesh + COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_api3d_vtk2mesh + "${MMG3D_CI_TESTS}/API_tests/cellsAndNode-data.vtk" + "${CTEST_OUTPUT_DIR}/test_API3d-vtk2mesh.o" + ) + ADD_TEST(NAME test_compare_para_tria + COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_compare-para-tria + ${MMG3D_CI_TESTS}/test_para_tria/proc0.mesh + ${CTEST_OUTPUT_DIR}/proc0.o.mesh + ) + SET_TESTS_PROPERTIES ( test_compare_para_tria + PROPERTIES FIXTURES_REQUIRED test_para_tria ) + + ADD_TEST(NAME test_ridge_preservation_in_ls_mode + COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_ridge_preservation_in_ls_mode + ${MMG3D_CI_TESTS}/OptLs_NM_ridge/cube-it2.mesh + ${CTEST_OUTPUT_DIR}/mmg3d_OptLs_NM_cube-it2.o.mesh + ) + SET_TESTS_PROPERTIES ( test_ridge_preservation_in_ls_mode + PROPERTIES FIXTURES_REQUIRED mmg3d_OptLs_NM_ridge ) + +ENDIF() + +IF ( (NOT VTK_FOUND) OR USE_VTK MATCHES OFF ) + SET(expr "VTK library not founded") + + IF ( MMG3D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + SET_PROPERTY(TEST test_api3d_vtk2mesh + PROPERTY PASS_REGULAR_EXPRESSION "${expr}") + ENDIF() + SET_PROPERTY(TEST libmmg3d_generic_io_vtk + PROPERTY PASS_REGULAR_EXPRESSION "${expr}") + SET_PROPERTY(TEST libmmg3d_generic_io_vtu + PROPERTY PASS_REGULAR_EXPRESSION "${expr}") +ENDIF ( ) + +IF ( CMAKE_Fortran_COMPILER AND PERL_FOUND) + ADD_TEST(NAME libmmg3d_fortran_a + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_fortran_a + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/adaptation_example0_fortran/example0_a/cube.mesh" + "${CTEST_OUTPUT_DIR}/libmmg3d-Adaptation_Fortran_0_a-cube.o" + ) + ADD_TEST(NAME libmmg3d_fortran_b + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_fortran_b + "${CTEST_OUTPUT_DIR}/libmmg3d-Adaptation_Fortran_0_b-cube.o" + ) + ADD_TEST(NAME libmmg3d_fortran_io_0 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_fortran_io + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_multisols_example6/torus.mesh" + "${CTEST_OUTPUT_DIR}/libmmg3d_Fortran_io-torus.o" "0" + ) + ADD_TEST(NAME libmmg3d_fortran_io_1 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_fortran_io + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_multisols_example6/torus.mesh" + "${CTEST_OUTPUT_DIR}/libmmg3d_Fortran_io-torus.o" "1" + ) + ADD_TEST(NAME libmmg3d_fortran_lsOnly3d + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_fortran_lsOnly + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/plane.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/m.sol" + "${CTEST_OUTPUT_DIR}/libmmg3d_lsOnly_multimat.o" ) + + ADD_TEST(NAME libmmg3d_fortran_lsAndMetric3d + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_fortran_lsAndMetric + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/plane.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/m.sol" + "${CTEST_OUTPUT_DIR}/libmmg3d_lsAndMetric_multimat.o" ) + + IF ( MMG3D_CI AND NOT ONLY_VERY_SHORT_TESTS ) + ADD_TEST(NAME test_api3d_fortran_0 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/test_api3d_fortran_0 + "${MMG3D_CI_TESTS}/API_tests/2dom.mesh" + "${CTEST_OUTPUT_DIR}/test_API3d.o" + ) + ENDIF() + +ENDIF() diff --git a/cmake/testing/libmmg_tests.cmake b/cmake/testing/libmmg_tests.cmake index 66ec0f272..1915820a9 100644 --- a/cmake/testing/libmmg_tests.cmake +++ b/cmake/testing/libmmg_tests.cmake @@ -38,15 +38,17 @@ SET ( MMG_LIB_TESTS_MAIN_PATH IF ( LIBMMG_STATIC ) SET ( lib_name lib${PROJECT_NAME}_a ) + SET ( lib_type "STATIC" ) ELSEIF ( LIBMMG_SHARED ) SET ( lib_name lib${PROJECT_NAME}_so ) + SET ( lib_type "SHARED" ) ELSE () MESSAGE(WARNING "You must activate the compilation of the static or" " shared ${PROJECT_NAME} library to compile this tests." ) ENDIF ( ) ##### Fortran Tests -IF (CMAKE_Fortran_COMPILER) +IF (CMAKE_Fortran_COMPILER AND PERL_FOUND) ENABLE_LANGUAGE (Fortran) SET ( MMG_LIB_TESTS ${MMG_LIB_TESTS} @@ -57,7 +59,7 @@ IF (CMAKE_Fortran_COMPILER) ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0_fortran/main.F90 ) -ENDIF (CMAKE_Fortran_COMPILER) + ENDIF (CMAKE_Fortran_COMPILER AND PERL_FOUND) LIST(LENGTH MMG_LIB_TESTS nbTests_tmp) MATH(EXPR nbTests "${nbTests_tmp} - 1") @@ -66,6 +68,31 @@ FOREACH ( test_idx RANGE ${nbTests} ) LIST ( GET MMG_LIB_TESTS ${test_idx} test_name ) LIST ( GET MMG_LIB_TESTS_MAIN_PATH ${test_idx} main_path ) - ADD_LIBRARY_TEST ( ${test_name} ${main_path} copy_mmg_headers ${lib_name} ) + ADD_LIBRARY_TEST ( ${test_name} ${main_path} copy_mmg_headers ${lib_name} ${lib_type} ) ENDFOREACH ( ) + +IF( MMG_CI ) + # Add libmmg tests + SET(LIBMMG_EXEC0_a ${EXECUTABLE_OUTPUT_PATH}/libmmg_example0_a ) + SET(LIBMMG_CPP_a ${EXECUTABLE_OUTPUT_PATH}/libmmg_cpp_a ) + + ADD_TEST(NAME libmmg_example0_a COMMAND ${LIBMMG_EXEC0_a} + ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0/init + ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0/cube + "${CTEST_OUTPUT_DIR}/libmmg_Adaptation_0.o") + ADD_TEST(NAME libmmg_cpp_a COMMAND ${LIBMMG_CPP_a} + ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0_cpp/init + ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0_cpp/cube + "${CTEST_OUTPUT_DIR}/libmmg_Adaptation_0_cpp.o") + + IF ( CMAKE_Fortran_COMPILER AND PERL_FOUND) + SET(LIBMMG_FORTRAN_a ${EXECUTABLE_OUTPUT_PATH}/libmmg_fortran_a) + ADD_TEST(NAME libmmg_fortran COMMAND ${LIBMMG_FORTRAN_a} + ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0_fortran/init + ${PROJECT_SOURCE_DIR}/libexamples/mmg/adaptation_example0_fortran/cube + "${CTEST_OUTPUT_DIR}/libmmg_Adaptation_0_Fortran.o" + ) + ENDIF() + +ENDIF( MMG_CI ) diff --git a/cmake/testing/libmmgs_tests.cmake b/cmake/testing/libmmgs_tests.cmake index 5fe7be4b0..4e940d671 100644 --- a/cmake/testing/libmmgs_tests.cmake +++ b/cmake/testing/libmmgs_tests.cmake @@ -23,7 +23,7 @@ ############################################################################### ##### -##### Mmgs Library Examples +##### Build executable for Mmgs Library Examples and add tests if needed ##### ############################################################################### @@ -34,6 +34,10 @@ SET ( MMGS_LIB_TESTS libmmgs_example2 libmmgs_example3 libmmgs_lsOnly + libmmgs_lsOnly_optim + libmmgs_lsOnly_hsiz + libmmgs_lsAndMetric_optim + libmmgs_lsAndMetric_hsiz libmmgs_lsAndMetric ) SET ( MMGS_LIB_TESTS_MAIN_PATH @@ -43,20 +47,26 @@ SET ( MMGS_LIB_TESTS_MAIN_PATH ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_example0/main.c ${PROJECT_SOURCE_DIR}/libexamples/mmgs/io_multisols_example3/main.c ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/main.c + ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/main_optim.c + ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/main_hsiz.c + ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsAndMetric/main_optim.c + ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsAndMetric/main_hsiz.c ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsAndMetric/main.c ) IF ( LIBMMGS_STATIC ) SET ( lib_name lib${PROJECT_NAME}s_a ) + SET ( lib_type "STATIC" ) ELSEIF ( LIBMMGS_SHARED ) SET ( lib_name lib${PROJECT_NAME}s_so ) + SET ( lib_type "SHARED" ) ELSE () MESSAGE(WARNING "You must activate the compilation of the static or" " shared ${PROJECT_NAME} library to compile this tests." ) ENDIF ( ) ##### Fortran Tests -IF ( CMAKE_Fortran_COMPILER ) +IF ( CMAKE_Fortran_COMPILER AND PERL_FOUND) ENABLE_LANGUAGE ( Fortran ) SET ( MMGS_LIB_TESTS ${MMGS_LIB_TESTS} @@ -64,6 +74,10 @@ IF ( CMAKE_Fortran_COMPILER ) libmmgs_fortran_b libmmgs_fortran_io libmmgs_fortran_lsOnly + libmmgs_fortran_lsOnly_optim + libmmgs_fortran_lsOnly_hsiz + libmmgs_fortran_lsAndMetric_optim + libmmgs_fortran_lsAndMetric_hsiz libmmgs_fortran_lsAndMetric ) @@ -72,10 +86,14 @@ IF ( CMAKE_Fortran_COMPILER ) ${PROJECT_SOURCE_DIR}/libexamples/mmgs/adaptation_example0_fortran/example0_b/main.F90 ${PROJECT_SOURCE_DIR}/libexamples/mmgs/io_multisols_example3/main.F90 ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/main.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/main_optim.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/main_hsiz.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsAndMetric/main_optim.F90 + ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsAndMetric/main_hsiz.F90 ${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsAndMetric/main.F90 ) -ENDIF ( CMAKE_Fortran_COMPILER ) +ENDIF ( CMAKE_Fortran_COMPILER AND PERL_FOUND) LIST(LENGTH MMGS_LIB_TESTS nbTests_tmp) MATH(EXPR nbTests "${nbTests_tmp} - 1") @@ -84,6 +102,90 @@ FOREACH ( test_idx RANGE ${nbTests} ) LIST ( GET MMGS_LIB_TESTS ${test_idx} test_name ) LIST ( GET MMGS_LIB_TESTS_MAIN_PATH ${test_idx} main_path ) - ADD_LIBRARY_TEST ( ${test_name} ${main_path} copy_s_headers ${lib_name} ) + ADD_LIBRARY_TEST ( ${test_name} ${main_path} copy_s_headers ${lib_name} ${lib_type}) ENDFOREACH ( ) + +ADD_TEST(NAME libmmgs_example0_a + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_example0_a + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/adaptation_example0/example0_a/cube.mesh" + "${CTEST_OUTPUT_DIR}/libmmgs_Adaptation_0_a-cube.o" + ) +ADD_TEST(NAME libmmgs_example0_b + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_example0_b + "${CTEST_OUTPUT_DIR}/libmmgs_Adaptation_0_b.o.mesh" + ) +ADD_TEST(NAME libmmgs_example1 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_example1 + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/adaptation_example1/2spheres" + "${CTEST_OUTPUT_DIR}/libmmgs_Adaptation_1-2spheres_1.o" + "${CTEST_OUTPUT_DIR}/libmmgs_Adaptation_1-2spheres_2.o" + ) +ADD_TEST(NAME libmmgs_example2 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_example2 + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_example0/teapot" + "${CTEST_OUTPUT_DIR}/libmmgs-IsosurfDiscretization_0-teapot.o" + ) +ADD_TEST(NAME libmmgs_example3_io_0 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_example3 + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/io_multisols_example3/torus.mesh" + "${CTEST_OUTPUT_DIR}/libmmgs_io_3-naca.o" "0" + ) +ADD_TEST(NAME libmmgs_example3_io_1 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_example3 + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/io_multisols_example3/torus.mesh" + "${CTEST_OUTPUT_DIR}/libmmgs_io_3-naca.o" "1" + ) +ADD_TEST(NAME libmmgs_lsOnly + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_lsOnly + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" + "${CTEST_OUTPUT_DIR}/libmmgs_lsOnly_multimat.o" + ) +ADD_TEST(NAME libmmgs_lsAndMetric + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_lsAndMetric + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" + "${CTEST_OUTPUT_DIR}/libmmgs_lsAndMetric_multimat.o" + ) + +IF ( CMAKE_Fortran_COMPILER AND PERL_FOUND ) + SET(LIBMMGS_EXECFORTRAN_a ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_a) + SET(LIBMMGS_EXECFORTRAN_b ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_b) + SET(LIBMMGS_EXECFORTRAN_IO ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_io) + SET(LIBMMGS_EXECFORTRAN_LSONLY ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_lsOnly ) + SET(LIBMMGS_EXECFORTRAN_LSANDMETRIC ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_lsAndMetric ) + + ADD_TEST(NAME libmmgs_fortran_a + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_a + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/adaptation_example0_fortran/example0_a/cube.mesh" + "${CTEST_OUTPUT_DIR}/libmmgs-Adaptation_Fortran_0_a-cube.o" + ) + ADD_TEST(NAME libmmgs_fortran_b + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_b + "${CTEST_OUTPUT_DIR}/libmmgs_Adaptation_Fortran_0_b.o" + ) + ADD_TEST(NAME libmmgs_fortran_io_0 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_io + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/io_multisols_example3/torus.mesh" + "${CTEST_OUTPUT_DIR}/libmmgs_Fortran_io-torus.o" "0" + ) + ADD_TEST(NAME libmmgs_fortran_io_1 + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_io + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/io_multisols_example3/torus.mesh" + "${CTEST_OUTPUT_DIR}/libmmgs_Fortran_io-torus.o" "1" + ) + ADD_TEST(NAME libmmgs_fortran_lsOnly + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_lsOnly + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" + "${CTEST_OUTPUT_DIR}/libmmgs_lsOnly_multimat.o" + ) + ADD_TEST(NAME libmmgs_fortran_lsAndMetric + COMMAND ${EXECUTABLE_OUTPUT_PATH}/libmmgs_fortran_lsAndMetric + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat.mesh" + "${PROJECT_SOURCE_DIR}/libexamples/mmgs/IsosurfDiscretization_lsOnly/multi-mat-sol.sol" + "${CTEST_OUTPUT_DIR}/libmmgs_lsAndMetric_multimat.o" + ) + +ENDIF ( ) diff --git a/cmake/testing/mmg2d_tests.cmake b/cmake/testing/mmg2d_tests.cmake index 95ddf943c..cccfa0a22 100644 --- a/cmake/testing/mmg2d_tests.cmake +++ b/cmake/testing/mmg2d_tests.cmake @@ -52,14 +52,20 @@ ADD_TEST(NAME mmg2d_val COMMAND ${EXECUT_MMG2D} -v val ${MMG2D_CI_TESTS}/Circle/cercle -out ${CTEST_OUTPUT_DIR}/mmg2d_val.o.meshb) +SET_PROPERTY(TEST mmg2d_val + PROPERTY WILL_FAIL TRUE) -#ADD_TEST(NAME mmg2d_default -# COMMAND ${EXECUT_MMG2D} -default -# ${MMG2D_CI_TESTS}/Circle/cercle -# -out ${CTEST_OUTPUT_DIR}/mmg2d_default.o.meshb) +ADD_TEST(NAME mmg2d_locParamCrea + COMMAND ${EXECUT_MMG2D} -v 5 -default + ${MMG2D_CI_TESTS}/LocParamsCrea/circle2refs.mesh) -SET_PROPERTY(TEST mmg2d_val #mmg2d_default - PROPERTY WILL_FAIL TRUE) +SET_TESTS_PROPERTIES ( mmg2d_locParamCrea + PROPERTIES FIXTURES_SETUP mmg2d_locParamCrea ) +ADD_TEST(NAME mmg2d_locParamClean + COMMAND ${CMAKE_COMMAND} -E remove -f + ${MMG2D_CI_TESTS}/LocParamsCrea/circle2refs.mmg2d) +SET_TESTS_PROPERTIES ( mmg2d_locParamClean + PROPERTIES FIXTURES_REQUIRED mmg2d_locParamCrea ) ADD_TEST(NAME mmg2d_hsizOption COMMAND ${EXECUT_MMG2D} -v 5 -hsiz 0.1 -sol 2 @@ -138,7 +144,7 @@ ADD_TEST(NAME mmg2d_locParam_ani -out ${CTEST_OUTPUT_DIR}/locParams-ani.o.meshb) ADD_TEST(NAME mmg2d_opnbdy_yes - COMMAND ${EXECUT_MMG2D} -v 5 -opnbdy -hausd 0.001 + COMMAND ${EXECUT_MMG2D} -v 5 -opnbdy -hausd 0.001 -d ${MMG2D_CI_TESTS}/Opnbdy/opnbdy-mesh.msh -out ${CTEST_OUTPUT_DIR}/mmg2d-opnbdy-mesh-yes.o.meshb) @@ -148,11 +154,17 @@ ADD_TEST(NAME mmg2d_opnbdy_no -out ${CTEST_OUTPUT_DIR}/mmg2d-opnbdy-mesh-no.o.meshb) ADD_TEST(NAME mmg2d_opnbdy_ls - COMMAND ${EXECUT_MMG2D} -v 5 -opnbdy -ls 3.4 -hausd 0.001 + COMMAND ${EXECUT_MMG2D} -v 5 -opnbdy -ls 3.4 -hausd 0.001 -d ${MMG2D_CI_TESTS}/Opnbdy/opnbdy.mesh -sol ${MMG2D_CI_TESTS}/Opnbdy/ls.sol -out ${CTEST_OUTPUT_DIR}/mmg2d-opnbdy-ls.o.meshb) +ADD_TEST(NAME mmg2d_opnbdy_lssurf + COMMAND ${EXECUT_MMG2D} -v 5 -opnbdy -lssurf 0.6 + ${MMG2D_CI_TESTS}/Opnbdy/opnbdy.mesh + -sol ${MMG2D_CI_TESTS}/Opnbdy/ls.sol + -out ${CTEST_OUTPUT_DIR}/mmg2d-opnbdy-lssurf.o.meshb) + ADD_TEST(NAME mmg2d_opnbdy_yes_ani COMMAND ${EXECUT_MMG2D} -v 5 -hausd 0.001 -A -opnbdy ${MMG2D_CI_TESTS}/Opnbdy/opnbdy-mesh.msh @@ -289,7 +301,7 @@ ADD_TEST(NAME mmg2d_vtkvtu_ani ${MMG2D_CI_TESTS}/VtkInout/ani.vtu ${CTEST_OUTPUT_DIR}/mmg2d_vtkvtu_ani) -IF ( NOT VTK_FOUND ) +IF ( (NOT VTK_FOUND) OR USE_VTK MATCHES OFF ) SET(expr "VTK library not founded") SET_PROPERTY(TEST mmg2d_vtkvtk PROPERTY PASS_REGULAR_EXPRESSION "${expr}") @@ -386,6 +398,7 @@ ADD_TEST(NAME mmg2d_SquareAniso ${MMG2D_CI_TESTS}/SquareAniso/adap1 ${CTEST_OUTPUT_DIR}/mmg2d_SquareAniso-mmg2d_SquareAniso-adap1.o.meshb) +# optim ADD_TEST(NAME mmg2d_Circle-optimAni COMMAND ${EXECUT_MMG2D} -v 5 -optim -A -sol 2 ${MMG2D_CI_TESTS}/Circle/cercle @@ -396,6 +409,18 @@ ADD_TEST(NAME mmg2d_Circle-hsizAni ${MMG2D_CI_TESTS}/Circle/cercle -out ${CTEST_OUTPUT_DIR}/mmg2d_Circle-hsizAni.o.mesh) +# optim + ani + oprhan + unused point +ADD_TEST(NAME mmg2d_Disk-optimAni + COMMAND ${EXECUT_MMG2D} -v 5 -optim -A -sol 2 + ${MMG2D_CI_TESTS}/Disk/disk-orphan + -out ${CTEST_OUTPUT_DIR}/mmg2d_disk-optimAni.o.mesh) + +# optim + iso + oprhan + unused point +ADD_TEST(NAME mmg2d_Disk-optim + COMMAND ${EXECUT_MMG2D} -v 5 -optim -sol 2 + ${MMG2D_CI_TESTS}/Disk/disk-orphan + -out ${CTEST_OUTPUT_DIR}/mmg2d_disk-optim.o.mesh) + ############################################################################### ##### ##### Mesh generation @@ -436,13 +461,13 @@ ADD_TEST(NAME mmg2d_NacaGeneration-hsizAni # non convex test cases ADD_TEST(NAME mmg2d_ACDCGeneration - COMMAND ${EXECUT_MMG2D} -v 5 + COMMAND ${EXECUT_MMG2D} -v 5 -d ${MMG2D_CI_TESTS}/ACDCGeneration/acdcBdy.mesh -out ${CTEST_OUTPUT_DIR}/mmg2d_ACDCGeneration.o.meshb) # nsd option: keep only domain of ref 2 ADD_TEST(NAME mmg2d_ACDCGeneration-nsd2 - COMMAND ${EXECUT_MMG2D} -v 5 -nsd 2 + COMMAND ${EXECUT_MMG2D} -v 5 -nsd 2 -d ${MMG2D_CI_TESTS}/ACDCGeneration/acdcBdy.mesh -out ${CTEST_OUTPUT_DIR}/mmg2d_ACDCGeneration-nds2.o.meshb) @@ -451,6 +476,11 @@ ADD_TEST(NAME mmg2d_GaronneGeneration ${MMG2D_CI_TESTS}/GaronneGeneration/garonneEdges.mesh -out ${CTEST_OUTPUT_DIR}/mmg2d_GaronneGeneration.o.meshb) +ADD_TEST(NAME mmg2d_GaronneGeneration2 + COMMAND ${EXECUT_MMG2D} -v 5 + ${MMG2D_CI_TESTS}/GaronneGeneration/garonne.mesh + -out ${CTEST_OUTPUT_DIR}/mmg2d_GaronneGeneration2.o.meshb) + ############################################################################### ##### ##### Implicit domain discretization @@ -463,6 +493,30 @@ ADD_TEST(NAME mmg2d_LSMultiMat_val ${MMG2D_CI_TESTS}/LSMultiMat/multi-mat ${CTEST_OUTPUT_DIR}/mmg2d_multi-mat-val.o.meshb ) + +ADD_TEST(NAME mmg2d_OptLs_Bridge + COMMAND ${EXECUT_MMG2D} -v 5 -ls + -sol ${MMG2D_CI_TESTS}/OptLs_bridge/bridge.sol + ${MMG2D_CI_TESTS}/OptLs_bridge/bridge + ${CTEST_OUTPUT_DIR}/mmg2d_OptLs_bridge.o.meshb + ) + +# lssurf: discretization of boundaries only +ADD_TEST(NAME mmg2d_OptLsSurf_box + COMMAND ${EXECUT_MMG2D} -v 5 -lssurf + -sol ${MMG2D_CI_TESTS}/OptLsSurf_box/box.sol + ${MMG2D_CI_TESTS}/OptLsSurf_box/box.mesh + ${CTEST_OUTPUT_DIR}/mmg2d_OptLsSurf_box.o.meshb + ) + +# lssurf + multimat: discretization of boundaries only +ADD_TEST(NAME mmg2d_OptLsSurf_multiMat_box + COMMAND ${EXECUT_MMG2D} -v 5 -lssurf + -sol ${MMG2D_CI_TESTS}/OptLsSurf_box/box.sol + ${MMG2D_CI_TESTS}/OptLsSurf_box/box_multiMat.mesh + ${CTEST_OUTPUT_DIR}/mmg2d_OptLsSurf_multiMat_box.o.meshb + ) + #multi-mat + opnbdy + non-manifold check ADD_TEST(NAME mmg2d_LSMultiMat_nm COMMAND ${EXECUT_MMG2D} -v 5 -ls 3 -opnbdy -nr @@ -515,6 +569,19 @@ ADD_TEST(NAME mmg2d_OptLs_dom_withbub -sol ${MMG2D_CI_TESTS}/LSDiscretization/bub.sol ${CTEST_OUTPUT_DIR}/mmg2d_OptLs_dom-withbub.o.meshb) +# ls + rmc + LSBaseReference +ADD_TEST(NAME mmg2d_OptLs_LSBaseReferences-rmc + COMMAND ${EXECUT_MMG2D} -v 5 -ls -rmc + ${MMG2D_CI_TESTS}/LSBaseReferences/box + -sol ${MMG2D_CI_TESTS}/LSBaseReferences/box.sol + ${CTEST_OUTPUT_DIR}/mmg2d_OptLs_LSBaseReferences-rmc.o.meshb) + +ADD_TEST(NAME mmg2d_OptLs_LSBaseReferences-normc + COMMAND ${EXECUT_MMG2D} -v 5 -ls + ${MMG2D_CI_TESTS}/LSBaseReferences/box + -sol ${MMG2D_CI_TESTS}/LSBaseReferences/box.sol + ${CTEST_OUTPUT_DIR}/mmg2d_OptLs_LSBaseReferences-normc.o.meshb) + # ls + rmc: max pile size bug ADD_TEST(NAME mmg2d_OptLs_dom_rmcmaxpile COMMAND ${EXECUT_MMG2D} -v 5 -ls -rmc @@ -534,6 +601,26 @@ ADD_TEST(NAME mmg2d_OptLs_dom_rembub2 -sol ${MMG2D_CI_TESTS}/LSDiscretization/bub.sol ${CTEST_OUTPUT_DIR}/mmg2d_OptLs_dom-rembub2.o.meshb) +add_test( + NAME mmg2d_OptLs_isoref_defaut + COMMAND ${EXECUT_MMG2D} -v 5 -ls ${MMG2D_CI_TESTS}/OptLs_isoref/2d-mesh.mesh + -sol ${MMG2D_CI_TESTS}/OptLs_isoref/2d-mesh.sol + ${CTEST_OUTPUT_DIR}/mmg2d_isoref.o.mesh + ) +add_test( + NAME mmg2d_OptLs_isoref_5 + COMMAND ${EXECUT_MMG2D} -v 5 -isoref 5 -ls + ${MMG2D_CI_TESTS}/OptLs_isoref/2d-mesh-isoref5.mesh + -sol ${MMG2D_CI_TESTS}/OptLs_isoref/2d-mesh.sol + ${CTEST_OUTPUT_DIR}/mmg2d_isoref5.o.mesh + ) + +if (BASH) + add_test( + NAME mmg2d_optLs_isoref + COMMAND ${BASH} -c "diff <(wc -wl ${CTEST_OUTPUT_DIR}/mmg2d_isoref.o.mesh | awk '{print $1 $2}') <(wc -wl ${CTEST_OUTPUT_DIR}/mmg2d_isoref5.o.mesh | awk '{print $1 $2}')" + ) +endif() # ls discretisation + optim option ADD_TEST(NAME mmg2d_LSMultiMat_optim @@ -574,6 +661,23 @@ ADD_TEST(NAME mmg2d_LSMultiMat_withMetAndLs ${MMG2D_CI_TESTS}/LSMultiMat/multi-mat ${CTEST_OUTPUT_DIR}/mmg2d_LSMultiMat-withMetAndLs.o.meshb) +# ls discretisation + xreg +ADD_TEST(NAME mmg2d_CoorRegularization_apple + COMMAND ${EXECUT_MMG2D} -v 5 -ls -xreg + ${MMG2D_CI_TESTS}/CoorRegularization_apple/apple + -out ${CTEST_OUTPUT_DIR}/CoorRegularization_apple.o.meshb) + +# ls discretisation + xreg + nr +ADD_TEST(NAME mmg2d_CoorRegularization_appleNR + COMMAND ${EXECUT_MMG2D} -v 5 -ls -xreg -nr + ${MMG2D_CI_TESTS}/CoorRegularization_apple/apple + -out ${CTEST_OUTPUT_DIR}/CoorRegularization_appleNR.o.meshb) + +# ls discretisation + xreg + nr + check of negative areas +ADD_TEST(NAME mmg2d_CoorRegularizationNegativeArea + COMMAND ${EXECUT_MMG2D} -v 5 -ls -xreg -hmax 0.1 + ${MMG2D_CI_TESTS}/CoorRegularizationNegativeArea/CoorRegularizationNegativeArea + -out ${CTEST_OUTPUT_DIR}/CoorRegularizationNegativeArea.o.meshb) ############################################################################### ##### @@ -581,7 +685,7 @@ ADD_TEST(NAME mmg2d_LSMultiMat_withMetAndLs ##### ############################################################################### ##### -IF ( ELAS_FOUND ) +IF ( ELAS_FOUND AND NOT USE_ELAS MATCHES OFF ) ADD_TEST(NAME mmg2d_LagMotion0_circle COMMAND ${EXECUT_MMG2D} -v 5 -lag 0 -in ${MMG2D_CI_TESTS}/LagMotion_circle/circle @@ -593,7 +697,7 @@ IF ( ELAS_FOUND ) -out ${CTEST_OUTPUT_DIR}/mmg2d_LagMotion1_circle-circle.o.meshb ) ADD_TEST(NAME mmg2d_LagMotion2_circle - COMMAND ${EXECUT_MMG2D} -v 5 -lag 2 + COMMAND ${EXECUT_MMG2D} -v 5 -lag 2 -d -in ${MMG2D_CI_TESTS}/LagMotion_circle/circle -out ${CTEST_OUTPUT_DIR}/mmg2d_LagMotion2_circle-circle.o.meshb ) @@ -606,3 +710,44 @@ IF ( ELAS_FOUND ) ) ENDIF() + +############################################################################### +##### +##### Check snapping (prevision of non-manifold situations) +##### +############################################################################### +##### +SET(nmRegex "unsnap at least 1 point") + +ADD_TEST(NAME mmg2d_LSSnapval_manifold1 + COMMAND ${EXECUT_MMG2D} -v 5 -ls + -in ${MMG2D_CI_TESTS}/LSSnapval/8elts1.mesh + -sol ${MMG2D_CI_TESTS}/LSSnapval/manifold.sol + -out ${CTEST_OUTPUT_DIR}/mmg2d_LSSnapval_manifold1.o.mesh + ) + +ADD_TEST(NAME mmg2d_LSSnapval_manifold2 + COMMAND ${EXECUT_MMG2D} -v 5 -ls + -in ${MMG2D_CI_TESTS}/LSSnapval/8elts2.mesh + -sol ${MMG2D_CI_TESTS}/LSSnapval/manifold.sol + -out ${CTEST_OUTPUT_DIR}/mmg2d_LSSnapval_manifold2.o.mesh + ) + +SET_PROPERTY(TEST mmg2d_LSSnapval_manifold1 mmg2d_LSSnapval_manifold2 + PROPERTY FAIL_REGULAR_EXPRESSION "${nmRegex}") + +ADD_TEST(NAME mmg2d_LSSnapval_non-manifold1 + COMMAND ${EXECUT_MMG2D} -v 5 -ls + -in ${MMG2D_CI_TESTS}/LSSnapval/8elts1.mesh + -sol ${MMG2D_CI_TESTS}/LSSnapval/8elts1-nm.sol + -out ${CTEST_OUTPUT_DIR}/mmg2d_LSSnapval_non-manifold1.o.mesh + ) + +ADD_TEST(NAME mmg2d_LSSnapval_non-manifold2 + COMMAND ${EXECUT_MMG2D} -v 5 -ls + -in ${MMG2D_CI_TESTS}/LSSnapval/8elts2.mesh + -sol ${MMG2D_CI_TESTS}/LSSnapval/8elts2-nm.sol + -out ${CTEST_OUTPUT_DIR}/mmg2d_LSSnapval_non-manifold2.o.mesh + ) +SET_PROPERTY(TEST mmg2d_LSSnapval_non-manifold1 mmg2d_LSSnapval_non-manifold2 + PROPERTY PASS_REGULAR_EXPRESSION "${nmRegex}") diff --git a/cmake/testing/mmg3d_tests.cmake b/cmake/testing/mmg3d_tests.cmake index 45a64d7fb..dd39cb3b4 100644 --- a/cmake/testing/mmg3d_tests.cmake +++ b/cmake/testing/mmg3d_tests.cmake @@ -20,8 +20,6 @@ ## use this copy of the mmg distribution only if you accept them. ## ============================================================================= -GET_FILENAME_COMPONENT ( SHRT_EXECUT_MMG3D ${EXECUT_MMG3D} NAME ) - ############################################################################## ##### ##### Tests that may be run twice @@ -30,12 +28,15 @@ GET_FILENAME_COMPONENT ( SHRT_EXECUT_MMG3D ${EXECUT_MMG3D} NAME ) SET ( test_names # Simple test: must already pass - mmg3d_SimpleCube + mmg3d_SimpleCube_fast # MultiDomain mmg3d_MultiDom_Ellipse_fast # Non-manifold test case mmg3d_NM_Cube_fast mmg3d_NM_Complex_fast + # test case with non-manifold, ridges, ref edges and a curve surface + mmg3d_NM_cone_fast + # mmg3d_NM_cone_ani_fast #Fail because at second run a tetra we have a tet with 4 ridge vertices ) SET ( input_files @@ -45,6 +46,8 @@ SET ( input_files ### non-manifold ${MMG3D_CI_TESTS}/NM_Cube/nm ${MMG3D_CI_TESTS}/NM_Complex/nm4 + ${MMG3D_CI_TESTS}/cone-nm.mesh + #${MMG3D_CI_TESTS}/cone-nm.mesh ) SET ( args @@ -54,6 +57,8 @@ SET ( args ### non-manifold "-v 5 -hmax 0.1" "-v 5" + "-v 5" + #"-v 5 -A" ) IF ( LONG_TESTS ) @@ -143,7 +148,7 @@ IF ( LONG_TESTS ) ${MMG3D_CI_TESTS}/CubeSkin0.1_Inside0.4/CubeSkin0.1 ${MMG3D_CI_TESTS}/CubeSkin0.2_Inside0.4/CubeSkin0.2 ${MMG3D_CI_TESTS}/CubeSkin0.0125_Inside0.125/CubeSkin0.125 - ${MMG3D_CI_TESTS}/CubeSkin0.0125_Inside0.25/CubeSkin0.25 + # ${MMG3D_CI_TESTS}/CubeSkin0.0125_Inside0.25/CubeSkin0.25 # ${MMG3D_CI_TESTS}/CubeSkin0.0125_Inside0.5/CubeSkin0.5 ### Linkrods ${MMG3D_CI_TESTS}/Various_unref_Linkrods_met0.2/linkrods @@ -192,7 +197,7 @@ IF ( LONG_TESTS ) "-v 5" "-v 5" "-v 5" - "-v 5" + # "-v 5" # "-v 5" ### Linkrods "-v 5 -hausd 0.1" @@ -356,14 +361,20 @@ ADD_TEST(NAME mmg3d_val ${MMG3D_CI_TESTS}/Cube/cube ${CTEST_OUTPUT_DIR}/mmg3d_cube-val.o.meshb ) +SET_PROPERTY(TEST mmg3d_val + PROPERTY WILL_FAIL TRUE) -#ADD_TEST(NAME mmg3d_default -# COMMAND ${EXECUT_MMG3D} -v 5 -default -# ${MMG3D_CI_TESTS}/Cube/cube -# -out ${CTEST_OUTPUT_DIR}/mmg3d_default.o.meshb) +ADD_TEST(NAME mmg3d_locParamCrea + COMMAND ${EXECUT_MMG3D} -v 5 -default + ${MMG3D_CI_TESTS}/LocParamsCrea/step.0) -SET_PROPERTY(TEST mmg3d_val #mmg3d_default - PROPERTY WILL_FAIL TRUE) +SET_TESTS_PROPERTIES ( mmg3d_locParamCrea + PROPERTIES FIXTURES_SETUP mmg3d_locParamCrea ) +ADD_TEST(NAME mmg3d_locParamClean + COMMAND ${CMAKE_COMMAND} -E remove -f + ${MMG3D_CI_TESTS}/LocParamsCrea/step.mmg3d) +SET_TESTS_PROPERTIES ( mmg3d_locParamClean + PROPERTIES FIXTURES_REQUIRED mmg3d_locParamCrea ) # default hybrid ADD_TEST(NAME mmg3d_hybrid_3d @@ -438,6 +449,12 @@ ADD_TEST(NAME mmg3d_opnbdy_ls_peninsula -sol ${MMG3D_CI_TESTS}/OpnBdy_peninsula/ls.sol -out ${CTEST_OUTPUT_DIR}/mmg3d_OpnBdy_ls_peninsula.o.meshb) +ADD_TEST(NAME mmg3d_opnbdy_lssurf-nofile_peninsula + COMMAND ${EXECUT_MMG3D} -v 5 -opnbdy -lssurf 0.6 -nr -hgrad 1.5 -hausd 0.02 + -in ${MMG3D_CI_TESTS}/OpnBdy_peninsula/peninsula + -sol ${MMG3D_CI_TESTS}/OpnBdy_peninsula/ls.sol + -out ${CTEST_OUTPUT_DIR}/mmg3d_OpnBdy_lssurf_peninsula.o.meshb) + # ls + nsd ADD_TEST(NAME mmg3d_opnbdy_ls_peninsula-nsd3 COMMAND ${EXECUT_MMG3D} -v 5 -opnbdy -ls -nsd 3 @@ -466,7 +483,7 @@ ADD_TEST(NAME mmg3d_opnbdy_ref_island ##### ############################################################################### ##### -IF ( ELAS_FOUND ) +IF ( ELAS_FOUND AND NOT USE_ELAS MATCHES OFF ) ADD_TEST(NAME mmg3d_LagMotion0_tinyBoxt COMMAND ${EXECUT_MMG3D} -v 5 -lag 0 -in ${MMG3D_CI_TESTS}/LagMotion1_tinyBoxt/tinyBoxt @@ -520,6 +537,12 @@ ADD_TEST(NAME mmg3d_OptimAni_Sphere ${CTEST_OUTPUT_DIR}/mmg3d_OptimAni_Sphere.o.mesh ) +ADD_TEST(NAME mmg3d_OptimAni_Cube + COMMAND ${EXECUT_MMG3D} -v 5 -optim -A -hgrad -1 + ${MMG3D_CI_TESTS}/Cube/cube-ani + -out ${CTEST_OUTPUT_DIR}/mmg3d_OptimAni_cube.o.meshb) + + ############################################################################## ##### ##### Check optimLES @@ -538,6 +561,16 @@ ADD_TEST(NAME mmg3d_OptimLES_sphere ##### ############################################################################### ##### + +# lssurf: discretization of boundaries only +ADD_TEST(NAME mmg3d_OptLsSurf_box + COMMAND ${EXECUT_MMG3D} -v 5 -lssurf + -sol ${MMG3D_CI_TESTS}/OptLsSurf_box/box.sol + ${MMG3D_CI_TESTS}/OptLsSurf_box/box.mesh + ${CTEST_OUTPUT_DIR}/mmg3d_OptLsSurf_box.o.meshb + ) + +# multi-mat ADD_TEST(NAME mmg3d_LSMultiMat COMMAND ${EXECUT_MMG3D} -v 5 -ls -nr ${MMG3D_CI_TESTS}/LSMultiMat/step.0.mesh @@ -580,6 +613,21 @@ ADD_TEST(NAME mmg3d_OptLs_plane_m -sol ${MMG3D_CI_TESTS}/OptLs_plane/m.sol ${CTEST_OUTPUT_DIR}/mmg3d_OptLs_plane-m.o.meshb) +# ridge preservation +IF ( (NOT SCOTCH_FOUND) OR USE_SCOTCH MATCHES OFF ) + SET ( DISABLE_RENUM "" ) +ELSE() + SET ( DISABLE_RENUM -rn 0 ) +ENDIF() + +ADD_TEST(NAME mmg3d_OptLs_NM_ridge + COMMAND ${EXECUT_MMG3D} -v 5 -ls 0.5 -noinsert -noswap -nomove -nr ${DISABLE_RENUM} + ${MMG3D_CI_TESTS}/OptLs_NM_ridge/cube-it2.mesh + ${CTEST_OUTPUT_DIR}/mmg3d_OptLs_NM_cube-it2.o.mesh) + +SET_TESTS_PROPERTIES ( mmg3d_OptLs_NM_ridge + PROPERTIES FIXTURES_SETUP mmg3d_OptLs_NM_ridge ) + # non-zero ls ADD_TEST(NAME mmg3d_OptLs_plane_nonzero COMMAND ${EXECUT_MMG3D} -v 5 -ls 0.1 @@ -623,6 +671,19 @@ ADD_TEST(NAME mmg3d_OptLs_plane_withMetAndLs -met ${MMG3D_CI_TESTS}/OptLs_plane/met.sol ${CTEST_OUTPUT_DIR}/mmg3d_OptLs_plane-nonzero.o.meshb) +# ls + rmc + LSBaseReference +ADD_TEST(NAME mmg3d_OptLs_LSBaseReferences-rmc + COMMAND ${EXECUT_MMG3D} -v 5 -ls -rmc -nr + ${MMG3D_CI_TESTS}/LSBaseReferences/box + -sol ${MMG3D_CI_TESTS}/LSBaseReferences/box.sol + ${CTEST_OUTPUT_DIR}/mmg3d_OptLs_LSBaseReferences-rmc.o.meshb) + +ADD_TEST(NAME mmg3d_OptLs_LSBaseReferences-normc + COMMAND ${EXECUT_MMG3D} -v 5 -ls -nr + ${MMG3D_CI_TESTS}/LSBaseReferences/box + -sol ${MMG3D_CI_TESTS}/LSBaseReferences/box.sol + ${CTEST_OUTPUT_DIR}/mmg3d_OptLs_LSBaseReferences-normc.o.meshb) + # ls + rmc ADD_TEST(NAME mmg3d_OptLs_plane_withbub COMMAND ${EXECUT_MMG3D} -v 5 -ls @@ -657,6 +718,43 @@ ADD_TEST(NAME mmg3d_OptLs_temp_orphan -hausd 0.5 -nr -hgrad -1 -nsd 3 ${CTEST_OUTPUT_DIR}/mmg3d_OptLs_temp_orphan.o.meshb) +# OptLs and isoref option: compare the result of ls discretization with ref 10 +# and results of the same case with ref 5 +#include(FindUnixCommands) + +add_test( + NAME mmg3d_OptLs_isoref_defaut + COMMAND ${EXECUT_MMG3D} -v 5 -ls ${MMG3D_CI_TESTS}/OptLs_isoref/3d-mesh.mesh + -sol ${MMG3D_CI_TESTS}/OptLs_isoref/3d-mesh.sol + ${CTEST_OUTPUT_DIR}/mmg3d_isoref.o.mesh + ) +add_test( + NAME mmg3d_OptLs_isoref_5 + COMMAND ${EXECUT_MMG3D} -v 5 -isoref 5 -ls + ${MMG3D_CI_TESTS}/OptLs_isoref/3d-mesh-isoref5.mesh + -sol ${MMG3D_CI_TESTS}/OptLs_isoref/3d-mesh.sol + ${CTEST_OUTPUT_DIR}/mmg3d_isoref5.o.mesh + ) + +if (BASH) + add_test( + NAME mmg3d_optLs_isoref + COMMAND ${BASH} -c "diff <(wc -wl ${CTEST_OUTPUT_DIR}/mmg3d_isoref.o.mesh | awk '{print $1 $2}') <(wc -wl ${CTEST_OUTPUT_DIR}/mmg3d_isoref5.o.mesh | awk '{print $1 $2}')" + ) +endif() + +ADD_TEST(NAME test_para_tria + COMMAND ${EXECUT_MMG3D} + -ar 0.02 -nofem -nosizreq -hgradreq -1 -hgrad -1 + ${MMG3D_CI_TESTS}/test_para_tria/proc0.mesh + -sol ${MMG3D_CI_TESTS}/test_para_tria/proc0.sol + ${CTEST_OUTPUT_DIR}/proc0.o.mesh + ) + +SET_TESTS_PROPERTIES ( test_para_tria + PROPERTIES FIXTURES_SETUP test_para_tria ) + + IF ( LONG_TESTS ) # Test the Ls option ADD_TEST(NAME mmg3d_OptLs_cube303d_hminMax_hgrad1.2_hausd0.005 @@ -678,7 +776,7 @@ IF ( LONG_TESTS ) ##### ############################################################################### ##### - IF ( ELAS_FOUND ) + IF ( ELAS_FOUND AND NOT USE_ELAS MATCHES OFF ) ADD_TEST(NAME mmg3d_LagMotion0_boxt COMMAND ${EXECUT_MMG3D} -v 5 -lag 0 -in ${MMG3D_CI_TESTS}/LagMotion1_boxt/boxt diff --git a/cmake/testing/mmg_tests.cmake b/cmake/testing/mmg_tests.cmake index 1bcfbb4c1..6b7149161 100644 --- a/cmake/testing/mmg_tests.cmake +++ b/cmake/testing/mmg_tests.cmake @@ -20,9 +20,31 @@ ## use this copy of the mmg distribution only if you accept them. ## ============================================================================= -FOREACH(EXEC ${LISTEXEC_MMG}) - - GET_FILENAME_COMPONENT ( SHRT_EXEC ${EXEC} NAME ) +# Execut_mmg contains the list of executables to test (for now the mmg3d +# executable is in EXECUT_MMG3D (filled by mmg3d.cmake) and the mmgs executable +# is in EXECUTE_MMGS (filled by mmgs.cmake)) +SET(EXECUT_MMG ${EXECUT_MMGS} ${EXECUT_MMG3D}) +SET(SHRT_EXECUT_MMG ${SHRT_EXECUT_MMGS} ${SHRT_EXECUT_MMG3D}) + +# Make some files not openable +IF ( EXISTS ${CTEST_OUTPUT_DIR}/unwrittable7.meshb + AND NOT IS_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable7.meshb ) + FILE ( REMOVE ${CTEST_OUTPUT_DIR}/unwrittable7.meshb ) +ENDIF () +IF ( NOT EXISTS ${CTEST_OUTPUT_DIR}/unwrittable7.meshb) + FILE(MAKE_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable7.meshb) +ENDIF() + +IF ( EXISTS ${CTEST_OUTPUT_DIR}/unwrittable8.sol + AND NOT IS_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable8.sol ) + FILE ( REMOVE ${CTEST_OUTPUT_DIR}/unwrittable8.sol ) +ENDIF () +IF ( NOT EXISTS ${CTEST_OUTPUT_DIR}/unwrittable8.sol) + FILE(MAKE_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable8.sol) +ENDIF() + +# Lists of tests that are common to mmgs and mmg3d +FOREACH(EXEC SHRT_EXEC IN ZIP_LISTS EXECUT_MMG SHRT_EXECUT_MMG) ############################################################################### ##### @@ -30,7 +52,7 @@ FOREACH(EXEC ${LISTEXEC_MMG}) ##### ############################################################################### - # Gmsh without metric: see mmg3d_tests.cmale and mmgs_tests.cmake + # Gmsh without metric: see mmg3d_tests.cmake and mmgs_tests.cmake # Binary gmsh iso metric ADD_TEST(NAME mmg_binary_gmsh_iso_${SHRT_EXEC} @@ -92,7 +114,7 @@ FOREACH(EXEC ${LISTEXEC_MMG}) ${MMG_CI_TESTS}/VtkInout/ani.vtu ${CTEST_OUTPUT_DIR}/mmg_vtkvtu_ani_${SHRT_EXEC}) - IF ( NOT VTK_FOUND ) + IF ( (NOT VTK_FOUND) OR USE_VTK MATCHES OFF ) SET(expr "VTK library not founded") SET_PROPERTY(TEST mmg_vtkvtk_${SHRT_EXEC} PROPERTY PASS_REGULAR_EXPRESSION "${expr}") @@ -126,8 +148,8 @@ FOREACH(EXEC ${LISTEXEC_MMG}) ) SET ( args - "-v 5 -hgrad 1.15" - "-v 5 -hgrad 1.15" + "-v 5 -hgrad 1.25" + "-v 5 -hgrad 1.25" ) ADD_RUN_AGAIN_TESTS ( ${EXEC} "${test_names}" "${args}" "${input_files}" ) @@ -266,6 +288,19 @@ ADD_TEST(NAME mmg_hsizAni_${SHRT_EXEC} ${MMG_CI_TESTS}/TorusholesAni_chocCyl/torusholesTiny -out ${CTEST_OUTPUT_DIR}/mmg_hsizAni_${SHRT_EXEC}.o.meshb) +# optim + Ani + orphan + unused point +ADD_TEST(NAME mmg_sphere-optimAni_${SHRT_EXEC} + COMMAND ${EXEC} -v 5 ${common_args} + ${MMG_CI_TESTS}/SphereVolAni/sphere3 -sol 2 -optim -A -v 5 + -out ${CTEST_OUTPUT_DIR}/mmg_sphere-optimAni_${SHRT_EXEC}-sphere-optimAni.o.meshb) + +# optim + Iso + orphan + unused point +ADD_TEST(NAME mmg_sphere-optim_${SHRT_EXEC} + COMMAND ${EXEC} -v 5 ${common_args} + ${MMG_CI_TESTS}/SphereVolAni/sphere3 -sol 2 -optim -v 5 + -out ${CTEST_OUTPUT_DIR}/mmg_sphere-optim_${SHRT_EXEC}-sphere-optim.o.meshb) + + ADD_TEST(NAME mmg_hsizHmax_${SHRT_EXEC} COMMAND ${EXEC} -v 5 -hsiz 0.1 -hmax 0.05 ${common_args} ${MMG_CI_TESTS}/Cube/cube @@ -297,10 +332,14 @@ ADD_TEST(NAME mmg_MultiDom_Cube_ReqEntities_${SHRT_EXEC} ${MMG_CI_TESTS}/MultiDom_Cube_ReqEntities/c -out ${CTEST_OUTPUT_DIR}/mmg_MultiDom_Cube_ReqEntities_nosizreq_${SHRT_EXEC}.o.meshb) -ADD_TEST(NAME mmg_MultiDom_Ellipse_ReqEntitiesAni_${SHRT_EXEC} - COMMAND ${EXEC} -v 5 -hausd 0.002 -A ${common_args} - ${MMG_CI_TESTS}/MultiDom_Ellipse_ReqEntities/c.d - -out ${CTEST_OUTPUT_DIR}/mmg_MultiDom_Ellipse_ReqEntitiesAni_${SHRT_EXEC}.o.meshb) +# Too long for github actions on windows (more than 1 hour). Lasts 15mins on winnie +# (physical windows), 4mins on ubuntu/mac. See gprof-profile.out file of +# ${MMG_CI_TESTS}/MultiDom_Ellipse_ReqEntities/ (lot of time is passed in gradsiz_ani) +# +#ADD_TEST(NAME mmg_MultiDom_Ellipse_ReqEntitiesAni_${SHRT_EXEC} +# COMMAND ${EXEC} -v 5 -hausd 0.002 -A ${common_args} +# ${MMG_CI_TESTS}/MultiDom_Ellipse_ReqEntities/c.d +# -out ${CTEST_OUTPUT_DIR}/mmg_MultiDom_Ellipse_ReqEntitiesAni_${SHRT_EXEC}.o.meshb) # -A @@ -326,6 +365,27 @@ ADD_TEST(NAME mmg_CommandLineAni_${SHRT_EXEC} ${MMG_CI_TESTS}/c1/c1.meshb -out ${CTEST_OUTPUT_DIR}/mmg_nreg_${SHRT_EXEC}.o.meshb) + # xreg + ADD_TEST( NAME mmg_CoorRegularizationCube_${SHRT_EXEC} + COMMAND ${EXEC} -v 5 -nr -xreg + ${MMG_CI_TESTS}/CoorRegularizationCube/cube + -out ${CTEST_OUTPUT_DIR}/CoorRegularizationCube_${SHRT_EXEC}.o.meshb) + + ADD_TEST( NAME mmg_CoorRegularizationRandomCube_${SHRT_EXEC} + COMMAND ${EXEC} -v 5 -xreg + ${MMG_CI_TESTS}/CoorRegularizationRandomCube/cubeRandom.mesh + -out ${CTEST_OUTPUT_DIR}/CoorRegularizationRandomCube_${SHRT_EXEC}.o.meshb) + + # -lssurf + IF ( ${SHRT_EXEC} MATCHES "3d" ) + SET ( ADD_ARG "-opnbdy" ) + ENDIF() + ADD_TEST(NAME mmg_OptLsSurf_peninsula_${SHRT_EXEC} + COMMAND ${EXEC} -v 5 ${ADD_ARG} -lssurf -nr -hgrad 1.5 -hausd 0.02 + -in ${MMG_CI_TESTS}/OptLsSurf_peninsula/peninsula + -sol ${MMG_CI_TESTS}/OptLsSurf_peninsula/ls.sol + -out ${CTEST_OUTPUT_DIR}/mmg_OptLsSurf_peninsula_${SHRT_EXEC}.o.meshb) + ############################################################################## ##### ##### Various test cases @@ -344,5 +404,12 @@ ADD_TEST(NAME mmg_CommandLineAni_${SHRT_EXEC} ${MMG_CI_TESTS}/SurfEdges_house/housebad.meshb -out ${CTEST_OUTPUT_DIR}/mmg_SurfEdges_${SHRT_EXEC}.o.meshb) + # test robustness of optim + aniso mode + ADD_TEST(NAME mmg_SurfEdges_OptimAni_${SHRT_EXEC} + COMMAND ${EXEC} -v 5 -hgrad -1 -optim -A -noinsert -noswap -nomove -nosizreq -hgradreq -1 + ${MMG_CI_TESTS}/SurfEdges_house/housebad.meshb + -out ${CTEST_OUTPUT_DIR}/mmg_SurfEdges_OptimAni_${SHRT_EXEC}.o.meshb) + + -ENDFOREACH(EXEC) +ENDFOREACH() diff --git a/cmake/testing/mmgs_tests.cmake b/cmake/testing/mmgs_tests.cmake index ae365a392..e2ddcd188 100644 --- a/cmake/testing/mmgs_tests.cmake +++ b/cmake/testing/mmgs_tests.cmake @@ -20,8 +20,6 @@ ## use this copy of the Mmg distribution only if you accept them. ## ============================================================================= -GET_FILENAME_COMPONENT ( SHRT_EXECUT_MMGS ${EXECUT_MMGS} NAME ) - ############################################################################### ##### ##### Continuous Integration @@ -61,6 +59,8 @@ ADD_TEST(NAME mmgs_val COMMAND ${EXECUT_MMGS} -val ${MMGS_CI_TESTS}/Teapot/teapot ) +SET_PROPERTY(TEST mmgs_val + PROPERTY WILL_FAIL TRUE) # nsd ADD_TEST(NAME mmgs_nsd24 @@ -68,13 +68,16 @@ ADD_TEST(NAME mmgs_nsd24 ${MMGS_CI_TESTS}/Teapot/teapot -out ${CTEST_OUTPUT_DIR}/mmgs_nsd24.o.meshb) -#ADD_TEST(NAME mmgs_default -# COMMAND ${EXECUT_MMGS} -default -# ${MMGS_CI_TESTS}/Teapot/teapot -# -out ${CTEST_OUTPUT_DIR}/mmgs_memOption.o.meshb) - -SET_PROPERTY(TEST mmgs_val #mmgs_default - PROPERTY WILL_FAIL TRUE) +ADD_TEST(NAME mmgs_locParamCrea + COMMAND ${EXECUT_MMGS} -v 5 -default + ${MMGS_CI_TESTS}/LocParamsCrea/circle2refs.mesh) +SET_TESTS_PROPERTIES ( mmgs_locParamCrea + PROPERTIES FIXTURES_SETUP mmgs_locParamCrea ) +ADD_TEST(NAME mmgs_locParamClean + COMMAND ${CMAKE_COMMAND} -E remove -f + ${MMGS_CI_TESTS}/LocParamsCrea/circle2refs.mmgs) +SET_TESTS_PROPERTIES ( mmgs_locParamClean + PROPERTIES FIXTURES_REQUIRED mmgs_locParamCrea ) ############################################################################### ##### @@ -112,7 +115,7 @@ ADD_TEST(NAME mmgs_vtkvtp_ani ${MMGS_CI_TESTS}/VtkInout/ani.vtp ${CTEST_OUTPUT_DIR}/mmgs_vtkvtp_ani) -IF ( NOT VTK_FOUND ) +IF ( (NOT VTK_FOUND) OR USE_VTK MATCHES OFF ) SET(expr "VTK library not founded") SET_PROPERTY(TEST mmgs_vtkvtp PROPERTY PASS_REGULAR_EXPRESSION "${expr}") @@ -193,9 +196,31 @@ ADD_TEST(NAME mmgs_OptLs_teapot2 ${MMGS_CI_TESTS}/OptLs_teapot/teapot ${CTEST_OUTPUT_DIR}/mmgs_OptLs_teapot2-teapot.o.meshb) +add_test( + NAME mmgs_OptLs_isoref_defaut + COMMAND ${EXECUT_MMGS} -v 5 -ls ${MMGS_CI_TESTS}/OptLs_isoref/surf-mesh.mesh + -sol ${MMGS_CI_TESTS}/OptLs_isoref/surf-mesh.sol + ${CTEST_OUTPUT_DIR}/mmgs_isoref.o.mesh + ) +add_test( + NAME mmgs_OptLs_isoref_5 + COMMAND ${EXECUT_MMGS} -v 5 -isoref 5 -ls + ${MMGS_CI_TESTS}/OptLs_isoref/surf-mesh-isoref5.mesh + -sol ${MMGS_CI_TESTS}/OptLs_isoref/surf-mesh.sol + ${CTEST_OUTPUT_DIR}/mmgs_isoref5.o.mesh + ) + +if (BASH) + add_test( + NAME mmgs_optLs_isoref + COMMAND ${BASH} -c "diff <(wc -wl ${CTEST_OUTPUT_DIR}/mmgs_isoref.o.mesh | awk '{print $1 $2}') <(wc -wl ${CTEST_OUTPUT_DIR}/mmgs_isoref5.o.mesh | awk '{print $1 $2}')" + ) +endif() + + ####### -met option ADD_TEST(NAME mmgs_2squares-withMet - COMMAND ${EXECUT_MMGS} -v 5 + COMMAND ${EXECUT_MMGS} -v 5 -d ${MMG2D_CI_TESTS}/2squares/2squares -met ${MMG2D_CI_TESTS}/2squares/2s.sol -out ${CTEST_OUTPUT_DIR}/mmgs_2squares-met.o.meshb) @@ -218,7 +243,6 @@ ADD_TEST(NAME mmgs_OptLs_teapot-nsd3 ${MMGS_CI_TESTS}/OptLs_teapot/teapot ${CTEST_OUTPUT_DIR}/mmgs_OptLs_teapot-ls-nsd3.o.meshb) - ############################################################################### ##### ##### Detected Bugs @@ -262,6 +286,25 @@ ADD_TEST(NAME mmgs_LSMultiMat -sol ${MMGS_CI_TESTS}/LSMultiMat/multi-mat-sol.sol ${CTEST_OUTPUT_DIR}/mmgs_LSMultiMat.o.meshb) +ADD_TEST(NAME mmgs_LSMultiMat-rmc + COMMAND ${EXECUT_MMGS} -v 5 -ls -hmin 0.005 -hmax 0.1 -hausd 0.001 -hgrad 1.3 -rmc + ${MMGS_CI_TESTS}/LSMultiMat/multi-mat + -sol ${MMGS_CI_TESTS}/LSMultiMat/multi-mat-sol.sol + ${CTEST_OUTPUT_DIR}/mmgs_LSMultiMat.o.meshb) + +# ls + rmc + LSBaseReference +ADD_TEST(NAME mmgs_OptLs_LSBaseReferences-rmc + COMMAND ${EXECUT_MMGS} -v 5 -ls -rmc + ${MMGS_CI_TESTS}/LSBaseReferences/box + -sol ${MMGS_CI_TESTS}/LSBaseReferences/box.sol + ${CTEST_OUTPUT_DIR}/mmgs_OptLs_LSBaseReferences-rmc.o.meshb) + +ADD_TEST(NAME mmgs_OptLs_LSBaseReferences-normc + COMMAND ${EXECUT_MMGS} -v 5 -ls + ${MMGS_CI_TESTS}/LSBaseReferences/box + -sol ${MMGS_CI_TESTS}/LSBaseReferences/box.sol + ${CTEST_OUTPUT_DIR}/mmgs_OptLs_LSBaseReferences-normc.o.meshb) + # non 0 ls ADD_TEST(NAME mmgs_LSMultiMat_nonzero COMMAND ${EXECUT_MMGS} -v 5 -ls 0.01 -hausd 0.001 @@ -269,6 +312,22 @@ ADD_TEST(NAME mmgs_LSMultiMat_nonzero -sol ${MMGS_CI_TESTS}/LSMultiMat/multi-mat-sol.sol ${CTEST_OUTPUT_DIR}/mmgs_LSMultiMat-nonzero.o.meshb) +# optim + aniso option with corners +ADD_TEST(NAME mmgs_CubeOptimAni + COMMAND ${EXECUT_MMGS} -v 5 -optim -A -hgrad -1 + ${MMGS_CI_TESTS}/CubeOptimAni/cube-ani + -out ${CTEST_OUTPUT_DIR}/mmgs_CubeOptimAni-cube.o.meshb) + +# optim + aniso option for open surface +ADD_TEST(NAME mmgs_OpnbdyOptimAni-circle + COMMAND ${EXECUT_MMGS} -v 5 -optim -A -hgrad -1 + ${MMGS_CI_TESTS}/OpnbdyOptimAni/cercle-3D.mesh + -out ${CTEST_OUTPUT_DIR}/mmgs_OpnbdyOptimAni-circle.o.meshb) + +ADD_TEST(NAME mmgs_OpnbdyOptimAni-adap1 + COMMAND ${EXECUT_MMGS} -v 5 -optim -A -hgrad -1 + ${MMGS_CI_TESTS}/OpnbdyOptimAni/adap1-3D.mesh + -out ${CTEST_OUTPUT_DIR}/mmgs_OpnbdyOptimAni-adap1.o.meshb) # ls discretisation + optim option ADD_TEST(NAME mmgs_LSMultiMat_optim @@ -284,6 +343,13 @@ ADD_TEST(NAME mmgs_LSMultiMat_optimAni -sol ${MMGS_CI_TESTS}/LSMultiMat/multi-mat-sol.sol ${CTEST_OUTPUT_DIR}/mmgs_LSMultiMat-optimAni.o.meshb) +SET(passRegex "## ERROR: MISMATCH OPTIONS: OPTIM OPTION IS NOT AVAILABLE") + +SET_PROPERTY(TEST mmgs_LSMultiMat_optim + PROPERTY PASS_REGULAR_EXPRESSION "${passRegex}") +SET_PROPERTY(TEST mmgs_LSMultiMat_optimAni + PROPERTY PASS_REGULAR_EXPRESSION "${passRegex}") + # ls discretisation + hsiz option ADD_TEST(NAME mmgs_LSMultiMat_hsiz COMMAND ${EXECUT_MMGS} -v 5 -ls -hsiz 0.05 -hausd 0.001 @@ -313,3 +379,67 @@ ADD_TEST(NAME mmgs_LSMultiMat_withMetAndLs -sol ${MMGS_CI_TESTS}/LSMultiMat/multi-mat-sol.sol ${MMGS_CI_TESTS}/LSMultiMat/multi-mat ${CTEST_OUTPUT_DIR}/mmgs_LSMultiMat-withMetAndLs.o.meshb) + +# ls discretization with wrong orientation of input triangles +ADD_TEST(NAME mmgs_LSTriaOri + COMMAND ${EXECUT_MMGS} -v 5 -ls -hausd 0.001 + ${MMGS_CI_TESTS}/LSTriaOri/fault.mesh + ${CTEST_OUTPUT_DIR}/mmgs_LSTriaOri.o.meshb) + +# lssurf: discretization of boundaries only +ADD_TEST(NAME mmgs_OptLsSurf_box + COMMAND ${EXECUT_MMGS} -v 5 -lssurf + -sol ${MMGS_CI_TESTS}/OptLsSurf_box/box.sol + ${MMGS_CI_TESTS}/OptLsSurf_box/box-3D.mesh + ${CTEST_OUTPUT_DIR}/mmgs_OptLsSurf_box.o.meshb + ) + +# lssurf + multimat: discretization of boundaries only +ADD_TEST(NAME mmgs_OptLsSurf_multiMat_box + COMMAND ${EXECUT_MMGS} -v 5 -lssurf + -sol ${MMGS_CI_TESTS}/OptLsSurf_box/box.sol + ${MMGS_CI_TESTS}/OptLsSurf_box/box_multiMat-3D.mesh + ${CTEST_OUTPUT_DIR}/mmgs_OptLsSurf_multiMat_box.o.meshb + ) + + +############################################################################### +##### +##### Check snapping (prevision of non-manifold situations) +##### +############################################################################### +##### +SET(nmRegex "unsnap at least 1 point") + +ADD_TEST(NAME mmgs_LSSnapval_manifold1 + COMMAND ${EXECUT_MMGS} -v 5 -ls + -in ${MMGS_CI_TESTS}/LSSnapval/8elts1.mesh + -sol ${MMGS_CI_TESTS}/LSSnapval/manifold.sol + -out ${CTEST_OUTPUT_DIR}/mmgs_LSSnapval_manifold1.o.mesh + ) + +ADD_TEST(NAME mmgs_LSSnapval_manifold2 + COMMAND ${EXECUT_MMGS} -v 5 -ls + -in ${MMGS_CI_TESTS}/LSSnapval/8elts2.mesh + -sol ${MMGS_CI_TESTS}/LSSnapval/manifold.sol + -out ${CTEST_OUTPUT_DIR}/mmgs_LSSnapval_manifold2.o.mesh + ) + +SET_PROPERTY(TEST mmgs_LSSnapval_manifold1 mmgs_LSSnapval_manifold2 + PROPERTY FAIL_REGULAR_EXPRESSION "${nmRegex}") + +ADD_TEST(NAME mmgs_LSSnapval_non-manifold1 + COMMAND ${EXECUT_MMGS} -v 5 -ls + -in ${MMGS_CI_TESTS}/LSSnapval/8elts1.mesh + -sol ${MMGS_CI_TESTS}/LSSnapval/8elts1-nm.sol + -out ${CTEST_OUTPUT_DIR}/mmgs_LSSnapval_non-manifold1.o.mesh + ) + +ADD_TEST(NAME mmgs_LSSnapval_non-manifold2 + COMMAND ${EXECUT_MMGS} -v 5 -ls + -in ${MMGS_CI_TESTS}/LSSnapval/8elts2.mesh + -sol ${MMGS_CI_TESTS}/LSSnapval/8elts2-nm.sol + -out ${CTEST_OUTPUT_DIR}/mmgs_LSSnapval_non-manifold2.o.mesh + ) +SET_PROPERTY(TEST mmgs_LSSnapval_non-manifold1 mmgs_LSSnapval_non-manifold2 + PROPERTY PASS_REGULAR_EXPRESSION "${nmRegex}") diff --git a/cmake/tools/FindMMG.cmake b/cmake/tools/FindMMG.cmake index d4dfb2d66..147e7e8bc 100644 --- a/cmake/tools/FindMMG.cmake +++ b/cmake/tools/FindMMG.cmake @@ -34,13 +34,12 @@ # MMG_LIBRARIES - mmg component libraries to be linked # # The user can give specific paths where to find the libraries adding cmake -# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg): +# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg/install): # MMG_DIR - Where to find the base directory of mmg -# MMG_INCDIR - Where to find the header files +# MMG_INCDIR - Path toward Mmg installation (should at least contains mmg/common filder) # MMG_LIBDIR - Where to find the library files -# MMG_BUILDDIR - Where to find the build directory of Mmg # The module can also look for the following environment variables if paths -# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR, MMG_BUILDDIR +# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR if (NOT MMG_FOUND) set(MMG_DIR "" CACHE PATH "Installation directory of MMG library") @@ -49,25 +48,6 @@ if (NOT MMG_FOUND) endif() endif() -# Looking for the Mmg build directory -# ----------------------------------- -set(ENV_MMG_BUILDDIR "$ENV{MMG_BUILDDIR}") - -if ( NOT MMG_BUILDDIR ) - FIND_PATH(MMG_BUILDDIR_INTERNAL - NAMES src/common/mmgcmakedefines.h - HINTS ${ENV_MMG_BUILDDIR} ${MMG_DIR} ${ENV_MMG_DIR} - PATH_SUFFIXES build Build BUILD builds Builds BUILDS - DOC "The mmg build directory" - ) -else () - set(MMG_BUILDDIR_INTERNAL "${MMG_BUILDDIR}") -endif() - -if ( NOT MMG_BUILDDIR AND MMG_BUILDDIR_INTERNAL ) - SET ( MMG_BUILDDIR "${MMG_BUILDDIR_INTERNAL}" ) -endif ( ) - # Looking for include # ------------------- @@ -79,22 +59,10 @@ set(ENV_MMG_INCDIR "$ENV{MMG_INCDIR}") if(ENV_MMG_INCDIR) list(APPEND _inc_env "${ENV_MMG_INCDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include") - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include/mmg") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _inc_env "${MMG_BUILDDIR}/include") - list(APPEND _inc_env "${MMG_BUILDDIR}/include/mmg") - else ( ) - list(APPEND _inc_env "${ENV_MMG_DIR}") - list(APPEND _inc_env "${ENV_MMG_DIR}/include") - list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include") - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include/mmg") - endif() - endif() + list(APPEND _inc_env "${ENV_MMG_DIR}") + list(APPEND _inc_env "${ENV_MMG_DIR}/include") + list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") else() if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") @@ -122,42 +90,24 @@ if(MMG_INCDIR) find_path(MMG_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${MMG_INCDIR} - PATH_SUFFIXES "mmg" "mmg/mmg2d" "mmg/mmgs" "mmg/mmg3d" "mmg2d" + PATH_SUFFIXES "mmg" "mmg/mmg2d" "mmg/mmgs" "mmg/mmg3d" "mmg/common" "mmg2d" "mmgs" "mmg3d") -elseif(MMG_BUILDDIR) - set(MMG_libmmgtypes.h_DIRS "MMG_libmmgtypes.h_DIRS-NOTFOUND") - find_path(MMG_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" - "include/mmg/mmgs" "include/mmg/mmg3d") else() if(MMG_DIR) set(MMG_libmmgtypes.h_DIRS "MMG_libmmgtypes.h_DIRS-NOTFOUND") - if ( MMG_BUILDDIR ) - find_path(MMG_libmmgtypes.h_DIRS - NAMES */libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" - "include/mmg/mmgs" "include/mmg/mmg3d") - else() - find_path(MMG_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" - "include/mmg/mmgs" "include/mmg/mmg3d") - endif() - + find_path(MMG_libmmgtypes.h_DIRS + NAMES libmmgtypes.h + HINTS ${MMG_DIR}/include + PATH_SUFFIXES "mmg" "mmg/common") else() set(MMG_libmmgtypes.h_DIRS "MMG_libmmgtypes.h_DIRS-NOTFOUND") find_path(MMG_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${_inc_env} - PATH_SUFFIXES "mmg" "mmg/mmg2d" "mmg/mmgs" "mmg/mmg3d" "mmg2d" - "mmgs" "mmg3d") + PATH_SUFFIXES "mmg" "mmg/common") endif() endif() -STRING(REGEX REPLACE "(mmg/mmg2d)|(mmg/mmgs)|(mmg/mmg3d)" "" +STRING(REGEX REPLACE "(mmg/mmg2d)|(mmg/mmgs)|(mmg/mmg3d)|(mmg/common)" "" MMG_libmmgtypes.h_DIRS ${MMG_libmmgtypes.h_DIRS}) mark_as_advanced(MMG_libmmgtypes.h_DIRS) @@ -184,19 +134,9 @@ unset(_lib_env) set(ENV_MMG_LIBDIR "$ENV{MMG_LIBDIR}") if(ENV_MMG_LIBDIR) list(APPEND _lib_env "${ENV_MMG_LIBDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}") - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}/lib") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _lib_env "${MMG_BUILDDIR}/lib") - else ( ) - list(APPEND _lib_env "${ENV_MMG_DIR}") - list(APPEND _lib_env "${ENV_MMG_DIR}/lib") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _lib_env "${MMG_BUILDDIR_INTERNAL}/lib") - endif() - endif() + list(APPEND _lib_env "${ENV_MMG_DIR}") + list(APPEND _lib_env "${ENV_MMG_DIR}/lib") else() if(WIN32) string(REPLACE ":" ";" _lib_env "$ENV{LIB}") @@ -224,17 +164,10 @@ else() if(MMG_DIR) set(MMG_mmg_LIBRARY "MMG_mmg_LIBRARY-NOTFOUND") - if ( MMG_BUILDDIR ) - find_library(MMG_mmg_LIBRARY - NAMES mmg - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES lib lib32 lib64) - else () - find_library(MMG_mmg_LIBRARY - NAMES mmg - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES lib lib32 lib64) - endif() + find_library(MMG_mmg_LIBRARY + NAMES mmg + HINTS ${MMG_DIR} + PATH_SUFFIXES "lib" "lib32" "lib64") else() set(MMG_mmg_LIBRARY "MMG_mmg_LIBRARY-NOTFOUND") find_library(MMG_mmg_LIBRARY diff --git a/cmake/tools/FindMMG2D.cmake b/cmake/tools/FindMMG2D.cmake index 67adc47f8..9b03da8f0 100644 --- a/cmake/tools/FindMMG2D.cmake +++ b/cmake/tools/FindMMG2D.cmake @@ -34,13 +34,12 @@ # MMG2D_LIBRARIES - mmg component libraries to be linked # # The user can give specific paths where to find the libraries adding cmake -# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg): -# MMG_DIR - Where to find the base directory of mmg -# MMG_INCDIR - Where to find the header files -# MMG_LIBDIR - Where to find the library files -# MMG_BUILDDIR - Where to find the build directory of Mmg +# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg/install): +# MMG_DIR - Where to find the base directory of mmg +# MMG_INCDIR - Path toward Mmg installation (should at least contains mmg/common filder) +# MMG_LIBDIR - Where to find the library files # The module can also look for the following environment variables if paths -# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR, MMG_BUILDDIR +# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR if (NOT MMG2D_FOUND) set(MMG_DIR "" CACHE PATH "Installation directory of MMG library") @@ -49,25 +48,6 @@ if (NOT MMG2D_FOUND) endif() endif() -# Looking for the Mmg build directory -# ----------------------------------- -set(ENV_MMG_BUILDDIR "$ENV{MMG_BUILDDIR}") - -if ( NOT MMG_BUILDDIR ) - FIND_PATH(MMG_BUILDDIR_INTERNAL - NAMES src/common/mmgcmakedefines.h - HINTS ${ENV_MMG_BUILDDIR} ${MMG_DIR} ${ENV_MMG_DIR} - PATH_SUFFIXES build Build BUILD builds Builds BUILDS - DOC "The mmg build directory" - ) -else () - set(MMG_BUILDDIR_INTERNAL "${MMG_BUILDDIR}") -endif() - -if ( NOT MMG_BUILDDIR AND MMG_BUILDDIR_INTERNAL ) - SET ( MMG_BUILDDIR "${MMG_BUILDDIR_INTERNAL}" ) -endif ( ) - # Looking for include # ------------------- @@ -79,22 +59,10 @@ set(ENV_MMG_INCDIR "$ENV{MMG_INCDIR}") if(ENV_MMG_INCDIR) list(APPEND _inc_env "${ENV_MMG_INCDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include") - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include/mmg") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _inc_env "${MMG_BUILDDIR}/include") - list(APPEND _inc_env "${MMG_BUILDDIR}/include/mmg") - else ( ) - list(APPEND _inc_env "${ENV_MMG_DIR}") - list(APPEND _inc_env "${ENV_MMG_DIR}/include") - list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include") - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include/mmg") - endif() - endif() + list(APPEND _inc_env "${ENV_MMG_DIR}") + list(APPEND _inc_env "${ENV_MMG_DIR}/include") + list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") else() if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") @@ -123,36 +91,21 @@ if(MMG_INCDIR) NAMES libmmgtypes.h HINTS ${MMG_INCDIR} PATH_SUFFIXES "mmg/mmg2d" "mmg2d") -elseif(MMG_BUILDDIR) - set(MMG2D_libmmgtypes.h_DIRS "MMG2D_libmmgtypes.h_DIRS-NOTFOUND") - find_path(MMG2D_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d") -else() if(MMG_DIR) set(MMG2D_libmmgtypes.h_DIRS "MMG2D_libmmgtypes.h_DIRS-NOTFOUND") - if ( MMG_BUILDDIR ) - find_path(MMG2D_libmmgtypes.h_DIRS - NAMES */libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d") - else() - find_path(MMG2D_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d") - endif() - + find_path(MMG2D_libmmgtypes.h_DIRS + NAMES libmmgtypes.h + HINTS ${MMG_DIR}/include + PATH_SUFFIXES "mmg" "mmg/common") else() set(MMG2D_libmmgtypes.h_DIRS "MMG2D_libmmgtypes.h_DIRS-NOTFOUND") find_path(MMG2D_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${_inc_env} - PATH_SUFFIXES "include/mmg" "include/mmg/mmg2d") + PATH_SUFFIXES "mmg" "mmg/common") endif() endif() -STRING(REGEX REPLACE "(mmg/mmg2d)" "" +STRING(REGEX REPLACE "(mmg/mmg2d)|(mmg/common)" "" MMG2D_libmmgtypes.h_DIRS ${MMG2D_libmmgtypes.h_DIRS} ) mark_as_advanced(MMG2D_libmmgtypes.h_DIRS) @@ -179,19 +132,9 @@ unset(_lib_env) set(ENV_MMG_LIBDIR "$ENV{MMG_LIBDIR}") if(ENV_MMG_LIBDIR) list(APPEND _lib_env "${ENV_MMG_LIBDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}") - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}/lib") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _lib_env "${MMG_BUILDDIR}/lib") - else ( ) - list(APPEND _lib_env "${ENV_MMG_DIR}") - list(APPEND _lib_env "${ENV_MMG_DIR}/lib") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _lib_env "${MMG_BUILDDIR_INTERNAL}/lib") - endif() - endif() + list(APPEND _lib_env "${ENV_MMG_DIR}") + list(APPEND _lib_env "${ENV_MMG_DIR}/lib") else() if(WIN32) string(REPLACE ":" ";" _lib_env "$ENV{LIB}") @@ -219,17 +162,10 @@ else() if(MMG_DIR) set(MMG2D_mmg2d_LIBRARY "MMG2D_mmg2d_LIBRARY-NOTFOUND") - if ( MMG_BUILDDIR ) - find_library(MMG2D_mmg2d_LIBRARY - NAMES mmg2d - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES lib lib32 lib64) - else () - find_library(MMG2D_mmg2d_LIBRARY - NAMES mmg2d - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES lib lib32 lib64) - endif() + find_library(MMG2D_mmg2d_LIBRARY + NAMES mmg2d + HINTS ${MMG_DIR} + PATH_SUFFIXES lib lib32 lib64) else() set(MMG2D_mmg2d_LIBRARY "MMG2D_mmg2d_LIBRARY-NOTFOUND") find_library(MMG2D_mmg2d_LIBRARY diff --git a/cmake/tools/FindMMG3D.cmake b/cmake/tools/FindMMG3D.cmake index 1f6256b91..da1341221 100644 --- a/cmake/tools/FindMMG3D.cmake +++ b/cmake/tools/FindMMG3D.cmake @@ -34,13 +34,12 @@ # MMG3D_LIBRARIES - mmg component libraries to be linked # # The user can give specific paths where to find the libraries adding cmake -# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg): -# MMG_DIR - Where to find the base directory of mmg -# MMG_INCDIR - Where to find the header files -# MMG_LIBDIR - Where to find the library files -# MMG_BUILDDIR - Where to find the build directory of Mmg +# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg/install): +# MMG_DIR - Where to find the base directory of mmg +# MMG_INCDIR - Path toward Mmg installation (should at least contains mmg/common filder) +# MMG_LIBDIR - Where to find the library files # The module can also look for the following environment variables if paths -# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR, MMG_BUILDDIR +# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR if (NOT MMG3D_FOUND) set(MMG_DIR "" CACHE PATH "Installation directory of MMG library") @@ -49,25 +48,6 @@ if (NOT MMG3D_FOUND) endif() endif() -# Looking for the Mmg build directory -# ----------------------------------- -set(ENV_MMG_BUILDDIR "$ENV{MMG_BUILDDIR}") - -if ( NOT MMG_BUILDDIR ) - FIND_PATH(MMG_BUILDDIR_INTERNAL - NAMES src/common/mmgcmakedefines.h - HINTS ${ENV_MMG_BUILDDIR} ${MMG_DIR} ${ENV_MMG_DIR} - PATH_SUFFIXES build Build BUILD builds Builds BUILDS - DOC "The mmg build directory" - ) -else () - set(MMG_BUILDDIR_INTERNAL "${MMG_BUILDDIR}") -endif() - -if ( NOT MMG_BUILDDIR AND MMG_BUILDDIR_INTERNAL ) - SET ( MMG_BUILDDIR "${MMG_BUILDDIR_INTERNAL}" ) -endif ( ) - # Looking for include # ------------------- @@ -79,22 +59,10 @@ set(ENV_MMG_INCDIR "$ENV{MMG_INCDIR}") if(ENV_MMG_INCDIR) list(APPEND _inc_env "${ENV_MMG_INCDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include") - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include/mmg") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _inc_env "${MMG_BUILDDIR}/include") - list(APPEND _inc_env "${MMG_BUILDDIR}/include/mmg") - else ( ) - list(APPEND _inc_env "${ENV_MMG_DIR}") - list(APPEND _inc_env "${ENV_MMG_DIR}/include") - list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include") - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include/mmg") - endif() - endif() + list(APPEND _inc_env "${ENV_MMG_DIR}") + list(APPEND _inc_env "${ENV_MMG_DIR}/include") + list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") else() if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") @@ -123,36 +91,21 @@ if(MMG_INCDIR) NAMES libmmgtypes.h HINTS ${MMG_INCDIR} PATH_SUFFIXES "mmg/mmg3d" "mmg3d") -elseif(MMG_BUILDDIR) - set(MMG3D_libmmgtypes.h_DIRS "MMG3D_libmmgtypes.h_DIRS-NOTFOUND") - find_path(MMG3D_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg3d") -else() if(MMG_DIR) set(MMG3D_libmmgtypes.h_DIRS "MMG3D_libmmgtypes.h_DIRS-NOTFOUND") - if ( MMG_BUILDDIR ) - find_path(MMG3D_libmmgtypes.h_DIRS - NAMES */libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg3d") - else() - find_path(MMG3D_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg3d") - endif() - + find_path(MMG3D_libmmgtypes.h_DIRS + NAMES libmmgtypes.h + HINTS ${MMG_DIR}/include + PATH_SUFFIXES "mmg" "mmg/common") else() set(MMG3D_libmmgtypes.h_DIRS "MMG3D_libmmgtypes.h_DIRS-NOTFOUND") find_path(MMG3D_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${_inc_env} - PATH_SUFFIXES "include/mmg" "include/mmg/mmg3d") + PATH_SUFFIXES "mmg" "mmg/common") endif() endif() -STRING(REGEX REPLACE "(mmg/mmg3d)" "" +STRING(REGEX REPLACE "(mmg/mmg3d)|(mmg/common)" "" MMG3D_libmmgtypes.h_DIRS ${MMG3D_libmmgtypes.h_DIRS} ) mark_as_advanced(MMG3D_libmmgtypes.h_DIRS) @@ -179,19 +132,9 @@ unset(_lib_env) set(ENV_MMG_LIBDIR "$ENV{MMG_LIBDIR}") if(ENV_MMG_LIBDIR) list(APPEND _lib_env "${ENV_MMG_LIBDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}") - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}/lib") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _lib_env "${MMG_BUILDDIR}/lib") - else ( ) - list(APPEND _lib_env "${ENV_MMG_DIR}") - list(APPEND _lib_env "${ENV_MMG_DIR}/lib") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _lib_env "${MMG_BUILDDIR_INTERNAL}/lib") - endif() - endif() + list(APPEND _lib_env "${ENV_MMG_DIR}") + list(APPEND _lib_env "${ENV_MMG_DIR}/lib") else() if(WIN32) string(REPLACE ":" ";" _lib_env "$ENV{LIB}") @@ -219,17 +162,10 @@ else() if(MMG_DIR) set(MMG3D_mmg3d_LIBRARY "MMG3D_mmg3d_LIBRARY-NOTFOUND") - if ( MMG_BUILDDIR ) - find_library(MMG3D_mmg3d_LIBRARY - NAMES mmg3d - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES lib lib32 lib64) - else () - find_library(MMG3D_mmg3d_LIBRARY - NAMES mmg3d - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES lib lib32 lib64) - endif() + find_library(MMG3D_mmg3d_LIBRARY + NAMES mmg3d + HINTS ${MMG_DIR} + PATH_SUFFIXES lib lib32 lib64) else() set(MMG3D_mmg3d_LIBRARY "MMG3D_mmg3d_LIBRARY-NOTFOUND") find_library(MMG3D_mmg3d_LIBRARY diff --git a/cmake/tools/FindMMGS.cmake b/cmake/tools/FindMMGS.cmake index f8fe09b12..c45c46324 100644 --- a/cmake/tools/FindMMGS.cmake +++ b/cmake/tools/FindMMGS.cmake @@ -34,13 +34,12 @@ # MMGS_LIBRARIES - mmg component libraries to be linked # # The user can give specific paths where to find the libraries adding cmake -# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg): -# MMG_DIR - Where to find the base directory of mmg -# MMG_INCDIR - Where to find the header files -# MMG_LIBDIR - Where to find the library files -# MMG_BUILDDIR - Where to find the build directory of Mmg +# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg/install): +# MMG_DIR - Where to find the base directory of mmg +# MMG_INCDIR - Path toward Mmg installation (should at least contains mmg/common filder) +# MMG_LIBDIR - Where to find the library files # The module can also look for the following environment variables if paths -# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR, MMG_BUILDDIR +# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR if (NOT MMGS_FOUND) set(MMG_DIR "" CACHE PATH "Installation directory of MMG library") @@ -49,25 +48,6 @@ if (NOT MMGS_FOUND) endif() endif() -# Looking for the Mmg build directory -# ----------------------------------- -set(ENV_MMG_BUILDDIR "$ENV{MMG_BUILDDIR}") - -if ( NOT MMG_BUILDDIR ) - FIND_PATH(MMG_BUILDDIR_INTERNAL - NAMES src/common/mmgcmakedefines.h - HINTS ${ENV_MMG_BUILDDIR} ${MMG_DIR} ${ENV_MMG_DIR} - PATH_SUFFIXES build Build BUILD builds Builds BUILDS - DOC "The mmg build directory" - ) -else () - set(MMG_BUILDDIR_INTERNAL "${MMG_BUILDDIR}") -endif() - -if ( NOT MMG_BUILDDIR AND MMG_BUILDDIR_INTERNAL ) - SET ( MMG_BUILDDIR "${MMG_BUILDDIR_INTERNAL}" ) -endif ( ) - # Looking for include # ------------------- @@ -79,22 +59,10 @@ set(ENV_MMG_INCDIR "$ENV{MMG_INCDIR}") if(ENV_MMG_INCDIR) list(APPEND _inc_env "${ENV_MMG_INCDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include") - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include/mmg") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _inc_env "${MMG_BUILDDIR}/include") - list(APPEND _inc_env "${MMG_BUILDDIR}/include/mmg") - else ( ) - list(APPEND _inc_env "${ENV_MMG_DIR}") - list(APPEND _inc_env "${ENV_MMG_DIR}/include") - list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include") - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include/mmg") - endif() - endif() + list(APPEND _inc_env "${ENV_MMG_DIR}") + list(APPEND _inc_env "${ENV_MMG_DIR}/include") + list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") else() if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") @@ -123,36 +91,21 @@ if(MMG_INCDIR) NAMES libmmgtypes.h HINTS ${MMG_INCDIR} PATH_SUFFIXES "mmg/mmgs" "mmgs") -elseif(MMG_BUILDDIR) - set(MMGS_libmmgtypes.h_DIRS "MMGS_libmmgtypes.h_DIRS-NOTFOUND") - find_path(MMGS_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmgs") -else() if(MMG_DIR) set(MMGS_libmmgtypes.h_DIRS "MMGS_libmmgtypes.h_DIRS-NOTFOUND") - if ( MMG_BUILDDIR ) - find_path(MMGS_libmmgtypes.h_DIRS - NAMES */libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmgs") - else() - find_path(MMGS_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmgs") - endif() - + find_path(MMGS_libmmgtypes.h_DIRS + NAMES libmmgtypes.h + HINTS ${MMG_DIR}/include + PATH_SUFFIXES "mmg" "mmg/common") else() set(MMGS_libmmgtypes.h_DIRS "MMGS_libmmgtypes.h_DIRS-NOTFOUND") find_path(MMGS_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${_inc_env} - PATH_SUFFIXES "include/mmg" "include/mmg/mmgs") + PATH_SUFFIXES "mmg" "mmg/common") endif() endif() -STRING(REGEX REPLACE "(mmg/mmgs)" "" +STRING(REGEX REPLACE "(mmg/mmgs)|(mmg/common)" "" MMGS_libmmgtypes.h_DIRS ${MMGS_libmmgtypes.h_DIRS} ) mark_as_advanced(MMGS_libmmgtypes.h_DIRS) @@ -179,19 +132,9 @@ unset(_lib_env) set(ENV_MMG_LIBDIR "$ENV{MMG_LIBDIR}") if(ENV_MMG_LIBDIR) list(APPEND _lib_env "${ENV_MMG_LIBDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}") - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}/lib") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _lib_env "${MMG_BUILDDIR}/lib") - else ( ) - list(APPEND _lib_env "${ENV_MMG_DIR}") - list(APPEND _lib_env "${ENV_MMG_DIR}/lib") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _lib_env "${MMG_BUILDDIR_INTERNAL}/lib") - endif() - endif() + list(APPEND _lib_env "${ENV_MMG_DIR}") + list(APPEND _lib_env "${ENV_MMG_DIR}/lib") else() if(WIN32) string(REPLACE ":" ";" _lib_env "$ENV{LIB}") @@ -219,17 +162,10 @@ else() if(MMG_DIR) set(MMGS_mmgs_LIBRARY "MMGS_mmgs_LIBRARY-NOTFOUND") - if ( MMG_BUILDDIR ) - find_library(MMGS_mmgs_LIBRARY - NAMES mmgs - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES lib lib32 lib64) - else () - find_library(MMGS_mmgs_LIBRARY - NAMES mmgs - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES lib lib32 lib64) - endif() + find_library(MMGS_mmgs_LIBRARY + NAMES mmgs + HINTS ${MMG_DIR} + PATH_SUFFIXES lib lib32 lib64) else() set(MMGS_mmgs_LIBRARY "MMGS_mmgs_LIBRARY-NOTFOUND") find_library(MMGS_mmgs_LIBRARY diff --git a/doc/doxygen/BUILD_DOXYGEN_DOC.md b/doc/doxygen/BUILD_DOXYGEN_DOC.md new file mode 100644 index 000000000..f05fa5a2c --- /dev/null +++ b/doc/doxygen/BUILD_DOXYGEN_DOC.md @@ -0,0 +1,18 @@ +# Mmg doxygen documentation + +## Online documentation +The Doxygen documentation of the last release of Mmg is available on : https://mmgtools.github.io/ + +## Build locally your own html documentation +You can build the Mmg documentation using the `make doc` command generated by CMake. + +For CMake begginers you can follow the next steps: +``` + cd mmg + mkdir build + cd build + cmake .. + make doc +``` + +By default the Doxygen output is builded by the under the `doc` sub directory of the build directory (so in `build/doc` in the previous example). You can configure the `MMG_DOC_DIR` CMake variable to change the Doxygen output directory. diff --git a/doc/doxygen/mmg3d/Doxyfile.in b/doc/doxygen/Doxyfile.in similarity index 97% rename from doc/doxygen/mmg3d/Doxyfile.in rename to doc/doxygen/Doxyfile.in index 38f129cfd..629e2479f 100644 --- a/doc/doxygen/mmg3d/Doxyfile.in +++ b/doc/doxygen/Doxyfile.in @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = mmg3d +PROJECT_NAME = Mmg # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -44,14 +44,14 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = "Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)" # With the PROJECT_LOGO tag one can specify an logo or icon that is included in # the documentation. The maximum height of the logo should not exceed 55 pixels # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo # to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = @CMAKE_CURRENT_SOURCE_DIR@/doc/doxygen/logo-Mmg.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is @@ -130,7 +130,7 @@ INLINE_INHERITED_MEMB = NO # shortest path that makes the file name unique will be used # The default value is: YES. -FULL_PATH_NAMES = NO +FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand @@ -142,7 +142,7 @@ FULL_PATH_NAMES = NO # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = @CMAKE_CURRENT_SOURCE_DIR@ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -220,12 +220,6 @@ TAB_SIZE = 8 ALIASES = -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -268,8 +262,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = c=C \ - h=C +EXTENSION_MAPPING = c=C h=C F90=Fortran cpp=C++ hpp=C++ # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -734,7 +727,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src/common @CMAKE_CURRENT_SOURCE_DIR@/src/mmg3d +INPUT = @CMAKE_CURRENT_SOURCE_DIR@/README.md @CMAKE_CURRENT_SOURCE_DIR@/CONTRIBUTING.md @CMAKE_CURRENT_SOURCE_DIR@/src @CMAKE_CURRENT_SOURCE_DIR@/libexamples @CMAKE_CURRENT_SOURCE_DIR@/doc # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -754,8 +747,7 @@ INPUT_ENCODING = UTF-8 # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, # *.qsf, *.as and *.js. -FILE_PATTERNS = *.h \ - *.c +FILE_PATTERNS = *.h *.hpp *.c *.cpp *.F90 *md # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. @@ -770,7 +762,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/build @CMAKE_CURRENT_SOURCE_DIR@/cmake @CMAKE_CURRENT_SOURCE_DIR@/scripts # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -803,14 +795,14 @@ EXCLUDE_SYMBOLS = # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = +EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/libexamples/ # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. -EXAMPLE_PATTERNS =*.c +EXAMPLE_PATTERNS =*.c *.cpp *.F90 # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands @@ -823,7 +815,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = . +IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/doc/doxygen/images # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -871,7 +863,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_SOURCE_DIR@/README.md #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -884,7 +876,7 @@ USE_MDFILE_AS_MAINPAGE = # also VERBATIM_HEADERS is set to NO. # The default value is: NO. -SOURCE_BROWSER = NO +SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. @@ -970,13 +962,6 @@ VERBATIM_HEADERS = YES ALPHABETICAL_INDEX = NO -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -1000,7 +985,7 @@ GENERATE_HTML = YES # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_OUTPUT = html +HTML_OUTPUT = . # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). @@ -1039,18 +1024,6 @@ HTML_HEADER = HTML_FOOTER = -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- # defined cascading style sheet that is included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. @@ -1344,7 +1317,9 @@ DISABLE_INDEX = NO # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_TREEVIEW = YES +GENERATE_TREEVIEW = NO + +FULL_SIDEBAR = YES # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. @@ -1532,7 +1507,7 @@ EXTRA_SEARCH_MAPPINGS = # If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. # The default value is: YES. -GENERATE_LATEX = NO +GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1575,7 +1550,7 @@ COMPACT_LATEX = NO # The default value is: a4. # This tag requires that the tag GENERATE_LATEX is set to YES. -PAPER_TYPE = a4wide +PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names # that should be included in the LaTeX output. To get the times font for @@ -1652,16 +1627,6 @@ LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See # http://en.wikipedia.org/wiki/BibTeX and \cite for more info. @@ -1915,7 +1880,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = USE_SUSCELAS +PREDEFINED = USE_ELAS USE_SCOTCH USE_VTK ENABLE_TESTING # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -1981,12 +1946,6 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- @@ -2000,15 +1959,6 @@ PERL_PATH = /usr/bin/perl CLASS_DIAGRAMS = NO -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # If set to YES, the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. diff --git a/doc/doxygen/README b/doc/doxygen/README deleted file mode 100644 index e68bfa78a..000000000 --- a/doc/doxygen/README +++ /dev/null @@ -1,9 +0,0 @@ -MMGS doxygen documentation is in the mmgs directory and MMG3D doxygen documentation in the mmg3d directory. - -To see documentation in html : open [mmgs|mmg3d]/html/index.html - -To see it in pdf (not build for now, uncomment associated lines in CMakeLists.txt to build it): - $cd [mmgs|mmg3d] - $cd latex - $make pdf -open latex/refman.pdf diff --git a/doc/doxygen/References.bib b/doc/doxygen/References.bib new file mode 100644 index 000000000..4d9359ada --- /dev/null +++ b/doc/doxygen/References.bib @@ -0,0 +1,43 @@ +@article{COUPEZ20112391, +title = {Metric construction by length distribution tensor and edge based error for anisotropic adaptive meshing}, +journal = {Journal of Computational Physics}, +volume = {230}, +number = {7}, +pages = {2391-2405}, +year = {2011}, +issn = {0021-9991}, +doi = {https://doi.org/10.1016/j.jcp.2010.11.041}, +url = {https://www.sciencedirect.com/science/article/pii/S002199911000656X}, +author = {T. Coupez}, +keywords = {Metric, Length distribution tensor, Anisotropic meshing, Interpolation error, Edge error estimate}, +abstract = {Metric tensors play a key role to control the generation of unstructured anisotropic meshes. In practice, the most well established error analysis enables to calculate a metric tensor on an element basis. In this paper, we propose to build a metric field directly at the nodes of the mesh for a direct use in the meshing tools. First, the unit mesh metric is defined and well justified on a node basis, by using the statistical concept of length distribution tensors. Then, the interpolation error analysis is performed on the projected approximate scalar field along the edges. The error estimate is established on each edge whatever the dimension is. It enables to calculate a stretching factor providing a new edge length distribution, its associated tensor and the corresponding metric. The optimal stretching factor field is obtained by solving an optimization problem under the constraint of a fixed number of edges in the mesh. Several examples of interpolation error are proposed as well as preliminary results of anisotropic adaptation for interface and free surface problem using a level set method.} +} + +@inproceedings{vlachos2001curved, + title={Curved PN triangles}, + author={Vlachos, Alex and Peters, J{\"o}rg and Boyd, Chas and Mitchell, Jason L}, + booktitle={Proceedings of the 2001 symposium on Interactive 3D graphics}, + pages={159--166}, + year={2001} +} + +@article{borouchaki1998mesh, + title={Mesh gradation control}, + author={Borouchaki, Houman and Hecht, Frederic and Frey, Pascal J}, + journal={International Journal for Numerical Methods in Engineering}, + volume={43}, + number={6}, + pages={1143--1165}, + year={1998}, + publisher={Wiley Online Library} +} + +@article{dapogny2014three, + title={Three-dimensional adaptive domain remeshing, implicit domain meshing, and applications to free and moving boundary problems}, + author={Dapogny, Charles and Dobrzynski, C{\'e}cile and Frey, Pascal}, + journal={Journal of computational physics}, + volume={262}, + pages={358--378}, + year={2014}, + publisher={Elsevier} +} diff --git a/doc/doxygen/logo-Mmg.png b/doc/doxygen/logo-Mmg.png new file mode 100644 index 000000000..6e96bcf67 Binary files /dev/null and b/doc/doxygen/logo-Mmg.png differ diff --git a/doc/doxygen/mmg2d/Doxyfile.in b/doc/doxygen/mmg2d/Doxyfile.in deleted file mode 100644 index 1b9f29025..000000000 --- a/doc/doxygen/mmg2d/Doxyfile.in +++ /dev/null @@ -1,2270 +0,0 @@ -# Doxyfile 1.8.5 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = mmg2d - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = . - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese- -# Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en, -# Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish, -# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, -# Turkish, Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = NO - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. -# -# Note For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = c=C \ - h=C - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = NO - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = YES - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. -# Note: If this tag is empty the current directory is searched. - -INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src/common @CMAKE_CURRENT_SOURCE_DIR@/src/mmg2d - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. - -FILE_PATTERNS = *.h \ - *.c - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = */libmmg2df.h - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH =../libexamples/mmg2d/example0 ../libexamples/mmg2d/example0_fortran ../libexamples/mmg2d/example1 - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS =*.c - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = YES - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = . - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = NO - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /