From: ndjinga Date: Wed, 9 Sep 2020 11:58:22 +0000 (+0200) Subject: Suppressed pre_requis directory X-Git-Tag: V9_6_0~55 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=81922448e7d6a48c858712ae22d10a3b0ccf0e01;p=tools%2Fsolverlab.git Suppressed pre_requis directory --- diff --git a/CDMATH/linearsolver/inc/CMakeLists.txt b/CDMATH/linearsolver/inc/CMakeLists.txt index cb01f87..5e87867 100755 --- a/CDMATH/linearsolver/inc/CMakeLists.txt +++ b/CDMATH/linearsolver/inc/CMakeLists.txt @@ -1,7 +1,3 @@ -INCLUDE_DIRECTORIES( - ${SLEPC_INCLUDES} -) - FILE(GLOB include_linearsolver_HXX . *.hxx ) INSTALL(FILES ${include_linearsolver_HXX} DESTINATION include) diff --git a/CDMATH/pre_requis/PETSc/CMakeLists.txt b/CDMATH/pre_requis/PETSc/CMakeLists.txt deleted file mode 100755 index 5458c75..0000000 --- a/CDMATH/pre_requis/PETSc/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -PROJECT(PETSc) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) - - - diff --git a/CDMATH/pre_requis/PETSc/f2cblaslapack-3.4.2.q4.tar.gz b/CDMATH/pre_requis/PETSc/f2cblaslapack-3.4.2.q4.tar.gz deleted file mode 100755 index 1ec3ecc..0000000 Binary files a/CDMATH/pre_requis/PETSc/f2cblaslapack-3.4.2.q4.tar.gz and /dev/null differ diff --git a/CDMATH/pre_requis/PETSc/hdf5-1.10.3.tar.gz b/CDMATH/pre_requis/PETSc/hdf5-1.10.3.tar.gz deleted file mode 100755 index 7de101d..0000000 Binary files a/CDMATH/pre_requis/PETSc/hdf5-1.10.3.tar.gz and /dev/null differ diff --git a/CDMATH/tests/CMakeLists.txt b/CDMATH/tests/CMakeLists.txt index f37e09a..cef0ca5 100755 --- a/CDMATH/tests/CMakeLists.txt +++ b/CDMATH/tests/CMakeLists.txt @@ -39,7 +39,7 @@ IF (CDMATH_WITH_TESTS) ADD_TEST(UnitTestCDMATH TestCDMATH) SET_PROPERTY(TEST UnitTestCDMATH PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}") - INSTALL(TARGETS TestCDMATH DESTINATION tests/unit_tests) + INSTALL(TARGETS TestCDMATH DESTINATION bin/unit_tests) ADD_SUBDIRECTORY(cdmath) @@ -51,8 +51,8 @@ ENDIF (CDMATH_WITH_TESTS) ADD_SUBDIRECTORY(ressources) -FILE(COPY doc/ DESTINATION convergence_tests) -INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/convergence_tests DESTINATION doc/) +FILE(COPY doc/ DESTINATION share/doc/) +INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/convergence_tests DESTINATION share/validation) if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) # Examples tests diff --git a/CDMATH/tests/cdmath/CMakeLists.txt b/CDMATH/tests/cdmath/CMakeLists.txt index c55cf74..b20f14e 100755 --- a/CDMATH/tests/cdmath/CMakeLists.txt +++ b/CDMATH/tests/cdmath/CMakeLists.txt @@ -32,4 +32,4 @@ else (CDMATH_WITH_PETSC) TARGET_LINK_LIBRARIES(TestMesh base mesh medloader medcoupling med) endif (CDMATH_WITH_PETSC) -INSTALL(TARGETS TestMesh DESTINATION tests/unit_tests) +INSTALL(TARGETS TestMesh DESTINATION bin/unit_tests) diff --git a/CDMATH/tests/examples/CMakeLists.txt b/CDMATH/tests/examples/CMakeLists.txt index 003c184..7bb78e6 100755 --- a/CDMATH/tests/examples/CMakeLists.txt +++ b/CDMATH/tests/examples/CMakeLists.txt @@ -11,7 +11,7 @@ WaveSystem_Stationary/WaveSystemUpwind WaveSystem_Stationary/WaveSystemCentered WaveSystem_Shock/WaveSystemUpwind WaveSystem_Shock/WaveSystemCentered WaveSystem_Shock/WaveSystemPStag WaveSystem_Shock/WaveSystemStaggered ) -install(DIRECTORY ${NICE_EXAMPLES_TO_INSTALL} DESTINATION examples) +install(DIRECTORY ${NICE_EXAMPLES_TO_INSTALL} DESTINATION share/examples) IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) ADD_SUBDIRECTORY(TransportEquation1DUpwindExplicit) diff --git a/CDMATH/tests/ressources/CMakeLists.txt b/CDMATH/tests/ressources/CMakeLists.txt index 304bbfe..f9387fc 100755 --- a/CDMATH/tests/ressources/CMakeLists.txt +++ b/CDMATH/tests/ressources/CMakeLists.txt @@ -4,6 +4,6 @@ SET(MESH_MED2 file(COPY ${MESH_MED2} DESTINATION ${CMAKE_BINARY_DIR}/tests/ressources) -install(DIRECTORY ${MESH_MED2} DESTINATION meshes) +install(DIRECTORY ${MESH_MED2} DESTINATION share/meshes) diff --git a/CDMATH/tests/swig/CMakeLists.txt b/CDMATH/tests/swig/CMakeLists.txt index ccaaeef..64126c4 100755 --- a/CDMATH/tests/swig/CMakeLists.txt +++ b/CDMATH/tests/swig/CMakeLists.txt @@ -12,7 +12,7 @@ if (CDMATH_WITH_PETSC) ADD_TEST(TestsLinearSolverSwig ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/linearSolverTests.py) SET_PROPERTY(TEST TestsLinearSolverSwig PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}") SET_PROPERTY(TEST TestsLinearSolverSwig APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}") - INSTALL(FILES linearSolverTests.py DESTINATION tests/unit_tests) + INSTALL(FILES linearSolverTests.py DESTINATION bin/unit_tests) SET_PROPERTY(TEST TestsCDMATHSwig PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}") @@ -34,5 +34,5 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_POSTPRO) add_subdirectory (BoySurface) endif () -INSTALL(FILES ${MESH_MED} mainTests.py test_VTK_routines.py test_PV_routines.py DESTINATION tests/unit_tests) +INSTALL(FILES ${MESH_MED} mainTests.py test_VTK_routines.py test_PV_routines.py DESTINATION bin/unit_tests) diff --git a/CDMATH/tests/validation/CMakeLists.txt b/CDMATH/tests/validation/CMakeLists.txt index 7afdccf..e255ecb 100755 --- a/CDMATH/tests/validation/CMakeLists.txt +++ b/CDMATH/tests/validation/CMakeLists.txt @@ -109,7 +109,7 @@ IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/ - DESTINATION bin/validation/${dir} + DESTINATION share/validation/${dir} FILES_MATCHING PATTERN "*.py" PATTERN "*.med" PATTERN "*_0.vtu" @@ -120,13 +120,13 @@ IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) if(NOT ${is_2DPoissonVF} EQUAL -1) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/ - DESTINATION doc/convergence_tests/2DPoissonVF + DESTINATION share/doc/convergence_tests/2DPoissonVF FILES_MATCHING PATTERN "*_SQUARE.ipynb" PATTERN "*_SQUARE.pdf" ) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/ - DESTINATION doc/convergence_tests/2DPoissonVF/${dir} + DESTINATION share/doc/convergence_tests/2DPoissonVF/${dir} FILES_MATCHING PATTERN "*.png" PATTERN "*.ipynb" PATTERN "*.py" @@ -143,13 +143,13 @@ IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) if(NOT ${is_2DWaveSystem} EQUAL -1) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/ - DESTINATION doc/convergence_tests/2DWaveSystemVF_stationary + DESTINATION share/doc/convergence_tests/2DWaveSystemVF_stationary FILES_MATCHING PATTERN "*_SQUARE.ipynb" PATTERN "*_SQUARE.pdf" ) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/ - DESTINATION doc/convergence_tests/2DWaveSystemVF_stationary/${dir} + DESTINATION share/doc/convergence_tests/2DWaveSystemVF_stationary/${dir} FILES_MATCHING PATTERN "*.png" PATTERN "*.ipynb" PATTERN "*.py" @@ -167,13 +167,13 @@ IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) if(NOT ${is_2DDiffusion} EQUAL -1) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/ - DESTINATION doc/convergence_tests/2DAnisotropicDiffusionVF + DESTINATION share/doc/convergence_tests/2DAnisotropicDiffusionVF FILES_MATCHING PATTERN "*_SQUARE.ipynb" PATTERN "*_SQUARE.pdf" ) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/ - DESTINATION doc/convergence_tests/2DAnisotropicDiffusionVF/${dir} + DESTINATION share/doc/convergence_tests/2DAnisotropicDiffusionVF/${dir} FILES_MATCHING PATTERN "*.png" PATTERN "*.ipynb" PATTERN "*.py" diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b16209..7badf23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,13 +22,13 @@ set (MEDFILE_ROOT_DIR OFF CACHE STRING "MED library path" ) set (MEDCOUPLING_ROOT_DIR OFF CACHE STRING "MEDCoupling library path" ) #url of tarball librairies -set (DOWNLOAD_PETSC http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.tar.gz +set (DOWNLOAD_PETSC http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.5.tar.gz CACHE STRING "PETSc tarball path/url" ) set (DOWNLOAD_SLEPC https://slepc.upv.es/download/distrib/slepc-3.13.4.tar.gz CACHE STRING "SLEPC tarball path/url" ) -set (DOWNLOAD_F2CBLASLAPACK ${CDMATH_SOURCE_DIR}/pre_requis/PETSc/f2cblaslapack-3.4.2.q4.tar.gz +set (DOWNLOAD_F2CBLASLAPACK https://www.mcs.anl.gov/petsc/mirror/externalpackages/f2cblaslapack-3.4.2.q4.tar.gz CACHE STRING "F2CBLASLAPACK tarball path/url" ) -set (DOWNLOAD_HDF5 ${CDMATH_SOURCE_DIR}/pre_requis/PETSc/hdf5-1.10.3.tar.gz +set (DOWNLOAD_HDF5 https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.3/src/hdf5-1.10.3.tar.gz CACHE STRING "HDF5 tarball path/url" ) set (DOWNLOAD_MED http://files.salome-platform.org/Salome/other/med-4.1.0.tar.gz CACHE STRING "MED tarball path/url") @@ -36,7 +36,7 @@ set (DOWNLOAD_MEDCOUPLING http://files.salome-platform.org/Salome/other/medCou CACHE STRING "MEDCoupling tarball path/url" ) list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files") - +include(ExternalProject)#For PETSc, MED and MEDCoupling ###################################################### # Detection or compilation of PETSc+SLEPc+HDF5 # ###################################################### @@ -65,7 +65,7 @@ list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files") message ( STATUS "Checking variable SLEPC_DIR" ) if ( IS_DIRECTORY ${SLEPC_DIR}/include AND EXISTS ${SLEPC_DIR}/lib/libslepc.so) - set(SLEPC_INCLUDES ${SLEPC_DIR}/include) + set(SLEPC_INCLUDES ${SLEPC_DIR}/include) set(SLEPC_LIBRARIES ${SLEPC_DIR}/lib/libslepc.so) message( STATUS "SLEPc found at ${SLEPC_DIR}" ) else() @@ -81,14 +81,14 @@ list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files") set(HDF5_ROOT ${PETSC_DIR}/${PETSC_ARCH})# define hint for hdf5/med installation in petsc external packages endif( DEFINED ENV{HDF5_ROOT} ) endif( NOT HDF5_ROOT ) - set(HDF5_LIBRARY_DIR ${HDF5_ROOT}/lib) + set(HDF5_LIBRARY_DIR ${HDF5_ROOT}/lib) set(HDF5_INCLUDE_DIRS ${HDF5_ROOT}/include) else ( DEFINED ENV{PETSC_DIR} OR PETSC_DIR ) message ( STATUS "PETSC_DIR not set, searching PETSc and SLEPc in the system" ) if ( IS_DIRECTORY "/usr/include/petsc/" AND EXISTS "/usr/lib64/libpetsc.so" ) #Case fedora/redhat system install message ( STATUS "PETSC includes found in /usr/include/petsc/" ) - message ( STATUS "PETSC library found in /usr/lib64" ) + message ( STATUS "PETSC library found in /usr/lib64" ) set(PETSC_DIR /usr/) set(PETSC_INCLUDES /usr/include/petsc /usr/include/petsc/petsc/mpiuni) set(PETSC_LIBRARIES /usr/lib64/libpetsc.so) @@ -101,9 +101,9 @@ list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files") #Define and search slepc variables if ( IS_DIRECTORY "/usr/include/slepc/" AND EXISTS "/usr/lib64/libslepc.so" ) message( STATUS "SLEPc includes found in /usr/include/slepc/" ) - message( STATUS "SLEPc library found in /usr/lib64/slepc/" ) + message( STATUS "SLEPc library found in /usr/lib64/slepc/" ) set(SLEPC_DIR /usr/) - set(SLEPC_INCLUDES ${SLEPC_DIR}/include) + set(SLEPC_INCLUDES ${SLEPC_DIR}/include) set(SLEPC_LIBRARIES ${SLEPC_DIR}/lib/libslepc.so) set (CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, slepc-devel (>= 3.4)") # This is not fully working yet. else ( IS_DIRECTORY "/usr/include/slepc/" AND EXISTS "/usr/lib64/libslepc.so" ) @@ -114,10 +114,9 @@ list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files") if ( NOT HDF5_ROOT AND NOT DEFINED ENV{HDF5_ROOT} )#hdf5 is not defined in the environment find_package(HDF5 REQUIRED) set(CPACK_DEBIAN_PACKAGE_DEPENDS "libhdf5-dev") - set(CPACK_RPM_PACKAGE_REQUIRES "hdf5-devel") + set(CPACK_RPM_PACKAGE_REQUIRES "hdf5-devel") endif( NOT HDF5_ROOT AND NOT DEFINED ENV{HDF5_ROOT} ) - #elseif ( IS_DIRECTORY "/usr/lib/petsc/include" AND EXISTS "/usr/lib/petsc/lib/libpetsc_real.so" ) #Case ubuntu/debian system install # message ( STATUS "PETSc includes found in /usr/lib/petsc/include") # message ( STATUS "PETSc library found in /usr/lib/petsc/lib/libpetsc_real.so") @@ -152,11 +151,12 @@ list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files") #extract tarball name string(LENGTH "${DOWNLOAD_PETSC}" tarball_url_length)#length of the tarball string(FIND "${DOWNLOAD_PETSC}" "/" start_tarball_name REVERSE )# last occurence of "/" - MATH(EXPR start_tarball_name "${start_tarball_name}+1")#start after the occurence of "/" + MATH(EXPR start_tarball_name "${start_tarball_name}+1")#start after the occurence of "/" MATH(EXPR tarball_name_length "${tarball_url_length}-${start_tarball_name}-7")#name ends before .tar.gz that counts for 7 characters string(SUBSTRING ${DOWNLOAD_PETSC} ${start_tarball_name} ${tarball_name_length} PETSC_TARBALL_NAME) set(PETSC_DIR ${CMAKE_CURRENT_BINARY_DIR}/pre_requis/${PETSC_TARBALL_NAME}) # Location of the final install + set(PETSC_ARCH arch-linux-c-opt) set(PETSC_INSTALL ${CMAKE_INSTALL_PREFIX}/share/petsc)#folder to copy petsc libraries and include files ExternalProject_Add (PETSc @@ -164,9 +164,9 @@ list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files") SOURCE_DIR ${PETSC_DIR} BUILD_IN_SOURCE TRUE CONFIGURE_COMMAND /configure --prefix=${PETSC_INSTALL} --with-debugging=0 --with-mpi=0 --download-f2cblaslapack=${DOWNLOAD_F2CBLASLAPACK} --with-fc=0 --download-slepc=${DOWNLOAD_SLEPC} --download-hdf5=${DOWNLOAD_HDF5} - BUILD_COMMAND make + BUILD_COMMAND make all TEST_COMMAND make check - INSTALL_COMMAND make all + INSTALL_COMMAND make install INSTALL_DIR ${PETSC_DIR} STAMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/pre_requis LOG_DOWNLOAD TRUE # Wrap download in script to log output @@ -177,15 +177,22 @@ list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files") LOG_INSTALL TRUE # Wrap install in script to log output ) - #file (STRINGS "${PETSC_DIR}/${PETSC_ARCH}/include/petscversion.h" vstrings REGEX "#define PETSC_VERSION_(RELEASE|MAJOR|MINOR|SUBMINOR|PATCH) ") - #message( STATUS "PETSc version is ${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}" ) message( STATUS "PETSc, SLEPc and HDF5 will be installed at ${PETSC_INSTALL}") - string(SUBSTRING ${PETSC_TARBALL_NAME} 6 ${tarball_name_length} PETSC_VERSION) + string(LENGTH "${PETSC_TARBALL_NAME}" tarball_name_length)#length of the tarball + string(FIND "${PETSC_TARBALL_NAME}" "-" start_version_name REVERSE )# last occurence of "-" + MATH(EXPR start_version_name "${start_version_name}+1")#start after the occurence of "/" + string(SUBSTRING ${PETSC_TARBALL_NAME} ${start_version_name} ${tarball_name_length} PETSC_VERSION) + message( STATUS "PETSc version ${PETSC_VERSION} will be installed" ) + + set(PETSC_INCLUDES ${PETSC_DIR}/${PETSC_ARCH}/include ${PETSC_DIR}/include) + set(PETSC_LIBRARIES ${PETSC_DIR}/${PETSC_ARCH}/lib/libpetsc.so) + #define slepc variables set(SLEPC_DIR ${PETSC_INSTALL}) - set(SLEPC_INCLUDES ${SLEPC_DIR}/include) - set(SLEPC_LIBRARIES ${SLEPC_DIR}/lib/libslepc.so) + set(SLEPC_INCLUDES ${SLEPC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/externalpackages/slepc-3.13.4/include ${PETSC_DIR}/${PETSC_ARCH}/externalpackages/slepc-3.13.4/installed-arch-linux2-c-opt/include) + set(SLEPC_LIBRARIES ${PETSC_DIR}/${PETSC_ARCH}/externalpackages/slepc-3.13.4/installed-arch-linux2-c-opt/lib/libslepc.so) + message( STATUS "SLEPc includes ${SLEPC_INCLUDES}") #define hdf5 variables if ( NOT HDF5_ROOT )#hdf5 is not defined in cmake arguments @@ -204,8 +211,14 @@ list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files") if ( ${PETSC_VERSION} VERSION_GREATER 3.5 ) add_definitions(-DPETSC_VERSION_GREATER_3_5) endif( ${PETSC_VERSION} VERSION_GREATER 3.5 ) + string(REPLACE ";" ":" PETSC_INCLUDES_INSTALL "${PETSC_INCLUDES}")# use colon instead of semicolon in environment file env_CDMATH.sh +add_library(petsc SHARED IMPORTED) +set_property(TARGET petsc PROPERTY IMPORTED_LOCATION ${PETSC_LIBRARIES}) +add_library(slepc SHARED IMPORTED) +set_property(TARGET slepc PROPERTY IMPORTED_LOCATION ${SLEPC_LIBRARIES}) + ###################################################### # Detection or compilation of MEDFile # ###################################################### @@ -219,9 +232,7 @@ if( MEDFILE_ROOT_DIR OR DEFINED ENV{MEDFILE_ROOT_DIR}) message (STATUS "MEDFile found in ${MEDFILE_ROOT_DIR}") else( MEDFILE_ROOT_DIR OR DEFINED ENV{MEDFILE_ROOT_DIR}) - #string(FIND "${HDF5_LIBRARIES}" "libhdf5.so" pos) - #string(SUBSTRING "${HDF5_LIBRARIES}" 0 ${pos} HDF5_LIBRARY_DIR) - + message(STATUS "MED will be downloaded and installed from ${DOWNLOAD_MED}") set(MACHINE PCLINUX) set(MEDFILE_DEFINITIONS "-D${MACHINE} -DMEDFILE_INSTALL_DOC=OFF")#Comment ne pas compiler la doc ? @@ -406,14 +417,11 @@ endif() find_package (XDR REQUIRED) # Enter subdirectories -set( CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/cdmath) add_subdirectory (CDMATH) if(SOLVERLAB_WITH_COREFLOWS) - set( CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/../coreflows) add_subdirectory (CoreFlows) endif(SOLVERLAB_WITH_COREFLOWS) -set( CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/../) # Configuration file configure_file( ${PROJECT_SOURCE_DIR}/env_SOLVERLAB.sh diff --git a/CoreFlows/CMakeLists.txt b/CoreFlows/CMakeLists.txt index 56e3088..529e534 100755 --- a/CoreFlows/CMakeLists.txt +++ b/CoreFlows/CMakeLists.txt @@ -85,6 +85,8 @@ endif () # INCLUDE_DIRECTORIES( # ${CoreFlows_INCLUDES} # + ${PETSC_INCLUDES} + ${SLEPC_INCLUDES} ) # # SET(CoreFlowsMain_SOURCES # @@ -102,13 +104,13 @@ SET(CoreFlowsMain_SOURCES # ) # # SET(MAIN_SOURCES # - main.cxx # + mainCoreFlows.cxx # ) # SET(_extra_lib_CoreFlows ${CDMATH_LIBRARIES} ${PETSC_LIBRARIES} ) # ADD_EXECUTABLE(CoreFlowsMainExe ${MAIN_SOURCES}) # SET_TARGET_PROPERTIES(CoreFlowsMainExe PROPERTIES COMPILE_FLAGS "") # TARGET_LINK_LIBRARIES(CoreFlowsMainExe CoreFlows ${_extra_lib_CoreFlows}) # -INSTALL(TARGETS CoreFlowsMainExe DESTINATION bin/Executable) # +INSTALL(TARGETS CoreFlowsMainExe DESTINATION bin) # # configure_file( ${PROJECT_SOURCE_DIR}/env_CoreFlows.sh diff --git a/CoreFlows/Models/src/CMakeLists.txt b/CoreFlows/Models/src/CMakeLists.txt index d55ec75..b6084d4 100755 --- a/CoreFlows/Models/src/CMakeLists.txt +++ b/CoreFlows/Models/src/CMakeLists.txt @@ -1,6 +1,8 @@ INCLUDE_DIRECTORIES( ${CoreFlows_INCLUDES} # + ${PETSC_INCLUDES} + ${SLEPC_INCLUDES} ) SET(src_models_CXX diff --git a/CoreFlows/env_CoreFlows.sh b/CoreFlows/env_CoreFlows.sh index 991bb77..82d48d0 100755 --- a/CoreFlows/env_CoreFlows.sh +++ b/CoreFlows/env_CoreFlows.sh @@ -1,15 +1,15 @@ #!/bin/bash -export CDMATH_DIR=@CDMATH_DIR@ +export CDMATH_DIR=@CDMATH_INSTALL@ source $CDMATH_DIR/env_CDMATH.sh export CoreFlows_INSTALL=@CMAKE_INSTALL_PREFIX@ export PETSC_DIR=@PETSC_DIR@ export PETSC_ARCH=@PETSC_ARCH@ -export PETSC_INCLUDES=@PETSC_INCLUDES_PATH@ +export PETSC_INCLUDES=@PETSC_INCLUDES_INSTALL@ #------------------------------------------------------------------------------------------------------------------- -export CoreFlows=$CoreFlows_INSTALL/bin/Executable/CoreFlowsMainExe +export CoreFlows=$CoreFlows_INSTALL/bin/CoreFlowsMainExe export LD_LIBRARY_PATH=$CoreFlows_INSTALL/lib:$CDMATH_DIR/lib:${PETSC_DIR}/${PETSC_ARCH}/lib:${MEDCOUPLING_LIBRARIES}:${MEDFILE_C_LIBRARIES}:${LD_LIBRARY_PATH} -export PYTHONPATH=$CoreFlows_INSTALL/lib:$CoreFlows_INSTALL/lib/CoreFlows_Python:$CoreFlows_INSTALL/bin/CoreFlows_Python:$CoreFlows_INSTALL/lib/python2.7/site-packages/salome:$CDMATH_DIR/lib/cdmath:$CDMATH_DIR/bin/cdmath:$CDMATH_DIR/bin/cdmath/postprocessing:${PETSC_DIR}/${PETSC_ARCH}/lib:${MEDCOUPLING_LIBRARIES}:${MEDFILE_C_LIBRARIES}:${PYTHONPATH} +export PYTHONPATH=$CoreFlows_INSTALL/lib:$CoreFlows_INSTALL/lib/coreflows:$CoreFlows_INSTALL/bin/coreflows:$CoreFlows_INSTALL/lib/python2.7/site-packages/salome:$CDMATH_DIR/lib/cdmath:$CDMATH_DIR/bin/cdmath:$CDMATH_DIR/bin/cdmath/postprocessing:${PETSC_DIR}/${PETSC_ARCH}/lib:${MEDCOUPLING_LIBRARIES}:${MEDFILE_C_LIBRARIES}:${PYTHONPATH} export CoreFlowsGUI=$CoreFlows_INSTALL/bin/salome/CoreFlows_Standalone.py diff --git a/CoreFlows/examples/C/CMakeLists.txt b/CoreFlows/examples/C/CMakeLists.txt index c18e4bd..4d73610 100755 --- a/CoreFlows/examples/C/CMakeLists.txt +++ b/CoreFlows/examples/C/CMakeLists.txt @@ -2,6 +2,8 @@ project(testC) INCLUDE_DIRECTORIES( ${CoreFlows_INCLUDES} # + ${PETSC_INCLUDES} + ${SLEPC_INCLUDES} ) diff --git a/CoreFlows/main.cxx b/CoreFlows/main.cxx deleted file mode 100755 index 647de10..0000000 --- a/CoreFlows/main.cxx +++ /dev/null @@ -1,106 +0,0 @@ -#include "SinglePhase.hxx" -#include "DriftModel.hxx" -#include "FiveEqsTwoFluid.hxx" -#include "IsothermalTwoFluid.hxx" -#include "TransportEquation.hxx" -#include "DiffusionEquation.hxx" - -#include - -using namespace std; - -int main() -{ - int spaceDim = 2; - - // set the limit field for each boundary - double wallVelocityX=0; - double wallVelocityY=0; - double wallTemperature=563; - - double inletConcentration=0; - double inletVelocityX=0; - double inletVelocityY=1; - double inletTemperature=563; - - double outletPressure=155e5; - - // physical constants - vector gravite(spaceDim,0.) ; - gravite[1]=-8.5; - gravite[0]=5; - - DriftModel myProblem(around155bars600K,spaceDim); - int nVar = myProblem.getNumberOfVariables(); - - //Prepare for the mesh - double xinf=0.0; - double xsup=1.0; - double yinf=0.0; - double ysup=1.0; - int nx=2; - int ny=2; - - // Prepare for the initial condition - vector VV_Constant(nVar); - // constant vector - VV_Constant[0] = 0; - VV_Constant[1] = 155e5; - VV_Constant[2] = 0; - VV_Constant[3] = 1; - VV_Constant[4] = 563; - - //Initial field creation - cout << "Building initial data" << endl; - myProblem.setVerbose(true); - myProblem.setInitialFieldConstant(spaceDim,VV_Constant,xinf,xsup,nx,"wall","wall",yinf,ysup,ny,"inlet","outlet"); - - //set the boundary conditions - vectorpressure_reference_point(2); - pressure_reference_point[0]=xsup; - pressure_reference_point[1]=ysup; - myProblem.setOutletBoundaryCondition("outlet", outletPressure,pressure_reference_point); - myProblem.setInletBoundaryCondition("inlet", inletTemperature, inletConcentration, inletVelocityX, inletVelocityY); - myProblem.setWallBoundaryCondition("wall", wallTemperature, wallVelocityX, wallVelocityY); - - // set physical parameters - myProblem.setGravity(gravite); - - // set the numerical method - myProblem.setNumericalScheme(staggered, Implicit); - myProblem.setWellBalancedCorrection(true); - myProblem.setNonLinearFormulation(VFFC); - - // name of result file - string fileName = "DriftModel_2DInclinedBoilingChannel"; - - // computation parameters - unsigned MaxNbOfTimeStep = 1 ; - int freqSave = 1; - double cfl = 0.5; - double maxTime = 5; - double precision = 1e-4; - - myProblem.setCFL(cfl); - myProblem.setPrecision(precision); - myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep); - myProblem.setTimeMax(maxTime); - myProblem.setFreqSave(freqSave); - myProblem.setFileName(fileName); - myProblem.saveVelocity(); - myProblem.setNewtonSolver(precision,1); - - // evolution - myProblem.initialize(); - - bool ok = myProblem.run(); - if (ok) - cout << "Simulation "<1): - myProblem.saveVelocity(); - pass - - # evolution - myProblem.initialize(); - print("Running python "+ fileName ); - - ok = myProblem.run(); - if (ok): - print( "Simulation python " + fileName + " is successful !" ); - pass - else: - print( "Simulation python " + fileName + " failed ! " ); - pass - - print( "------------ End of calculation !!! -----------" ); - - myProblem.terminate(); - return ok - -if __name__ == """__main__""": - main() diff --git a/CoreFlows/mainCoreFlows.cxx b/CoreFlows/mainCoreFlows.cxx new file mode 100755 index 0000000..647de10 --- /dev/null +++ b/CoreFlows/mainCoreFlows.cxx @@ -0,0 +1,106 @@ +#include "SinglePhase.hxx" +#include "DriftModel.hxx" +#include "FiveEqsTwoFluid.hxx" +#include "IsothermalTwoFluid.hxx" +#include "TransportEquation.hxx" +#include "DiffusionEquation.hxx" + +#include + +using namespace std; + +int main() +{ + int spaceDim = 2; + + // set the limit field for each boundary + double wallVelocityX=0; + double wallVelocityY=0; + double wallTemperature=563; + + double inletConcentration=0; + double inletVelocityX=0; + double inletVelocityY=1; + double inletTemperature=563; + + double outletPressure=155e5; + + // physical constants + vector gravite(spaceDim,0.) ; + gravite[1]=-8.5; + gravite[0]=5; + + DriftModel myProblem(around155bars600K,spaceDim); + int nVar = myProblem.getNumberOfVariables(); + + //Prepare for the mesh + double xinf=0.0; + double xsup=1.0; + double yinf=0.0; + double ysup=1.0; + int nx=2; + int ny=2; + + // Prepare for the initial condition + vector VV_Constant(nVar); + // constant vector + VV_Constant[0] = 0; + VV_Constant[1] = 155e5; + VV_Constant[2] = 0; + VV_Constant[3] = 1; + VV_Constant[4] = 563; + + //Initial field creation + cout << "Building initial data" << endl; + myProblem.setVerbose(true); + myProblem.setInitialFieldConstant(spaceDim,VV_Constant,xinf,xsup,nx,"wall","wall",yinf,ysup,ny,"inlet","outlet"); + + //set the boundary conditions + vectorpressure_reference_point(2); + pressure_reference_point[0]=xsup; + pressure_reference_point[1]=ysup; + myProblem.setOutletBoundaryCondition("outlet", outletPressure,pressure_reference_point); + myProblem.setInletBoundaryCondition("inlet", inletTemperature, inletConcentration, inletVelocityX, inletVelocityY); + myProblem.setWallBoundaryCondition("wall", wallTemperature, wallVelocityX, wallVelocityY); + + // set physical parameters + myProblem.setGravity(gravite); + + // set the numerical method + myProblem.setNumericalScheme(staggered, Implicit); + myProblem.setWellBalancedCorrection(true); + myProblem.setNonLinearFormulation(VFFC); + + // name of result file + string fileName = "DriftModel_2DInclinedBoilingChannel"; + + // computation parameters + unsigned MaxNbOfTimeStep = 1 ; + int freqSave = 1; + double cfl = 0.5; + double maxTime = 5; + double precision = 1e-4; + + myProblem.setCFL(cfl); + myProblem.setPrecision(precision); + myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep); + myProblem.setTimeMax(maxTime); + myProblem.setFreqSave(freqSave); + myProblem.setFileName(fileName); + myProblem.saveVelocity(); + myProblem.setNewtonSolver(precision,1); + + // evolution + myProblem.initialize(); + + bool ok = myProblem.run(); + if (ok) + cout << "Simulation "<1): + myProblem.saveVelocity(); + pass + + # evolution + myProblem.initialize(); + print("Running python "+ fileName ); + + ok = myProblem.run(); + if (ok): + print( "Simulation python " + fileName + " is successful !" ); + pass + else: + print( "Simulation python " + fileName + " failed ! " ); + pass + + print( "------------ End of calculation !!! -----------" ); + + myProblem.terminate(); + return ok + +if __name__ == """__main__""": + main() diff --git a/CoreFlows/swig/CMakeLists.txt b/CoreFlows/swig/CMakeLists.txt index e4a0bdc..b56b953 100755 --- a/CoreFlows/swig/CMakeLists.txt +++ b/CoreFlows/swig/CMakeLists.txt @@ -7,14 +7,16 @@ SET_SOURCE_FILES_PROPERTIES(CoreFlows.i PROPERTIES SWIG_DEFINITIONS "-shadow") INCLUDE_DIRECTORIES( ${Python_INCLUDE_DIRS} ${CoreFlows_INCLUDES} # + ${PETSC_INCLUDES} + ${SLEPC_INCLUDES} ) -SET(_extra_lib_SWIG ${CDMATH_LIBRARIES} ${PETSC_LIBRARIES}) +SET(_extra_lib_SWIG ${CDMATH_LIBRARIES} ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES}) SWIG_ADD_MODULE(CoreFlows python CoreFlows.i) -SWIG_LINK_LIBRARIES(CoreFlows ${PYTHON_LIBRARIES} ${_extra_lib_SWIG} CoreFlows ${PETSC_LIBRARIES}) +SWIG_LINK_LIBRARIES(CoreFlows ${PYTHON_LIBRARIES} ${_extra_lib_SWIG} CoreFlows ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES}) -INSTALL(TARGETS _CoreFlows DESTINATION lib/CoreFlows_Python) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CoreFlows.py DESTINATION bin/CoreFlows_Python) -INSTALL(FILES ${CoreFlows_SOURCE_DIR}/main.py DESTINATION bin/) +INSTALL(TARGETS _CoreFlows DESTINATION lib/coreflows) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CoreFlows.py DESTINATION bin/coreflows) +INSTALL(FILES ${CoreFlows_SOURCE_DIR}/mainCoreFlows.py DESTINATION bin/) diff --git a/README.md b/README.md index 9332aaa..3adbb6d 100755 --- a/README.md +++ b/README.md @@ -70,9 +70,9 @@ Compile and install SOLVERLAB Simpler build for a minimum version: * `cmake ../SOLVERLAB-master/ -DCMAKE_INSTALL_PREFIX=../SOLVERLAB_install -DCMAKE_BUILD_TYPE=Release ` > This will download and build the following dependencies -> - PETSc from http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.13.tar.gz +> - PETSc from http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.13.5.tar.gz > - SLEPc from https://slepc.upv.es/download/distrib/slepc-3.13.4.tar.gz -> - HDF5 http://files.salome-platform.org/Salome/other/med-4.1.0.tar.gz +> - HDF5 https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.3/src/hdf5-1.10.3.tar.gz > - MEDFILE from http://files.salome-platform.org/Salome/other/med-4.1.0.tar.gz > - MEDCOUPLING from http://files.salome-platform.org/Salome/other/medCoupling-9.4.0.tar.gz diff --git a/env_SOLVERLAB.sh b/env_SOLVERLAB.sh index 79526fe..37d9fb8 100644 --- a/env_SOLVERLAB.sh +++ b/env_SOLVERLAB.sh @@ -1,7 +1,7 @@ #!/bin/bash -export CDMATH_INSTALL=@CMAKE_INSTALL_PREFIX@/cdmath -export COREFLOWS_INSTALL=@CMAKE_INSTALL_PREFIX@/coreflows +export CDMATH_INSTALL=@CMAKE_INSTALL_PREFIX@ +export COREFLOWS_INSTALL=@CMAKE_INSTALL_PREFIX@ export PETSC_DIR=@PETSC_INSTALL@ export PETSC_ARCH=@PETSC_ARCH@ export PETSC_INCLUDES=@PETSC_INCLUDES_INSTALL@