From: ndjinga Date: Mon, 5 Oct 2020 11:29:22 +0000 (+0200) Subject: Simplified use of variables for MATPLOTLIB, PyQt and paraview variables X-Git-Tag: V9_6_0~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=22f4e2e7232ba0196814060496d5b1e9b4b2c552;p=tools%2Fsolverlab.git Simplified use of variables for MATPLOTLIB, PyQt and paraview variables --- diff --git a/CDMATH/tests/CMakeLists.txt b/CDMATH/tests/CMakeLists.txt index 78b8002..e343ec9 100755 --- a/CDMATH/tests/CMakeLists.txt +++ b/CDMATH/tests/CMakeLists.txt @@ -33,7 +33,7 @@ IF (CDMATH_WITH_TESTS) endif(CDMATH_WITH_PETSC) if (CDMATH_WITH_PYTHON) - SET(TESTS_PYTHON_PATH ${CMAKE_BINARY_DIR}/CDMATH/swig:${CMAKE_BINARY_DIR}/CDMATH/postprocessing:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${PARAVIEW_ROOT_DIR}/lib/:${PARAVIEW_ROOT_DIR}/lib/python3.6/site-packages/:${PARAVIEW_ROOT_DIR}/lib/python3.6/site-packages/vtkmodules/:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${MATPLOTLIB_ROOT_DIR}/lib/python3.6/site-packages:${PYQT5_ROOT_DIR}:${PYQT5_ROOT_DIR}/lib/python3.6/site-packages:${PYTHONPATH} ) + SET(TESTS_PYTHON_PATH ${CMAKE_BINARY_DIR}/CDMATH/swig:${CMAKE_BINARY_DIR}/CDMATH/postprocessing:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PV_PYTHON_DIR} ) endif(CDMATH_WITH_PYTHON) TARGET_LINK_LIBRARIES(TestCDMATH TestMesh base mesh ${CPPUNIT_LIBS} ${_extra_lib_TESTS}) diff --git a/CDMATH/tests/examples/BurgersEquation1D/CMakeLists.txt b/CDMATH/tests/examples/BurgersEquation1D/CMakeLists.txt old mode 100644 new mode 100755 index a19b719..ec3f10b --- a/CDMATH/tests/examples/BurgersEquation1D/CMakeLists.txt +++ b/CDMATH/tests/examples/BurgersEquation1D/CMakeLists.txt @@ -2,7 +2,12 @@ if (CDMATH_WITH_PYTHON ) ADD_TEST(ExampleBurgersEquation_1DFV_shock_formation ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DBurgersEquation_shock_formation.py ) + SET_PROPERTY(TEST ExampleBurgersEquation_1DFV_shock_formation PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleBurgersEquation_1DFV_shock_formation APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") + ADD_TEST(ExampleBurgersEquation_1DFV_rarefaction_wave ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DBurgersEquation_rarefaction_wave.py ) + SET_PROPERTY(TEST ExampleBurgersEquation_1DFV_rarefaction_wave PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleBurgersEquation_1DFV_rarefaction_wave APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") endif (CDMATH_WITH_PYTHON ) diff --git a/CDMATH/tests/examples/HeatEquation1DExplicit/CMakeLists.txt b/CDMATH/tests/examples/HeatEquation1DExplicit/CMakeLists.txt old mode 100644 new mode 100755 index 117a131..33ac254 --- a/CDMATH/tests/examples/HeatEquation1DExplicit/CMakeLists.txt +++ b/CDMATH/tests/examples/HeatEquation1DExplicit/CMakeLists.txt @@ -6,10 +6,14 @@ if (CDMATH_WITH_PYTHON ) SET(CFL 0.99 )#Courant Friedrichs Lewy number ADD_TEST(ExampleHeatEquation_1DFV_Explicit_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/HeatEquation1DExplicit.py ${NX} ${CFL}) + SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Explicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Explicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") SET(CFL 2 )#Courant Friedrichs Lewy number ADD_TEST(ExampleHeatEquation_1DFV_Explicit_CFL2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/HeatEquation1DExplicit.py ${NX} ${CFL}) + SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Explicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Explicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") endif (CDMATH_WITH_PYTHON ) diff --git a/CDMATH/tests/examples/Poisson2DVF_DISK/FiniteVolumes2DPoisson_DISK.py b/CDMATH/tests/examples/Poisson2DVF_DISK/FiniteVolumes2DPoisson_DISK.py index e003ed6..9a923cd 100755 --- a/CDMATH/tests/examples/Poisson2DVF_DISK/FiniteVolumes2DPoisson_DISK.py +++ b/CDMATH/tests/examples/Poisson2DVF_DISK/FiniteVolumes2DPoisson_DISK.py @@ -69,7 +69,7 @@ for i in range(nbCells): Ck=my_mesh.getCell(k) distance=Ci.getBarryCenter().distance(Ck.getBarryCenter()) coeff=Fj.getMeasure()/Ci.getMeasure()/distance - Rigidite.setValue(i,k,-coeff) # terme extradiagonal + Rigidite.addValue(i,k,-coeff) # terme extradiagonal else: coeff=Fj.getMeasure()/Ci.getMeasure()/Ci.getBarryCenter().distance(Fj.getBarryCenter()) #For the particular case where the mesh boundary does not coincide with the domain boundary diff --git a/CDMATH/tests/examples/TransportEquation1DCenteredExplicit/CMakeLists.txt b/CDMATH/tests/examples/TransportEquation1DCenteredExplicit/CMakeLists.txt old mode 100644 new mode 100755 index c28588d..5b6ef87 --- a/CDMATH/tests/examples/TransportEquation1DCenteredExplicit/CMakeLists.txt +++ b/CDMATH/tests/examples/TransportEquation1DCenteredExplicit/CMakeLists.txt @@ -8,20 +8,29 @@ if (CDMATH_WITH_PYTHON ) SET(CFL 0.99 )#Courant Friedrichs Lewy number ADD_TEST(ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredExplicit.py ${NX} ${CFL} ${SMOOTHNESS} ) + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") - SET(CFL 0.5 )#Courant Friedrichs Lewy number + SET(CFL 0.5 )#Courant Friedrichs Lewy number + + ADD_TEST(ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL0.5 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredExplicit.py ${NX} ${CFL} ${SMOOTHNESS} ) + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL0.5 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL0.5 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") - ADD_TEST(ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL0.5 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredExplicit.py ${NX} ${CFL} ${SMOOTHNESS} ) SET(SMOOTHNESS 1 ) SET(CFL 0.99 )#Courant Friedrichs Lewy number ADD_TEST(ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredExplicit.py ${NX} ${CFL} ${SMOOTHNESS} ) + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") SET(CFL 0.5 )#Courant Friedrichs Lewy number ADD_TEST(ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL0.5 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredExplicit.py ${NX} ${CFL} ${SMOOTHNESS} ) + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL0.5 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL0.5 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") endif (CDMATH_WITH_PYTHON ) diff --git a/CDMATH/tests/examples/TransportEquation1DCenteredImplicit/CMakeLists.txt b/CDMATH/tests/examples/TransportEquation1DCenteredImplicit/CMakeLists.txt index a243a0a..2498e77 100755 --- a/CDMATH/tests/examples/TransportEquation1DCenteredImplicit/CMakeLists.txt +++ b/CDMATH/tests/examples/TransportEquation1DCenteredImplicit/CMakeLists.txt @@ -6,14 +6,14 @@ if (CDMATH_WITH_PYTHON ) SET(CFL 1 )#Courant Friedrichs Lewy number ADD_TEST(ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredImplicit.py ${NX} ${CFL}) - SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}:${Python_ROOT_DIR}/lib") - SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${MATPLOTLIB_ROOT_DIR}/lib/python3.6/site-packages:${PV_PYTHON_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") SET(CFL 2 )#Courant Friedrichs Lewy number ADD_TEST(ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredImplicit.py ${NX} ${CFL}) - SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}:${Python_ROOT_DIR}/lib") - SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${MATPLOTLIB_ROOT_DIR}/lib/python3.6/site-packages:${PV_PYTHON_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") endif (CDMATH_WITH_PYTHON ) diff --git a/CDMATH/tests/examples/TransportEquation1DUpwindExplicit/CMakeLists.txt b/CDMATH/tests/examples/TransportEquation1DUpwindExplicit/CMakeLists.txt old mode 100644 new mode 100755 index f1fe640..4ff0efc --- a/CDMATH/tests/examples/TransportEquation1DUpwindExplicit/CMakeLists.txt +++ b/CDMATH/tests/examples/TransportEquation1DUpwindExplicit/CMakeLists.txt @@ -6,14 +6,20 @@ if (CDMATH_WITH_PYTHON ) SET(CFL 0.9999 )#Courant Friedrichs Lewy number ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Explicit_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindExplicit.py ${NX} ${CFL}) + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") SET(CFL 0.5 )#Courant Friedrichs Lewy number ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Explicit_CFL0.5 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindExplicit.py ${NX} ${CFL}) + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL0.5 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL0.5 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") SET(CFL 2 )#Courant Friedrichs Lewy number ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Explicit_CFL2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindExplicit.py ${NX} ${CFL}) + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") endif (CDMATH_WITH_PYTHON ) diff --git a/CDMATH/tests/examples/TransportEquation1DUpwindImplicit/CMakeLists.txt b/CDMATH/tests/examples/TransportEquation1DUpwindImplicit/CMakeLists.txt index de2b44d..cad8f72 100755 --- a/CDMATH/tests/examples/TransportEquation1DUpwindImplicit/CMakeLists.txt +++ b/CDMATH/tests/examples/TransportEquation1DUpwindImplicit/CMakeLists.txt @@ -6,15 +6,14 @@ if (CDMATH_WITH_PYTHON ) SET(CFL 1 )#Courant Friedrichs Lewy number ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindImplicit.py ${NX} ${CFL}) - SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}:${Python_ROOT_DIR}/lib") - SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${MATPLOTLIB_ROOT_DIR}/lib/python3.6/site-packages:${PV_PYTHON_DIR}") - + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") SET(CFL 2 )#Courant Friedrichs Lewy number ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindImplicit.py ${NX} ${CFL}) - SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}:${Python_ROOT_DIR}/lib") - SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${MATPLOTLIB_ROOT_DIR}/lib/python3.6/site-packages:${PV_PYTHON_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}") + SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}") endif (CDMATH_WITH_PYTHON ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0856bde..bcc58c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,12 +42,6 @@ list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files") include(ExternalProject)#For PETSc, MED and MEDCoupling -set(Python_ROOT_DIR $ENV{PYTHON_ROOT_DIR} ) -set(PYQT5_ROOT_DIR $ENV{PYQT5_ROOT_DIR} ) -set(PARAVIEW_ROOT_DIR $ENV{PARAVIEW_ROOT_DIR} ) -set(MATPLOTLIB_ROOT_DIR $ENV{MATPLOTLIB_ROOT_DIR} ) -set(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} ) - ###################################################### # Detection or compilation of PETSc+SLEPc+HDF5 # ###################################################### @@ -362,26 +356,26 @@ endif(TARGET PETSc AND TARGET MEDCoupling) #################### # Paraview variables to choose python version and for env_SOLVERLAB.sh +if ( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR}) + if ( DEFINED PARAVIEW_ROOT_DIR ) + set( PARAVIEW_INCLUDE_DIR ${PARAVIEW_ROOT_DIR}/include) + set( PARAVIEW_LIBRARIES_DIR ${PARAVIEW_ROOT_DIR}/lib) + else( DEFINED PARAVIEW_ROOT_DIR ) + set( PARAVIEW_INCLUDE_DIR $ENV{PARAVIEW_ROOT_DIR}/include) + set( PARAVIEW_LIBRARIES_DIR $ENV{PARAVIEW_ROOT_DIR}/lib) + endif( DEFINED PARAVIEW_ROOT_DIR ) +else( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR}) + message(STATUS "PARAVIEW_ROOT_DIR not set. Trying to detect paraview.") + set( PARAVIEW_INCLUDE_DIR /usr/include/paraview/) + set( PARAVIEW_LIBRARIES_DIR /usr/lib/paraview/:/usr/lib64/paraview/:/usr/lib64/vtk/:/usr/lib/vtk/) +endif( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR}) + if ( DEFINED PARAVIEW_VERSION OR DEFINED ENV{PARAVIEW_VERSION} ) if ( NOT DEFINED PARAVIEW_VERSION ) set( PARAVIEW_VERSION $ENV{PARAVIEW_VERSION}) endif( NOT DEFINED PARAVIEW_VERSION ) message(STATUS "ParaView version is ${PARAVIEW_VERSION}" ) else( DEFINED PARAVIEW_VERSION OR DEFINED ENV{PARAVIEW_VERSION} ) - if ( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR}) - if ( DEFINED PARAVIEW_ROOT_DIR ) - set( PARAVIEW_INCLUDE_DIR ${PARAVIEW_ROOT_DIR}/include) - set( PARAVIEW_LIBRARIES_DIR ${PARAVIEW_ROOT_DIR}/lib) - else( DEFINED PARAVIEW_ROOT_DIR ) - set( PARAVIEW_INCLUDE_DIR $ENV{PARAVIEW_ROOT_DIR}/include) - set( PARAVIEW_LIBRARIES_DIR $ENV{PARAVIEW_ROOT_DIR}/lib) - endif( DEFINED PARAVIEW_ROOT_DIR ) - else( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR}) - message(STATUS "PARAVIEW_VERSION and PARAVIEW_ROOT_DIR not set. Trying to detect paraview.") - set( PARAVIEW_INCLUDE_DIR /usr/include/paraview/) - set( PARAVIEW_LIBRARIES_DIR /usr/lib/paraview/:/usr/lib64/paraview/:/usr/lib64/vtk/:/usr/lib/vtk/) - endif( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR}) - set( PARAVIEW_SUFFIXES paraview-5.0 paraview-5.1 paraview-5.2 paraview-5.3 paraview-5.4 paraview-5.5 paraview-5.6 paraview-5.7 paraview-5.8 paraview-5.9 ) find_file( vtkConfig_file vtkPVConfig.h HINTS ${PARAVIEW_INCLUDE_DIR} PATH_SUFFIXES ${PARAVIEW_SUFFIXES}) @@ -436,9 +430,21 @@ ELSE (${CMAKE_VERSION} VERSION_GREATER "3.12.0") set(Python_VERSION_MINOR ${PYTHON_VERSION_MINOR}) ENDIF(${CMAKE_VERSION} VERSION_GREATER "3.12.0") +IF ( PYTHON_ROOT_DIR OR ENV{PYTHON_ROOT_DIR}) + IF ( PYTHON_ROOT_DIR ) + set(PYQT5_ROOT_DIR ${PYQT5_ROOT_DIR} ) + ELSE( PYTHON_ROOT_DIR }) + set(PYQT5_ROOT_DIR $ENV{PYQT5_ROOT_DIR} ) + ENDIF( PYTHON_ROOT_DIR }) +ENDIF(PYTHON_ROOT_DIR OR ENV{PYTHON_ROOT_DIR}) +set(PARAVIEW_ROOT_DIR $ENV{PARAVIEW_ROOT_DIR} ) +set(MATPLOTLIB_ROOT_DIR $ENV{MATPLOTLIB_ROOT_DIR} ) +set(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} ) + + #Paraview library paths -set (PV_LIB_DIR /usr/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/dist-packages/paraview/:/usr/lib64/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtk/:${PARAVIEW_LIBRARIES_DIR}) -set (PV_PYTHON_DIR /usr/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/dist-packages/paraview/:/usr/lib64/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtk/:/usr/lib64/paraview/site-packages/:/usr/lib64/paraview/site-packages/paraview/:/usr/lib64/paraview/site-packages/vtk/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/paraview/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtkmodules:/usr/lib/paraview/site-packages/paraview:/usr/lib/paraview/site-packages/paraview/vtk:${PARAVIEW_LIBRARIES_DIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtkmodules/) +set (PV_LIB_DIR /usr/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/dist-packages/paraview/:/usr/lib64/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtk/:${MATPLOTLIB_ROOT_DIR}/lib/:${PARAVIEW_LIBRARIES_DIR}) +set (PV_PYTHON_DIR /usr/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/dist-packages/paraview/:/usr/lib64/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtk/:/usr/lib64/paraview/site-packages/:/usr/lib64/paraview/site-packages/paraview/:/usr/lib64/paraview/site-packages/vtk/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/paraview/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtkmodules:/usr/lib/paraview/site-packages/paraview:/usr/lib/paraview/site-packages/paraview/vtk:${PARAVIEW_ROOT_DIR}/lib/:${PARAVIEW_ROOT_DIR}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/:${PARAVIEW_ROOT_DIR}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtkmodules/:${MATPLOTLIB_ROOT_DIR}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages:${PYQT5_ROOT_DIR}:${PYQT5_ROOT_DIR}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages) message(STATUS "Python version found is ${Python_VERSION}") find_package (SWIG 3.0 REQUIRED)