]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
update CDMATH
authorBernard Secher <bernard.secher@cea.fr>
Thu, 3 Sep 2020 05:48:12 +0000 (07:48 +0200)
committerBernard Secher <bernard.secher@cea.fr>
Thu, 3 Sep 2020 05:48:12 +0000 (07:48 +0200)
97 files changed:
CDMATH/.gitignore [new file with mode: 0644]
CDMATH/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/README.md
CDMATH/cmake_files/FindCDMATH.cmake [changed mode: 0644->0755]
CDMATH/cmake_files/FindPETSc.cmake [changed mode: 0644->0755]
CDMATH/cmake_files/FindPYTHON.cmake
CDMATH/cmake_files/FindParaView.cmake [new file with mode: 0755]
CDMATH/env_CDMATH.sh [changed mode: 0644->0755]
CDMATH/linearsolver/inc/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/linearsolver/inc/SparseMatrixPetsc.hxx
CDMATH/linearsolver/src/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/mesh/inc/Field.hxx [changed mode: 0644->0755]
CDMATH/mesh/src/Field.cxx [changed mode: 0644->0755]
CDMATH/postprocessing/PV_routines.py [changed mode: 0644->0755]
CDMATH/postprocessing/VTK_routines.py [changed mode: 0644->0755]
CDMATH/swig/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/cdmath/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/cdmath/SparseMatrixPetscTests.cxx [changed mode: 0644->0755]
CDMATH/tests/examples/BurgersEquation1D/1DBurgersEquation_shock_formation.py [changed mode: 0644->0755]
CDMATH/tests/examples/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/EulerSystem_Shock/EulerSystemUpwind/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/EulerSystem_Shock/EulerSystemUpwind/EulerSystemUpwind.py [changed mode: 0644->0755]
CDMATH/tests/examples/HeatEquation1DExplicit/HeatEquation1DExplicit.py [changed mode: 0644->0755]
CDMATH/tests/examples/HeatEquation1DImplicit/HeatEquation1DImplicit.py [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson1DEF/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson1DEF/FiniteElements1DPoisson.py [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson1DVF/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson1DVF/FiniteVolumes1DPoisson.py [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DEF/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DEF_DISK/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DEF_DISK/FiniteElements2DPoisson_DISK.py [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/FiniteElements2DPoisson_DISK_StiffBC.py [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/FiniteElements2DPoisson_SQUARE_StiffBC.py [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DVF/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DVF_DISK/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DVF_DISK/FiniteVolumes2DPoisson_DISK.py [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DVF_DISK_StiffBC/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DVF_DISK_StiffBC/FiniteVolumes2DPoisson_DISK_StiffBC.py [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DCubeSkinEF/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DEF/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DEF_BALL/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DEF_BALL/FiniteElements3DPoisson_BALL.py [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DEF_RadiatorAndWindow/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DEF_RadiatorAndWindow/FiniteElements3DPoisson_CUBE_RadiatorAndWindow.py [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DSphereEF/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DTorusEF/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DTorusEF/FiniteElements3DPoissonTorus.py [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DVF/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DVF_BALL/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson3DVF_BALL/FiniteVolumes3DPoisson_BALL.py [changed mode: 0644->0755]
CDMATH/tests/examples/SpectrumLaplace2DEF/CMakeLists.txt [new file with mode: 0755]
CDMATH/tests/examples/SpectrumLaplace2DEF/SpectrumLaplace2DEF_SQUARE.py [new file with mode: 0755]
CDMATH/tests/examples/SpectrumLaplace2DVF/CMakeLists.txt [new file with mode: 0755]
CDMATH/tests/examples/SpectrumLaplace2DVF/SpectrumLaplace2DVF_SQUARE.py [new file with mode: 0755]
CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/CMakeLists.txt [new file with mode: 0755]
CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/SpectrumFiniteElements3DLaplace-Beltrami.py [new file with mode: 0755]
CDMATH/tests/examples/TransportEquation/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/TransportEquation/TransportEquationUpwind.py [changed mode: 0644->0755]
CDMATH/tests/examples/TransportEquation1DCenteredExplicit/1DTransportEquationCenteredExplicit.py [changed mode: 0644->0755]
CDMATH/tests/examples/TransportEquation1DCenteredImplicit/1DTransportEquationCenteredImplicit.py [changed mode: 0644->0755]
CDMATH/tests/examples/TransportEquation1DUpwindExplicit/1DTransportEquationUpwindExplicit.py [changed mode: 0644->0755]
CDMATH/tests/examples/TransportEquation1DUpwindImplicit/1DTransportEquationUpwindImplicit.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem1DStaggered_RiemannProblem/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem1DStaggered_RiemannProblem/WaveSystem1DStaggered_RiemannProblem.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem1DUpwind/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem1DUpwind/WaveSystem1DUpwind.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem1DUpwind_RiemannProblem/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem1DUpwind_RiemannProblem/WaveSystem1DUpwind_RiemannProblem.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem2DUpwind_RiemannProblem/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem2DUpwind_RiemannProblem/WaveSystemUpwind.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/WaveSystemCentered.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/WaveSystemPStag.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemStaggered/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemStaggered/WaveSystemStaggered.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/WaveSystemUpwind.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/WaveSystemCentered.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemPStag/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemPStag/WaveSystemPStag.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemStaggered/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemStaggered/WaveSystemStaggered.py [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemUpwind/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemUpwind/WaveSystemUpwind.py [changed mode: 0644->0755]
CDMATH/tests/ressources/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/swig/BoySurface/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/swig/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/swig/mainTests.py [changed mode: 0644->0755]
CDMATH/tests/swig/test_PV_routines.py [changed mode: 0644->0755]
CDMATH/tests/swig/test_VTK_routines.py [changed mode: 0644->0755]
CDMATH/tests/swig/test_analyticalFunction_discretizer.py [changed mode: 0644->0755]
CDMATH/tests/validation/CMakeLists.txt [changed mode: 0644->0755]

diff --git a/CDMATH/.gitignore b/CDMATH/.gitignore
new file mode 100644 (file)
index 0000000..24bf7e7
--- /dev/null
@@ -0,0 +1,27 @@
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.pyc
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+
+# Temporary files
+*~
+
+# Automatically generated documentation files
+doc/*
+pre_requis/MEDFile/doc/*
+*.map
+
+# Eclipse files
+.cproject
+.project
+.settings/*
old mode 100644 (file)
new mode 100755 (executable)
index b330341..313a04a
@@ -16,15 +16,28 @@ option (CDMATH_WITH_PYTHON "Compile Python interface for CDMATH." OFF)
 option (CDMATH_WITH_POSTPRO "Install postprocessing Python modules." OFF)
 option (CDMATH_WITH_PACKAGE "Generate RPM, Debian and tarball packages." OFF)
 option (CDMATH_WITH_TESTS "Compile unit testing." OFF)
+
+#Path to installed libraries
 set (PETSC_DIR            OFF CACHE STRING "PETSc library path" )
-set (HDF5_ROOT        OFF CACHE STRING "HDF5 library path" )#For the compilation of MED with a specific version
+set (SLEPC_DIR            OFF CACHE STRING "SLEPc library path" )
+set (F2CBLASLAPACK_DIR    OFF CACHE STRING "F2CBLASLAPACK library path" )
+set (HDF5_ROOT            OFF CACHE STRING "HDF5 library path" )#For the compilation of MED with a specific version of HDF5
 set (MEDFILE_ROOT_DIR     OFF CACHE STRING "MED library path" )
 set (MEDCOUPLING_ROOT_DIR OFF CACHE STRING "MEDCoupling library path" )
-set (DOWNLOAD_MED         ${CDMATH_SOURCE_DIR}/pre_requis/med-4.0.0.tar.gz               CACHE STRING "MED tarball path/url")
-set (DOWNLOAD_MEDCOUPLING ${CDMATH_SOURCE_DIR}/pre_requis/medCoupling-9.4.0.tar.gz       CACHE STRING "MEDCoupling tarball path/url" )
-set (DOWNLOAD_PETSC       ${CDMATH_SOURCE_DIR}/pre_requis/PETSc/petsc-lite-3.13.1.tar.gz CACHE STRING "PETSc tarball path/url" )
-set (DOWNLOAD_HDF5        ${CDMATH_SOURCE_DIR}/pre_requis/PETSc/hdf5-1.10.3.tar.gz       CACHE STRING "HDF5 tarball path/url" )
-set (DOWNLOAD_SLEPC       ${CDMATH_SOURCE_DIR}/pre_requis/PETSc/slepc-3.13.1.tar.gz      CACHE STRING "SLEPC tarball path/url" )
+
+#url of tarball librairies
+set (DOWNLOAD_PETSC         http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.13.2.tar.gz
+     CACHE STRING           "PETSc tarball path/url" )
+set (DOWNLOAD_SLEPC         https://slepc.upv.es/download/distrib/slepc-3.13.2.tar.gz
+     CACHE STRING           "SLEPC tarball path/url" )
+set (DOWNLOAD_F2CBLASLAPACK ${CDMATH_SOURCE_DIR}/pre_requis/PETSc/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  
+     CACHE STRING           "HDF5 tarball path/url" )
+set (DOWNLOAD_MED           http://files.salome-platform.org/Salome/other/med-4.0.0.tar.gz
+     CACHE STRING           "MED tarball path/url")
+set (DOWNLOAD_MEDCOUPLING   http://files.salome-platform.org/Salome/other/medCoupling-9.4.0.tar.gz
+     CACHE STRING           "MEDCoupling tarball path/url" )
 
 
 # Base directories
@@ -33,97 +46,140 @@ set (MESH_DIR ${CDMATH_SOURCE_DIR}/mesh)
 set (LINEARSOLVER_DIR ${CDMATH_SOURCE_DIR}/linearsolver)
 set (CDMATH_SWIG_DIR ${CDMATH_SOURCE_DIR}/swig)
 set (CDMATH_POSTPRO_DIR ${CDMATH_SOURCE_DIR}/postprocessing)
-set (PRE_REQUIS_DIR ${CDMATH_SOURCE_DIR}/pre_requis)
 
 set (TESTS_DIR ${CDMATH_SOURCE_DIR}/tests)
 list (APPEND CMAKE_MODULE_PATH "${CDMATH_SOURCE_DIR}/cmake_files")
 
 # PETSc and HDF5
-if (CDMATH_WITH_PETSC OR PETSC_DIR OR DOWNLOAD_PETSC OR DEFINED ENV{PETSC_DIR} )
-    message ( STATUS "Checking variable PETSC_DIR : " $ENV{PETSC_DIR} )
+if (CDMATH_WITH_PETSC OR PETSC_DIR OR DEFINED ENV{PETSC_DIR} )
 
   if ( DEFINED ENV{PETSC_DIR} OR PETSC_DIR)
-    if(NOT PETSC_DIR)
+    if   (NOT PETSC_DIR)
       set(PETSC_DIR $ENV{PETSC_DIR})
+      message ( STATUS "Checking variable PETSC_DIR : " $ENV{PETSC_DIR} )
+    else (NOT PETSC_DIR)
+      message ( STATUS "Checking variable PETSC_DIR : " ${PETSC_DIR} )
     endif(NOT PETSC_DIR)
 
     find_package (PETSc 3.4 REQUIRED)
     petsc_get_version ()
-    string(REPLACE ";" ":"  PETSC_INCLUDES_PATH "${PETSC_INCLUDES}")# use colon instead of semicolon in environment file env_CDMATH.sh
-    message ( STATUS "PETSC found. Version is ${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}" )
+
+    message ( STATUS "PETSc found. Version is ${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}" )
+    set(PETSC_INSTALL ${PETSC_DIR})
 
     #Define and search slepc variables
-    set(SLEPC_DIR ${PETSC_DIR}/${PETSC_ARCH})
+    if   ( NOT SLEPC_DIR )
+      if   ( DEFINED ENV{SLEPC_DIR} )
+        set(SLEPC_DIR $ENV{SLEPC_DIR})
+      else ( DEFINED ENV{SLEPC_DIR} )
+        set(SLEPC_DIR ${PETSC_DIR}/${PETSC_ARCH})
+      endif( DEFINED ENV{SLEPC_DIR} )
+    endif( NOT SLEPC_DIR)
+
     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_LIBRARIES ${SLEPC_DIR}/lib/libslepc.so)
-      message( STATUS "SLEPC found at ${SLEPC_DIR}" )
+      message( STATUS "SLEPc found at ${SLEPC_DIR}" )
     else()
-      message( FATAL_ERROR "SLEPC not found at ${SLEPC_DIR}" )
+      message( FATAL_ERROR "SLEPc not found at ${SLEPC_DIR}" )
     endif()
 
-    #HDF5 to be found in petsc external packages
-    if( NOT HDF5_ROOT AND NOT DEFINED ENV{HDF5_ROOT} )#hdf5 is not defined in the environment
-      set(HDF5_ROOT $ENV{PETSC_DIR}/$ENV{PETSC_ARCH})# define hint for hdf5/med installation in petsc external packages
-    endif( NOT HDF5_ROOT AND NOT DEFINED ENV{HDF5_ROOT} )
-
+    #define hdf5 variables
+    if   ( NOT HDF5_ROOT )#hdf5 is not defined in cmake arguments
+      if  ( DEFINED ENV{HDF5_ROOT} )#hdf5 is defined in the environment
+        set(HDF5_ROOT $ENV{HDF5_ROOT})
+      else( DEFINED ENV{HDF5_ROOT} )#hdf5 is not defined in the environment
+        #HDF5 to be found in petsc external packages
+        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_INCLUDE_DIRS ${HDF5_ROOT}/include)
   else ( DEFINED ENV{PETSC_DIR} OR PETSC_DIR )
-    message ( STATUS "PETSC_DIR not set, searching petsc in the system" )
+    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" AND IS_DIRECTORY "/usr/include/slepc/" AND EXISTS "/usr/lib64/libslepc.so" )  #Case fedora/redhat system install
+    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" )
       set(PETSC_DIR /usr/)
       set(PETSC_INCLUDES  /usr/include/petsc /usr/include/petsc/petsc/mpiuni)
       set(PETSC_LIBRARIES /usr/lib64/libpetsc.so)
 
-      #set(PETSC_VERSION "3.8") #3.8 for fedora 26 , 3.9 for fedora 29 , 3.10 for fedora 30, , 3.12 for fedora 32
-      petsc_get_version ()
-      set (CPACK_RPM_PACKAGE_REQUIRES   "${CPACK_RPM_PACKAGE_REQUIRES}, petsc-devel (>= 3.4)") # This is not fully working yet. 
-
-      message( STATUS "SLEPC includes found in /usr/include/slepc/" )
-      message( STATUS "SLEPC library found in /usr/lib64/slepc/" )
-      set(SLEPC_DIR /usr/)
-      set(SLEPC_INCLUDES ${SLEPC_DIR}/include)
-      set(SLEPC_LIBRARIES ${SLEPC_DIR}/lib/libslepc.so)
+      set(PETSC_VERSION "3.8") #3.8 for fedora 26 , 3.9 for fedora 29 , 3.10 for fedora 30, , 3.12 for fedora 32
+      
+      set(CPACK_RPM_PACKAGE_REQUIRES   "${CPACK_RPM_PACKAGE_REQUIRES}, petsc-devel (>= 3.4)") # This is not fully working yet. 
+      set(PETSC_INSTALL ${PETSC_DIR})
+
+      #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/" )
+        set(SLEPC_DIR /usr/)
+        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" )
+        message( FATAL_ERROR "SLEPc not found in the system" )
+      endif( IS_DIRECTORY "/usr/include/slepc/" AND EXISTS "/usr/lib64/libslepc.so" )
 
       #HDF5 to be found in the system
-      set (CPACK_DEBIAN_PACKAGE_DEPENDS "libhdf5-dev")
-      set (CPACK_RPM_PACKAGE_REQUIRES "hdf5-devel")
+      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")
+      endif( NOT HDF5_ROOT AND NOT DEFINED ENV{HDF5_ROOT} )
+
 
-    #elseif ( IS_DIRECTORY "/usr/lib/petsc/" AND EXISTS "/usr/lib/petsc/lib/libpetsc_real.so" AND IS_DIRECTORY "/usr/lib/slepc/" AND EXISTS "/usr/lib/slepc/lib/libslepc_real.so") #Case ubuntu/debian system install
-    #  message ( STATUS "PETSC found in /usr/lib/petsc/ and exists /usr/lib/petsc/lib/libpetsc_real.so")
+    #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")
     #  set(PETSC_DIR /usr/lib/petsc/)
     #  set(PETSC_INCLUDES  ${PETSC_DIR}/include ${PETSC_DIR}/include/petsc/mpiuni)
-    #  set(PETSC_LIBRARIES ${PETSC_DIR}/libpetsc_real.so)
+    #  set(PETSC_LIBRARIES ${PETSC_DIR}/lib/libpetsc_real.so)
 
     #  find_package (PETSc 3.4 REQUIRED)
     #  petsc_get_version ()
     #  set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, petsc-dev   (>= 3.4)") # This is not fully working yet. 
 
-    #  message ( STATUS "SLEPC found in /usr/lib/slepc/ and exists /usr/lib/slepc/lib/libslepc_real.so")
-    #  set(SLEPC_DIR /usr/lib/slepc/)
-    #  set(SLEPC_INCLUDES  ${SLEPC_DIR}/include )
-    #  set(SLEPC_LIBRARIES ${SLEPC_DIR}/libslepc_real.so)
+    #  Define and search slepc variables
+    #  if   ( IS_DIRECTORY "/usr/lib/slepc/include" AND EXISTS "/usr/lib/slepc/lib/libslepc_real.so" )
+    #    message( STATUS "SLEPc includes found in /usr/lib/slepc/include" )
+    #    message( STATUS "SLEPc library  found in /usr/lib/slepc/lib/libslepc_real.so" )
+    #    set(SLEPC_DIR /usr/lib/slepc/)
+    #    set(SLEPC_INCLUDES ${SLEPC_DIR}/include)
+    #    set(SLEPC_LIBRARIES ${SLEPC_DIR}/lib/libslepc_real.so)
+    #    set (CPACK_DEBIAN_PACKAGE_REQUIRES   "${CPACK_DEBIAN_PACKAGE_REQUIRES}, slepc-devel (>= 3.4)") # This is not fully working yet. 
+    #  else ( IS_DIRECTORY "/usr/lib/slepc/include" AND EXISTS "/usr/lib/slepc/lib/libslepc_real.so" )
+    #    message( FATAL_ERROR "SLEPc not found in the system" )
+    #  endif( IS_DIRECTORY "/usr/lib/slepc/include" AND EXISTS "/usr/lib/slepc/lib/libslepc_real.so" )
 
     #elseif ( IS_DIRECTORY "/usr/local/lib/python2.7/dist-packages/petsc") #Case ubuntu/debian system pip install
 
-    else ( IS_DIRECTORY "/usr/include/petsc/" AND EXISTS "/usr/lib64/libpetsc.so" AND IS_DIRECTORY "/usr/include/slepc/" AND EXISTS "/usr/lib64/libslepc.so" )  # No petsc in system, do compile petsc along with slepc as an external package
-      message (STATUS "PETSC not found in the system, PETSC (with SLEPC and HDF5) will be downloaded and compiled" )
-      set(PETSC_SRC ${CDMATH_SOURCE_DIR}/pre_requis/PETSc)
-      set(PETSC_DIR ${CMAKE_INSTALL_PREFIX}/share/petsc_install) # Location of the final install 
-      set(PETSC_INCLUDES  ${PETSC_DIR}/include/  ${PETSC_DIR}/include/petsc/mpiuni)
-      set(PETSC_LIBRARIES ${PETSC_DIR}/lib/libpetsc.so) 
+    else ( IS_DIRECTORY "/usr/include/petsc/" AND EXISTS "/usr/lib64/libpetsc.so" )  # No petsc in system, do compile petsc along with slepc as an external package
+      message (STATUS "PETSC not found in the system")
+      message (STATUS "PETSC will be downloaded and compiled from ${DOWNLOAD_PETSC}" )
+      message (STATUS "SLEPC will be downloaded and compiled from ${DOWNLOAD_SLEPC}" )
+      message (STATUS "HDF5  will be downloaded and compiled from ${DOWNLOAD_HDF5}" )
+
+      #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 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_INSTALL ${CMAKE_INSTALL_PREFIX}/share/petsc)#folder to copy petsc libraries and include files
 
       ExternalProject_Add (PETSc
       URL               ${DOWNLOAD_PETSC}   
-      SOURCE_DIR        ${CMAKE_CURRENT_BINARY_DIR}/pre_requis/PETSc
+      SOURCE_DIR        ${PETSC_DIR}
       BUILD_IN_SOURCE   TRUE
-      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${PETSC_DIR} --with-debugging=0 --with-mpi=0 --download-f2cblaslapack=${PETSC_SRC}/f2cblaslapack-3.4.2.q4.tar.gz --with-fc=0 --download-slepc=${DOWNLOAD_SLEPC} --download-hdf5=${DOWNLOAD_HDF5}
-      BUILD_COMMAND     make all
+      CONFIGURE_COMMAND <SOURCE_DIR>/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
       TEST_COMMAND      make check
-      INSTALL_COMMAND   make install
+      INSTALL_COMMAND   make all
       INSTALL_DIR       ${PETSC_DIR}
       STAMP_DIR         ${CMAKE_CURRENT_BINARY_DIR}/pre_requis
       LOG_DOWNLOAD      TRUE           # Wrap download in script to log output
@@ -134,33 +190,35 @@ if (CDMATH_WITH_PETSC OR PETSC_DIR OR DOWNLOAD_PETSC OR DEFINED ENV{PETSC_DIR} )
       LOG_INSTALL       TRUE           # Wrap install in script to log output
        )
 
-      petsc_get_version ()
-      string(REPLACE ";" ":"  PETSC_INCLUDES_PATH "${PETSC_INCLUDES}")# use colon instead of semicolon in environment file env_CDMATH.sh
-      message ( STATUS "PETSC found. Version is ${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}" )
+      #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)
       #define slepc variables
-      set(SLEPC_DIR ${PETSC_DIR}/${PETSC_ARCH})
+      set(SLEPC_DIR ${PETSC_INSTALL})
       set(SLEPC_INCLUDES ${SLEPC_DIR}/include)
       set(SLEPC_LIBRARIES ${SLEPC_DIR}/lib/libslepc.so)
 
-      #HDF5 to be found in petsc external packages
-      if   ( NOT HDF5_ROOT AND NOT DEFINED ENV{HDF5_ROOT} )#hdf5 is not defined in the environment
-        set(HDF5_ROOT $ENV{PETSC_DIR}/$ENV{PETSC_ARCH})# define hint for hdf5/med installation in petsc external packages
-      endif( NOT HDF5_ROOT AND NOT DEFINED ENV{HDF5_ROOT} )
-
-    endif ( IS_DIRECTORY "/usr/include/petsc/" AND EXISTS "/usr/lib64/libpetsc.so" AND IS_DIRECTORY "/usr/include/slepc/" AND EXISTS "/usr/lib64/libslepc.so"  )
+      #define hdf5 variables
+      if   ( NOT HDF5_ROOT )#hdf5 is not defined in cmake arguments
+        if  ( DEFINED ENV{HDF5_ROOT} )#hdf5 is defined in the environment
+          set(HDF5_ROOT $ENV{HDF5_ROOT})
+        else( DEFINED ENV{HDF5_ROOT} )#hdf5 is not defined in the environment          
+          set(HDF5_ROOT ${PETSC_INSTALL})#HDF5 to be found in petsc installation
+        endif( DEFINED ENV{HDF5_ROOT} )
+      endif( NOT HDF5_ROOT )
+      set(HDF5_LIBRARY_DIR ${HDF5_ROOT}/lib)
+      set(HDF5_INCLUDE_DIRS ${HDF5_ROOT}/include)
+
+    endif ( IS_DIRECTORY "/usr/include/petsc/" AND EXISTS "/usr/lib64/libpetsc.so" )
   endif ( DEFINED ENV{PETSC_DIR} OR PETSC_DIR )
 
   if   ( ${PETSC_VERSION} VERSION_GREATER 3.5 )
     add_definitions(-DPETSC_VERSION_GREATER_3_5)
   endif( ${PETSC_VERSION} VERSION_GREATER 3.5 )
-
-endif( CDMATH_WITH_PETSC OR PETSC_DIR  OR DOWNLOAD_PETSC OR DEFINED ENV{PETSC_DIR} )
-
-#HDF5
-if   ( NOT HDF5_ROOT AND DEFINED ENV{HDF5_ROOT} )#hdf5 is defined in the environment
-  set(HDF5_ROOT $ENV{HDF5_ROOT})
-endif( NOT HDF5_ROOT AND DEFINED ENV{HDF5_ROOT} )
+string(REPLACE ";" ":"  PETSC_INCLUDES_INSTALL "${PETSC_INCLUDES}")# use colon instead of semicolon in environment file env_CDMATH.sh
+endif( CDMATH_WITH_PETSC OR PETSC_DIR  OR DEFINED ENV{PETSC_DIR} )
 
 #MED
 if( MEDFILE_ROOT_DIR OR DEFINED ENV{MEDFILE_ROOT_DIR})
@@ -169,20 +227,17 @@ if( MEDFILE_ROOT_DIR OR DEFINED ENV{MEDFILE_ROOT_DIR})
     set(MEDFILE_ROOT_DIR $ENV{MEDFILE_ROOT_DIR} )
   endif( NOT MEDFILE_ROOT_DIR )
 
-  message (STATUS "Seeking MEDFile library in ${MEDFILE_ROOT_DIR}")
   find_package (MEDFile REQUIRED)
+  message (STATUS "MEDFile found in ${MEDFILE_ROOT_DIR}")
 
 else( MEDFILE_ROOT_DIR OR DEFINED ENV{MEDFILE_ROOT_DIR})
-  find_package (HDF5 REQUIRED)
-  add_library(hdf5   SHARED IMPORTED)
-  set_property(TARGET hdf5 PROPERTY IMPORTED_LOCATION ${HDF5_ROOT}/lib/libhdf5.so)
-
-  string(FIND "${HDF5_LIBRARIES}" "libhdf5.so" pos)
-  string(SUBSTRING "${HDF5_LIBRARIES}" 0 ${pos} HDF5_LIBRARY_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 ?
-  set(MEDFILE_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/pre_requis/med_install) # Location of the final install
+  set(MEDFILE_ROOT_DIR ${CMAKE_INSTALL_PREFIX}/share/med) # Location of the final install
   
   #extraction of the tarball archive name
   string(LENGTH "${DOWNLOAD_MED}" tarball_url_length)#length of the name of the tarball
@@ -191,14 +246,11 @@ else( MEDFILE_ROOT_DIR OR DEFINED ENV{MEDFILE_ROOT_DIR})
   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_MED} ${start_tarball_name} ${tarball_name_length} MED_TARBALL_NAME)
 
-  message(STATUS "MED tarball name is ${MED_TARBALL_NAME}")
-
   ExternalProject_Add (MED
         URL               ${DOWNLOAD_MED}  #location of med tarball
         SOURCE_DIR        ${CMAKE_CURRENT_BINARY_DIR}/pre_requis/${MED_TARBALL_NAME}
         BUILD_IN_SOURCE   TRUE
         CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${MEDFILE_ROOT_DIR}  --with-hdf5=${HDF5_ROOT} --with-hdf5-include=${HDF5_ROOT}/include --with-hdf5-lib=${HDF5_LIBRARY_DIR} --with-hdf5-bin=${HDF5_ROOT}/bin  --with-swig=yes 
-        DEPENDS           hdf5
         BUILD_COMMAND     make
         INSTALL_COMMAND   make install
         INSTALL_DIR       ${MEDFILE_ROOT_DIR}
@@ -213,11 +265,8 @@ else( MEDFILE_ROOT_DIR OR DEFINED ENV{MEDFILE_ROOT_DIR})
   
   set(MEDFILE_INCLUDE_DIRS ${MEDFILE_ROOT_DIR}/include)# Nécessaire pour le medloader et les sous-dossiers mesh, et IJKMesh
   set(MEDFILE_C_LIBRARIES med medC)# Nécessaire pour le medloader
-endif( MEDFILE_ROOT_DIR OR DEFINED ENV{MEDFILE_ROOT_DIR})
 
-#For the environment file
-set(MEDFILE_C_LIBRARIES_PATH ${MEDFILE_ROOT_DIR}/lib/libmed.so ${MEDFILE_ROOT_DIR}/lib/libmedC.so)
-string(REPLACE ";" ":"  MEDFILE_C_LIBRARIES_PATH "${MEDFILE_C_LIBRARIES_PATH}")# use colon instead of semicolon in environment file env_CDMATH.sh
+endif( MEDFILE_ROOT_DIR OR DEFINED ENV{MEDFILE_ROOT_DIR})
 
 add_library(med   SHARED IMPORTED)
 set_property(TARGET med  PROPERTY IMPORTED_LOCATION ${MEDFILE_ROOT_DIR}/lib/libmed.so)
@@ -240,28 +289,25 @@ if( MEDCOUPLING_ROOT_DIR OR DEFINED ENV{MEDCOUPLING_ROOT_DIR})
   endif( NOT EXISTS ${MEDCOUPLING_ROOT_DIR}/lib/libmedloader.so OR NOT EXISTS ${MEDCOUPLING_ROOT_DIR}/lib/libmedcoupling.so OR NOT EXISTS ${MEDCOUPLING_ROOT_DIR}/include/MEDCoupling.hxx)
 
 else( MEDCOUPLING_ROOT_DIR OR DEFINED ENV{MEDCOUPLING_ROOT_DIR})
-
-  set(MEDCOUPLING_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/pre_requis/medCoupling_install) # Location of the final install
+  message(STATUS "MEDCoupling will be downloaded and installed from ${DOWNLOAD_MEDCOUPLING}")
+  set(MEDCOUPLING_ROOT_DIR ${CMAKE_INSTALL_PREFIX}/share/medcoupling) # Location of the final install
+  SET(ENV{HDF5_ROOT} ${HDF5_ROOT})#MEDCoupling install process seems to require an environment variable
 
   #extraction of the tarball archive name
-  string(LENGTH ${DOWNLOAD_MEDCOUPLING} tarball_url_length)#length of the tarball
-  string(FIND   ${DOWNLOAD_MEDCOUPLING} "/" start_tarball_name REVERSE )# last occurence of "/"
+  string(LENGTH "${DOWNLOAD_MEDCOUPLING}" tarball_url_length)#length of the tarball
+  string(FIND   "${DOWNLOAD_MEDCOUPLING}" "/" start_tarball_name REVERSE )# last 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_MEDCOUPLING} ${start_tarball_name} ${tarball_name_length} MEDCOUPLING_TARBALL_NAME)
   string(SUBSTRING ${MEDCOUPLING_TARBALL_NAME} 12 ${tarball_name_length} MEDCOUPLING_VERSION_NAME)
 
-  message(STATUS "MEDCOUPLING tarball name is ${MEDCOUPLING_TARBALL_NAME}")
-  message(STATUS "MEDCOUPLING version is ${MEDCOUPLING_VERSION_NAME}")
-
-  SET(ENV{HDF5_ROOT} ${HDF5_ROOT})#MEDCoupling install process seems to require an environment variable
+  message(STATUS "MEDCoupling version is ${MEDCOUPLING_VERSION_NAME}")
 
   ExternalProject_Add (MEDCoupling
         URL               ${DOWNLOAD_MEDCOUPLING}  #location of medcoupling tarball
         SOURCE_DIR        ${CMAKE_CURRENT_BINARY_DIR}/pre_requis/${MEDCOUPLING_TARBALL_NAME}
 #        BUILD_IN_SOURCE   FALSE
         CONFIGURE_COMMAND cmake <SOURCE_DIR>/${MEDCOUPLING_TARBALL_NAME} -DCMAKE_INSTALL_PREFIX=${MEDCOUPLING_ROOT_DIR} -DCONFIGURATION_ROOT_DIR=<SOURCE_DIR>/configuration-${MEDCOUPLING_VERSION_NAME} -DMEDFILE_ROOT_DIR=${MEDFILE_ROOT_DIR} -DMEDCOUPLING_ENABLE_PARTITIONER=OFF -DMEDCOUPLING_PARTITIONER_METIS=OFF -DMEDCOUPLING_PARTITIONER_SCOTCH=OFF -DMEDCOUPLING_ENABLE_RENUMBER=OFF -DMEDCOUPLING_BUILD_DOC=OFF -DHDF5_ROOT_DIR=${HDF5_ROOT}
-        DEPENDS           med
         BUILD_COMMAND     make
         INSTALL_COMMAND   make install
         INSTALL_DIR       ${MEDCOUPLING_ROOT_DIR}
@@ -273,81 +319,126 @@ else( MEDCOUPLING_ROOT_DIR OR DEFINED ENV{MEDCOUPLING_ROOT_DIR})
         LOG_TEST          TRUE           # Wrap test in script to log output
         LOG_INSTALL       TRUE           # Wrap install in script to log output
   )
-endif( MEDCOUPLING_ROOT_DIR OR DEFINED ENV{MEDCOUPLING_ROOT_DIR} )
 
-set(MEDCOUPLING_INCLUDE_DIR  ${MEDCOUPLING_ROOT_DIR}/include)
+endif( MEDCOUPLING_ROOT_DIR OR DEFINED ENV{MEDCOUPLING_ROOT_DIR} )
 
-#For the environment file
-set(MEDCOUPLING_LIBRARIES_PATH    ${MEDCOUPLING_ROOT_DIR}/lib/libmedloader.so ${MEDCOUPLING_ROOT_DIR}/lib/libmedcoupling.so)
-string(REPLACE ";" ":"  MEDCOUPLING_LIBRARIES_PATH "${MEDCOUPLING_LIBRARIES_PATH}")# use colon instead of semicolon in environment file env_CDMATH.sh
+set(MEDCOUPLING_INCLUDE_DIR ${MEDCOUPLING_ROOT_DIR}/include)
+set(MEDCOUPLING_LIBRARIES   ${MEDCOUPLING_ROOT_DIR}/lib    )#for environment file env_CDMATH.sh 
 
 add_library(medloader   SHARED IMPORTED )
 set_property(TARGET medloader   PROPERTY IMPORTED_LOCATION ${MEDCOUPLING_ROOT_DIR}/lib/libmedloader.so)
 add_library(medcoupling SHARED IMPORTED )
 set_property(TARGET medcoupling PROPERTY IMPORTED_LOCATION ${MEDCOUPLING_ROOT_DIR}/lib/libmedcoupling.so)
 
-if(DEFINED MED AND DEFINED PETSc)
+if   (TARGET MED AND TARGET PETSc)
   ExternalProject_Add_StepDependencies( MED build PETSc )#PETSc doit être compilé avant MED car c'est PETSc qui compile HDF5
-endif(DEFINED MED AND DEFINED PETSc)
+endif(TARGET MED AND TARGET PETSc)
 
-if(DEFINED MED AND DEFINED MEDCoupling)
+if   (TARGET MED AND TARGET MEDCoupling)
   ExternalProject_Add_StepDependencies( MEDCoupling build MED )#MED doit être compilé avant MEDCoupling
-endif(DEFINED MED AND DEFINED MEDCoupling)
+endif(TARGET MED AND TARGET MEDCoupling)
+if   (TARGET PETSc AND TARGET MEDCoupling)
+  ExternalProject_Add_StepDependencies( MEDCoupling build PETSc )#PETSc doit être compilé avant MEDCoupling (car il contient hdf5)
+endif(TARGET PETSc AND TARGET MEDCoupling)
  
 # Paraview variables for env_CDMATH.sh
-if (CDMATH_WITH_PYTHON AND CDMATH_WITH_POSTPRO)
-  set (PV_LIB_DIR /usr/lib/python2.7/dist-packages/:/usr/lib64/paraview/)
-  set (PV_PYTHON_DIR /usr/lib/python2.7/dist-packages:/usr/lib64/paraview/site-packages/:/usr/lib64/paraview/site-packages/paraview/:/usr/lib64/paraview/site-packages/vtk/:/usr/lib64/paraview/python2.7/site-packages/:/usr/lib64/paraview/python2.7/site-packages/paraview/:/usr/lib64/paraview/python2.7/site-packages/vtkmodules:/usr/lib64/paraview/python3.7/site-packages/:/usr/lib64/paraview/python3.7/site-packages/paraview/:/usr/lib64/paraview/python3.7/site-packages/vtkmodules)
-endif ()
+if   (CDMATH_WITH_PYTHON AND CDMATH_WITH_POSTPRO)
+#find_package(VTK) 
+#find_package(ParaView)  
+  
+  #extraction of the paraview version"
+  IF   ( EXISTS "/usr/include/paraview/vtkPVConfig.h" )
+    file(STRINGS /usr/include/paraview/vtkPVConfig.h vtkConfig)
+  ELSE ( EXISTS "/usr/include/paraview/vtkPVConfig.h" )
+    message(WARNING "Could not find ParaView configuration file vtkPVConfig.h. Postprocessing won't work")
+  ENDIF( EXISTS "/usr/include/paraview/vtkPVConfig.h" )
+
+  FOREACH(line ${vtkConfig})
+    string(FIND "${line}" "#define PARAVIEW_VERSION_FULL " pos)
+    IF(NOT ${pos} EQUAL -1)
+      string(LENGTH ${line} line_length)#length of the tarball
+      MATH(EXPR start_pv_version "${line_length}-6")#line ends with "x.y.z", that counts for 7 characters
+      string(SUBSTRING ${line} ${start_pv_version} 5 PV_VERSION)
+      break()
+    ENDIF(NOT ${pos} EQUAL -1)
+  ENDFOREACH(line vtkConfig)
+  
+  message(STATUS "ParaView version is ${PV_VERSION}" )
+  IF   ( ${PV_VERSION} VERSION_GREATER 5.6.0 OR ${PV_VERSION} VERSION_EQUAL 5.6.0 )#Use python 3, use VERSION_GREATER_EQUAL if cmake >=3.7
+    SET(PYTHON2OR3 "3")
+  ELSE ( ${PV_VERSION} VERSION_GREATER 5.6.0 OR ${PV_VERSION} VERSION_EQUAL 5.6.0 )#Use python 2
+    SET(PYTHON2OR3 "2")
+  ENDIF( ${PV_VERSION} VERSION_GREATER 5.6.0 OR ${PV_VERSION} VERSION_EQUAL 5.6.0 )
+
+    set (PV_LIB_DIR    /usr/lib/python${PYTHON2OR3}.7/dist-packages/paraview/:/usr/lib64/paraview/:/usr/lib/paraview/)
+    set (PV_PYTHON_DIR /usr/lib/python${PYTHON2OR3}.7/dist-packages/paraview/:/usr/lib64/paraview/site-packages/:/usr/lib64/paraview/site-packages/paraview/:/usr/lib64/paraview/site-packages/vtk/:/usr/lib64/paraview/python${PYTHON2OR3}.7/site-packages/:/usr/lib64/paraview/python${PYTHON2OR3}.7/site-packages/paraview/:/usr/lib64/paraview/python${PYTHON2OR3}.7/site-packages/vtkmodules:/usr/lib/paraview/site-packages/paraview:/usr/lib/paraview/site-packages/paraview/vtk)
+
+endif(CDMATH_WITH_PYTHON AND CDMATH_WITH_POSTPRO)
 
 # Swig interface
-if (CDMATH_WITH_PYTHON)
-   find_package (PYTHON REQUIRED)
-   find_package (SWIG 3.0 REQUIRED)
-   set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, python-dev, python-numpy, swig")
-   set (CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, python-devel, numpy, swig")
-   add_subdirectory (${CDMATH_SWIG_DIR})
-endif ()
+if   (CDMATH_WITH_PYTHON)
+    IF   (${CMAKE_VERSION} VERSION_GREATER "3.12.0")
+      find_package(Python ${PYTHON2OR3} REQUIRED COMPONENTS Interpreter Development )
+      SET(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
+    ELSE (${CMAKE_VERSION} VERSION_GREATER "3.12.0")
+      find_package(PythonInterp ${PYTHON2OR3} REQUIRED )
+      find_package(PythonLibs   ${PYTHON2OR3} REQUIRED )
+      set(Python_LIBRARIES    ${PYTHON_LIBRARIES})
+      set(Python_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
+      set(Python_VERSION      ${PYTHON_VERSION_STRING})
+    ENDIF(${CMAKE_VERSION} VERSION_GREATER "3.12.0")
+
+  message(STATUS "Python version is ${Python_VERSION}")
+
+  find_package (SWIG 3.0 REQUIRED)
+  set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, python-dev, python-numpy, swig")
+  set (CPACK_RPM_PACKAGE_REQUIRES   "${CPACK_RPM_PACKAGE_REQUIRES},   python-devel,      numpy, swig")
+  add_subdirectory (${CDMATH_SWIG_DIR})
+endif(CDMATH_WITH_PYTHON)
 
 find_package (XDR REQUIRED)
 add_subdirectory (${BASE_DIR})
 add_subdirectory (${MESH_DIR})
 
-if (CDMATH_WITH_PETSC)
+if   (CDMATH_WITH_PETSC)
     add_subdirectory (${LINEARSOLVER_DIR})
-endif ()
+endif(CDMATH_WITH_PETSC)
 
 # Documentation
 if (CDMATH_WITH_DOCUMENTATION)
   find_package (Doxygen)
   set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, doxygen, graphviz, mscgen")
   set (CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, doxygen, graphviz, mscgen")
-  if (NOT DOXYGEN_FOUND)
+  if   (NOT DOXYGEN_FOUND)
     message (FATAL_ERROR "Doxygen is needed to build the documentation. Please install it correctly.")
-  endif (NOT DOXYGEN_FOUND)
+  endif(NOT DOXYGEN_FOUND)
   configure_file (Doxyfile.in ${PROJECT_BINARY_DIR}/Doxyfile  @ONLY IMMEDIATE)
   add_custom_target (doc COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
                                                          SOURCES ${PROJECT_BINARY_DIR}/Doxyfile)
-  if ( IS_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html)
-    install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html DESTINATION share/doc/cdmath)
-  endif()
-endif ()
+  if   ( IS_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html)
+    install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html DESTINATION doc/cdmath-dev-doc)
+  endif( IS_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html)
+endif(CDMATH_WITH_DOCUMENTATION)
+
+#Debug option : todo = sort flags
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg -fprofile-arcs -ftest-coverage -lgcov")
+if   (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+  SET(CMAKE_EXE_LINKER_FLAGS "-pg -fprofile-arcs -ftest-coverage -lgcov")
+  SET(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage")
+endif(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
 
 # Tests
-if (CDMATH_WITH_TESTS)
-  set (CMAKE_EXE_LINKER_FLAGS "-pg -fprofile-arcs -ftest-coverage -lgcov")
-  enable_testing ()
+if   (CDMATH_WITH_TESTS)
   find_package (CPPUNIT REQUIRED)
-endif ()
-if (CDMATH_WITH_TESTS AND CDMATH_WITH_PYTHON)
   enable_testing ()
   add_subdirectory (${TESTS_DIR})#contains c++ and python tests
-endif()
+endif(CDMATH_WITH_TESTS)
 
 # Packaging
 if (CDMATH_WITH_PACKAGE)
   include (CPackLists.txt)
-endif ()
+endif(CDMATH_WITH_PACKAGE)
 
 # Postprocessing
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_POSTPRO)
index 5a696a7b35f7658516cd86ef170aeefa4ab8d469..9b2ca6b29962c165f938356d9ea7d5a81c6aa22b 100755 (executable)
@@ -30,21 +30,19 @@ Create your source directory. For instance:
 * `cd ~/workspace/cdmath`
 
 Download from GitHub
-* click on the following link : `https://github.com/ndjinga/CDMATH/archive/master.zip` then unzip the file in a directory cdmath-master
-* or type the following in a terminal : `wget https://github.com/ndjinga/CDMATH/archive/master.zip` then unzip the file in a directory cdmath-master
+* click on the following link : `https://github.com/ndjinga/CDMATH/archive/master.zip`, then unzip the file in a directory cdmath-master
+* or type the following in a terminal : `wget https://github.com/ndjinga/CDMATH/archive/master.zip`, then unzip the file in a directory cdmath-master
 * or clone the git repository to a folder cdmath-master:  `git clone https://github.com/ndjinga/CDMATH.git cdmath-master`
 
 
 Set environment for the compilation of CDMATH
 ---------------------------------------------
-Dependencies. The following packages list is sufficient on Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04 :
+Dependencies. The following package list is sufficient on Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04 :
 
  - `cmake3` (mandatory)
  - `g++` or another C++ compiler (mandatory)
- - `libhdf5-dev` (mandatory)
  - `python-dev`, `python-numpy` and `swig`, if you want to use CDMATH commands in Python scripts. Use the compilation option `-DCDMATH_WITH_PYTHON=ON`. (highly recommended)
  - `python-matplotlib` and `paraview` for postprocessing tools such as plotting curves (matplotlib) or generating 3D view images (paraview). Use the compilation option `-DCDMATH_WITH_POSTPRO=ON` (recommended).
- - `petsc` if you want to solve large spase linear systems. Typically required for implicit methods. Use the compilation option `-DCDMATH_WITH_PETSC=ON` (recommended).
  - `jupyter`, in order to generate and visualise nice reports from test case simulations (optional)
  - `doxygen`, `graphviz` and `mscgen`, if you want to generate a nice source code documentation in `~/workspace/cdmath/cdmath_install/doc/`. Use the compilation option `-DCDMATH_WITH_DOCUMENTATION=ON` (optional).
  - `libcppunit-dev`, if you want to generate unit tests. Use the compilation option `-DCDMATH_WITH_TESTS=ON` (optional).
@@ -59,27 +57,35 @@ Directories. Create the suggested build and installation folders:
 
 Compile and install CDMATH
 --------------------------
-Generate makefiles for a minimum version:
-* `cmake ../cdmath-master/ -DCMAKE_INSTALL_PREFIX=../cdmath_install -DCMAKE_BUILD_TYPE=Release`
-
-Or generate makefiles for an all-options version:
-* `cmake ../cdmath-master -DCMAKE_INSTALL_PREFIX=../cdmath_install -DCMAKE_BUILD_TYPE=Release -G"Eclipse CDT4 - Unix Makefiles" -D_ECLIPSE_VERSION=4.3 -DCDMATH_WITH_PETSC=ON -DCDMATH_WITH_PYTHON=ON  -DCDMATH_WITH_POSTPRO=ON -DCDMATH_WITH_TESTS=ON -DCDMATH_WITH_DOCUMENTATION=ON`
-
+Simpler build for a minimum version:
+* `cmake ../cdmath-master/ -DCMAKE_INSTALL_PREFIX=../cdmath_install -DCMAKE_BUILD_TYPE=Release -DCDMATH_WITH_PETSC=ON -DCDMATH_WITH_PYTHON=ON `  
+> This will download and build the following dependencies
+> - PETSc from http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.13.2.tar.gz
+> - SLEPc from https://slepc.upv.es/download/distrib/slepc-3.13.2.tar.gz
+> - HDF5 http://files.salome-platform.org/Salome/other/med-4.0.0.tar.gz
+> - MEDFILE from http://files.salome-platform.org/Salome/other/med-4.0.0.tar.gz
+> - MEDCOUPLING from http://files.salome-platform.org/Salome/other/medCoupling-9.4.0.tar.gz
+
+Advanced build for an all-options version:
+* `cmake ../cdmath-master -DCMAKE_INSTALL_PREFIX=../cdmath_install -DCMAKE_BUILD_TYPE=Release -G"Eclipse CDT4 - Unix Makefiles" -D_ECLIPSE_VERSION=4.3 -DCDMATH_WITH_PETSC=ON -DCDMATH_WITH_PYTHON=ON  -DCDMATH_WITH_POSTPRO=ON -DCDMATH_WITH_TESTS=ON -DCDMATH_WITH_DOCUMENTATION=ON -DPETSC_DIR=${PETSC_DIR} -DMEDFILE_ROOT_DIR=${MEDFILE_ROOT_DIR} -DMEDCOUPLING_ROOT_DIR=${MEDCOUPLING_ROOT_DIR}`  
+> This assumes that you have an existing 
+> - install of PETSc (with submodules SLEPC and HDF5) at the location given by the environment variable PETSC_DIR and the architecture variable PETSC_ARCH  
+> See the instructions given in [the official documentation](http://www.mcs.anl.gov/petsc/documentation/installation.html)
+> - install of MED                                    at the location given by the environment variable MEDFILE_ROOT_DIR
+> - install of MEDCOUPLING                            at the location given by the environment variable MEDCOUPLING_ROOT_DIR
+
+The 3 dependencies PETSC, MED and MEDCOUPLING should have been compiled with the same version of HDF5  
+Warning : the linux package libhdf5-dev is generally not compatible with the libraries MED and MEDCoupling
 Compile and install:
 * `make`
-* `make install`
+* `make doc install`
 
 Run unit and example tests:
-* make check
+* make example
 
 Run validation tests:
 * make validation
 
-Notes for compilation options:
-* Eclipse: The Cmake options `-G"Eclipse CDT4 - Unix Makefiles" -D_ECLIPSE_VERSION=4.3` create project files if you want to develop CDMATH with Eclipse Kepler or higher.
-* HDF5: On some systems (not Ubuntu 14.04 nor Ubuntu 16.04), you may have to use the compilation option `-DHDF5_ROOT_DIR=/path/to/hdf5/library` too.
-* PETSc: If the library Petsc is already installed in your system (packages libpetsc-dev for ubuntu and petsc-devel for fedora 25 and 26), you may save time and disk space by using the installed library instead of installing a new one. In order to do so use the compilation options `-DPETSC_DIR=/path/to/petsc/installation/petsc -DPETSC_ARCH=arch-linux2-c-opt`. If you prefer to compile PETSc yourself from the sources you may follow the instructions given in [the official documentation](http://www.mcs.anl.gov/petsc/documentation/installation.html).
-
 Use of CDMATH
 -------------
 We recommend using CDMATH in python scripts which avoids the hassle of having to edit Makefile files and compiling every C++ scripts.
@@ -91,11 +97,14 @@ Then in your terminal simply type
 
 If performance or parallelism is an issue for your simulations, you can use CDMATH librairies with your C++ code :
  * C++ libraries: `export LD_LIBRARY_PATH=~/workspace/cdmath/cdmath_install/lib`
- * To know how to include the right libraries for compilation, see the makefiles of the examples. They include the list `-linterpkernel -lmedC -lmedloader -lmedcoupling -lbase -lmesh -llinearsolver`.
+ * To know how to include the right libraries for compilation, see the makefiles of the examples. They include the list ` -lmedC -lmedloader -lmedcoupling -lbase -lmesh -llinearsolver`.
 
 The CDMATH environment variables consist in :
- * C++ libraries: `export LD_LIBRARY_PATH=~/workspace/cdmath/cdmath_install/lib`
- * Python libraries: `export PYTHONPATH=~/workspace/cdmath/cdmath_install/lib/cdmath:~/workspace/cdmath/cdmath_install/bin/cdmath`
+ * CDMATH C++ library path: `~/workspace/cdmath/cdmath_install/lib`
+ * CDMATH Python library paths: `~/workspace/cdmath/cdmath_install/lib/cdmath:~/workspace/cdmath/cdmath_install/bin/cdmath`
+ * PETSc, SLEPc and HDF5 library path: `${PETSC_DIR}/${PETSC_ARCH}/lib`
+ * MED library path: `${MEDFILE_ROOT_DIR}/lib`
+ * MEDCOUPLING library path: `${MEDCOUPLING_ROOT_DIR}/lib`
 
 Create Linux installation packages for CDMATH
 ---------------------------------------------
old mode 100644 (file)
new mode 100755 (executable)
index 6c99918..87fb033
@@ -54,20 +54,32 @@ set(CDMATH_INCLUDES ${CDMATH_DIR}/include)
 if (NOT (IS_DIRECTORY  ${CDMATH_INCLUDES}) )
   message (SEND_ERROR "CDMATH_INCLUDES can not be used, ${CDMATH_INCLUDES} does not exist.")
 endif () 
+set(MED_INCLUDES ${CDMATH_DIR}/share/med/include)
+if (NOT (IS_DIRECTORY  ${MED_INCLUDES}) )
+  message (SEND_ERROR "MED_INCLUDES can not be used, ${MED_INCLUDES} does not exist.")
+endif () 
+set(MEDCOUPLING_INCLUDES ${CDMATH_DIR}/share/medcoupling/include)
+if (NOT (IS_DIRECTORY  ${MEDCOUPLING_INCLUDES}) )
+  message (SEND_ERROR "MEDCOUPLING_INCLUDES can not be used, ${MEDCOUPLING_INCLUDES} does not exist.")
+endif () 
 
 # CDMATH libraries against which to link
 # This sets the variable ${CDMATH_LIBRARIES}.
 set(CDMATH_LIBDIR ${CDMATH_DIR}/lib)
-if (NOT (IS_DIRECTORY  ${CDMATH_LIBDIR}) )
+if ( NOT (IS_DIRECTORY  ${CDMATH_LIBDIR}) )
   message (SEND_ERROR "CDMATH_LIBDIR can not be used, ${CDMATH_LIBDIR} does not exist.")
 endif () 
-find_library (INTERPKERNEL_LIB NAMES interpkernel PATHS ${CDMATH_LIBDIR})
-find_library (MEDC_LIB NAMES medC PATHS ${CDMATH_LIBDIR})
-find_library (MEDLOADER_LIB NAMES medloader PATHS ${CDMATH_LIBDIR})
-find_library (MEDCOUPLING_LIB NAMES medcoupling PATHS ${CDMATH_LIBDIR})
 find_library (CDMATHBASE_LIB NAMES base PATHS ${CDMATH_LIBDIR})
 find_library (CDMATHMESH_LIB NAMES mesh PATHS ${CDMATH_LIBDIR})
-find_library (CDMATHLINEARSOLVER_LIB NAMES linearsolver PATHS ${CDMATH_LIBDIR})
+find_library (MEDC_LIB NAMES medC PATHS ${CDMATH_DIR}/share/med/lib)
+find_library (MEDLOADER_LIB NAMES medloader PATHS ${CDMATH_DIR}/share/medcoupling/lib/)
+find_library (MEDCOUPLING_LIB NAMES medcoupling PATHS ${CDMATH_DIR}/share/medcoupling/lib/)
+#find_library (CDMATHLINEARSOLVER_LIB NAMES linearsolver PATHS ${CDMATH_LIBDIR})
 set (CDMATH_LIBRARIES
-    ${INTERPKERNEL_LIB} ${MEDC_LIB} ${MEDLOADER_LIB} ${MEDCOUPLING_LIB}
-    ${CDMATHBASE_LIB} ${CDMATHMESH_LIB} ${CDMATHLINEARSOLVER_LIB})
+       ${MEDC_LIB} 
+       ${MEDLOADER_LIB} 
+       ${MEDCOUPLING_LIB}
+       ${CDMATHBASE_LIB} 
+       ${CDMATHMESH_LIB} 
+#      ${CDMATHLINEARSOLVER_LIB}
+       )
old mode 100644 (file)
new mode 100755 (executable)
index 649ae8e..a81c9f9
@@ -81,8 +81,9 @@ find_path (PETSC_DIR include/petsc.h
   #RedHat paths
   /usr/include/petsc
   # Debian paths
-  /usr/lib/petscdir/3.7.6 /usr/lib/petscdir/3.7
-  /usr/lib/petscdir/3.6.2 /usr/lib/petscdir/3.6
+  /usr/lib/petscdir/3.12.4 /usr/lib/petscdir/3.12 #Ubuntu 20.04
+  /usr/lib/petscdir/3.7.6 /usr/lib/petscdir/3.7 #Ubuntu 18.04
+  /usr/lib/petscdir/3.6.2 /usr/lib/petscdir/3.6 #Ubuntu 16.04
   /usr/lib/petscdir/3.5.1 /usr/lib/petscdir/3.5
   /usr/lib/petscdir/3.4.2 /usr/lib/petscdir/3.4
   /usr/lib/petscdir/3.3 /usr/lib/petscdir/3.2 /usr/lib/petscdir/3.1
@@ -97,9 +98,10 @@ find_program (MAKE_EXECUTABLE NAMES make gmake)
 if (PETSC_DIR AND NOT PETSC_ARCH)
   set (_petsc_arches
     $ENV{PETSC_ARCH}                            # If set, use environment variable first
-    linux-gnu-c-debug linux-gnu-c-opt           # Debian defaults (petsc compilation)
+    linux-gnu-c-debug linux-gnu-c-opt           # old Debian defaults (petsc compilation)
+    arch-linux-c-opt or arch-linux-c-debug      # new Debian defaults (petsc compilation)
     x86_64-linux-gnu-real   i686-linux-gnu-real # Debian defaults (petsc system installation)
-    arch-linux2-c-opt or arch-linux2-c-debug    # RedHat defaults (petsc compilation)
+    arch-linux2-c-opt or arch-linux2-c-debug    # old RedHat defaults (petsc compilation)
     x86_64-redhat-linux-gnu i686-redhat-linux-gnu # RedHat defaults (petsc apt installation)
     x86_64-unknown-linux-gnu i386-unknown-linux-gnu)
   set (petscconf "NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
index df658fba494ada1a4bdd7a2be4e7cc97e71df820..8139e53f0fe2a024c731fd67956127a4b67140b0 100755 (executable)
-# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library 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 2.1 of the License.
-#
-# This library 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 along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# ------
-
-MESSAGE(STATUS "Check for python ...")
-
-# ------
-
-IF(PYTHON_IS_MANDATORY STREQUAL 0)
-  SET(PYTHON_IS_MANDATORY 0)
-  SET(PYTHON_IS_OPTIONAL 1)
-ENDIF(PYTHON_IS_MANDATORY STREQUAL 0)
-IF(PYTHON_IS_OPTIONAL STREQUAL 0)
-  SET(PYTHON_IS_MANDATORY 1)
-  SET(PYTHON_IS_OPTIONAL 0)
-ENDIF(PYTHON_IS_OPTIONAL STREQUAL 0)
-IF(NOT PYTHON_IS_MANDATORY AND NOT PYTHON_IS_OPTIONAL)
-  SET(PYTHON_IS_MANDATORY 1)
-  SET(PYTHON_IS_OPTIONAL 0)
-ENDIF(NOT PYTHON_IS_MANDATORY AND NOT PYTHON_IS_OPTIONAL)
-
-# ------
-
-SET(PYTHON_STATUS 1)
-IF(WITHOUT_PYTHON OR WITH_PYTHON STREQUAL 0)
-  SET(PYTHON_STATUS 0)
-  MESSAGE(STATUS "python disabled from command line.")
-ENDIF(WITHOUT_PYTHON OR WITH_PYTHON STREQUAL 0)
-
-# ------
-
-IF(PYTHON_STATUS)
-  IF(WITH_PYTHON)
-    SET(PYTHON_ROOT_USER ${WITH_PYTHON})
-  ENDIF(WITH_PYTHON)
-  IF(NOT PYTHON_ROOT_USER)
-    SET(PYTHON_ROOT_USER $ENV{PYTHON_ROOT})
-  ENDIF(NOT PYTHON_ROOT_USER)
-  IF(NOT PYTHON_ROOT_USER)
-    SET(PYTHON_ROOT_USER $ENV{PYTHONHOME})
-  ENDIF(NOT PYTHON_ROOT_USER)
-ENDIF(PYTHON_STATUS)
-
-# ------
-
-IF(PYTHON_STATUS)
-  IF(PYTHON_ROOT_USER)
-    SET(PYTHON_FIND_PATHS_OPTION NO_DEFAULT_PATH)
-  ELSE(PYTHON_ROOT_USER)
-    SET(PYTHON_FIND_PATHS_OPTION)
-  ENDIF(PYTHON_ROOT_USER)
-ENDIF(PYTHON_STATUS)
-
-# ------
-
-IF(PYTHON_STATUS)
-  IF(WINDOWS)
-    IF(CMAKE_BUILD_TYPE STREQUAL Release)
-      SET(PYTHON_EXECUTABLE_TO_FIND python)
-    ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
-      SET(PYTHON_EXECUTABLE_TO_FIND python_d)
-    ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
-  ELSE(WINDOWS)
-    SET(PYTHON_EXECUTABLE_TO_FIND python)
-  ENDIF(WINDOWS)
-  IF(NOT PYTHON_ROOT_USER)
-    SET(PYTHON_EXECUTABLE_PATHS)
-  ELSE(NOT PYTHON_ROOT_USER)
-    IF(WINDOWS)
-      SET(PYTHON_EXECUTABLE_PATHS ${PYTHON_ROOT_USER})
-    ELSE(WINDOWS)
-      SET(PYTHON_EXECUTABLE_PATHS ${PYTHON_ROOT_USER}/bin)
-    ENDIF(WINDOWS)
-  ENDIF(NOT PYTHON_ROOT_USER)
-  FIND_PROGRAM(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE_TO_FIND} PATHS ${PYTHON_EXECUTABLE_PATHS} ${PYTHON_FIND_PATHS_OPTION})
-  IF(PYTHON_EXECUTABLE)
-    MESSAGE(STATUS "python found: ${PYTHON_EXECUTABLE}")
-    IF(PYTHON_EXECUTABLE STREQUAL /usr/bin/python)
-    ELSE(PYTHON_EXECUTABLE STREQUAL /usr/bin/python)
-      SET(PYTHON_ROOT_USER ${PYTHON_EXECUTABLE})
-      GET_FILENAME_COMPONENT(PYTHON_ROOT_USER ${PYTHON_ROOT_USER} PATH)
-      IF(NOT WINDOWS)
-       GET_FILENAME_COMPONENT(PYTHON_ROOT_USER ${PYTHON_ROOT_USER} PATH)
-      ENDIF(NOT WINDOWS)
-    ENDIF(PYTHON_EXECUTABLE STREQUAL /usr/bin/python)
-  ELSE(PYTHON_EXECUTABLE)
-    IF(PYTHON_ROOT_USER)
-      MESSAGE(STATUS "${PYTHON_EXECUTABLE_TO_FIND} not found in ${PYTHON_EXECUTABLE_PATHS}, check your PYTHON installation.")
-    ELSE(PYTHON_ROOT_USER)
-      MESSAGE(STATUS "${PYTHON_EXECUTABLE_TO_FIND} not found on system, try to use WITH_PYTHON option or PYTHON_ROOT environment variable.")
-    ENDIF(PYTHON_ROOT_USER)
-    SET(PYTHON_STATUS 0)
-  ENDIF(PYTHON_EXECUTABLE)
-ENDIF(PYTHON_STATUS)
-
-# ------
-
-IF(PYTHON_STATUS)
-  EXECUTE_PROCESS(
-    COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write(sys.version[:3])"
-    OUTPUT_VARIABLE PYTHON_VERSION
-    )
-ENDIF(PYTHON_STATUS)
-
-# ------
-
-IF(PYTHON_STATUS)
-  IF(PYTHON_ROOT_USER)
-    SET(PYTHON_FIND_PATHS_OPTION NO_DEFAULT_PATH)
-  ELSE(PYTHON_ROOT_USER)
-    SET(PYTHON_FIND_PATHS_OPTION)
-  ENDIF(PYTHON_ROOT_USER)
-ENDIF(PYTHON_STATUS)
-
-# ------
-
-IF(PYTHON_STATUS)
-  IF(PYTHON_ROOT_USER)
-    SET(PYTHON_INCLUDE_PATHS ${PYTHON_ROOT_USER}/include ${PYTHON_ROOT_USER}/include/python${PYTHON_VERSION})
-  ELSE(PYTHON_ROOT_USER)
-    SET(PYTHON_INCLUDE_PATHS /usr/include/python${PYTHON_VERSION})
-  ENDIF(PYTHON_ROOT_USER)
-  SET(PYTHON_INCLUDE_TO_FIND Python.h)
-  FIND_PATH(PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_TO_FIND} PATHS ${PYTHON_INCLUDE_PATHS} ${PYTHON_FIND_PATHS_OPTION})
-  SET(PYTHON_DEFINITIONS)
-  IF(PYTHON_INCLUDE_DIR)
-    SET(PYTHON_INCLUDES -I${PYTHON_INCLUDE_DIR})# to remove
-    SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
-    IF(WINDOWS)
-      IF(CMAKE_BUILD_TYPE STREQUAL Release)
-      ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
-       SET(PYTHON_INCLUDES ${PYTHON_INCLUDES} -DHAVE_DEBUG_PYTHON)# to remove
-       SET(PYTHON_DEFINITIONS "-DHAVE_DEBUG_PYTHON")
-      ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
-    ENDIF(WINDOWS)
-    MESSAGE(STATUS "${PYTHON_INCLUDE_TO_FIND} found in ${PYTHON_INCLUDE_DIR}")
-  ELSE(PYTHON_INCLUDE_DIR)
-    SET(PYTHON_STATUS 0)
-    IF(PYTHON_ROOT_USER)
-      MESSAGE(STATUS "${PYTHON_INCLUDE_TO_FIND} not found in ${PYTHON_INCLUDE_PATHS}, check your PYTHON installation.")
-    ELSE(PYTHON_ROOT_USER)
-      MESSAGE(STATUS "${PYTHON_INCLUDE_TO_FIND} not found on system, try to use WITH_PYTHON option or PYTHON_ROOT environment variable.")
-    ENDIF(PYTHON_ROOT_USER)
-  ENDIF(PYTHON_INCLUDE_DIR)
-ENDIF(PYTHON_STATUS)
-
-# ----
-
-IF(PYTHON_STATUS)
-  IF(PYTHON_ROOT_USER)
-    IF(WINDOWS)
-      SET(PYTHON_LIB_PATHS ${PYTHON_ROOT_USER}/libs)
-    ELSE(WINDOWS)
-      SET(PYTHON_LIB_PATHS ${PYTHON_ROOT_USER}/lib ${PYTHON_ROOT_USER}/lib/python${PYTHON_VERSION}/config)
-    ENDIF(WINDOWS)
-  ELSE(PYTHON_ROOT_USER)
-    SET(PYTHON_LIB_PATHS)
-  ENDIF(PYTHON_ROOT_USER)
-  IF(WINDOWS)
-    STRING(REPLACE "." "" PYTHON_VERSION_WITHOUT_DOT ${PYTHON_VERSION})
-    IF(CMAKE_BUILD_TYPE STREQUAL Release)
-      FIND_LIBRARY(PYTHON_LIB python${PYTHON_VERSION_WITHOUT_DOT} PATHS ${PYTHON_LIB_PATHS} ${PYTHON_FIND_PATHS_OPTION})
-    ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
-      FIND_LIBRARY(PYTHON_LIB python${PYTHON_VERSION_WITHOUT_DOT}_d PATHS ${PYTHON_LIB_PATHS} ${PYTHON_FIND_PATHS_OPTION})
-    ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
-  ELSE(WINDOWS)
-    FIND_LIBRARY(PYTHON_LIB python${PYTHON_VERSION} PATHS ${PYTHON_LIB_PATHS} ${PYTHON_FIND_PATHS_OPTION})
-  ENDIF(WINDOWS)
-  SET(PYTHON_LIBS)
-  IF(PYTHON_LIB)
-    SET(PYTHON_LIBS ${PYTHON_LIBS} ${PYTHON_LIB})
-    MESSAGE(STATUS "python lib found: ${PYTHON_LIB}")
-  ELSE(PYTHON_LIB)
-    SET(PYTHON_STATUS 0)
-    IF(PYTHON_ROOT_USER)
-      MESSAGE(STATUS "python lib not found in ${PYTHON_LIB_PATHS}, check your PYTHON installation.")
-    ELSE(PYTHON_ROOT_USER)
-      MESSAGE(STATUS "python lib not found on system, try to use WITH_PYTHON option or PYTHON_ROOT environment variable.")
-    ENDIF(PYTHON_ROOT_USER)
-  ENDIF(PYTHON_LIB)
-ENDIF(PYTHON_STATUS)
-
-# ----
-
-SET(NUMPY_STATUS 0)
-IF(PYTHON_STATUS)
-  EXECUTE_PROCESS(
-    COMMAND ${PYTHON_EXECUTABLE} -c "import numpy ; import sys ; sys.stdout.write(numpy.get_include())"
-    OUTPUT_VARIABLE NUMPY_INCLUDE_DIR
-    ERROR_QUIET
-    )
-  IF(NUMPY_INCLUDE_DIR)
-    SET(NUMPY_STATUS 1)
-  ENDIF(NUMPY_INCLUDE_DIR)
-  IF(NUMPY_STATUS)
-    SET(PYTHON_INCLUDES ${PYTHON_INCLUDES} -DWITH_NUMPY -I${NUMPY_INCLUDE_DIR})# to remove
-    SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR})
-    SET(PYTHON_DEFINITIONS "${PYTHON_DEFINITIONS} -DWITH_NUMPY")
-    MESSAGE(STATUS "numpy found : ${NUMPY_INCLUDE_DIR}")
-  ELSE(NUMPY_STATUS)
-    MESSAGE(STATUS "numpy not found")
-  ENDIF(NUMPY_STATUS)
-ENDIF(PYTHON_STATUS)
-
-# ----
-
-IF(PYTHON_STATUS)
-  SET(PYTHON_CPPFLAGS ${PYTHON_INCLUDES})# to remove
-  SET(PYLOGLEVEL WARNING)
-ELSE(PYTHON_STATUS)
-  IF(PYTHON_IS_MANDATORY)
-    MESSAGE(FATAL_ERROR "python not found ... mandatory ... abort")
-  ELSE(PYTHON_IS_MANDATORY)
-    MESSAGE(STATUS "python not found ... optional ... disabled")
-  ENDIF(PYTHON_IS_MANDATORY)
-ENDIF(PYTHON_STATUS)
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindPython
+----------
+
+Find Python interpreter, compiler and development environment (include
+directories and libraries).
+
+Three components are supported:
+
+* ``Interpreter``: search for Python interpreter.
+* ``Compiler``: search for Python compiler. Only offered by IronPython.
+* ``Development``: search for development artifacts (include directories and
+  libraries).
+
+If no ``COMPONENTS`` is specified, ``Interpreter`` is assumed.
+
+To ensure consistent versions between components ``Interpreter``, ``Compiler``
+and ``Development``, specify all components at the same time::
+
+  find_package (Python COMPONENTS Interpreter Development)
+
+This module looks preferably for version 3 of Python. If not found, version 2
+is searched.
+To manage concurrent versions 3 and 2 of Python, use :module:`FindPython3` and
+:module:`FindPython2` modules rather than this one.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :ref:`Imported Targets <Imported Targets>`:
+
+``Python::Interpreter``
+  Python interpreter. Target defined if component ``Interpreter`` is found.
+``Python::Compiler``
+  Python compiler. Target defined if component ``Compiler`` is found.
+``Python::Python``
+  Python library. Target defined if component ``Development`` is found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project
+(see :ref:`Standard Variable Names <CMake Developer Standard Variable Names>`):
+
+``Python_FOUND``
+  System has the Python requested components.
+``Python_Interpreter_FOUND``
+  System has the Python interpreter.
+``Python_EXECUTABLE``
+  Path to the Python interpreter.
+``Python_INTERPRETER_ID``
+  A short string unique to the interpreter. Possible values include:
+    * Python
+    * ActivePython
+    * Anaconda
+    * Canopy
+    * IronPython
+``Python_STDLIB``
+  Standard platform independent installation directory.
+
+  Information returned by
+  ``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=True)``.
+``Python_STDARCH``
+  Standard platform dependent installation directory.
+
+  Information returned by
+  ``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=True)``.
+``Python_SITELIB``
+  Third-party platform independent installation directory.
+
+  Information returned by
+  ``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=False)``.
+``Python_SITEARCH``
+  Third-party platform dependent installation directory.
+
+  Information returned by
+  ``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``.
+``Python_Compiler_FOUND``
+  System has the Python compiler.
+``Python_COMPILER``
+  Path to the Python compiler. Only offered by IronPython.
+``Python_COMPILER_ID``
+  A short string unique to the compiler. Possible values include:
+    * IronPython
+``Python_Development_FOUND``
+  System has the Python development artifacts.
+``Python_INCLUDE_DIRS``
+  The Python include directories.
+``Python_LIBRARIES``
+  The Python libraries.
+``Python_LIBRARY_DIRS``
+  The Python library directories.
+``Python_RUNTIME_LIBRARY_DIRS``
+  The Python runtime library directories.
+``Python_VERSION``
+  Python version.
+``Python_VERSION_MAJOR``
+  Python major version.
+``Python_VERSION_MINOR``
+  Python minor version.
+``Python_VERSION_PATCH``
+  Python patch version.
+
+Hints
+^^^^^
+
+``Python_ROOT_DIR``
+  Define the root directory of a Python installation.
+
+``Python_USE_STATIC_LIBS``
+  * If not defined, search for shared libraries and static libraries in that
+    order.
+  * If set to TRUE, search **only** for static libraries.
+  * If set to FALSE, search **only** for shared libraries.
+
+Commands
+^^^^^^^^
+
+This module defines the command ``Python_add_library`` which have the same
+semantic as :command:`add_library` but take care of Python module naming rules
+(only applied if library is of type ``MODULE``) and add dependency to target
+``Python::Python``::
+
+  Python_add_library (my_module MODULE src1.cpp)
+
+If library type is not specified, ``MODULE`` is assumed.
+#]=======================================================================]
+
+
+set (_PYTHON_PREFIX Python)
+
+if (DEFINED Python_FIND_VERSION)
+  set (_Python_REQUIRED_VERSION_MAJOR ${Python_FIND_VERSION_MAJOR})
+
+  include (${CMAKE_CURRENT_LIST_DIR}/FindPython/Support.cmake)
+else()
+  # iterate over versions in quiet and NOT required modes to avoid multiple
+  # "Found" messages and prematurally failure.
+  set (_Python_QUIETLY ${Python_FIND_QUIETLY})
+  set (_Python_REQUIRED ${Python_FIND_REQUIRED})
+  set (Python_FIND_QUIETLY TRUE)
+  set (Python_FIND_REQUIRED FALSE)
+
+  set (_Python_REQUIRED_VERSIONS 3 2)
+  set (_Python_REQUIRED_VERSION_LAST 2)
+
+  foreach (_Python_REQUIRED_VERSION_MAJOR IN LISTS _Python_REQUIRED_VERSIONS)
+    set (Python_FIND_VERSION ${_Python_REQUIRED_VERSION_MAJOR})
+    include (${CMAKE_CURRENT_LIST_DIR}/FindPython/Support.cmake)
+    if (Python_FOUND OR
+        _Python_REQUIRED_VERSION_MAJOR EQUAL _Python_REQUIRED_VERSION_LAST)
+      break()
+    endif()
+    # clean-up some CACHE variables to ensure look-up restart from scratch
+    foreach (_Python_ITEM IN LISTS _Python_CACHED_VARS)
+      unset (${_Python_ITEM} CACHE)
+    endforeach()
+  endforeach()
+
+  unset (Python_FIND_VERSION)
+
+  set (Python_FIND_QUIETLY ${_Python_QUIETLY})
+  set (Python_FIND_REQUIRED ${_Python_REQUIRED})
+  if (Python_FIND_REQUIRED OR NOT Python_FIND_QUIETLY)
+    # call again validation command to get "Found" or error message
+    find_package_handle_standard_args (Python HANDLE_COMPONENTS
+                                              REQUIRED_VARS ${_Python_REQUIRED_VARS}
+                                              VERSION_VAR Python_VERSION)
+  endif()
+endif()
+
+if (COMMAND __Python_add_library)
+  macro (Python_add_library)
+    __Python_add_library (Python ${ARGV})
+  endmacro()
+endif()
+
+unset (_PYTHON_PREFIX)
diff --git a/CDMATH/cmake_files/FindParaView.cmake b/CDMATH/cmake_files/FindParaView.cmake
new file mode 100755 (executable)
index 0000000..c6b786d
--- /dev/null
@@ -0,0 +1,224 @@
+#[==[.md
+# paraview-config.cmake
+
+This file is used by CMake when finding ParaView.
+
+The following variables are provided by this module:
+
+  * `ParaView_VERSION`: The version of ParaView found.
+  * `ParaView_PREFIX_PATH`: Install prefix for ParaView.
+  * `PARAVIEW_USE_QT`: If ParaView's Qt GUI is available.
+  * `PARAVIEW_USE_MPI`: If ParaView is built with MPI support.
+  * `PARAVIEW_USE_PYTHON`: If ParaView is built with Python support.
+  * `PARAVIEW_PYTHONPATH`: Where ParaView's Python modules live under the
+    install prefix. Unset if Python is not available.
+  * `PARAVIEW_PLUGIN_SUBDIR`: The subdirectory under the library directory for
+    plugins.
+  * `ParaView_CLIENT_XML_FILES`: XML files for client applications to use to
+    reproduce ParaView's menu items. Only provided if `PARAVIEW_USE_QT`
+    is set.
+  * `ParaView_LIBRARIES`: The list of modules specified by `COMPONENTS` and
+    `OPTIONAL_COMPONENTS`. This may be used in `MODULES` arguments in the API
+    (e.g., `vtk_module_autoinit`). All modules are also targets and may be
+    linked to using `target_link_libraries`.
+#]==]
+
+set(${CMAKE_FIND_PACKAGE_NAME}_CMAKE_MODULE_PATH_save "${CMAKE_MODULE_PATH}")
+list(INSERT CMAKE_MODULE_PATH 0
+  "${CMAKE_CURRENT_LIST_DIR}")
+
+set("${CMAKE_FIND_PACKAGE_NAME}_CMAKE_PREFIX_PATH_save" "${CMAKE_PREFIX_PATH}")
+include("${CMAKE_CURRENT_LIST_DIR}/paraview-prefix.cmake")
+set("${CMAKE_FIND_PACKAGE_NAME}_PREFIX_PATH"
+  "${_vtk_module_import_prefix}")
+unset(_vtk_module_import_prefix)
+list(INSERT CMAKE_PREFIX_PATH 0
+  "${${CMAKE_FIND_PACKAGE_NAME}_PREFIX_PATH}")
+
+set("${CMAKE_FIND_PACKAGE_NAME}_VERSION" "@PARAVIEW_VERSION_FULL@")
+
+unset("${CMAKE_FIND_PACKAGE_NAME}_FOUND")
+
+set(_paraview_use_external_vtk "@PARAVIEW_USE_EXTERNAL_VTK@")
+set(_paraview_find_package_args)
+if (NOT _paraview_use_external_vtk)
+  list(APPEND _paraview_find_package_args
+    PATHS "${CMAKE_CURRENT_LIST_DIR}/vtk"
+    NO_DEFAULT_PATH)
+endif ()
+if (${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
+  list(APPEND _paraview_find_package_args
+    QUIET)
+endif ()
+find_package(VTK REQUIRED
+  ${_paraview_find_package_args})
+if (NOT VTK_FOUND)
+  set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 0)
+endif ()
+unset(_paraview_find_package_args)
+unset(_paraview_use_external_vtk)
+
+set(PARAVIEW_USE_QT "@PARAVIEW_USE_QT@")
+set(PARAVIEW_USE_MPI "@PARAVIEW_USE_MPI@")
+set(PARAVIEW_USE_PYTHON "@PARAVIEW_USE_PYTHON@")
+set(PARAVIEW_PLUGIN_SUBDIR "paraview@paraview_version_suffix@/plugins")
+
+if (PARAVIEW_USE_PYTHON)
+  set(PARAVIEW_PYTHONPATH "@PARAVIEW_PYTHON_SITE_PACKAGES_SUFFIX@")
+  include("${CMAKE_CURRENT_LIST_DIR}/ParaViewPython-targets.cmake")
+  # Unset this for now; these targets will be defined later.
+  unset("${CMAKE_FIND_PACKAGE_NAME}_FOUND")
+  unset("${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE")
+endif ()
+
+include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}-targets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}-vtk-module-properties.cmake")
+
+include("${CMAKE_CURRENT_LIST_DIR}/paraview-find-package-helpers.cmake" OPTIONAL)
+include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}-vtk-module-find-packages.cmake")
+
+include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}Plugins-paraview_plugins-targets-depends.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}Plugins-targets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}Plugins-paraview-plugin-properties.cmake")
+
+include("${CMAKE_CURRENT_LIST_DIR}/ParaViewTools-targets.cmake" OPTIONAL)
+
+include("${CMAKE_CURRENT_LIST_DIR}/ParaViewClient.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/ParaViewPlugin.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/ParaViewServerManager.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/ParaViewTesting.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/vtkModuleWrapClientServer.cmake")
+
+if (@PARAVIEW_USE_PYTHON@) # PARAVIEW_USE_PYTHON
+  include("${CMAKE_CURRENT_LIST_DIR}/paraview.modules-vtk-python-module-properties.cmake")
+endif ()
+
+if (@PARAVIEW_USE_QT@) # PARAVIEW_USE_QT
+  include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}Client-targets.cmake")
+  include("${CMAKE_CURRENT_LIST_DIR}/ParaView-client-xml.cmake")
+endif ()
+
+set(_paraview_components_to_check)
+foreach (_paraview_component IN LISTS "${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS")
+  if (DEFINED "${CMAKE_FIND_PACKAGE_NAME}_${_paraview_component}_FOUND")
+    # It was already not-found (likely due to `find-package` failures).
+  elseif (TARGET "${CMAKE_FIND_PACKAGE_NAME}::${_paraview_component}")
+    list(APPEND _paraview_components_to_check
+      "${_paraview_component}")
+  else ()
+    set("${CMAKE_FIND_PACKAGE_NAME}_${_paraview_component}_FOUND" 0)
+    list(APPEND "${CMAKE_FIND_PACKAGE_NAME}_${_paraview_component}_NOT_FOUND_MESSAGE"
+      "The ${_paraview_component} component is not available.")
+  endif ()
+endforeach ()
+unset(_paraview_component)
+
+set(_paraview_vtk_components)
+
+while (_paraview_components_to_check)
+  list(GET _paraview_components_to_check 0 _paraview_component)
+  list(REMOVE_AT _paraview_components_to_check 0)
+  if (DEFINED "${CMAKE_FIND_PACKAGE_NAME}_${_paraview_component}_FOUND")
+    # We've already made a determiniation.
+    continue ()
+  endif ()
+
+  get_property(_paraview_dependencies
+    TARGET    "${CMAKE_FIND_PACKAGE_NAME}::${_paraview_component}"
+    PROPERTY  "INTERFACE_paraview_module_depends")
+  string(REPLACE "${CMAKE_FIND_PACKAGE_NAME}::" "" _paraview_dependencies "${_paraview_dependencies}")
+  set(_paraview_all_dependencies_checked TRUE)
+  foreach (_paraview_dependency IN LISTS _paraview_dependencies)
+    # Handle VTK module dependencies.
+    string(FIND "${_paraview_component}" "VTK::" _paraview_vtk_idx)
+    if (NOT _paraview_vtk_idx EQUAL -1)
+      unset(_paraview_vtk_idx)
+      if (NOT TARGET "${_paraview_dependency}")
+        set("${CMAKE_FIND_PACKAGE_NAME}_${_paraview_component}_FOUND" 0)
+        list(APPEND "${CMAKE_FIND_PACKAGE_NAME}_${_paraview_component}_NOT_FOUND_MESSAGE"
+          "Failed to find the ${_paraview_dependency} module.")
+      endif ()
+      continue ()
+    endif ()
+    unset(_paraview_vtk_idx)
+
+    if (DEFINED "${CMAKE_FIND_PACKAGE_NAME}_${_paraview_dependency}_FOUND")
+      if (NOT ${CMAKE_FIND_PACKAGE_NAME}_${_paraview_dependency}_FOUND)
+        set("${CMAKE_FIND_PACKAGE_NAME}_${_paraview_component}_FOUND" 0)
+        list(APPEND "${CMAKE_FIND_PACKAGE_NAME}_${_paraview_component}_NOT_FOUND_MESSAGE"
+          "Failed to find the ${_paraview_dependency} component.")
+      endif ()
+    else ()
+      # Check its dependencies.
+      list(APPEND _paraview_components_to_check
+        "${_paraview_dependency}")
+      set(_paraview_all_found FALSE)
+    endif ()
+  endforeach ()
+  if (NOT DEFINED "${CMAKE_FIND_PACKAGE_NAME}_${_paraview_component}_FOUND")
+    if (_paraview_all_dependencies_checked)
+      set("${CMAKE_FIND_PACKAGE_NAME}_${_paraview_component}_FOUND" 1)
+    else ()
+      list(APPEND _paraview_components_to_check
+        "${_paraview_component}")
+    endif ()
+  endif ()
+  unset(_paraview_all_dependencies_checked)
+  unset(_paraview_dependency)
+  unset(_paraview_dependencies)
+endwhile ()
+unset(_paraview_component)
+unset(_paraview_components_to_check)
+
+set(_paraview_missing_components)
+foreach (_paraview_component IN LISTS "${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS")
+  if (NOT ${CMAKE_FIND_PACKAGE_NAME}_${_paraview_component}_FOUND AND ${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED_${_paraview_component})
+    list(APPEND _paraview_missing_components
+      "${_paraview_component}")
+  endif ()
+endforeach ()
+
+if (_paraview_missing_components)
+  list(REMOVE_DUPLICATES _paraview_missing_components)
+  list(SORT _paraview_missing_components)
+  string(REPLACE ";" ", " _paraview_missing_components "${_paraview_missing_components}")
+  set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 0)
+  set("${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE"
+    "Could not find the ${CMAKE_FIND_PACKAGE_NAME} package with the following required components: ${_paraview_missing_components}.")
+endif ()
+unset(_paraview_missing_components)
+
+set("${CMAKE_FIND_PACKAGE_NAME}_LIBRARIES")
+if (NOT DEFINED "${CMAKE_FIND_PACKAGE_NAME}_FOUND")
+  # If nothing went wrong, we've successfully found the package.
+  set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1)
+  # Build the `_LIBRARIES` variable.
+  foreach (_paraview_component IN LISTS "${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS")
+    list(APPEND "${CMAKE_FIND_PACKAGE_NAME}_LIBRARIES"
+      "${CMAKE_FIND_PACKAGE_NAME}::${_paraview_component}")
+  endforeach ()
+  unset(_paraview_component)
+endif ()
+
+set(CMAKE_PREFIX_PATH "${${CMAKE_FIND_PACKAGE_NAME}_CMAKE_PREFIX_PATH_save}")
+unset("${CMAKE_FIND_PACKAGE_NAME}_CMAKE_PREFIX_PATH_save")
+
+set(CMAKE_MODULE_PATH "${${CMAKE_FIND_PACKAGE_NAME}_CMAKE_MODULE_PATH_save}")
+unset(${CMAKE_FIND_PACKAGE_NAME}_CMAKE_MODULE_PATH_save)
+
+# Compatibility with old code.
+if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION)
+  set(PARAVIEW_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/paraview-use-file-deprecated.cmake")
+elseif (${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION VERSION_LESS 5.7)
+  set(PARAVIEW_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/paraview-use-file-compat.cmake")
+else ()
+  set(PARAVIEW_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/paraview-use-file-error.cmake")
+endif ()
+
+# 5.8 renamed these variables, so provide them if 5.8 is not the minimum
+# requested.
+if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION OR
+    ${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION VERSION_LESS "5.8")
+  set(PARAVIEW_BUILD_QT_GUI "${PARAVIEW_USE_QT}")
+  set(PARAVIEW_ENABLE_PYTHON "${PARAVIEW_USE_PYTHON}")
+endif ()
old mode 100644 (file)
new mode 100755 (executable)
index a7754a4..a7ab61b
@@ -1,23 +1,19 @@
 #!/bin/bash
 
 export CDMATH_INSTALL=@CMAKE_INSTALL_PREFIX@
-export PETSC_DIR=@PETSC_DIR@
+export PETSC_DIR=@PETSC_INSTALL@
 export PETSC_ARCH=@PETSC_ARCH@
-export PETSC_INCLUDES=@PETSC_INCLUDES_PATH@
-export PETSC_LIBRARIES=@PETSC_LIBRARIES@
-export SLEPC_DIR=@SLEPC_DIR@
-export SLEPC_INCLUDES=@SLEPC_INCLUDES@
-export SLEPC_LIBRARIES=@SLEPC_LIBRARIES@
+export PETSC_INCLUDES=@PETSC_INCLUDES_INSTALL@
+export PETSC_LIBRARIES=@PETSC_DIR@/@PETSC_ARCH@/lib
 export MEDFILE_ROOT_DIR=@MEDFILE_ROOT_DIR@
 export MEDFILE_INCLUDE_DIRS=@MEDFILE_INCLUDE_DIRS@
-export MEDFILE_C_LIBRARIES=@MEDFILE_C_LIBRARIES_PATH@
+export MEDFILE_LIBRARIES=@MEDFILE_ROOT_DIR@/lib
 export MEDCOUPLING_ROOT_DIR=@MEDCOUPLING_ROOT_DIR@
 export MEDCOUPLING_INCLUDE_DIR=@MEDCOUPLING_INCLUDE_DIR@
-export MEDCOUPLING_LIBRARIES=@MEDCOUPLING_LIBRARIES_PATH@
-export MEDCOUPLING_INSTALL_PYTHON=@MEDCOUPLING_INSTALL_PYTHON@
+export MEDCOUPLING_LIBRARIES=@MEDCOUPLING_LIBRARIES@
 export PV_LIB_DIR=@PV_LIB_DIR@
 export PV_PYTHON_DIR=@PV_PYTHON_DIR@
 
-export LD_LIBRARY_PATH=$CDMATH_INSTALL/lib:$CDMATH_INSTALL/lib/medcoupling:$CDMATH_INSTALL/lib/med:$PETSC_DIR/$PETSC_ARCH/lib:$PETSC_DIR/lib:$PETSC_LIBRARIES:$SLEPC_LIBRARIES:$PV_LIB_DIR:${LD_LIBRARY_PATH}
-export PYTHONPATH=$CDMATH_INSTALL/lib/cdmath:$CDMATH_INSTALL/bin/cdmath:$CDMATH_INSTALL/bin/cdmath/postprocessing:$CDMATH_INSTALL/$MEDCOUPLING_INSTALL_PYTHON:$PV_PYTHON_DIR:${PYTHONPATH}
+export LD_LIBRARY_PATH=$CDMATH_INSTALL/lib:$MEDCOUPLING_LIBRARIES:$MEDFILE_LIBRARIES:$PETSC_LIBRARIES:${PETSC_DIR}/${PETSC_ARCH}/lib:$PV_LIB_DIR:${LD_LIBRARY_PATH}
+export PYTHONPATH=$CDMATH_INSTALL/lib/cdmath:$CDMATH_INSTALL/bin/cdmath:$CDMATH_INSTALL/bin/cdmath/postprocessing:$CDMATH_INSTALL/$PV_PYTHON_DIR:$MEDCOUPLING_LIBRARIES:$MEDFILE_LIBRARIES:$PETSC_LIBRARIES:${PETSC_DIR}/${PETSC_ARCH}/lib:${PYTHONPATH}
 
old mode 100644 (file)
new mode 100755 (executable)
index 0c7ec51..cb01f87
@@ -1,4 +1,7 @@
+INCLUDE_DIRECTORIES(
+  ${SLEPC_INCLUDES}
+)
 
-FILE(GLOB include_linearsolver_HXX . *.hxx)
+FILE(GLOB include_linearsolver_HXX . *.hxx  )
 
 INSTALL(FILES ${include_linearsolver_HXX} DESTINATION include)
index 704f79e384cf5bc381139b0d579396e74c8d3faa..d06cd262f9e3a4dd7d69654c93ae0b6998f585b4 100755 (executable)
@@ -14,6 +14,7 @@
 #include "MEDCouplingUMesh.hxx"
 #include "Vector.hxx"
 #include <petsc.h>
+
 #include <slepceps.h>
 #include <slepcsvd.h>
 
old mode 100644 (file)
new mode 100755 (executable)
index 54a471c..bbf20ef
@@ -7,10 +7,6 @@ INCLUDE_DIRECTORIES(
   ${SLEPC_INCLUDES}
 )
 
-IF (CMAKE_CDMATH_TESTS)
-  SET(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage")
-ENDIF (CMAKE_CDMATH_TESTS)
-
 FILE(GLOB src_linearsolver_CXX . *.cxx)
 ADD_LIBRARY(linearsolver SHARED ${src_linearsolver_CXX} ${MPI_CXX_LIBRARIES})
 
old mode 100644 (file)
new mode 100755 (executable)
index 38e09a9..752f15c
@@ -245,9 +245,9 @@ class Field
 
     DoubleTab getNormEuclidean( void ) const ;
 
-    double max( void ) const ;
+    double max( int component=0 ) const ;
 
-    double min( void ) const ;
+    double min( int component=0 ) const ;
 
     void setTime ( double time, int iter );
 
@@ -295,11 +295,18 @@ class Field
 
     /**
      * Computes the maximum of each component of the field
-     * The field may be multicomponent so the result of the function
+     * The field may be multicomponent so the result of the function is a vector
      * return the vector of numerical value of the Linfinity norm of each component of the field
      */
     Vector normMax() const;
 
+    /**
+     * Computes the maximum of each component of the field as well as the index where the maximum was found
+     * The field may be multicomponent so the result of the function is a vector of values and a vector of indices
+     * return the vector of numerical value of the Linfinity norm of each component of the field AND the corresponding vector of indices
+     */
+    Vector componentMax(Vector & Indices) const;
+
     const Field& operator= ( const Field& f ) ;
 
     Field operator+ ( const Field& f ) const ;
old mode 100644 (file)
new mode 100755 (executable)
index 4314379..64044f6
@@ -409,29 +409,29 @@ Field::getNormEuclidean() const
 }
 
 double
-Field::max() const
+Field::max(int component) const
 {
-       if( getNumberOfComponents() !=1)
-               throw CdmathException("double Field::max() : field should have a single component in order to extract maximum value");
+       if( component >= getNumberOfComponents() )
+               throw CdmathException("double Field::max() : component number should be smaller than field number of components");
                
-       double result=0;
+       double result=-1e100;
        for(int i=0; i<getNumberOfElements() ; i++)
-               if( result < (*this)(i,0))
-                       result = (*this)(i,0);
+               if( result < (*this)(i,component))
+                       result = (*this)(i,component);
 
        return result;
 }
 
 double
-Field::min() const
+Field::min(int component) const
 {
-       if( getNumberOfComponents() !=1)
-               throw CdmathException("double Field::min() : field should have a single component in order to extract minimum value");
+       if( component >= getNumberOfComponents() )
+               throw CdmathException("double Field::min() : component number should be smaller than field number of components");
                
        double result=1e100;
        for(int i=0; i<getNumberOfElements() ; i++)
-               if( result > (*this)(i,0))
-                       result = (*this)(i,0);
+               if( result > (*this)(i,component))
+                       result = (*this)(i,component);
 
        return result;
 }
@@ -557,6 +557,24 @@ Field::normMax ( ) const
        return result;
 }
 
+Vector 
+Field::componentMax(Vector & Indices) const
+{
+       int nbComp=_field->getNumberOfComponents();
+       int nbElems=getNumberOfElements();
+
+       Vector result(nbComp);//Vector containing the Linfinity norm of each component
+
+       for(int i=0; i<nbElems ; i++)
+        for(int j=0; j<nbComp ; j++)
+            if(fabs((*this)(i,j))>result(j))
+            {
+                result(j)=fabs((*this)(i,j));
+                Indices(j)=i;
+            }
+       return result;    
+}
+
 //----------------------------------------------------------------------
 double&
 Field::operator() ( int ielem )
old mode 100644 (file)
new mode 100755 (executable)
index bf46a56..2891699
@@ -64,9 +64,9 @@ def Slice_PV_field_data_to_numpyArray(field,
     inputFileName = field.getName()
     field.writeVTK(inputFileName)
  
-    numpy_array = Slice_PV_data_to_numpyArray(inputFileName+"_0.vtu", point, normal, resolution)
+    numpy_array = Slice_PV_data_to_numpyArray(inputFileName+"_1.vtu", point, normal, resolution)
 
-    os.remove(inputFileName+"_0.vtu")
+    os.remove(inputFileName+"_1.vtu")
     return numpy_array
 
 def Slice_PV_field_data_to_txt_file(field, outputFileName,
old mode 100644 (file)
new mode 100755 (executable)
index 14a00b8..7022789
@@ -39,9 +39,9 @@ def Extract_field_data_over_line_to_numpyArray(field, point1, point2, resolution
     inputFileName = field.getName()#os.getcwd()+field.get_name()
     field.writeVTK(inputFileName)
 
-    numpy_array = Extract_VTK_data_over_line_to_numpyArray(inputFileName+"_0.vtu", point1, point2, resolution)
+    numpy_array = Extract_VTK_data_over_line_to_numpyArray(inputFileName+"_1.vtu", point1, point2, resolution)
 
-    os.remove(inputFileName+"_0.vtu")
+    os.remove(inputFileName+"_1.vtu")
     return numpy_array
 
 def Extract_field_data_over_line_to_txt_file(field, point1, point2, resolution, outputFileName):
@@ -89,9 +89,9 @@ def Slice_field_data_to_numpyArray(field,
     inputFileName = field.getName()
     field.writeVTK(inputFileName)
  
-    numpy_array = Slice_VTK_data_to_numpyArray(inputFileName+"_0.vtu", point, normal, resolution)
+    numpy_array = Slice_VTK_data_to_numpyArray(inputFileName+"_1.vtu", point, normal, resolution)
 
-    os.remove(inputFileName+"_0.vtu")
+    os.remove(inputFileName+"_1.vtu")
     return numpy_array
 
 def Slice_field_data_to_txt_file(field, outputFileName,
old mode 100644 (file)
new mode 100755 (executable)
index 73af47c..c153857
@@ -1,5 +1,12 @@
 INCLUDE(${SWIG_USE_FILE})
 
+INCLUDE_DIRECTORIES(
+  ${Python_INCLUDE_DIRS}
+  ${MEDCOUPLING_INCLUDE_DIR}
+  ${BASE_DIR}/inc
+  ${MESH_DIR}/inc
+)
+
 SET(_extra_lib_SWIG)
 if (CDMATH_WITH_PETSC)
     INCLUDE_DIRECTORIES(
@@ -19,18 +26,21 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/swig/cdmath.i PROPERTIES CPLUSPL
 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/swig/cdmath.i PROPERTIES C OFF)
 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/swig/cdmath.i PROPERTIES SWIG_DEFINITIONS "-shadow")
 
-INCLUDE_DIRECTORIES(
-  ${PYTHON_INCLUDE_DIRS}
-  ${MEDCOUPLING_INCLUDE_DIR}
-  ${BASE_DIR}/inc
-  ${MESH_DIR}/inc
-)
-IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
+#Trying to remove warnings due to cmake policies cmp0078 and cmp0086
+IF   (${CMAKE_VERSION} VERSION_GREATER "3.13.0")
+  cmake_policy(SET CMP0078 NEW)
+  IF   (${CMAKE_VERSION} VERSION_GREATER "3.14.0")
+    cmake_policy(SET CMP0086 NEW)
+  ENDIF(${CMAKE_VERSION} VERSION_GREATER "3.14.0")
+ENDIF(${CMAKE_VERSION} VERSION_GREATER "3.13.0")
+
+IF   (${CMAKE_VERSION} VERSION_LESS "3.8.0") 
   SWIG_ADD_MODULE(cdmath python ${CMAKE_BINARY_DIR}/swig/cdmath.i)
-ELSE()
+ELSE (${CMAKE_VERSION} VERSION_LESS "3.8.0") 
   SWIG_ADD_LIBRARY(cdmath TYPE SHARED LANGUAGE python SOURCES ${CMAKE_BINARY_DIR}/swig/cdmath.i)
-ENDIF()
-SWIG_LINK_LIBRARIES(cdmath ${PYTHON_LIBS} base mesh ${medloader} ${medcoupling} ${_extra_lib_SWIG})
+ENDIF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
+SWIG_LINK_LIBRARIES(cdmath ${Python_LIBRARIES} base mesh ${medloader} ${medcoupling} ${_extra_lib_SWIG})
 
 INSTALL(TARGETS _cdmath DESTINATION lib/cdmath)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/cdmath.py DESTINATION bin/cdmath)
old mode 100644 (file)
new mode 100755 (executable)
index 648c8db..d476cdf
@@ -1,10 +1,8 @@
-# nom du projet tests
+# Nom du projet tests
 PROJECT(tests)
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 
 IF (CDMATH_WITH_TESTS)
-  ADD_SUBDIRECTORY(cdmath)
-
   INCLUDE_DIRECTORIES(
     ${MEDCOUPLING_INCLUDE_DIR}
     ${BASE_DIR}/inc
@@ -12,44 +10,49 @@ IF (CDMATH_WITH_TESTS)
     cdmath
     )
 
-  SET(_extra_lib_TESTS)
-  if (CDMATH_WITH_PETSC)
-      INCLUDE_DIRECTORIES(
-        ${LINEARSOLVER_DIR}/inc
-        ${PETSC_INCLUDES}
-        ${SLEPC_INCLUDES}
-        )
-      SET(_extra_lib_TESTS linearsolver ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
-  endif (CDMATH_WITH_PETSC)
-
   SET(MAIN_SOURCES
     MainTests.cxx
     )
 
   ADD_EXECUTABLE(TestCDMATH ${MAIN_SOURCES})
 
-  if (CDMATH_WITH_PETSC)
-     SET_TARGET_PROPERTIES(TestCDMATH PROPERTIES COMPILE_FLAGS -DCDMATH_WITH_PETSC)
-  else(CDMATH_WITH_PETSC)
-     SET_TARGET_PROPERTIES(TestCDMATH PROPERTIES COMPILE_FLAGS "")
-  endif (CDMATH_WITH_PETSC)
+  if  (CDMATH_WITH_PETSC)
+      INCLUDE_DIRECTORIES(
+        ${LINEARSOLVER_DIR}/inc
+        ${PETSC_INCLUDES}
+        ${SLEPC_INCLUDES}
+        )
+      SET(_extra_lib_TESTS linearsolver ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
+      SET_TARGET_PROPERTIES(TestCDMATH PROPERTIES COMPILE_FLAGS -DCDMATH_WITH_PETSC)
+      SET(TESTS_LIBRARY_PATH ${CMAKE_BINARY_DIR}/base/lib:${CMAKE_BINARY_DIR}/mesh/lib:${CMAKE_BINARY_DIR}/linearsolver/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT}/lib ) 
+  else (CDMATH_WITH_PETSC)
+      SET(_extra_lib_TESTS)
+      SET_TARGET_PROPERTIES(TestCDMATH PROPERTIES COMPILE_FLAGS "")
+      SET(TESTS_LIBRARY_PATH ${CMAKE_BINARY_DIR}/base/lib:${CMAKE_BINARY_DIR}/mesh/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT}/lib ) 
+  endif(CDMATH_WITH_PETSC)
+
+  if   (CDMATH_WITH_PYTHON)
+    SET(TESTS_PYTHON_PATH ${CMAKE_BINARY_DIR}/swig:${CMAKE_BINARY_DIR}/postprocessing ) 
+  endif(CDMATH_WITH_PYTHON)
 
   TARGET_LINK_LIBRARIES(TestCDMATH TestMesh base mesh ${CPPUNIT_LIBS} ${_extra_lib_TESTS})
 
   ADD_TEST(UnitTestCDMATH TestCDMATH)
-  SET_PROPERTY(TEST UnitTestCDMATH PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib")
+  SET_PROPERTY(TEST UnitTestCDMATH PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}")
+  INSTALL(TARGETS TestCDMATH DESTINATION tests/unit_tests)
+
+  ADD_SUBDIRECTORY(cdmath)
+
+  IF (CDMATH_WITH_PYTHON)
+    ADD_SUBDIRECTORY(swig)
+  ENDIF (CDMATH_WITH_PYTHON)
 
-  INSTALL(TARGETS TestCDMATH DESTINATION bin/tests)
 ENDIF (CDMATH_WITH_TESTS)
 
 ADD_SUBDIRECTORY(ressources)
 
-IF (CDMATH_WITH_PYTHON)
-  ADD_SUBDIRECTORY(swig)
-ENDIF (CDMATH_WITH_PYTHON)
-
-FILE(COPY doc/ DESTINATION convergence)
-INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/convergence DESTINATION share/doc/)
+FILE(COPY doc/ DESTINATION convergence_tests)
+INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/convergence_tests DESTINATION doc/)
 
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
   # Examples tests
@@ -62,6 +65,8 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
   add_custom_target (examples COMMAND ctest -R Example)# may be replace ctest -R with ctest -L
   add_custom_target (validation COMMAND ctest -R validation)# may be replace ctest -R with ctest -L
 
+  add_custom_target (spectrum COMMAND ctest -R Spectrum)# may be replace ctest -R with ctest -L
+  add_custom_target (beltrami COMMAND ctest -R Beltrami)# may be replace ctest -R with ctest -L
   add_custom_target (poisson COMMAND ctest -R Poisson)# may be replace ctest -R with ctest -L
   add_custom_target (diffusion COMMAND ctest -R Diffusion)# may be replace ctest -R with ctest -L
   add_custom_target (transport COMMAND ctest -R Transport)# may be replace ctest -R with ctest -L
@@ -77,6 +82,8 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
   add_custom_target (noscaling COMMAND ctest -R no_scaling)# may be replace ctest -R with ctest -L
   add_custom_target (2D COMMAND ctest -R 2D)# may be replace ctest -R with ctest -L
   add_custom_target (3D COMMAND ctest -R 3D)# may be replace ctest -R with ctest -L
+  add_custom_target (FE COMMAND ctest -R FE)# may be replace ctest -R with ctest -L
+  add_custom_target (FV COMMAND ctest -R FV)# may be replace ctest -R with ctest -L
   add_custom_target (shock COMMAND ctest -R Shock)# may be replace ctest -R with ctest -L
   add_custom_target (vortex COMMAND ctest -R Vortex)# may be replace ctest -R with ctest -L
   add_custom_target (riemann COMMAND ctest -R RiemannProblem)# may be replace ctest -R with ctest -L
old mode 100644 (file)
new mode 100755 (executable)
index 6082e01..c55cf74
@@ -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 lib)
+INSTALL(TARGETS TestMesh DESTINATION tests/unit_tests)
old mode 100644 (file)
new mode 100755 (executable)
index 2e1009b..ed8ef4f
@@ -129,13 +129,13 @@ SparseMatrixPetscTests::testClassSparseMatrixPetsc( void )
        CPPUNIT_ASSERT_DOUBLES_EQUAL( 2, vp[1],1.e-5);
 
        std::vector< Vector > Vp = A.getEigenvectors(2);
-       CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, Vp[0][0] - Vp[0][1],1.e-5);
-       CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, Vp[1][0] + Vp[1][1],1.e-5);
+       CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, abs(Vp[0][0]) - abs(Vp[0][1]),1.e-5);
+       CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, abs(Vp[1][0]) - abs(Vp[1][1]),1.e-5);
 
        MEDCoupling::DataArrayDouble * VpArrayDouble = A.getEigenvectorsDataArrayDouble(2);
        const double *values=VpArrayDouble->getConstPointer();
-       CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, values[0] + values[1],1.e-5);
-       CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, values[2] - values[3],1.e-5);
+       CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, abs(values[0]) - abs(values[1]),1.e-5);
+       CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, abs(values[2]) - abs(values[3]),1.e-5);
 
     A.setValue(0,0,-1.);
     A.setValue(0,1, 1.);
old mode 100644 (file)
new mode 100755 (executable)
index 61b9730..bc472d8
@@ -44,7 +44,7 @@ def Flux_Godunov2(u_l, u_r):
     elif (u_l*u_l>u_r*u_r):
         flux = max(1./3.*u_l*u_l*u_l,1./3.*u_r*u_r*u_r)
     else:
-        print "u_l ",u_l, " u_r ", u_r
+        print( "u_l ",u_l, " u_r ", u_r )
     return flux
 
 def Du_ncsv(u_l, u_i, u_r):
old mode 100644 (file)
new mode 100755 (executable)
index ead83ae..003c184
@@ -5,13 +5,13 @@ file(GLOB NICE_EXAMPLES_TO_INSTALL
   TransportEquation
   Poisson1DEF Poisson2DEF Poisson2DEF_DISK Poisson2DEF_DISK_StiffBC Poisson2DEF_SQUARE_StiffBC Poisson1DVF Poisson2DVF Poisson2DVF_DISK Poisson2DVF_DISK_StiffBC Poisson3DEF Poisson3DEF_BALL Poisson3DVF Poisson3DVF_BALL Poisson3DEF_RadiatorAndWindow
   Poisson3DSphereEF Poisson3DTorusEF Poisson3DCubeSkinEF # Laplace-Beltrami on surface
-    Laplace-BeltramiSpectrum3DEF #Spectrum of Laplace operator
+  SpectrumLaplace2DEF  SpectrumLaplace2DVF  SpectrumLaplaceBeltrami3DEF #Spectrum of Laplace operator
   WaveSystem1DUpwind WaveSystem1DUpwind_RiemannProblem WaveSystem1Staggered_RiemannProblem WaveSystem2DUpwind_RiemannProblem
 WaveSystem_Stationary/WaveSystemUpwind WaveSystem_Stationary/WaveSystemCentered WaveSystem_Stationary/WaveSystemPStag WaveSystem_Stationary/WaveSystemStaggered 
 WaveSystem_Shock/WaveSystemUpwind WaveSystem_Shock/WaveSystemCentered WaveSystem_Shock/WaveSystemPStag WaveSystem_Shock/WaveSystemStaggered 
 )
 
-install(DIRECTORY ${NICE_EXAMPLES_TO_INSTALL} DESTINATION share/examples)
+install(DIRECTORY ${NICE_EXAMPLES_TO_INSTALL} DESTINATION examples)
 
 IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     ADD_SUBDIRECTORY(TransportEquation1DUpwindExplicit)
@@ -34,7 +34,9 @@ IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     ADD_SUBDIRECTORY(Poisson3DSphereEF)
     ADD_SUBDIRECTORY(Poisson3DTorusEF)
     ADD_SUBDIRECTORY(Poisson3DCubeSkinEF)
-    ADD_SUBDIRECTORY(Laplace-BeltramiSpectrum3DEF)
+    ADD_SUBDIRECTORY(SpectrumLaplace2DEF)
+    ADD_SUBDIRECTORY(SpectrumLaplace2DVF)
+    ADD_SUBDIRECTORY(SpectrumLaplaceBeltrami3DEF)
     ADD_SUBDIRECTORY(Poisson3DEF)
     ADD_SUBDIRECTORY(Poisson3DEF_RadiatorAndWindow)
     ADD_SUBDIRECTORY(Poisson3DEF_BALL)
old mode 100644 (file)
new mode 100755 (executable)
index 821ab64..7e96b52
@@ -21,100 +21,100 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     SET(MESH_FILE  ../../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/meshCube.med  )
 
     ADD_TEST(ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/cubeWithCubes.med  )
 
     ADD_TEST(ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindExplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(IMPLICIT_SCHEME  1 )
 
     SET(MESH_FILE  ../../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/meshCube.med  )
 
     ADD_TEST(ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/cubeWithCubes.med  )
 
     ADD_TEST(ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleEulerSystem_2DShock_UpwindImplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index f27e3a1..01e2467
@@ -27,7 +27,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_shock(my_mesh, isCircle):
-    print "Initial data : Spherical wave"
+    print( "Initial data : Spherical wave" )
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -87,7 +87,7 @@ def jacobianMatrices(normale,coeff,rho_l,q_l,rho_r,q_r):
     u_l = q_l/rho_l;
     u_r = q_r/rho_r;
     if rho_l<0 or rho_r<0 :
-        print "rho_l=",rho_l, " rho_r= ",rho_r
+        print( "rho_l=",rho_l, " rho_r= ",rho_r )
         raise ValueError("Negative density")
     u = (u_l*sqrt(rho_l)+u_r*sqrt(rho_r))/(sqrt(rho_l)+sqrt(rho_r));   
     un=u*normale;
@@ -184,7 +184,7 @@ def computeDivergenceMatrix(my_mesh,implMat,Un):
                     implMat.addValue(j*nbComp,cellAutre*nbComp,Am)
                     implMat.addValue(j*nbComp,        j*nbComp,Am*(-1.))
                 elif(Fk.getGroupName() != "Neumann"):#Nothing to do for Neumann boundary condition
-                    print Fk.getGroupName()
+                    print( Fk.getGroupName() )
                     raise ValueError("computeFluxes: Unknown boundary condition name");
             
             maxAbsEigVa = max(maxAbsEigVa,abs(un+c0),abs(un-c0));
@@ -209,7 +209,7 @@ def EulerSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, i
     elif(filename.find("disk")>-1 or filename.find("Disk")>-1):
         pressure_field, velocity_field = initial_conditions_shock(my_mesh,True)
     else:
-        print "Mesh name : ", filename
+        print( "Mesh name : ", filename )
         raise ValueError("Mesh name should contain substring square, cube or disk")
 
     #iteration vectors
@@ -252,7 +252,7 @@ def EulerSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, i
             LS.setSndMember(Un)
             Un=LS.solve();
             if(not LS.getStatus()):
-                print "Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations"
+                print( "Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations")
                 raise ValueError("Pas de convergence du système linéaire");
             dUn-=Un
 
@@ -281,12 +281,12 @@ def EulerSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, i
             velocity_field.writeVTK("EulerSystem"+str(dim)+"DUpwind"+"_isImplicit"+str(isImplicit)+meshName+"_velocity",False);
 
     print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt))
-    print
+    print()
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint")
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time)
 
         pressure_field.setTime(time,0);
         pressure_field.writeVTK("EulerSystem"+str(dim)+"DUpwind"+"_isImplicit"+str(isImplicit)+meshName+"_pressure_Stat");
@@ -301,17 +301,17 @@ def EulerSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, i
         PV_routines.Save_PV_data_to_picture_file("EulerSystem"+str(dim)+"DUpwind"+"_isImplicit"+str(isImplicit)+meshName+"_velocity_Stat"+'_0.vtu',"Velocity",'CELLS',"EulerSystem"+str(dim)+"DUpwind"+meshName+"_velocity_Stat")
         
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint")
 
 
 def solve(my_mesh,filename,resolution, isImplicit):
-    print "Resolution of the Euler system in dimension ", my_mesh.getSpaceDimension()
+    print( "Resolution of the Euler system in dimension ", my_mesh.getSpaceDimension())
     if( my_mesh.getSpaceDimension()!=2):
         raise ValueError("Only dimension 2 simulations allowed")
-    print "Numerical method : upwind"
-    print "Initial data : spherical wave"
-    print "Wall boundary conditions"
-    print "Mesh name : ",filename , my_mesh.getNumberOfCells(), " cells"
+    print( "Numerical method : upwind")
+    print( "Initial data : spherical wave")
+    print( "Wall boundary conditions")
+    print( "Mesh name : ",filename , my_mesh.getNumberOfCells(), " cells")
 
     # Problem data
     tmax = 1.
old mode 100644 (file)
new mode 100755 (executable)
index bfe7c70..658941e
@@ -21,7 +21,7 @@ import sys
 from copy import deepcopy
 
 def HeatEquation1DExplicit(nx,cfl):
-    print "Simulation of 1D heat equation with an explicit scheme"
+    print( "Simulation of 1D heat equation with an explicit scheme")
 
     ##################### Simulation parameters
     a = 0.0 # space domain :  a <= x <= b
@@ -92,10 +92,10 @@ def HeatEquation1DExplicit(nx,cfl):
                 plt.savefig("HeatEquation1D_Explicit_"+str(nx)+"Cells_CFL"+str(cfl)+"_ResultField_"+str(it)+".png")
                 #plt.show()
 
-    print "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u)
-    print "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u)
-    print "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)])
-    print "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)])        
+    print( "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u) )
+    print( "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u) )
+    print( "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]) )
+    print( "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)])        )
     
     print("Simulation of heat equation with explicit scheme done.")
     
old mode 100644 (file)
new mode 100755 (executable)
index 64532b0..0090e51
@@ -30,7 +30,7 @@ def implicitSchemeMatrix(nx,cfl):
     return implMat
 
 def HeatEquation1DImplicit(nx,cfl):
-    print "Simulation of 1D heat equation with an implicit scheme"
+    print( "Simulation of 1D heat equation with an implicit scheme")
 
     ##################### Simulation parameters
     a = 0.0 # space domain :  a <= x <= b
@@ -96,7 +96,7 @@ def HeatEquation1DImplicit(nx,cfl):
             LS.setSndMember(Un)
             Un=LS.solve()
             if(not LS.getStatus()):
-                print "Linear system did not converge ", iterGMRES, " GMRES iterations"
+                print( "Linear system did not converge ", iterGMRES, " GMRES iterations" )
                 raise ValueError("Pas de convergence du système linéaire");
             for i in range(nx):
                 u[i]=Un[i]
@@ -117,10 +117,10 @@ def HeatEquation1DImplicit(nx,cfl):
                 plt.savefig("HeatEquation1D_Implicit_"+str(nx)+"Cells_CFL"+str(cfl)+"_ResultField_"+str(it)+".png")
                 #plt.show()
 
-    print "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u)
-    print "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u)
-    print "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)])
-    print "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)])        
+    print( "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u) )
+    print( "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u) )
+    print( "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]) )
+    print( "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)]) ) 
     
     print("Simulation of heat equation with implicit scheme done.")
     
old mode 100644 (file)
new mode 100755 (executable)
index 29ed476..c9b03c3
@@ -4,8 +4,8 @@ install(FILES ${MESH_MED} DESTINATION share/examples/Poisson1DEF)
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_1DEF ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements1DPoisson.py)
-    SET_PROPERTY(TEST ExamplePoisson_1DEF PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_1DEF 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}:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_1DEF PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_1DEF APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 1222963..8e8286e
@@ -110,9 +110,9 @@ print("Linear system matrix building done")
 LS=cdmath.LinearSolver(Rigidite,RHS,100,1.E-6,"CG","ILU")#Remplacer CG par CHOLESKY pour solveur direct
 SolSyst=LS.solve()
 
-print "Preconditioner used : ", LS.getNameOfPc()
-print "Number of iterations used : ", LS.getNumberOfIter()
-print "Final residual : ", LS.getResidu()
+print( "Preconditioner used : ", LS.getNameOfPc() )
+print( "Number of iterations used : ", LS.getNumberOfIter() )
+print( "Final residual : ", LS.getResidu() )
 print("Linear system solved")
 
 # Création du champ résultat
@@ -156,7 +156,7 @@ for i in range(nbNodes) :
 
 print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
 print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)
-print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
-print ("Maximum exact solution = ", my_RHSfield.max()/(pi*pi), " Minimum exact solution = ", my_RHSfield.min()/(pi*pi))
+print("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
+print("Maximum exact solution = ", my_RHSfield.max()/(pi*pi), " Minimum exact solution = ", my_RHSfield.min()/(pi*pi))
 
 assert erreur_abs/max_abs_sol_exacte <1.
old mode 100644 (file)
new mode 100755 (executable)
index 5fc47de..6f78283
@@ -2,8 +2,8 @@
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_1DVF_uniform ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes1DPoisson.py )
-    SET_PROPERTY(TEST ExamplePoisson_1DVF_uniform PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_1DVF_uniform APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_1DVF_uniform PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_1DVF_uniform APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 64fbe0a..db077ed
@@ -50,7 +50,7 @@ for i in range(nbCells):
        maxNbNeighbours= max(1+Ci.getNumberOfFaces(),maxNbNeighbours)
 
 print("Right hand side discretisation done")
-print "Max nb of neighbours = ", maxNbNeighbours
+print( "Max nb of neighbours = ", maxNbNeighbours )
 
 # Construction de la matrice et du vecteur second membre du système linéaire
 #===========================================================================
@@ -84,10 +84,10 @@ print("Linear system matrix building done")
 LS=cdmath.LinearSolver(Rigidite,RHS,100,1.E-6,"GMRES","ILU")
 SolSyst=LS.solve()
 
-print "Preconditioner used : ", LS.getNameOfPc()
-print "Number of iterations used : ", LS.getNumberOfIter()
-print "Final residual : ", LS.getResidu()
-print "Linear system solved"
+print( "Preconditioner used : ", LS.getNameOfPc() )
+print( "Number of iterations used : ", LS.getNumberOfIter() )
+print( "Final residual : ", LS.getResidu() )
+print( "Linear system solved")
 
 # Création du champ résultat
 #===========================
@@ -133,7 +133,7 @@ for i in range(nbCells) :
 
 print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
 print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)
-print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
-print ("Maximum exact solution = ", my_RHSfield.max()/(pi*pi), " Minimum exact solution = ", my_RHSfield.min()/(pi*pi))
+print("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
+print("Maximum exact solution = ", my_RHSfield.max()/(pi*pi), " Minimum exact solution = ", my_RHSfield.min()/(pi*pi))
 
 assert erreur_abs/max_abs_sol_exacte <1.
old mode 100644 (file)
new mode 100755 (executable)
index b95971a..8a3094e
@@ -9,8 +9,8 @@ install(FILES ${MESH_MED} DESTINATION share/examples/Poisson2DEF)
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_2DEF_SQUARE ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements2DPoisson_SQUARE.py)
-    SET_PROPERTY(TEST ExamplePoisson_2DEF_SQUARE PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DEF_SQUARE 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}:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DEF_SQUARE PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DEF_SQUARE APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 4e59897..3e6b99d
@@ -9,8 +9,8 @@ install(FILES ${MESH_MED} DESTINATION share/examples/Poisson2DEF_DISK)
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_2DEF_DISK ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements2DPoisson_DISK.py)
-    SET_PROPERTY(TEST ExamplePoisson_2DEF_DISK PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DEF_DISK 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}:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DEF_DISK PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DEF_DISK APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 94ccfec..6b8d6d0
@@ -123,9 +123,9 @@ print("Linear system matrix building done")
 LS=cdmath.LinearSolver(Rigidite,RHS,100,1.E-6,"CG","ILU")#Remplacer CG par CHOLESKY pour solveur direct
 SolSyst=LS.solve()
 
-print "Preconditioner used : ", LS.getNameOfPc()
-print "Number of iterations used : ", LS.getNumberOfIter()
-print "Final residual : ", LS.getResidu()
+print( "Preconditioner used : ", LS.getNameOfPc() )
+print( "Number of iterations used : ", LS.getNumberOfIter() )
+print( "Final residual : ", LS.getResidu() )
 print("Linear system solved")
 
 # Création du champ résultat
old mode 100644 (file)
new mode 100755 (executable)
index 0e909c5..e5d5d9a
@@ -9,8 +9,8 @@ install(FILES ${MESH_MED} DESTINATION share/examples/Poisson2DEF_DISK_StiffBC)
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_2DEF_DISK_StiffBC ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements2DPoisson_DISK_StiffBC.py)
-    SET_PROPERTY(TEST ExamplePoisson_2DEF_DISK_StiffBC PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DEF_DISK_StiffBC 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}:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DEF_DISK_StiffBC PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DEF_DISK_StiffBC APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index e2a4ad0..d7e4ca2
@@ -174,10 +174,10 @@ print("Linear system matrix building done")
 LS=cdmath.LinearSolver(Rigidite,RHS,100,1.E-6,"CG","ILU")#Remplacer CG par CHOLESKY pour solveur direct
 SolSyst=LS.solve()
 
-print "Preconditioner used : ", LS.getNameOfPc()
-print "Number of iterations used : ", LS.getNumberOfIter()
-print "Final residual : ", LS.getResidu()
-print("Linear system solved")
+print( "Preconditioner used : ", LS.getNameOfPc() )
+print( "Number of iterations used : ", LS.getNumberOfIter() )
+print( "Final residual : ", LS.getResidu() )
+print( "Linear system solved")
 
 # Création du champ résultat
 #===========================
@@ -216,7 +216,7 @@ l2_error = (my_ExactSol - my_ResultField).normL2()[0]
 
 print("L2 absolute error = norm( exact solution - numerical solution ) = ",l2_error )
 print("L2 relative error = norm( exact solution - numerical solution )/norm( exact solution ) = ",l2_error/l2_norm_sol_exacte)
-print ("Maximum numerical solution = ", my_ResultField.max(), " Minimum numerical solution = ", my_ResultField.min())
-print ("Maximum exact solution = ", my_ExactSol.max(), " Minimum exact solution = ", my_ExactSol.min())
+print("Maximum numerical solution = ", my_ResultField.max(), " Minimum numerical solution = ", my_ResultField.min())
+print("Maximum exact solution = ", my_ExactSol.max(), " Minimum exact solution = ", my_ExactSol.min())
 
 assert l2_error/l2_norm_sol_exacte <1.
old mode 100644 (file)
new mode 100755 (executable)
index e22fc5a..42bdb57
@@ -9,8 +9,8 @@ install(FILES ${MESH_MED} DESTINATION share/examples/Poisson2DEF_SQUARE_StiffBC)
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_2DEF_SQUARE_StiffBC ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements2DPoisson_SQUARE_StiffBC.py)
-    SET_PROPERTY(TEST ExamplePoisson_2DEF_SQUARE_StiffBC PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DEF_SQUARE_StiffBC 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}:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DEF_SQUARE_StiffBC PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DEF_SQUARE_StiffBC APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 9360d13..1911238
@@ -173,10 +173,10 @@ print("Linear system matrix building done")
 LS=cdmath.LinearSolver(Rigidite,RHS,100,1.E-6,"CG","ILU")#Remplacer CG par CHOLESKY pour solveur direct
 SolSyst=LS.solve()
 
-print "Preconditioner used : ", LS.getNameOfPc()
-print "Number of iterations used : ", LS.getNumberOfIter()
-print "Final residual : ", LS.getResidu()
-print("Linear system solved")
+print( "Preconditioner used : ", LS.getNameOfPc() )
+print( "Number of iterations used : ", LS.getNumberOfIter() )
+print( "Final residual : ", LS.getResidu() )
+print( "Linear system solved")
 
 # Création du champ résultat
 #===========================
@@ -215,7 +215,7 @@ l2_error = (my_ExactSol - my_ResultField).normL2()[0]
 
 print("L2 absolute error = norm( exact solution - numerical solution ) = ",l2_error )
 print("L2 relative error = norm( exact solution - numerical solution )/norm( exact solution ) = ",l2_error/l2_norm_sol_exacte)
-print ("Maximum numerical solution = ", my_ResultField.max(), " Minimum numerical solution = ", my_ResultField.min())
-print ("Maximum exact solution = ", my_ExactSol.max(), " Minimum exact solution = ", my_ExactSol.min())
+print("Maximum numerical solution = ", my_ResultField.max(), " Minimum numerical solution = ", my_ResultField.min())
+print("Maximum exact solution = ", my_ExactSol.max(), " Minimum exact solution = ", my_ExactSol.min())
 
 assert l2_error/l2_norm_sol_exacte <1.
old mode 100644 (file)
new mode 100755 (executable)
index 86bd872..6c4dd87
@@ -2,44 +2,44 @@
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_2DVF_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py)
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/meshSquare.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithLocRefSquares.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_SQUARE_loc_ref ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_loc_ref PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_loc_ref APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_loc_ref        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_loc_ref APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithCheckerboardSquares.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_SQUARE_checkerboard ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_checkerboard PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_checkerboard APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_checkerboard        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_checkerboard APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithHexagons.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_SQUARE_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithBrickWall.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_SQUARE_brickwall ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_brickwall PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_brickwall APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_brickwall        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_brickwall APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithDeformedQuadrangles.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_SQUARE_deformed_quadrangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_deformed_quadrangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_deformed_quadrangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_deformed_quadrangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_SQUARE_deformed_quadrangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 3d66204..662147a
@@ -4,26 +4,26 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     SET(MESH_FILE  ../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_DISK_spiderweb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_spiderweb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_spiderweb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_spiderweb        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_spiderweb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 91ab5fd..e003ed6
@@ -26,8 +26,8 @@ nbCells = my_mesh.getNumberOfCells()
 if( my_mesh.getSpaceDimension()!=2 or my_mesh.getMeshDimension()!=2) :
     raise ValueError("Wrong space or mesh dimension : space and mesh dimensions should be 2")
 
-print "Mesh loading done"
-print "Number of cells  = ", nbCells
+print( "Mesh loading done" )
+print( "Number of cells  = ", nbCells )
 
 #Discrétisation du second membre et extraction du nb max de voisins d'une cellule
 #================================================================================
@@ -50,7 +50,7 @@ for i in range(nbCells):
        maxNbNeighbours= max(1+Ci.getNumberOfFaces(),maxNbNeighbours)
 
 print("Right hand side discretisation done")
-print "Maximum number of neighbours = ", maxNbNeighbours
+print("Maximum number of neighbours = ", maxNbNeighbours )
 
 # Construction de la matrice et du vecteur second membre du système linéaire
 #===========================================================================
@@ -87,10 +87,10 @@ print("Linear system matrix building done")
 LS=cdmath.LinearSolver(Rigidite,RHS,500,1.E-6,"GMRES","ILU")
 SolSyst=LS.solve()
 
-print "Preconditioner used : ", LS.getNameOfPc()
-print "Number of iterations used : ", LS.getNumberOfIter()
-print "Final residual : ", LS.getResidu()
-print "Linear system solved"
+print( "Preconditioner used : ", LS.getNameOfPc() )
+print( "Number of iterations used : ", LS.getNumberOfIter() )
+print( "Final residual : ", LS.getResidu() )
+print( "Linear system solved" )
 
 # Création du champ résultat
 #===========================
old mode 100644 (file)
new mode 100755 (executable)
index e97511d..0ccf7bb
@@ -4,26 +4,26 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     SET(MESH_FILE  ../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_DISK_StiffBC_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK_StiffBC.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_DISK_StiffBC_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK_StiffBC.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_DISK_StiffBC_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK_StiffBC.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExamplePoisson_2DVF_DISK_StiffBC_spiderweb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK_StiffBC.py ${MESH_FILE})
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_spiderweb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_spiderweb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_spiderweb        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_2DVF_DISK_StiffBC_spiderweb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index f5282de..b3b09aa
@@ -27,8 +27,8 @@ nbCells = my_mesh.getNumberOfCells()
 if( my_mesh.getSpaceDimension()!=2 or my_mesh.getMeshDimension()!=2) :
     raise ValueError("Wrong space or mesh dimension : space and mesh dimensions should be 2")
 
-print "Mesh loading done"
-print "Number of cells  = ", nbCells
+print( "Mesh loading done" )
+print( "Number of cells  = ", nbCells )
 
 #Discrétisation du second membre et extraction du nb max de voisins d'une cellule
 #================================================================================
@@ -59,7 +59,7 @@ for i in range(nbCells):
     maxNbNeighbours= max(1+Ci.getNumberOfFaces(),maxNbNeighbours)
 
 print("Right hand side discretisation done")
-print "Maximum number of neighbours = ", maxNbNeighbours
+print( "Maximum number of neighbours = ", maxNbNeighbours)
 
 # Construction de la matrice et du vecteur second membre du système linéaire
 #===========================================================================
@@ -104,10 +104,10 @@ print("Linear system matrix building done")
 LS=cdmath.LinearSolver(Rigidite,RHS,500,1.E-6,"GMRES","ILU")
 SolSyst=LS.solve()
 
-print "Preconditioner used : ", LS.getNameOfPc()
-print "Number of iterations used : ", LS.getNumberOfIter()
-print "Final residual : ", LS.getResidu()
-print "Linear system solved"
+print( "Preconditioner used : ", LS.getNameOfPc() )
+print( "Number of iterations used : ", LS.getNumberOfIter() )
+print( "Final residual : ", LS.getResidu() )
+print( "Linear system solved" )
 
 # Création du champ résultat
 #===========================
old mode 100644 (file)
new mode 100755 (executable)
index c1c1db8..1e551a6
@@ -9,8 +9,8 @@ install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DCubeSkinEF)
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoissonBeltrami_3DFE_CUBESKIN ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements3DPoissonCubeSkin.py)
-    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_CUBESKIN PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_CUBESKIN APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_CUBESKIN        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_CUBESKIN APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 2e9bdb1..59e362d
@@ -9,8 +9,8 @@ install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DEF)
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_3DEF_CUBE ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements3DPoisson_CUBE.py)
-    SET_PROPERTY(TEST ExamplePoisson_3DEF_CUBE PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_3DEF_CUBE APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DEF_CUBE        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DEF_CUBE APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 854d190..9e64f40
@@ -9,8 +9,8 @@ install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DEF_BALL)
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_3DEF_BALL ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements3DPoisson_BALL.py)
-    SET_PROPERTY(TEST ExamplePoisson_3DEF_BALL PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_3DEF_BALL APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DEF_BALL        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DEF_BALL APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 9756e68..b53f1e0
@@ -131,9 +131,9 @@ print("Linear system matrix building done")
 #=================================
 LS=cdmath.LinearSolver(Rigidite,RHS,100,1.E-6,"CG","ILU")#,"ILU" Remplacer CG par CHOLESKY pour solveur direct
 SolSyst=LS.solve()
-print "Preconditioner used : ", LS.getNameOfPc()
-print "Number of iterations used : ", LS.getNumberOfIter()
-print "Final residual : ", LS.getResidu()
+print("Preconditioner used : ", LS.getNameOfPc() )
+print("Number of iterations used : ", LS.getNumberOfIter() )
+print("Final residual : ", LS.getResidu() )
 print("Linear system solved")
 
 # Création du champ résultat
@@ -179,6 +179,6 @@ for i in range(nbNodes) :
 
 print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
 print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)
-print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
+print("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
 
 assert erreur_abs/max_abs_sol_exacte <1.
old mode 100644 (file)
new mode 100755 (executable)
index e3312c2..758e321
@@ -9,8 +9,8 @@ install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DEF_RadiatorAndWind
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_3DEF_CUBE_RadiatorAndWindow ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements3DPoisson_CUBE_RadiatorAndWindow.py)
-    SET_PROPERTY(TEST ExamplePoisson_3DEF_CUBE_RadiatorAndWindow PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_3DEF_CUBE_RadiatorAndWindow APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DEF_CUBE_RadiatorAndWindow        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DEF_CUBE_RadiatorAndWindow APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 08b203d..3ec911c
@@ -192,8 +192,8 @@ for j in boundaryNodes:
 #sauvegarde sur le disque dur du résultat dans un fichier paraview
 my_Temperature.writeVTK("FiniteElements3DTemperature")
 
-print "Minimum temperature= ", my_Temperature.min(), ", maximum temperature= ", my_Temperature.max()
+print( "Minimum temperature= ", my_Temperature.min(), ", maximum temperature= ", my_Temperature.max() )
 assert my_Temperature.min()>= min(Tmur,Tfenetre,Tradiateur) and my_Temperature.max()<= max(Tmur,Tfenetre,Tradiateur)
 
-print "Numerical solution of 3D Laplace equation using finite elements done"
+print( "Numerical solution of 3D Laplace equation using finite elements done" )
 
old mode 100644 (file)
new mode 100755 (executable)
index 1808dcb..e4a33ca
@@ -9,8 +9,8 @@ install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DSphereEF)
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoissonBeltrami_3DFE_SPHERE ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements3DPoissonSphere.py)
-    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_SPHERE PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_SPHERE APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_SPHERE        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_SPHERE APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 5ebbd1a..a6b6ba0
@@ -9,8 +9,8 @@ install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DTorusEF)
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoissonBeltrami_3DFE_TORUS ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements3DPoissonTorus.py)
-    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_TORUS PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_TORUS APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_TORUS        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoissonBeltrami_3DFE_TORUS APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index b3b4785..d99fc87
@@ -174,8 +174,8 @@ print("Numerical solution of Poisson equation on a torus using finite elements d
 
 #Calcul de l'erreur commise par rapport à la solution exacte
 #===========================================================
-max_sol_exacte=exactSolField.getNormEuclidean().max()
-erreur_max=(exactSolField - my_ResultField).getNormEuclidean().max()
+max_sol_exacte=exactSolField.normMax()[0]
+erreur_max=(exactSolField - my_ResultField).normMax()[0]
 max_sol_num=my_ResultField.max()
 min_sol_num=my_ResultField.min()
 
old mode 100644 (file)
new mode 100755 (executable)
index b96cf43..1a57869
@@ -2,26 +2,26 @@
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_3DVF_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes3DPoisson_CUBE.py)
-    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_cubes        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/meshCube.med  )
 
     ADD_TEST(ExamplePoisson_3DVF_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes3DPoisson_CUBE.py)
-    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_tetrahedra        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/cubeWithLocRefCubes.med  )
 
     ADD_TEST(ExamplePoisson_3DVF_CUBE_loc_ref ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes3DPoisson_CUBE.py)
-    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_loc_ref PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_loc_ref APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_loc_ref        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_loc_ref APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/3DCheckerboard/checkerboard_4x4x4.med  )
 
     ADD_TEST(ExamplePoisson_3DVF_CUBE_checkerboard ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes3DPoisson_CUBE.py)
-    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_checkerboard PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_checkerboard APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_checkerboard        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DVF_CUBE_checkerboard APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index fed3355..bc87002
@@ -5,8 +5,8 @@ file(COPY ${MESH_FILE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExamplePoisson_3DVF_BALL_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes3DPoisson_BALL.py)
-    SET_PROPERTY(TEST ExamplePoisson_3DVF_BALL_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExamplePoisson_3DVF_BALL_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DVF_BALL_tetrahedra        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExamplePoisson_3DVF_BALL_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 548c51b..940eb2c
@@ -90,9 +90,9 @@ print("Linear system matrix building done")
 LS=cdmath.LinearSolver(Rigidite,RHS,500,1.E-6,"GMRES","ILU")
 SolSyst=LS.solve()
 
-print "Preconditioner used : ", LS.getNameOfPc()
-print "Number of iterations used : ", LS.getNumberOfIter()
-print "Final residual : ", LS.getResidu()
+print( "Preconditioner used : ", LS.getNameOfPc() )
+print( "Number of iterations used : ", LS.getNumberOfIter() )
+print( "Final residual : ", LS.getResidu() )
 print("Linear system solved")
 
 # Création du champ résultat
@@ -140,6 +140,6 @@ for i in range(nbCells) :
 
 print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
 print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)
-print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
+print("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
 
 assert erreur_abs/max_abs_sol_exacte <1.
diff --git a/CDMATH/tests/examples/SpectrumLaplace2DEF/CMakeLists.txt b/CDMATH/tests/examples/SpectrumLaplace2DEF/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..3aedd8d
--- /dev/null
@@ -0,0 +1,29 @@
+
+if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
+
+    #Cartesian cells split into right triangles
+    ADD_TEST(ExampleSpectrumLaplace_2DEF_SQUARE_rightTriangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumLaplace2DEF_SQUARE.py)
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DEF_SQUARE_rightTriangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DEF_SQUARE_rightTriangles APPEND PROPERTY ENVIRONMENT      "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+    SET(MESH_FILE  ../../ressources/meshSquare.med  )
+    SET(MESH_NAME  "DelaunayTriangles" )
+    ADD_TEST(ExampleSpectrumLaplace_2DEF_SQUARE_DelaunayTriangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumLaplace2DEF_SQUARE.py ${MESH_FILE} ${MESH_NAME})
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DEF_SQUARE_DelaunayTriangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DEF_SQUARE_DelaunayTriangles APPEND PROPERTY ENVIRONMENT      "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+    SET(MESH_FILE  ../../ressources/2DFlatCrossTriangles/squareWithFlatCrossTriangles_0.med  )
+    SET(MESH_NAME  "flatCrossTriangles" )
+    ADD_TEST(ExampleSpectrumLaplace_2DEF_SQUARE_flatCrossTriangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumLaplace2DEF_SQUARE.py ${MESH_FILE} ${MESH_NAME})
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DEF_SQUARE_flatCrossTriangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DEF_SQUARE_flatCrossTriangles APPEND PROPERTY ENVIRONMENT      "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+    SET(MESH_FILE  ../../ressources/2DSkinnyTriangles/squareWithSkinnyTriangles_0.med  )
+    SET(MESH_NAME  "skinnyTriangles" )
+    ADD_TEST(ExampleSpectrumLaplace_2DEF_SQUARE_skinnyTriangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumLaplace2DEF_SQUARE.py ${MESH_FILE} ${MESH_NAME})
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DEF_SQUARE_skinnyTriangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DEF_SQUARE_skinnyTriangles APPEND PROPERTY ENVIRONMENT      "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
+
+
diff --git a/CDMATH/tests/examples/SpectrumLaplace2DEF/SpectrumLaplace2DEF_SQUARE.py b/CDMATH/tests/examples/SpectrumLaplace2DEF/SpectrumLaplace2DEF_SQUARE.py
new file mode 100755 (executable)
index 0000000..5443f21
--- /dev/null
@@ -0,0 +1,147 @@
+# -*-coding:utf-8 -*
+#===============================================================================================================================
+# Name        : Calcul EF du spectre de l'opérateur de Laplace 2D -\triangle avec conditions aux limites de Dirichlet u=0
+# Author      : Michaël Ndjinga
+# Copyright   : CEA Saclay 2020
+# Description : Utilisation de la méthode des éléménts finis P1 avec champs discrétisés aux noeuds d'un maillage triangulaire
+#                      Création et sauvegarde des champs résultant en utilisant la librairie CDMATH
+#================================================================================================================================
+
+import cdmath
+import sys
+
+if len(sys.argv) >2 :#load a mesh file
+    my_mesh = cdmath.Mesh(sys.argv[1])
+    mesh_name=sys.argv[2]
+else :   #rectangular mesh split into triangles
+    xmin=0
+    xmax=1
+    ymin=0
+    ymax=1
+    
+    nx=15
+    ny=15
+    
+    my_mesh = cdmath.Mesh(xmin,xmax,nx,ymin,ymax,ny,0)
+    mesh_name="RightTriangles"
+
+if( my_mesh.getSpaceDimension()!=2 or my_mesh.getMeshDimension()!=2) :
+    raise ValueError("Wrong space or mesh dimension : space and mesh dimensions should be 2")
+if(not my_mesh.isTriangular()) :
+       raise ValueError("Wrong cell types : mesh is not made of triangles")
+eps=1e-6
+my_mesh.setGroupAtPlan(0.,0,eps,"DirichletBorder")#Bord GAUCHE
+my_mesh.setGroupAtPlan(1.,0,eps,"DirichletBorder")#Bord DROIT
+my_mesh.setGroupAtPlan(0.,1,eps,"DirichletBorder")#Bord BAS
+my_mesh.setGroupAtPlan(1.,1,eps,"DirichletBorder")#Bord HAUT
+
+nbNodes = my_mesh.getNumberOfNodes()
+nbCells = my_mesh.getNumberOfCells()
+
+print("Mesh loading done")
+print("Number of nodes=", nbNodes)
+print("Number of cells=", nbCells)
+
+#Détermination des noeuds intérieurs
+#===================================
+nbInteriorNodes = 0
+nbBoundaryNodes = 0
+maxNbNeighbours = 0#This is to determine the number of non zero coefficients in the sparse finite element rigidity matrix
+interiorNodes=[]
+boundaryNodes=[]
+
+#parcours des noeuds pour discrétisation du second membre et extraction 1) des noeuds intérieur 2) des noeuds frontière 3) du nb max voisins d'un noeud
+for i in range(nbNodes):
+       Ni=my_mesh.getNode(i)
+       if my_mesh.isBorderNode(i): # Détection des noeuds frontière
+               boundaryNodes.append(i)
+               nbBoundaryNodes=nbBoundaryNodes+1
+       else: # Détection des noeuds intérieurs
+               interiorNodes.append(i)
+               nbInteriorNodes=nbInteriorNodes+1
+               maxNbNeighbours= max(1+Ni.getNumberOfCells(),maxNbNeighbours) #true only in 2D, otherwise use function Ni.getNumberOfEdges()
+
+print("nb of interior nodes=", nbInteriorNodes)
+print("nb of boundary nodes=", nbBoundaryNodes)
+print("Max nb of neighbours=", maxNbNeighbours)
+
+# Construction de la matrice de rigidité
+#========================================
+Rigidite=cdmath.SparseMatrixPetsc(nbInteriorNodes,nbInteriorNodes,maxNbNeighbours)# warning : third argument is max number of non zero coefficients per line of the matrix
+
+# Vecteurs gradient de la fonction de forme associée à chaque noeud d'un triangle (hypothèse 2D)
+GradShapeFunc0=cdmath.Vector(2)
+GradShapeFunc1=cdmath.Vector(2)
+GradShapeFunc2=cdmath.Vector(2)
+
+nodal_volumes=cdmath.Vector(nbInteriorNodes)
+
+#On parcourt les triangles du domaine
+for i in range(nbCells):
+
+       Ci=my_mesh.getCell(i)
+
+       #Contribution à la matrice de rigidité
+       nodeId0=Ci.getNodeId(0)
+       nodeId1=Ci.getNodeId(1)
+       nodeId2=Ci.getNodeId(2)
+
+       N0=my_mesh.getNode(nodeId0)
+       N1=my_mesh.getNode(nodeId1)
+       N2=my_mesh.getNode(nodeId2)
+
+       #Formule des gradients voir EF P1 -> calcul déterminants
+       GradShapeFunc0[0]= (N1.y()-N2.y())/2
+       GradShapeFunc0[1]=-(N1.x()-N2.x())/2
+       GradShapeFunc1[0]=-(N0.y()-N2.y())/2
+       GradShapeFunc1[1]= (N0.x()-N2.x())/2
+       GradShapeFunc2[0]= (N0.y()-N1.y())/2
+       GradShapeFunc2[1]=-(N0.x()-N1.x())/2
+
+       #Création d'un tableau (numéro du noeud, gradient de la fonction de forme
+       GradShapeFuncs={nodeId0 : GradShapeFunc0}
+       GradShapeFuncs[nodeId1]=GradShapeFunc1
+       GradShapeFuncs[nodeId2]=GradShapeFunc2
+
+
+       # Remplissage de  la matrice de rigidité et du second membre
+       for j in [nodeId0,nodeId1,nodeId2] :
+               if boundaryNodes.count(j)==0 : #seuls les noeuds intérieurs contribuent au système linéaire (matrice de rigidité et second membre)
+                       j_int=interiorNodes.index(j)#indice du noeud j en tant que noeud intérieur
+                       nodal_volumes[j_int]+=Ci.getMeasure()/3
+                       #Contribution de la cellule triangulaire i à la ligne j_int du système linéaire
+                       for k in [nodeId0,nodeId1,nodeId2] : 
+                               if boundaryNodes.count(k)==0 : #seuls les noeuds intérieurs contribuent à la matrice du système linéaire
+                                       k_int=interiorNodes.index(k)#indice du noeud k en tant que noeud intérieur
+                                       Rigidite.addValue(j_int,k_int,GradShapeFuncs[j]*GradShapeFuncs[k]/Ci.getMeasure())
+                               #else: si condition limite non nulle au bord, ajouter la contribution du bord au second membre de la cellule j
+
+print("Stiffness matrix construction done")
+quit()
+# Conditionnement de la matrice de rigidité
+#=================================
+cond = Rigidite.getConditionNumber()
+print("Condition number is ",cond)
+
+# Spectre de la matrice de rigidité
+#==================================
+#Homogénéisation de la matrice de rigidité (sinon elle tend vers zero de meme que ses valeurs propres)
+for i in range(nbInteriorNodes):
+       nodal_volumes[i]=1/nodal_volumes[i]
+Rigidite.leftDiagonalScale(nodal_volumes)
+
+nev=10
+d=Rigidite.getEigenvectorsDataArrayDouble(nev)
+my_eigenfield = cdmath.Field("Eigenvectors field", cdmath.NODES, my_mesh, nev)
+for j in range(nbInteriorNodes):
+    for k in range(nev):
+      my_eigenfield[interiorNodes[j],k]=d[j,k];#remplissage des valeurs pour les noeuds intérieurs
+for j in range(nbBoundaryNodes):
+    for k in range(nev):
+      my_eigenfield[boundaryNodes[j],k]=0;#remplissage des valeurs pour les noeuds frontière (condition limite)
+for k in range(nev):
+    my_eigenfield.setInfoOnComponent(k,d.getInfoOnComponent(k))
+    
+# Sauvegarde du champ résultat
+#===========================
+my_eigenfield.writeVTK("spectrumFiniteElementsOn"+mesh_name+"Laplace")
diff --git a/CDMATH/tests/examples/SpectrumLaplace2DVF/CMakeLists.txt b/CDMATH/tests/examples/SpectrumLaplace2DVF/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..d4e9171
--- /dev/null
@@ -0,0 +1,45 @@
+
+if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
+
+    ADD_TEST(ExampleSpectrumLaplace_2DVF_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumLaplace2DVF_SQUARE.py )
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+#    SET(MESH_FILE  ../../ressources/squareWithLocRefSquares.med  )
+#    SET(MESH_NAME  "LocRefSquares" )
+
+#    ADD_TEST(ExampleSpectrumLaplace_2DVF_SQUARE_loc_ref ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumLaplace2DVF_SQUARE.py ${MESH_FILE} ${MESH_NAME})
+#    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_loc_ref        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+#    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_loc_ref APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+    SET(MESH_FILE  ../../ressources/squareWithCheckerboardSquares.med  )
+    SET(MESH_NAME  "Checkerboard" )
+
+    ADD_TEST(ExampleSpectrumLaplace_2DVF_SQUARE_checkerboard ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumLaplace2DVF_SQUARE.py ${MESH_FILE} ${MESH_NAME})
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_checkerboard        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_checkerboard APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+    SET(MESH_FILE  ../../ressources/meshSquare.med  )
+    SET(MESH_NAME  "DelaunayTriangles" )
+
+    ADD_TEST(ExampleSpectrumLaplace_2DVF_SQUARE_DelaunayTriangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumLaplace2DVF_SQUARE.py ${MESH_FILE} ${MESH_NAME})
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_DelaunayTriangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_DelaunayTriangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+    SET(MESH_FILE  ../../ressources/2DFlatCrossTriangles/squareWithFlatCrossTriangles_0.med  )
+    SET(MESH_NAME  "flatCrossTriangles" )
+
+    ADD_TEST(ExampleSpectrumLaplace_2DVF_SQUARE_flatCrossTriangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumLaplace2DVF_SQUARE.py ${MESH_FILE} ${MESH_NAME})
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_flatCrossTriangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_flatCrossTriangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+    SET(MESH_FILE  ../../ressources/2DSkinnyTriangles/squareWithSkinnyTriangles_0.med  )
+    SET(MESH_NAME  "skinnyTriangles" )
+
+    ADD_TEST(ExampleSpectrumLaplace_2DVF_SQUARE_skinnyTriangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumLaplace2DVF_SQUARE.py ${MESH_FILE} ${MESH_NAME})
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_skinnyTriangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplace_2DVF_SQUARE_skinnyTriangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
+
+
diff --git a/CDMATH/tests/examples/SpectrumLaplace2DVF/SpectrumLaplace2DVF_SQUARE.py b/CDMATH/tests/examples/SpectrumLaplace2DVF/SpectrumLaplace2DVF_SQUARE.py
new file mode 100755 (executable)
index 0000000..a60054c
--- /dev/null
@@ -0,0 +1,92 @@
+# -*-coding:utf-8 -*
+#===============================================================================================================================
+# Name        : Calcul VF du spectre de l'opérateur de Laplace 2D -\triangle avec conditions aux limites de Dirichlet u=0
+# Author      : Michaël Ndjinga
+# Copyright   : CEA Saclay 2020
+# Description : Utilisation de la méthode des volumes finis P1 avec champs discrétisés aux cellules d'un maillage quelconque
+#                      Création et sauvegarde des champs résultant en utilisant la librairie CDMATH
+#================================================================================================================================
+
+import cdmath
+import sys
+
+if len(sys.argv) >2 :#non rectangular mesh
+    my_mesh = cdmath.Mesh(sys.argv[1])
+    mesh_name=sys.argv[2]
+else :   #rectangular mesh
+# Création d'un maillage cartésien du domaine carré [0,1]x[0,1], définition des bords
+#====================================================================================
+    xmin=0
+    xmax=1
+    ymin=0
+    ymax=1
+    
+    nx=15
+    ny=15
+    
+    my_mesh = cdmath.Mesh(xmin,xmax,nx,ymin,ymax,ny)
+    mesh_name="RegularGrid"
+
+    eps=1e-6
+    my_mesh.setGroupAtPlan(0,0,eps,"DirichletBorder")#Bord GAUCHE
+    my_mesh.setGroupAtPlan(1,0,eps,"DirichletBorder")#Bord DROIT
+    my_mesh.setGroupAtPlan(0,1,eps,"DirichletBorder")#Bord BAS
+    my_mesh.setGroupAtPlan(1,1,eps,"DirichletBorder")#Bord HAUT
+
+nbCells = my_mesh.getNumberOfCells()
+
+if( my_mesh.getSpaceDimension()!=2 or my_mesh.getMeshDimension()!=2) :
+    raise ValueError("Wrong space or mesh dimension : space and mesh dimensions should be 2")
+
+print("Mesh loading done")
+print("Number of cells  = ", nbCells)
+
+#Détermination du nb max de voisins d'une cellule
+#================================================
+maxNbNeighbours=0#This is to determine the number of non zero coefficients in the sparse finite volumes rigidity matrix
+#parcours des cellules pour extraction du nb max de voisins d'une cellule
+for i in range(nbCells): 
+    Ci=my_mesh.getCell(i)
+    # compute maximum number of neighbours
+    maxNbNeighbours= max(1+Ci.getNumberOfFaces(),maxNbNeighbours)
+
+print("Max nb of neighbours = ", maxNbNeighbours)
+
+# Construction de la matrice et du vecteur second membre du système linéaire
+#===========================================================================
+Rigidite=cdmath.SparseMatrixPetsc(nbCells,nbCells,maxNbNeighbours)# warning : third argument is max number of non zero coefficients per line of the matrix
+#Parcours des cellules du domaine
+for i in range(nbCells):
+    Ci=my_mesh.getCell(i)
+    for j in range(Ci.getNumberOfFaces()):# parcours des faces voisinnes
+        Fj=my_mesh.getFace(Ci.getFaceId(j))
+        if not Fj.isBorder():
+            k=Fj.getCellId(0)
+            if k==i :
+                k=Fj.getCellId(1)
+            Ck=my_mesh.getCell(k)
+            distance=Ci.getBarryCenter().distance(Ck.getBarryCenter())
+            coeff=Fj.getMeasure()/Ci.getMeasure()/distance
+            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
+        Rigidite.addValue(i,i,coeff) # terme diagonal
+
+print("Stiffness matrix construction done")
+
+# Conditionnement de la matrice de rigidité
+#=================================
+cond = Rigidite.getConditionNumber()
+print("Condition number is ",cond)
+
+# Spectre de la matrice de rigidité
+#==================================
+nev=10
+d=Rigidite.getEigenvectorsDataArrayDouble(nev)
+my_eigenfield = cdmath.Field("Eigenvectors field", cdmath.CELLS, my_mesh, nev)
+my_eigenfield.setFieldByDataArrayDouble(d)
+
+# Sauvegarde du champ résultat
+#===========================
+my_eigenfield.writeVTK("spectrumFiniteVolumesOn"+mesh_name+"Laplace")
diff --git a/CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/CMakeLists.txt b/CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..9488daf
--- /dev/null
@@ -0,0 +1,27 @@
+
+if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
+
+    SET(MESH_FILE  ../../ressources/meshSphere.med  )
+    SET(MESH_NAME  "Sphere" )
+
+    ADD_TEST(ExampleSpectrumLaplaceBeltrami_3DFE_SPHERE ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumFiniteElements3DLaplace-Beltrami.py ${MESH_FILE} ${MESH_NAME} )
+    SET_PROPERTY(TEST ExampleSpectrumLaplaceBeltrami_3DFE_SPHERE PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplaceBeltrami_3DFE_SPHERE APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+    SET(MESH_FILE  ../../ressources/meshTorus.med  )
+    SET(MESH_NAME  "Torus" )
+
+    ADD_TEST(ExampleSpectrumLaplaceBeltrami_3DFE_TORUS ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumFiniteElements3DLaplace-Beltrami.py ${MESH_FILE} ${MESH_NAME} )
+    SET_PROPERTY(TEST ExampleSpectrumLaplaceBeltrami_3DFE_TORUS PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplaceBeltrami_3DFE_TORUS APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+    SET(MESH_FILE  ../../ressources/meshCubeSkin.med  )
+    SET(MESH_NAME  "CubeSkin" )
+
+    ADD_TEST(ExampleSpectrumLaplaceBeltrami_3DFE_CUBESKIN ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumFiniteElements3DLaplace-Beltrami.py ${MESH_FILE} ${MESH_NAME} )
+    SET_PROPERTY(TEST ExampleSpectrumLaplaceBeltrami_3DFE_CUBESKIN PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleSpectrumLaplaceBeltrami_3DFE_CUBESKIN APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
+endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
+
+
diff --git a/CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/SpectrumFiniteElements3DLaplace-Beltrami.py b/CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/SpectrumFiniteElements3DLaplace-Beltrami.py
new file mode 100755 (executable)
index 0000000..59439bb
--- /dev/null
@@ -0,0 +1,133 @@
+# -*-coding:utf-8 -*
+#===============================================================================================================================
+# Name        : Calcul EF du spectre de l'opérateur de Laplace-Beltrami -\triangle sur une surface en 3D
+# Author      : Michael Ndjinga
+# Copyright   : CEA Saclay 2020
+# Description : Utilisation de la méthode des éléménts finis P1 avec champs discrétisés aux noeuds d'un maillage triangulaire
+#               Création et sauvegarde des champs résultant en utilisant la librairie CDMATH
+#================================================================================================================================
+
+import cdmath
+import sys
+
+#Chargement du maillage triangulaire de la surface
+#=================================================
+my_mesh = cdmath.Mesh(sys.argv[1])
+mesh_name=sys.argv[2]
+if(not my_mesh.isTriangular()) :
+       raise ValueError("Wrong cell types : mesh is not made of triangles")
+if(my_mesh.getMeshDimension()!=2) :
+       raise ValueError("Wrong mesh dimension : expected a surface of dimension 2")
+if(my_mesh.getSpaceDimension()!=3) :
+       raise ValueError("Wrong space dimension : expected a space of dimension 3")
+
+nbNodes = my_mesh.getNumberOfNodes()
+nbCells = my_mesh.getNumberOfCells()
+
+print("Mesh building/loading done")
+print("nb of nodes=", nbNodes)
+print("nb of cells=", nbCells)
+
+maxNbNeighbours = my_mesh.getMaxNbNeighbours(cdmath.NODES)+1#This is to determine the number of non zero coefficients in the sparse finite element rigidity matrix
+
+# Construction de la matrice de rigidité
+#=======================================
+Rigidite=cdmath.SparseMatrixPetsc(nbNodes,nbNodes,maxNbNeighbours)# warning : third argument is number of non zero coefficients per line
+
+# Vecteurs gradient de la fonction de forme associée à chaque noeud d'un triangle
+GradShapeFunc0=cdmath.Vector(3)
+GradShapeFunc1=cdmath.Vector(3)
+GradShapeFunc2=cdmath.Vector(3)
+
+normalFace0=cdmath.Vector(3)
+normalFace1=cdmath.Vector(3)
+
+nodal_volumes=cdmath.Vector(nbNodes)
+
+#On parcourt les triangles du domaine
+for i in range(nbCells):
+
+       Ci=my_mesh.getCell(i)
+
+       #Contribution à la matrice de rigidité
+       nodeId0=Ci.getNodeId(0)
+       nodeId1=Ci.getNodeId(1)
+       nodeId2=Ci.getNodeId(2)
+       N0=my_mesh.getNode(nodeId0)
+       N1=my_mesh.getNode(nodeId1)
+       N2=my_mesh.getNode(nodeId2)
+
+       #Build normal to cell Ci
+       normalFace0[0]=Ci.getNormalVector(0,0)
+       normalFace0[1]=Ci.getNormalVector(0,1)
+       normalFace0[2]=Ci.getNormalVector(0,2)
+       normalFace1[0]=Ci.getNormalVector(1,0)
+       normalFace1[1]=Ci.getNormalVector(1,1)
+       normalFace1[2]=Ci.getNormalVector(1,2)
+
+       normalCell = normalFace0.crossProduct(normalFace1)
+       normalCell = normalCell/normalCell.norm()
+
+       cellMat=cdmath.Matrix(4)
+       cellMat[0,0]=N0.x()
+       cellMat[0,1]=N0.y()
+       cellMat[0,2]=N0.z()
+       cellMat[1,0]=N1.x()
+       cellMat[1,1]=N1.y()
+       cellMat[1,2]=N1.z()
+       cellMat[2,0]=N2.x()
+       cellMat[2,1]=N2.y()
+       cellMat[2,2]=N2.z()
+       cellMat[3,0]=normalCell[0]
+       cellMat[3,1]=normalCell[1]
+       cellMat[3,2]=normalCell[2]
+       cellMat[0,3]=1
+       cellMat[1,3]=1
+       cellMat[2,3]=1
+       cellMat[3,3]=0
+
+       #Formule des gradients voir EF P1 -> calcul déterminants
+       GradShapeFunc0[0]= cellMat.partMatrix(0,0).determinant()/2
+       GradShapeFunc0[1]=-cellMat.partMatrix(0,1).determinant()/2
+       GradShapeFunc0[2]= cellMat.partMatrix(0,2).determinant()/2
+       GradShapeFunc1[0]=-cellMat.partMatrix(1,0).determinant()/2
+       GradShapeFunc1[1]= cellMat.partMatrix(1,1).determinant()/2
+       GradShapeFunc1[2]=-cellMat.partMatrix(1,2).determinant()/2
+       GradShapeFunc2[0]= cellMat.partMatrix(2,0).determinant()/2
+       GradShapeFunc2[1]=-cellMat.partMatrix(2,1).determinant()/2
+       GradShapeFunc2[2]= cellMat.partMatrix(2,2).determinant()/2
+
+       #Création d'un tableau (numéro du noeud, gradient de la fonction de forme
+       GradShapeFuncs={nodeId0 : GradShapeFunc0}
+       GradShapeFuncs[nodeId1]=GradShapeFunc1
+       GradShapeFuncs[nodeId2]=GradShapeFunc2
+
+       # Remplissage de  la matrice de rigidité et du second membre
+       for j in [nodeId0,nodeId1,nodeId2] : 
+               nodal_volumes[j]+=Ci.getMeasure()/3
+               #Contribution de la cellule triangulaire i à la ligne j du système linéaire
+               for k in [nodeId0,nodeId1,nodeId2] : 
+                       Rigidite.addValue(j,k,GradShapeFuncs[j]*GradShapeFuncs[k]/Ci.getMeasure())
+
+print("Linear system matrix building done")
+
+# Conditionnement de la matrice de rigidité
+#==========================================
+cond = Rigidite.getConditionNumber(True)
+print("Condition number is ",cond)
+
+# Spectre de la matrice de rigidité
+#==================================
+#Homogénéisation de la matrice de rigidité (sinon elle tend vers zero de meme que ses valeurs propres)
+for i in range(nbNodes):
+       nodal_volumes[i]=1/nodal_volumes[i]
+Rigidite.leftDiagonalScale(nodal_volumes)
+
+nev=9
+d=Rigidite.getEigenvectorsDataArrayDouble(nev)
+my_eigenfield = cdmath.Field("Eigenvectors field", cdmath.NODES, my_mesh, nev)
+my_eigenfield.setFieldByDataArrayDouble(d)
+
+# Sauvegarde du champ résultat
+#===========================
+my_eigenfield.writeVTK("spectrumFiniteElementsOn"+mesh_name+"LaplaceBeltrami")
old mode 100644 (file)
new mode 100755 (executable)
index 331d29d..e43415f
@@ -2,8 +2,8 @@
 if (CDMATH_WITH_PYTHON )
 
     ADD_TEST(ExampleTransportEquation_2DUpwind_Explicit ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/TransportEquationUpwind.py)
-    SET_PROPERTY(TEST ExampleTransportEquation_2DUpwind_Explicit PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleTransportEquation_2DUpwind_Explicit 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}:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_2DUpwind_Explicit        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_2DUpwind_Explicit APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON )
 
old mode 100644 (file)
new mode 100755 (executable)
index 629cf1d..b534a9c
@@ -10,7 +10,7 @@ import VTK_routines
 precision=1e-5
 
 def initial_conditions_transport_equation(my_mesh):
-    print "Initial_data","Shock"
+    print( "Initial_data","Shock")
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -101,7 +101,7 @@ def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt,test_bc,velocity):
                     implMat.addValue(j*nbComp,cellAutre*nbComp,Am)
                     implMat.addValue(j*nbComp,        j*nbComp,Am*(-1.))
                 elif(test_bc!="Neumann" and Fk.getGroupName() != "Neumann"):#Nothing to do for Neumann boundary condition
-                    print Fk.getGroupName()
+                    print( Fk.getGroupName() )
                     raise ValueError("computeFluxes: Unknown boundary condition name");
                 
     return implMat
@@ -158,7 +158,7 @@ def TransportEquationVF(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
             LS.setSndMember(Un+S*dt)
             Un=LS.solve();
             if(not LS.getStatus()):
-                print "Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations"
+                print("Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations")
                 raise ValueError("Pas de convergence du système linéaire");
             dUn-=Un
 
@@ -174,10 +174,10 @@ def TransportEquationVF(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
     
         #Sauvegardes
         if(it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
-            print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-            print "Variation temporelle relative : ", maxVector[0]
+            print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+            print( "Variation temporelle relative : ", maxVector[0] )
             if(isImplicit):
-                print "Linear system converged in ", LS.getNumberOfIter(), " GMRES iterations"
+                print( "Linear system converged in ", LS.getNumberOfIter(), " GMRES iterations" )
 
             for k in range(nbCells):
                 unknown_field[k]  =Un[k]
@@ -185,16 +185,16 @@ def TransportEquationVF(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
             unknown_field.setTime(time,it);
             unknown_field.writeVTK("TransportEquation"+str(dim)+"DUpwind"+meshName,False);
 
-    print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-    print "Variation temporelle relative : ", maxVector[0]
+    print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+    print( "Variation temporelle relative : ", maxVector[0] )
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint" )
         raise ValueError("Maximum number of time steps reached : Stationary state not found !!!!!!!")
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time)
         if(test_bc=="Periodic"):
-            print "Mass loss: ", (total_mass_initial-unknown_field.integral()).norm(), " precision required= ", precision
+            print( "Mass loss: ", (total_mass_initial-unknown_field.integral()).norm(), " precision required= ", precision )
             assert (total_mass_initial-unknown_field.integral()).norm()<precision
         print "------------------------------------------------------------------------------------"
 
@@ -211,15 +211,15 @@ def TransportEquationVF(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
         
         return nbCells, time, it, unknown_field.getNormEuclidean().max(), diag_data_u
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint" )
         raise ValueError("Maximum time reached : Stationary state not found !!!!!!!")
 
 
 def solve(my_mesh, meshName, resolution, meshType, cfl, test_bc):
-    print "Resolution of the Transport Equation in dimension ", my_mesh.getMeshDimension()
-    print "Numerical method : ", "Upwind"
-    print "Initial data : ", "Spherical shock"
-    print "Mesh name : ",meshName , ", ", my_mesh.getNumberOfCells(), " cells"
+    print( "Resolution of the Transport Equation in dimension ", my_mesh.getMeshDimension() )
+    print( "Numerical method : ", "Upwind" )
+    print( "Initial data : ", "Spherical shock" )
+    print( "Mesh name : ",meshName , ", ", my_mesh.getNumberOfCells(), " cells" )
     
     # Problem data
     tmax = 10000.
old mode 100644 (file)
new mode 100755 (executable)
index 4355955..2b3ff9c
@@ -21,7 +21,7 @@ import sys
 from copy import deepcopy
 
 def Transport1DCenteredExplicit(nx,cfl, isSmooth):
-    print "Simulation of 1D transport equation with explicit centered scheme"
+    print( "Simulation of 1D transport equation with explicit centered scheme" )
 
     ##################### Simulation parameters
     a = 0.0 # space domain :  a <= x <= b
@@ -36,11 +36,11 @@ def Transport1DCenteredExplicit(nx,cfl, isSmooth):
     ########################## Initial data
     
     if(isSmooth):
-        print "Smooth initial data"
+        print( "Smooth initial data" )
         u_initial = [ sin(2*pi*xi)  for xi in x];# to be used with a=0, b=1
         tmax = 3*(b-a)/c # runs the simulation for 0 <= t <= tMax
     else:
-        print "Stiff initial data"
+        print( "Stiff initial data" )
         u_initial = [ int(1./3<xi)*int(xi<2./3)  for xi in x];# to be used with a=0, b=1
         tmax = (b-a)/c # runs the simulation for 0 <= t <= tMax
     ntmax = ceil(tmax/dt)
@@ -93,12 +93,12 @@ def Transport1DCenteredExplicit(nx,cfl, isSmooth):
                 plt.savefig("TransportEquation_CenteredExplicit_"+str(nx)+"Cells_Smoothness"+str(isSmooth)+"_CFL"+str(cfl)+"_ResultField_"+str(it)+".png")
                 #plt.show()
 
-    print "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u)
-    print "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u)
-    print "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)])
-    print "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)])        
+    print( "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u) )
+    print( "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u) )
+    print( "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]) )
+    print( "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)])        
     
-    print "Simulation of 1D transport equation with explicit centered scheme done"
+    print( "Simulation of 1D transport equation with explicit centered scheme done" )
     
     #return min, max, total variation and l1 error
     return min(u), max(u), np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]), dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)])
old mode 100644 (file)
new mode 100755 (executable)
index 790c3b8..af12e79
@@ -31,7 +31,7 @@ def centeredSchemeMatrix(nx,cfl):
     return centeredMat
     
 def Transport1DCenteredImplicit(nx,cfl):
-    print "Simulation of 1D transport equation with implicit centered scheme"
+    print( "Simulation of 1D transport equation with implicit centered scheme" )
 
     ##################### Simulation parameters
     a = 0.0 # space domain :  a <= x <= b
@@ -100,17 +100,17 @@ def Transport1DCenteredImplicit(nx,cfl):
             LS.setSndMember(Un)
             Un=LS.solve()
             if(not LS.getStatus()):
-                print "Linear system did not converge ", iterGMRES, " GMRES iterations"
+                print( "Linear system did not converge ", iterGMRES, " GMRES iterations" )
                 raise ValueError("Pas de convergence du système linéaire");
             for i in range(nx):
                 u[i]=Un[i]
     
             if ( max(u) > max_initial ):
-                print "-- Iter: " + str(it) + " max principle violated : max(t) > max(0) : max(t)= ",max(u), " max(0)= ", max_initial
+                print( "-- Iter: " + str(it) + " max principle violated : max(t) > max(0) : max(t)= ",max(u), " max(0)= ", max_initial )
             if ( min(u) < min_initial ):
-                print "-- Iter: " + str(it) + " min principle violated : min(t) < min(0) : min(t)= ",min(u), " min(0)= ", min_initial
+                print( "-- Iter: " + str(it) + " min principle violated : min(t) < min(0) : min(t)= ",min(u), " min(0)= ", min_initial )
             if ( np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]) > total_var_initial ):
-                print "-- Iter: " + str(it) + " total variation increased : var(t) > var(0) : var(t)= ", np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]), " var(0)= ", total_var_initial
+                print( "-- Iter: " + str(it) + " total variation increased : var(t) > var(0) : var(t)= ", np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]), " var(0)= ", total_var_initial )
 
             time += dt
             it += 1
@@ -119,15 +119,15 @@ def Transport1DCenteredImplicit(nx,cfl):
             line1.set_ydata(u)
             writer.grab_frame()
             if (it % output_freq == 0):
-                print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt))
+                print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
                 np.savetxt( "TransportEquation_CenteredImplicit_"+str(nx)+"Cells_CFL"+str(cfl)+"_ResultField_"+str(it)+".txt", u, delimiter="\n")
                 plt.savefig("TransportEquation_CenteredImplicit_"+str(nx)+"Cells_CFL"+str(cfl)+"_ResultField_"+str(it)+".png")
                 #plt.show()
 
-    print "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u)
-    print "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u)
-    print "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)])
-    print "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)])        
+    print( "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u) )
+    print( "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u) )
+    print( "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]) )
+    print( "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)]) )       
     
     print("Simulation of transport equation with implicit centered scheme done.")
     
old mode 100644 (file)
new mode 100755 (executable)
index 9ac84c9..d49da95
@@ -21,7 +21,7 @@ import sys
 from copy import deepcopy
 
 def Transport1DUpwindExplicit(nx,cfl):
-    print "Simulation of 1D transport equation with explicit upwind scheme"
+    print( "Simulation of 1D transport equation with explicit upwind scheme" )
 
     ##################### Simulation parameters
     a = 0.0 # space domain :  a <= x <= b
@@ -92,10 +92,10 @@ def Transport1DUpwindExplicit(nx,cfl):
                 plt.savefig("TransportEquation_UpwindExplicit_"+str(nx)+"Cells_CFL"+str(cfl)+"_ResultField_"+str(it)+".png")
                 #plt.show()
 
-    print "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u)
-    print "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u)
-    print "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)])
-    print "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)])        
+    print( "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u) )
+    print( "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u) )
+    print( "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]) )
+    print( "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)]) )       
     
     print("Simulation of transport equation with explicit upwind scheme done.")
     
old mode 100644 (file)
new mode 100755 (executable)
index f9d212d..84ddf39
@@ -31,7 +31,7 @@ def upwindSchemeMatrix(nx,cfl):
     return upwindMat
     
 def Transport1DUpwindImplicit(nx,cfl):
-    print "Simulation of 1D transport equation with implicit upwind scheme"
+    print( "Simulation of 1D transport equation with implicit upwind scheme" )
 
     ##################### Simulation parameters
     a = 0.0 # space domain :  a <= x <= b
@@ -98,7 +98,7 @@ def Transport1DUpwindImplicit(nx,cfl):
             LS.setSndMember(Un)
             Un=LS.solve()
             if(not LS.getStatus()):
-                print "Linear system did not converge ", iterGMRES, " GMRES iterations"
+                print( "Linear system did not converge ", iterGMRES, " GMRES iterations")
                 raise ValueError("Pas de convergence du système linéaire");
             for i in range(nx):
                 u[i]=Un[i]
@@ -119,10 +119,10 @@ def Transport1DUpwindImplicit(nx,cfl):
                 plt.savefig("TransportEquation_UpwindImplicit_"+str(nx)+"Cells_CFL"+str(cfl)+"_ResultField_"+str(it)+".png")
                 #plt.show()
 
-    print "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u)
-    print "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u)
-    print "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)])
-    print "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)])        
+    print( "Exact solution minimum   : ", min(u_initial), "Numerical solution minimum   : ",  min(u) )
+    print( "Exact solution maximum   : ", max(u_initial), "Numerical solution maximum   : ",  max(u) )
+    print( "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ",  np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]) )
+    print( "l1 numerical error       : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)]) )       
     
     print("Simulation of transport equation with implicit upwind scheme done.")
     
old mode 100644 (file)
new mode 100755 (executable)
index 62d7ec8..d7a9aea
@@ -3,8 +3,8 @@
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExampleWaveSystem_1DStaggered_RiemannProblem ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystem1DStaggered_RiemannProblem.py)
-    SET_PROPERTY(TEST ExampleWaveSystem_1DStaggered_RiemannProblem PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_1DStaggered_RiemannProblem APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_1DStaggered_RiemannProblem        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_1DStaggered_RiemannProblem APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 9fb4274..363c0e0
@@ -15,7 +15,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_Riemann_problem(a,b,nx):
-    print "Initial data Riemann problem"
+    print( "Initial data Riemann problem" )
 
     dx = (b - a) / nx #space step
     x=[a+0.5*dx + i*dx for i in range(nx)]   # array of cell center (1D mesh)
@@ -129,7 +129,7 @@ def WaveSystemVF(ntmax, tmax, cfl, a,b,nx, output_freq, meshName,scaling):
             LS_staggered.setSndMember(Un_staggered)
             Un_staggered=LS_staggered.solve();
             if(not LS_staggered.getStatus()):
-                print "Linear system did not converge for staggered scheme ", LS.getNumberOfIter(), " GMRES iterations"
+                print( "Linear system did not converge for staggered scheme ", LS.getNumberOfIter(), " GMRES iterations" )
                 raise ValueError("Pas de convergence du système linéaire");
             dUn_staggered-=Un_staggered
     
@@ -145,22 +145,22 @@ def WaveSystemVF(ntmax, tmax, cfl, a,b,nx, output_freq, meshName,scaling):
         
             #Sauvegardes
             if(it==1 or it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
-                print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-                print "Linear system converged in ", LS_staggered.getNumberOfIter(), " GMRES iterations"
+                print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+                print( "Linear system converged in ", LS_staggered.getNumberOfIter(), " GMRES iterations" )
     
                 np.savetxt("WaveSystem"+str(dim)+"DStaggered"+meshName+"_pressure"+str(it)+".txt", pressure_field_staggered, delimiter="\n")
                 np.savetxt("WaveSystem"+str(dim)+"DStaggered"+meshName+"_velocity"+str(it)+".txt", velocity_field_staggered, delimiter="\n")
                 plt.savefig("WaveSystem"+str(dim)+"DStaggered"+meshName+"_pressure"+str(it)+".png")
     
-                print
-    print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
+                print()
+    print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt))
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint" )
         return
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
-        print "------------------------------------------------------------------------------------"
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time)
+        print( "------------------------------------------------------------------------------------")
 
         np.savetxt( "WaveSystem"+str(dim)+"DStaggered"+meshName+"_pressure_Stat.txt", pressure_field_staggered, delimiter="\n")
         np.savetxt( "WaveSystem"+str(dim)+"DStaggered"+meshName+"_velocity_Stat.txt", velocity_field_staggered, delimiter="\n")
@@ -168,16 +168,16 @@ def WaveSystemVF(ntmax, tmax, cfl, a,b,nx, output_freq, meshName,scaling):
 
         return
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint")
         return
 
 
 def solve( a,b,nx, meshName, scaling, meshType, cfl):
 
-    print "Resolution of the Wave system in dimension 1 on "+str(nx)+ " cells, staggered scheme"
-    print "Initial data : ", "Riemann problem"
-    print "Boundary conditions : ", "Neumann"
-    print "Mesh name : ",meshName , ", ", nx, " cells"
+    print( "Resolution of the Wave system in dimension 1 on "+str(nx)+ " cells, staggered scheme")
+    print( "Initial data : ", "Riemann problem")
+    print( "Boundary conditions : ", "Neumann")
+    print( "Mesh name : ",meshName , ", ", nx, " cells")
     
     # Problem data
     tmax = 10000.
old mode 100644 (file)
new mode 100755 (executable)
index 0ebd48c..8a4f4e7
@@ -2,8 +2,8 @@
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExampleWaveSystem_1DFV_Upwind ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystem1DUpwind.py)
-    SET_PROPERTY(TEST ExampleWaveSystem_1DFV_Upwind PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_1DFV_Upwind APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_1DFV_Upwind        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_1DFV_Upwind APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 88f9973..1adc62a
@@ -143,8 +143,8 @@ def WaveSystem1DVF(ntmax, tmax, cfl, my_mesh, output_freq, resolution):
         #Sauvegardes
         if(it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
             print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt))
-            print "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 
-            print
+            print( "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 )
+            print()
 
             for k in range(nbCells):
                 pressure_field[k]=U[k,0]
@@ -155,15 +155,15 @@ def WaveSystem1DVF(ntmax, tmax, cfl, my_mesh, output_freq, resolution):
             velocity_field.setTime(time,it);
             velocity_field.writeCSV("WaveSystem1DUpwind_velocity");
     
-    print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt))
-    print "|| Un+1 - Un || : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 
-    print
+    print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+    print( "|| Un+1 - Un || : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 )
+    print()
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint" )
         raise ValueError("Maximum number of time steps reached : Stationary state not found !!!!!!!")
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time )
         for k in range(nbCells):
             pressure_field[k]=U[k,0]
             velocity_field[k,0]=U[k,1]/rho0
@@ -174,7 +174,7 @@ def WaveSystem1DVF(ntmax, tmax, cfl, my_mesh, output_freq, resolution):
         velocity_field.writeCSV("WaveSystem1DUpwind_velocity_Stat");
         
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint" )
         raise ValueError("Maximum time reached : Stationary state not found !!!!!!!")
 
 
old mode 100644 (file)
new mode 100755 (executable)
index f9fed6d..6abd336
@@ -3,8 +3,8 @@
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExampleWaveSystem_1DUpwind_RiemannProblem ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystem1DUpwind_RiemannProblem.py)
-    SET_PROPERTY(TEST ExampleWaveSystem_1DUpwind_RiemannProblem PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_1DUpwind_RiemannProblem APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_1DUpwind_RiemannProblem        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_1DUpwind_RiemannProblem APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 280c3fd..9ae483b
@@ -15,7 +15,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_Riemann_problem(a,b,nx):
-    print "Initial data Riemann problem"
+    print( "Initial data Riemann problem" )
 
     dx = (b - a) / nx #space step
     x=[a+0.5*dx + i*dx for i in range(nx)]   # array of cell center (1D mesh)
@@ -152,7 +152,7 @@ def WaveSystemVF(ntmax, tmax, cfl, a,b,nx, output_freq, meshName,scaling):
             LS.setSndMember(Un_implicite)
             Un_implicite=LS.solve();
             if(not LS.getStatus()):
-                print "Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations"
+                print( "Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations" )
                 raise ValueError("Pas de convergence du système linéaire");
             dUn_implicite-=Un_implicite
     
@@ -171,8 +171,8 @@ def WaveSystemVF(ntmax, tmax, cfl, a,b,nx, output_freq, meshName,scaling):
         
             #Sauvegardes
             if(it==1 or it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
-                print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-                print "Linear system converged in ", LS.getNumberOfIter(), " GMRES iterations"
+                print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+                print( "Linear system converged in ", LS.getNumberOfIter(), " GMRES iterations" )
     
                 np.savetxt("WaveSystem" +str(dim)+"DUpwindExplicit"+meshName+"_pressure"+str(it)+".txt", pressure_field          , delimiter="\n")
                 np.savetxt("WaveSystem" +str(dim)+"DUpwindExplicit"+meshName+"_velocity"+str(it)+".txt", velocity_field          , delimiter="\n")
@@ -180,15 +180,15 @@ def WaveSystemVF(ntmax, tmax, cfl, a,b,nx, output_freq, meshName,scaling):
                 np.savetxt("WaveSystem" +str(dim)+"DUpwindImplicit"+meshName+"_velocity"+str(it)+".txt", velocity_field          , delimiter="\n")
                 plt.savefig("WaveSystem"+str(dim)+"DUpwind"        +meshName+"_pressure"+str(it)+".png")
     
-                print
-    print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
+                print()
+    print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint" )
         return
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
-        print "------------------------------------------------------------------------------------"
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time )
+        print( "------------------------------------------------------------------------------------")
 
         np.savetxt( "WaveSystem"+str(dim)+"DUpwind"+meshName+"_pressure_Stat.txt", pressure_field, delimiter="\n")
         np.savetxt( "WaveSystem"+str(dim)+"DUpwind"+meshName+"_velocity_Stat.txt", velocity_field, delimiter="\n")
@@ -196,16 +196,16 @@ def WaveSystemVF(ntmax, tmax, cfl, a,b,nx, output_freq, meshName,scaling):
 
         return
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint")
         return
 
 
 def solve( a,b,nx, meshName, scaling, meshType, cfl):
 
-    print "Resolution of the Wave system in dimension 1 on "+str(nx)+ " cells, upwind scheme"
-    print "Initial data : ", "Riemann problem"
-    print "Boundary conditions : ", "Neumann"
-    print "Mesh name : ",meshName , ", ", nx, " cells"
+    print( "Resolution of the Wave system in dimension 1 on "+str(nx)+ " cells, upwind scheme")
+    print( "Initial data : ", "Riemann problem")
+    print( "Boundary conditions : ", "Neumann")
+    print( "Mesh name : ",meshName , ", ", nx, " cells")
     
     # Problem data
     tmax = 10000.
old mode 100644 (file)
new mode 100755 (executable)
index 2c5ec61..6e16e23
@@ -18,76 +18,76 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     SET(MESH_FILE  ../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithBrickWall.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_brickwall ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_brickwall PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_brickwall APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_brickwall        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_brickwall APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithCheckerboardSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_checkerboard ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_checkerboard PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_checkerboard APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_checkerboard        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_checkerboard APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithDeformedQuadrangles.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_deformedQuadrangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_deformedQuadrangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_deformedQuadrangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_deformedQuadrangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_deformedQuadrangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithHexagons.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(IMPLICIT_SCHEME  1 )
 
     SET(MESH_FILE  ../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithBrickWall.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_brickwall ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_brickwall PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_brickwall APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_brickwall        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_brickwall APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithCheckerboardSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_checkerboard ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_checkerboard PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_checkerboard APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_checkerboard        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_checkerboard APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithDeformedQuadrangles.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_deformedQuadrangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_deformedQuadrangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_deformedQuadrangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_deformedQuadrangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_deformedQuadrangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../ressources/squareWithHexagons.med  )
 
     ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index e03f833..964aeff
@@ -27,7 +27,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_RiemannProblem(my_mesh):
-    print "Initial data : Riemann problem"
+    print( "Initial data : Riemann problem" )
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -163,7 +163,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
             LS.setSndMember(Un)
             Un=LS.solve();
             if(not LS.getStatus()):
-                print "Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations"
+                print( "Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations" )
                 raise ValueError("Pas de convergence du système linéaire");
             dUn-=Un
 
@@ -176,7 +176,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
  
          #Sauvegardes
         if(it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
-            print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt))
+            print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
 
             for k in range(nbCells):
                 pressure_field[k]  =Un[k*(dim+1)+0]
@@ -192,12 +192,12 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
             velocity_field.writeVTK("WaveSystem"+str(dim)+"DUpwind"+"_isImplicit"+str(isImplicit)+meshName+"_velocity",False);
 
     print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt))
-    print
+    print()
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint")
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time)
 
         pressure_field.setTime(time,0);
         pressure_field.writeVTK("WaveSystem"+str(dim)+"DUpwind"+"_isImplicit"+str(isImplicit)+meshName+"_pressure_Stat");
@@ -212,15 +212,15 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
         PV_routines.Save_PV_data_to_picture_file("WaveSystem"+str(dim)+"DUpwind"+"_isImplicit"+str(isImplicit)+meshName+"_velocity_Stat"+'_0.vtu',"Velocity",'CELLS',"WaveSystem"+str(dim)+"DUpwind"+meshName+"_velocity_Stat")
         
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint")
 
 
 def solve(my_mesh,filename,resolution, isImplicit):
-    print "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension()
-    print "Numerical method : upwind"
-    print "Initial data : single straight discontinuity (Riemann problem)"
-    print "Neumann boundary conditions"
-    print "Mesh name : ",filename , my_mesh.getNumberOfCells(), " cells"
+    print( "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension() )
+    print( "Numerical method : upwind")
+    print( "Initial data : single straight discontinuity (Riemann problem)")
+    print( "Neumann boundary conditions")
+    print( "Mesh name : ",filename , my_mesh.getNumberOfCells(), " cells")
 
     # Problem data
     tmax = 1.
old mode 100644 (file)
new mode 100755 (executable)
index 1b0a86e..d112a48
@@ -19,50 +19,50 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     SET(MESH_FILE  ../../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_Centered_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_SQUARE_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_Centered_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/meshCube.med  )
 
     ADD_TEST(ExampleWaveSystem_3DShock_Centered_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_Centered_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_Centered_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_Centered_CUBE_tetrahedra        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_Centered_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/cubeWithCubes.med  )
 
     ADD_TEST(ExampleWaveSystem_3DShock_Centered_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_Centered_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_Centered_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_Centered_CUBE_cubes        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_Centered_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_Centered_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_Centered_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_Centered_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_spiderWeb        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_Centered_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Centered_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index c78c613..bed8816
@@ -28,7 +28,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_shock(my_mesh, isCircle):
-    print "Initial data : Spherical wave"
+    print( "Initial data : Spherical wave" )
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -145,7 +145,7 @@ def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
                     implMat.addValue(j*nbComp,cellAutre*nbComp,Am)
                     implMat.addValue(j*nbComp,        j*nbComp,Am*(-1.))
                 elif(Fk.getGroupName() != "Neumann"):#Nothing to do for Neumann boundary condition
-                    print Fk.getGroupName()
+                    print( Fk.getGroupName() )
                     raise ValueError("computeFluxes: Unknown boundary condition name");
                 
     return implMat
@@ -174,7 +174,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
     elif(filename.find("disk")>-1 or filename.find("Disk")>-1):
         pressure_field, velocity_field = initial_conditions_shock(my_mesh,True)
     else:
-        print "Mesh name : ", filename
+        print( "Mesh name : ", filename )
         raise ValueError("Mesh name should contain substring square, cube or disk")
 
     for k in range(nbCells):
@@ -215,7 +215,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
         cvgceLS=LS.getStatus();
         iterGMRES=LS.getNumberOfIter();
         if(not cvgceLS):
-            print "Linear system did not converge ", iterGMRES, " GMRES iterations"
+            print( "Linear system did not converge ", iterGMRES, " GMRES iterations" )
             raise ValueError("Pas de convergence du système linéaire");
         dUn-=Un
         
@@ -228,9 +228,9 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
     
         #Sauvegardes
         if(it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
-            print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-            print "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0
-            print "Linear system converged in ", iterGMRES, " GMRES iterations"
+            print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+            print( "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0 )
+            print( "Linear system converged in ", iterGMRES, " GMRES iterations" )
 
             for k in range(nbCells):
                 pressure_field[k]=Un[k*(dim+1)+0]
@@ -245,15 +245,15 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
             velocity_field.setTime(time,it);
             velocity_field.writeVTK("WaveSystem"+str(dim)+"DCentered"+meshName+"_velocity",False);
 
-    print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-    print "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0
-    print
+    print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+    print( "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0 )
+    print()
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint" )
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
-        print "------------------------------------------------------------------------------------"
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time )
+        print( "------------------------------------------------------------------------------------" )
 
         pressure_field.setTime(time,0);
         pressure_field.writeVTK("WaveSystem"+str(dim)+"DCentered"+meshName+"_pressure_Stat");
@@ -265,15 +265,15 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
         PV_routines.Save_PV_data_to_picture_file("WaveSystem"+str(dim)+"DCentered"+meshName+"_velocity_Stat"+'_0.vtu',"Velocity",'CELLS',"WaveSystem"+str(dim)+"DCentered"+meshName+"_velocity_Stat")
         
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint" )
 
 
 def solve(my_mesh,meshName,resolution):
-    print "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension()
-    print "Numerical method : implicit centered"
-    print "Initial data : spherical wave"
-    print "Wall boundary conditions"
-    print "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells"
+    print( "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension() )
+    print( "Numerical method : implicit centered")
+    print( "Initial data : spherical wave")
+    print( "Wall boundary conditions")
+    print( "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells")
     
     # Problem data
     tmax = 1000.
old mode 100644 (file)
new mode 100755 (executable)
index 7f85fc7..fcfbb10
@@ -19,50 +19,50 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     SET(MESH_FILE  ../../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_PStag_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_SQUARE_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_PStag_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/meshCube.med  )
 
     ADD_TEST(ExampleWaveSystem_3DShock_PStag_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_PStag_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_PStag_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_PStag_CUBE_tetrahedra        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_PStag_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/cubeWithCubes.med  )
 
     ADD_TEST(ExampleWaveSystem_3DShock_PStag_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_PStag_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_PStag_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_PStag_CUBE_cubes        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_PStag_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_PStag_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_PStag_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_PStag_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_spiderWeb        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_PStag_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_PStag_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index d922d0c..593997b
@@ -28,7 +28,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_shock(my_mesh, isCircle):
-    print "Initial data : Spherical wave"
+    print( "Initial data : Spherical wave" )
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -148,7 +148,7 @@ def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
                     implMat.addValue(j*nbComp,cellAutre*nbComp,Am)
                     implMat.addValue(j*nbComp,        j*nbComp,Am*(-1.))
                 elif(Fk.getGroupName() != "Neumann"):#Nothing to do for Neumann boundary condition
-                    print Fk.getGroupName()
+                    print( Fk.getGroupName() )
                     raise ValueError("computeFluxes: Unknown boundary condition name");
                 
     return implMat
@@ -177,7 +177,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
     elif(filename.find("disk")>-1 or filename.find("Disk")>-1):
         pressure_field, velocity_field = initial_conditions_shock(my_mesh,True)
     else:
-        print "Mesh name : ", filename
+        print( "Mesh name : ", filename )
         raise ValueError("Mesh name should contain substring square, cube or disk")
 
     for k in range(nbCells):
@@ -218,7 +218,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
         cvgceLS=LS.getStatus();
         iterGMRES=LS.getNumberOfIter();
         if(not cvgceLS):
-            print "Linear system did not converge ", iterGMRES, " GMRES iterations"
+            print( "Linear system did not converge ", iterGMRES, " GMRES iterations" )
             raise ValueError("Pas de convergence du système linéaire");
         dUn-=Un
         
@@ -231,9 +231,9 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
     
         #Sauvegardes
         if(it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
-            print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-            print "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0
-            print "Linear system converged in ", iterGMRES, " GMRES iterations"
+            print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+            print( "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0 )
+            print( "Linear system converged in ", iterGMRES, " GMRES iterations" )
 
             for k in range(nbCells):
                 pressure_field[k]=Un[k*(dim+1)+0]
@@ -248,15 +248,15 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
             velocity_field.setTime(time,it);
             velocity_field.writeVTK("WaveSystem"+str(dim)+"DPStag"+meshName+"_velocity",False);
 
-    print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-    print "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0
-    print
+    print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+    print( "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0)
+    print()
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint")
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
-        print "------------------------------------------------------------------------------------"
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time)
+        print( "------------------------------------------------------------------------------------")
 
         pressure_field.setTime(time,0);
         pressure_field.writeVTK("WaveSystem"+str(dim)+"DPStag"+meshName+"_pressure_Stat");
@@ -268,15 +268,15 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
         PV_routines.Save_PV_data_to_picture_file("WaveSystem"+str(dim)+"DPStag"+meshName+"_velocity_Stat"+'_0.vtu',"Velocity",'CELLS',"WaveSystem"+str(dim)+"DPStag"+meshName+"_velocity_Stat")
         
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint" )
 
 
 def solve(my_mesh,meshName,resolution):
-    print "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension()
-    print "Numerical method : implicit pseudo staggered"
-    print "Initial data : spherical wave"
-    print "Wall boundary conditions"
-    print "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells"
+    print( "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension() )
+    print( "Numerical method : implicit pseudo staggered" )
+    print( "Initial data : spherical wave" )
+    print( "Wall boundary conditions" )
+    print( "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells" )
     
     # Problem data
     tmax = 1000.
old mode 100644 (file)
new mode 100755 (executable)
index 836a6b2..31715d7
@@ -2,8 +2,8 @@
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExampleWaveSystem_2DShock_Staggered_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemStaggered.py )
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Staggered_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Staggered_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Staggered_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_Staggered_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index bcdd455..69ef241
@@ -27,7 +27,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_shock(my_mesh, isCircle):
-    print "Initial data : Spherical wave"
+    print( "Initial data : Spherical wave")
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -232,7 +232,7 @@ def WaveSystemStaggered(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
     elif(meshName.find("disk")>-1 or meshName.find("Disk")>-1):
         pressure_field, velocity_field = initial_conditions_shock(my_mesh,True)
     else:
-        print "Mesh name : ", meshName
+        print( "Mesh name : ", meshName )
         raise ValueError("Mesh name should contain substring square, cube or disk")
 
     for k in range(nbCells):
@@ -279,7 +279,7 @@ def WaveSystemStaggered(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
         cvgceLS=LS.getStatus();
         iterGMRES=LS.getNumberOfIter();
         if(not cvgceLS):
-            print "Linear system did not converge ", iterGMRES, " GMRES iterations"
+            print( "Linear system did not converge ", iterGMRES, " GMRES iterations")
             raise ValueError("Pas de convergence du système linéaire");
         dUn-=Un
         
@@ -296,9 +296,9 @@ def WaveSystemStaggered(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
     
         #Sauvegardes
         if(it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
-            print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-            print "Variation temporelle relative : pressure ", max_dp/p0 ,", velocity ", max_dq/rho0
-            print "Linear system converged in ", iterGMRES, " GMRES iterations"
+            print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+            print( "Variation temporelle relative : pressure ", max_dp/p0 ,", velocity ", max_dq/rho0 )
+            print( "Linear system converged in ", iterGMRES, " GMRES iterations" )
 
             for k in range(nbCells):
                 pressure_field[k]=Un[k]
@@ -313,15 +313,15 @@ def WaveSystemStaggered(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
             velocity_field.setTime(time,it);
             velocity_field.writeVTK("WaveSystem"+str(dim)+"DStaggered"+meshName+"_velocity",False);
 
-    print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-    print "Variation temporelle relative : pressure ", max_dp/p0 ,", velocity ", max_dq/rho0 
-    print
+    print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+    print( "Variation temporelle relative : pressure ", max_dp/p0 ,", velocity ", max_dq/rho0 )
+    print()
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint")
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
-        print "------------------------------------------------------------------------------------"
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time)
+        print( "------------------------------------------------------------------------------------")
 
         pressure_field.setTime(time,0);
         pressure_field.writeVTK("WaveSystem"+str(dim)+"DStaggered"+meshName+"_pressure_Stat");
@@ -333,15 +333,15 @@ def WaveSystemStaggered(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
         PV_routines.Save_PV_data_to_picture_file("WaveSystem"+str(dim)+"DStaggered"+meshName+"_velocity_Stat"+'_0.vtu',"Velocity",'CELLS',"WaveSystem"+str(dim)+"DStaggered"+meshName+"_velocity_Stat")
         
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint")
 
 
 def solve(my_mesh,meshName,resolution):
-    print "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension()
-    print "Numerical method : staggered scheme"
-    print "Initial data : Spherical wave"
-    print "Periodic boundary conditions"
-    print "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells"
+    print( "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension() )
+    print( "Numerical method : staggered scheme" )
+    print( "Initial data : Spherical wave" )
+    print( "Periodic boundary conditions" )
+    print( "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells" )
     
     # Problem data
     tmax = 1000.
old mode 100644 (file)
new mode 100755 (executable)
index ba18fac..64d3990
@@ -21,100 +21,100 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     SET(MESH_FILE  ../../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/meshCube.med  )
 
     ADD_TEST(ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_tetrahedra        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/cubeWithCubes.med  )
 
     ADD_TEST(ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_cubes        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_spiderWeb        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindExplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(IMPLICIT_SCHEME  1 )
 
     SET(MESH_FILE  ../../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/meshCube.med  )
 
     ADD_TEST(ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_tetrahedra        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/cubeWithCubes.med  )
 
     ADD_TEST(ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_cubes        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_spiderWeb        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DShock_UpwindImplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index c9f99cb..8569197
@@ -27,7 +27,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_shock(my_mesh, isCircle):
-    print "Initial data : Spherical wave"
+    print( "Initial data : Spherical wave" )
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -142,7 +142,7 @@ def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
                     implMat.addValue(j*nbComp,cellAutre*nbComp,Am)
                     implMat.addValue(j*nbComp,        j*nbComp,Am*(-1.))
                 elif(Fk.getGroupName() != "Neumann"):#Nothing to do for Neumann boundary condition
-                    print Fk.getGroupName()
+                    print( Fk.getGroupName() )
                     raise ValueError("computeFluxes: Unknown boundary condition name");
                 
     return implMat
@@ -165,7 +165,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
     elif(filename.find("disk")>-1 or filename.find("Disk")>-1):
         pressure_field, velocity_field = initial_conditions_shock(my_mesh,True)
     else:
-        print "Mesh name : ", filename
+        print( "Mesh name : ", filename )
         raise ValueError("Mesh name should contain substring square, cube or disk")
 
     #iteration vectors
@@ -209,7 +209,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
             LS.setSndMember(Un)
             Un=LS.solve();
             if(not LS.getStatus()):
-                print "Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations"
+                print( "Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations" )
                 raise ValueError("Pas de convergence du système linéaire");
             dUn-=Un
 
@@ -238,12 +238,12 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
             velocity_field.writeVTK("WaveSystem"+str(dim)+"DUpwind"+"_isImplicit"+str(isImplicit)+meshName+"_velocity",False);
 
     print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt))
-    print
+    print()
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint")
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time)
 
         pressure_field.setTime(time,0);
         pressure_field.writeVTK("WaveSystem"+str(dim)+"DUpwind"+"_isImplicit"+str(isImplicit)+meshName+"_pressure_Stat");
@@ -258,15 +258,15 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
         PV_routines.Save_PV_data_to_picture_file("WaveSystem"+str(dim)+"DUpwind"+"_isImplicit"+str(isImplicit)+meshName+"_velocity_Stat"+'_0.vtu',"Velocity",'CELLS',"WaveSystem"+str(dim)+"DUpwind"+meshName+"_velocity_Stat")
         
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint")
 
 
 def solve(my_mesh,filename,resolution, isImplicit):
-    print "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension()
-    print "Numerical method : upwind"
-    print "Initial data : spherical wave"
-    print "Wall boundary conditions"
-    print "Mesh name : ",filename , my_mesh.getNumberOfCells(), " cells"
+    print( "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension() )
+    print( "Numerical method : upwind" )
+    print( "Initial data : spherical wave" )
+    print( "Wall boundary conditions" )
+    print( "Mesh name : ",filename , my_mesh.getNumberOfCells(), " cells" )
 
     # Problem data
     tmax = 1.
old mode 100644 (file)
new mode 100755 (executable)
index 69614cc..8036da7
@@ -19,50 +19,50 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     SET(MESH_FILE  ../../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_Centered_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_SQUARE_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_Centered_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/meshCube.med  )
 
     ADD_TEST(ExampleWaveSystem_3DVortex_Centered_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_Centered_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_Centered_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_Centered_CUBE_tetrahedra        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_Centered_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/cubeWithCubes.med  )
 
     ADD_TEST(ExampleWaveSystem_3DVortex_Centered_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_Centered_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_Centered_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_Centered_CUBE_cubes        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_Centered_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_Centered_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_Centered_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_Centered_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_spiderWeb        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_Centered_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Centered_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index e7cd386..76c67b1
@@ -28,7 +28,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_disk_vortex(my_mesh):
-    print "Disk vortex initial data"
+    print( "Disk vortex initial data")
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -51,7 +51,7 @@ def initial_conditions_disk_vortex(my_mesh):
     return pressure_field, velocity_field
 
 def initial_conditions_square_vortex(my_mesh):
-    print "Initial data : Square vortex (Constant pressure, divergence free velocity)"
+    print( "Initial data : Square vortex (Constant pressure, divergence free velocity)")
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -148,7 +148,7 @@ def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
                     implMat.addValue(j*nbComp,cellAutre*nbComp,Am)
                     implMat.addValue(j*nbComp,        j*nbComp,Am*(-1.))
                 elif(Fk.getGroupName() != "Neumann"):#Nothing to do for Neumann boundary condition
-                    print Fk.getGroupName()
+                    print( Fk.getGroupName() )
                     raise ValueError("computeFluxes: Unknown boundary condition name");
                 
     return implMat
@@ -177,7 +177,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
     elif(filename.find("disk")>-1 or filename.find("Disk")>-1):
         pressure_field, velocity_field = initial_conditions_disk_vortex(my_mesh)
     else:
-        print "Mesh name : ", filename
+        print( "Mesh name : ", filename)
         raise ValueError("Mesh name should contain substring square, cube or disk")
 
     for k in range(nbCells):
@@ -217,7 +217,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
         cvgceLS=LS.getStatus();
         iterGMRES=LS.getNumberOfIter();
         if(not cvgceLS):
-            print "Linear system did not converge ", iterGMRES, " GMRES iterations"
+            print( "Linear system did not converge ", iterGMRES, " GMRES iterations")
             raise ValueError("Pas de convergence du système linéaire");
         dUn-=Un
         
@@ -230,9 +230,9 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
     
         #Sauvegardes
         if(it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
-            print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-            print "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0
-            print "Linear system converged in ", iterGMRES, " GMRES iterations"
+            print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+            print( "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0 )
+            print( "Linear system converged in ", iterGMRES, " GMRES iterations")
 
             for k in range(nbCells):
                 pressure_field[k]=Un[k*(dim+1)+0]
@@ -247,15 +247,15 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
             velocity_field.setTime(time,it);
             velocity_field.writeVTK("WaveSystem"+str(dim)+"DCentered"+meshName+"_velocity",False);
 
-    print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-    print "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0
-    print
+    print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+    print( "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0 )
+    print()
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint")
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
-        print "------------------------------------------------------------------------------------"
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time)
+        print( "------------------------------------------------------------------------------------")
 
         pressure_field.setTime(time,0);
         pressure_field.writeVTK("WaveSystem"+str(dim)+"DCentered"+meshName+"_pressure_Stat");
@@ -267,15 +267,15 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
         PV_routines.Save_PV_data_to_picture_file("WaveSystem"+str(dim)+"DCentered"+meshName+"_velocity_Stat"+'_0.vtu',"Velocity",'CELLS',"WaveSystem"+str(dim)+"DCentered"+meshName+"_velocity_Stat")
         
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint")
 
 
 def solve(my_mesh,meshName,resolution):
-    print "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension()
-    print "Numerical method : implicit centered"
-    print "Initial data : stationary solution (constant pressure, divergence free velocity)"
-    print "Wall boundary conditions"
-    print "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells"
+    print( "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension() )
+    print( "Numerical method : implicit centered" )
+    print( "Initial data : stationary solution (constant pressure, divergence free velocity)" )
+    print( "Wall boundary conditions" )
+    print( "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells" )
     
     # Problem data
     tmax = 1000.
old mode 100644 (file)
new mode 100755 (executable)
index f835093..356f1e9
@@ -19,50 +19,50 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     SET(MESH_FILE  ../../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_PStag_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_SQUARE_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_PStag_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/meshCube.med  )
 
     ADD_TEST(ExampleWaveSystem_3DVortex_PStag_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_PStag_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_PStag_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_PStag_CUBE_tetrahedra        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_PStag_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/cubeWithCubes.med  )
 
     ADD_TEST(ExampleWaveSystem_3DVortex_PStag_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_PStag_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_PStag_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_PStag_CUBE_cubes        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_PStag_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_PStag_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_PStag_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_PStag_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_spiderWeb        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_PStag_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py  ${MESH_FILE})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_PStag_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 8fe8730..3189433
@@ -28,7 +28,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_disk_vortex(my_mesh):
-    print "Disk vortex initial data"
+    print( "Disk vortex initial data" )
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -51,7 +51,7 @@ def initial_conditions_disk_vortex(my_mesh):
     return pressure_field, velocity_field
 
 def initial_conditions_square_vortex(my_mesh):
-    print "Initial data : Square vortex (Constant pressure, divergence free velocity)"
+    print( "Initial data : Square vortex (Constant pressure, divergence free velocity)" )
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -151,7 +151,7 @@ def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
                     implMat.addValue(j*nbComp,cellAutre*nbComp,Am)
                     implMat.addValue(j*nbComp,        j*nbComp,Am*(-1.))
                 elif(Fk.getGroupName() != "Neumann"):#Nothing to do for Neumann boundary condition
-                    print Fk.getGroupName()
+                    print( Fk.getGroupName() )
                     raise ValueError("computeFluxes: Unknown boundary condition name");
                 
     return implMat
@@ -180,7 +180,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
     elif(filename.find("disk")>-1 or filename.find("Disk")>-1):
         pressure_field, velocity_field = initial_conditions_disk_vortex(my_mesh)
     else:
-        print "Mesh name : ", filename
+        print( "Mesh name : ", filename)
         raise ValueError("Mesh name should contain substring square, cube or disk")
 
     for k in range(nbCells):
@@ -220,7 +220,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
         cvgceLS=LS.getStatus();
         iterGMRES=LS.getNumberOfIter();
         if(not cvgceLS):
-            print "Linear system did not converge ", iterGMRES, " GMRES iterations"
+            print( "Linear system did not converge ", iterGMRES, " GMRES iterations")
             raise ValueError("Pas de convergence du système linéaire");
         dUn-=Un
         
@@ -233,9 +233,9 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
     
         #Sauvegardes
         if(it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
-            print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-            print "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0
-            print "Linear system converged in ", iterGMRES, " GMRES iterations"
+            print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+            print( "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0 )
+            print( "Linear system converged in ", iterGMRES, " GMRES iterations" )
 
             for k in range(nbCells):
                 pressure_field[k]=Un[k*(dim+1)+0]
@@ -250,15 +250,15 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
             velocity_field.setTime(time,it);
             velocity_field.writeVTK("WaveSystem"+str(dim)+"DPStag"+meshName+"_velocity",False);
 
-    print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-    print "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0
-    print
+    print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+    print( "Variation temporelle relative : pressure ", maxVector[0]/p0 ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0 )
+    print()
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint")
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
-        print "------------------------------------------------------------------------------------"
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time)
+        print( "------------------------------------------------------------------------------------")
 
         pressure_field.setTime(time,0);
         pressure_field.writeVTK("WaveSystem"+str(dim)+"DPStag"+meshName+"_pressure_Stat");
@@ -270,15 +270,15 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution):
         PV_routines.Save_PV_data_to_picture_file("WaveSystem"+str(dim)+"DPStag"+meshName+"_velocity_Stat"+'_0.vtu',"Velocity",'CELLS',"WaveSystem"+str(dim)+"DPStag"+meshName+"_velocity_Stat")
         
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint")
 
 
 def solve(my_mesh,meshName,resolution):
-    print "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension()
-    print "Numerical method : implicit pseudo staggered"
-    print "Initial data : stationary solution (constant pressure, divergence free velocity)"
-    print "Wall boundary conditions"
-    print "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells"
+    print( "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension())
+    print( "Numerical method : implicit pseudo staggered")
+    print( "Initial data : stationary solution (constant pressure, divergence free velocity)")
+    print( "Wall boundary conditions")
+    print( "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells" )
     
     # Problem data
     tmax = 1000.
old mode 100644 (file)
new mode 100755 (executable)
index c662687..e227590
@@ -2,8 +2,8 @@
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     ADD_TEST(ExampleWaveSystem_2DVortex_Staggered_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemStaggered.py )
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Staggered_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Staggered_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Staggered_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_Staggered_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index cedc21c..6318a50
@@ -27,7 +27,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_square_vortex(my_mesh):
-    print "Initial data : Square vortex (Constant pressure, divergence free velocity)"
+    print( "Initial data : Square vortex (Constant pressure, divergence free velocity)" )
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -251,7 +251,7 @@ def WaveSystemStaggered(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
         cvgceLS=LS.getStatus();
         iterGMRES=LS.getNumberOfIter();
         if(not cvgceLS):
-            print "Linear system did not converge ", iterGMRES, " GMRES iterations"
+            print( "Linear system did not converge ", iterGMRES, " GMRES iterations")
             raise ValueError("Pas de convergence du système linéaire");
         dUn-=Un
         
@@ -268,9 +268,9 @@ def WaveSystemStaggered(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
     
         #Sauvegardes
         if(it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
-            print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-            print "Variation temporelle relative : pressure ", max_dp/p0 ,", velocity ", max_dq/rho0
-            print "Linear system converged in ", iterGMRES, " GMRES iterations"
+            print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+            print( "Variation temporelle relative : pressure ", max_dp/p0 ,", velocity ", max_dq/rho0)
+            print( "Linear system converged in ", iterGMRES, " GMRES iterations")
 
             for k in range(nbCells):
                 pressure_field[k]=Un[k]
@@ -285,15 +285,15 @@ def WaveSystemStaggered(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
             velocity_field.setTime(time,it);
             velocity_field.writeVTK("WaveSystem"+str(dim)+"DStaggered"+meshName+"_velocity",False);
 
-    print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
-    print "Variation temporelle relative : pressure ", max_dp/p0 ,", velocity ", max_dq/rho0 
-    print
+    print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
+    print( "Variation temporelle relative : pressure ", max_dp/p0 ,", velocity ", max_dq/rho0 )
+    print()
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint")
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
-        print "------------------------------------------------------------------------------------"
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time)
+        print( "------------------------------------------------------------------------------------")
 
         pressure_field.setTime(time,0);
         pressure_field.writeVTK("WaveSystem"+str(dim)+"DStaggered"+meshName+"_pressure_Stat");
@@ -305,15 +305,15 @@ def WaveSystemStaggered(ntmax, tmax, cfl, my_mesh, output_freq, meshName, resolu
         PV_routines.Save_PV_data_to_picture_file("WaveSystem"+str(dim)+"DStaggered"+meshName+"_velocity_Stat"+'_0.vtu',"Velocity",'CELLS',"WaveSystem"+str(dim)+"DStaggered"+meshName+"_velocity_Stat")
         
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint" )
 
 
 def solve(my_mesh,meshName,resolution):
-    print "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension()
-    print "Numerical method : staggered scheme"
-    print "Initial data : stationary solution (constant pressure, divergence free velocity)"
-    print "Periodic boundary conditions"
-    print "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells"
+    print( "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension())
+    print( "Numerical method : staggered scheme")
+    print( "Initial data : stationary solution (constant pressure, divergence free velocity)")
+    print( "Periodic boundary conditions")
+    print( "Mesh name : ",meshName , my_mesh.getNumberOfCells(), " cells")
     
     # Problem data
     tmax = 1000.
old mode 100644 (file)
new mode 100755 (executable)
index 5f37d66..bb3a7eb
@@ -21,100 +21,100 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
     SET(MESH_FILE  ../../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/meshCube.med  )
 
     ADD_TEST(ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_tetrahedra        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/cubeWithCubes.med  )
 
     ADD_TEST(ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_cubes        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_spiderWeb        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(IMPLICIT_SCHEME  0 )
 
     SET(MESH_FILE  ../../../ressources/meshSquare.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/squareWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/meshCube.med  )
 
     ADD_TEST(ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_tetrahedra PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_tetrahedra        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_tetrahedra APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/cubeWithCubes.med  )
 
     ADD_TEST(ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_cubes PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_cubes        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_cubes APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithTriangles.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_triangles PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_triangles        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_triangles APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSquares.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_squares PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_squares        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_squares APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithSpiderWeb.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_spiderWeb PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_spiderWeb        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_spiderWeb APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(MESH_FILE  ../../../ressources/diskWithHexagons.med  )
 
     ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py  ${MESH_FILE} ${IMPLICIT_SCHEME})
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_hexagons PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CDMATH_BINARY_DIR}/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}:${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_hexagons        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_hexagons APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
old mode 100644 (file)
new mode 100755 (executable)
index 83a5cfe..7cff68b
@@ -27,7 +27,7 @@ rho0=p0/c0*c0#reference density
 precision=1e-5
 
 def initial_conditions_disk_vortex(my_mesh):
-    print "Disk vortex initial data"
+    print( "Disk vortex initial data")
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -50,7 +50,7 @@ def initial_conditions_disk_vortex(my_mesh):
     return pressure_field, velocity_field
 
 def initial_conditions_square_vortex(my_mesh):
-    print "Initial data : Square vortex (Constant pressure, divergence free velocity)"
+    print( "Initial data : Square vortex (Constant pressure, divergence free velocity)" )
     dim     = my_mesh.getMeshDimension()
     nbCells = my_mesh.getNumberOfCells()
 
@@ -145,7 +145,7 @@ def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
                     implMat.addValue(j*nbComp,cellAutre*nbComp,Am)
                     implMat.addValue(j*nbComp,        j*nbComp,Am*(-1.))
                 elif(Fk.getGroupName() != "Neumann"):#Nothing to do for Neumann boundary condition
-                    print Fk.getGroupName()
+                    print( Fk.getGroupName() )
                     raise ValueError("computeFluxes: Unknown boundary condition name");
                 
     return implMat
@@ -168,7 +168,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
     elif(filename.find("disk")>-1 or filename.find("Disk")>-1):
         pressure_field, velocity_field = initial_conditions_disk_vortex(my_mesh)
     else:
-        print "Mesh name : ", filename
+        print( "Mesh name : ", filename)
         raise ValueError("Mesh name should contain substring square, cube or disk")
 
     #iteration vectors
@@ -204,7 +204,6 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
         
     print("Starting computation of the linear wave system with an UPWIND scheme …")
     
-    print "coucou2"
     # Starting time loop
     while (it<ntmax and time <= tmax and not isStationary):
         if(isImplicit):
@@ -212,7 +211,7 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
             LS.setSndMember(Un)
             Un=LS.solve();
             if(not LS.getStatus()):
-                print "Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations"
+                print( "Linear system did not converge ", LS.getNumberOfIter(), " GMRES iterations")
                 raise ValueError("Pas de convergence du système linéaire");
             dUn-=Un
 
@@ -241,12 +240,12 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
             velocity_field.writeVTK("WaveSystem"+str(dim)+"DUpwind"+meshName+"_velocity",False);
 
     print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt))
-    print
+    print()
 
     if(it>=ntmax):
-        print "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint"
+        print( "Nombre de pas de temps maximum ntmax= ", ntmax, " atteint")
     elif(isStationary):
-        print "Régime stationnaire atteint au pas de temps ", it, ", t= ", time
+        print( "Régime stationnaire atteint au pas de temps ", it, ", t= ", time)
 
         pressure_field.setTime(time,0);
         pressure_field.writeVTK("WaveSystem"+str(dim)+"DUpwind"+meshName+"_pressure_Stat");
@@ -261,15 +260,15 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is
         PV_routines.Save_PV_data_to_picture_file("WaveSystem"+str(dim)+"DUpwind"+meshName+"_velocity_Stat"+'_0.vtu',"Velocity",'CELLS',"WaveSystem"+str(dim)+"DUpwind"+meshName+"_velocity_Stat")
         
     else:
-        print "Temps maximum Tmax= ", tmax, " atteint"
+        print( "Temps maximum Tmax= ", tmax, " atteint")
 
 
 def solve(my_mesh,filename,resolution, isImplicit):
-    print "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension()
-    print "Numerical method : upwind"
-    print "Initial data : stationary solution (constant pressure, divergence free velocity)"
-    print "Wall boundary conditions"
-    print "Mesh name : ",filename , my_mesh.getNumberOfCells(), " cells"
+    print( "Resolution of the Wave system in dimension ", my_mesh.getSpaceDimension())
+    print( "Numerical method : upwind")
+    print( "Initial data : stationary solution (constant pressure, divergence free velocity)")
+    print( "Wall boundary conditions")
+    print( "Mesh name : ",filename , my_mesh.getNumberOfCells(), " cells")
 
     # Problem data
     tmax = 1.
old mode 100644 (file)
new mode 100755 (executable)
index f9387fc..304bbfe
@@ -4,6 +4,6 @@ SET(MESH_MED2
 
 file(COPY ${MESH_MED2} DESTINATION ${CMAKE_BINARY_DIR}/tests/ressources)
 
-install(DIRECTORY ${MESH_MED2} DESTINATION share/meshes)
+install(DIRECTORY ${MESH_MED2} DESTINATION meshes)
 
 
old mode 100644 (file)
new mode 100755 (executable)
index fc409d5..6269a66
@@ -1,9 +1,9 @@
 
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_POSTPRO)#The environment is probably too rich for the current test contain
   ADD_TEST(Test_Boys_Surface ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/BoysSurfaceVTK.py)
-  SET_PROPERTY(TEST Test_Boys_Surface PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-  SET_PROPERTY(TEST Test_Boys_Surface 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}:${PV_PYTHON_DIR}")
+  SET_PROPERTY(TEST Test_Boys_Surface PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+  SET_PROPERTY(TEST Test_Boys_Surface APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 endif ()
 
-INSTALL(FILES BoysSurfaceVTK.py VTKnewReader.py DESTINATION bin/tests/BoysSurface)
+INSTALL(FILES BoysSurfaceVTK.py VTKnewReader.py DESTINATION bin/BoysSurface)
 
old mode 100644 (file)
new mode 100755 (executable)
index 94c4de4..ccaaeef
@@ -8,36 +8,31 @@ SET(MESH_MED
 file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/tests/swig)
 ADD_TEST(TestsCDMATHSwig ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/mainTests.py)
 
-# Some users have to set environment variables manually before launching tests.
-# On Ubuntu:
-# export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib/:${PETSC_DIR}/${PETSC_ARCH}/lib
-# export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath
-
 if (CDMATH_WITH_PETSC)
     ADD_TEST(TestsLinearSolverSwig ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/linearSolverTests.py)
-    SET_PROPERTY(TEST TestsLinearSolverSwig PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib")
-    SET_PROPERTY(TEST TestsLinearSolverSwig APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}")
-    INSTALL(FILES linearSolverTests.py DESTINATION bin/tests)
+    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)
 
-    SET_PROPERTY(TEST TestsCDMATHSwig PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib")
+    SET_PROPERTY(TEST TestsCDMATHSwig PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}")
 
 else (CDMATH_WITH_PETSC)
-    SET_PROPERTY(TEST TestsCDMATHSwig PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${HDF5_ROOT_DIR}/lib")
+    SET_PROPERTY(TEST TestsCDMATHSwig PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${HDF5_ROOT_DIR}/lib")
 endif (CDMATH_WITH_PETSC)
 
-SET_PROPERTY(TEST TestsCDMATHSwig APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}")
+SET_PROPERTY(TEST TestsCDMATHSwig APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}")
 
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_POSTPRO)
   ADD_TEST(Tests_VTK_routines ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_VTK_routines.py)
-  SET_PROPERTY(TEST Tests_VTK_routines PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-  SET_PROPERTY(TEST Tests_VTK_routines 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}:${PV_PYTHON_DIR}")
+  SET_PROPERTY(TEST Tests_VTK_routines        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+  SET_PROPERTY(TEST Tests_VTK_routines APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
   ADD_TEST(Tests_PV_routines ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_PV_routines.py)
-  SET_PROPERTY(TEST Tests_PV_routines PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
-  SET_PROPERTY(TEST Tests_PV_routines 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}:${PV_PYTHON_DIR}")
+  SET_PROPERTY(TEST Tests_PV_routines        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+  SET_PROPERTY(TEST Tests_PV_routines APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
   add_subdirectory (BoySurface)
 endif ()
 
-INSTALL(FILES ${MESH_MED}  mainTests.py test_VTK_routines.py test_PV_routines.py DESTINATION bin/tests)
+INSTALL(FILES ${MESH_MED}  mainTests.py test_VTK_routines.py test_PV_routines.py DESTINATION tests/unit_tests)
 
old mode 100644 (file)
new mode 100755 (executable)
index 3870e5e..9bad2be
@@ -304,11 +304,11 @@ class TestsCDMATHSwig(unittest.TestCase):
             self.assertTrue(0.0 == conc13[i])
 
         conc15 = conc1 * 2.
-        conc16 = conc1 / 3.
+        conc16 = conc1 * 0.3 
 
         for i in range(conc15.getNumberOfElements()):
             self.assertTrue(conc1[i] * 2. == conc15[i])
-            self.assertTrue(conc1[i] / 3. == conc16[i])
+            self.assertTrue(conc1[i] * 0.3 == conc16[i])
 
         MF = Mesh(0.0, 1.0, 3, 0., 1., 3)
         concF1 = Field("CONCENTRATION", FACES, MF)
@@ -543,7 +543,7 @@ class TestsCDMATHSwig(unittest.TestCase):
 
         M23 = Mesh("meshSquare.med")
         self.assertTrue(len(M23.getNameOfFaceGroups()) == 5)
-        print M23.getNameOfFaceGroups()
+        print( M23.getNameOfFaceGroups() )
         self.assertTrue(M23.getNameOfFaceGroups()[3] == "Bottom")
         self.assertTrue(M23.getNameOfFaceGroups()[2] == "Left")
         self.assertTrue(M23.getNameOfFaceGroups()[1] == "Right")
@@ -631,7 +631,7 @@ class TestsCDMATHSwig(unittest.TestCase):
         self.assertTrue(9.0 == A22[1, 0])
         self.assertTrue(12.0 == A22[1, 1])
 
-        A22 = A / 2
+        A22 = A *0.5
         self.assertTrue(0.5 == A22[0, 0])
         self.assertTrue(1.0 == A22[0, 1])
         self.assertTrue(1.5 == A22[1, 0])
@@ -752,7 +752,7 @@ class TestsCDMATHSwig(unittest.TestCase):
         self.assertTrue(2.0 == E[0])
         self.assertTrue(4.0 == E[1])
 
-        E /= 2
+        E *= 0.5
         self.assertTrue(1.0 == E[0])
         self.assertTrue(2.0 == E[1])
 
@@ -760,7 +760,7 @@ class TestsCDMATHSwig(unittest.TestCase):
         self.assertTrue(2.0, E[0])
         self.assertTrue(4.0, E[1])
 
-        F = A / 2
+        F = A * 0.5
         self.assertTrue(A[0] / 2 == F[0])
         self.assertTrue(A[1] / 2 == F[1])
 
@@ -770,18 +770,18 @@ class TestsCDMATHSwig(unittest.TestCase):
         a = A[0]
         self.assertTrue(A[0] == a)
 
-#         v3=Vector(4);
-#         v3[0]=1;
-#         v3[1]=2;
-#         v3[2]=3;
-#         v3[3]=4;
-#
-#         v4=Vector(3);
-#         v4[0]=1.;
-#         v4[1]=2.;
-#         v4[2]=3.;
-#
-#         v5=v3^v4;
+#        v3=Vector(4);
+#        v3[0]=1;
+#        v3[1]=2;
+#        v3[2]=3;
+#        v3[3]=4;
+
+#        v4=Vector(3);
+#        v4[0]=1.;
+#        v4[1]=2.;
+#        v4[2]=3.;
+
+#        v5=v3^v4;
 #
 #         self.assertTrue( 1.==v5[0,0] );
 #         self.assertTrue( 2.==v5[0,1] );
old mode 100644 (file)
new mode 100755 (executable)
index 9c73305..10adad2
@@ -70,13 +70,13 @@ resolution=100
 
 outputFileName="Extract_PV_over_line_"+fileNameVTK1+".csv"
 Extract_PV_data_over_line_to_txt_file('2D_structured_cell_field_0.vtu', outputFileName, point1, point2, resolution)
-print "Extract_VTK_over_line ok"
+print( "Extract_VTK_over_line ok")
 
 point=[0.5,0.5,0]
 normal=[1,1,0]
 outputFileName="Slice_PV_data_to_txt_file_"+fileNameVTK3+".csv"
 Slice_PV_data_to_txt_file(fileNameVTK3+'_0.vtu', outputFileName, point, normal,resolution )
-print "Slice_PV_data_to_txt_file ok"
+print( "Slice_PV_data_to_txt_file ok")
 
 #outputFileName="Slice_field_data_to_txt_file"+fileNameVTK4+".csv"
 #Slice_PV_field_data_to_txt_file(field4, outputFileName, point, normal,resolution)
@@ -85,25 +85,25 @@ print "Slice_PV_data_to_txt_file ok"
 outputFileName="Clip_PV_data_to_VTK_"+fileNameVTK5
 inputFileName="Clip_VTK_data_to_VTK_"+fileNameVTK5
 Save_PV_data_to_picture_file(inputFileName+'_0.vtu',fieldName5,'CELLS',outputFileName)
-print "Save_PV_Clip_data_to_picture_file ok"
+print( "Save_PV_Clip_data_to_picture_file ok")
 
 outputFileName="Slice_PV_data_to_VTK_"+fileNameVTK5
 inputFileName="Slice_VTK_data_to_VTK_"+fileNameVTK5
 Save_PV_data_to_picture_file(inputFileName+'_0.vtu',fieldName5,'CELLS',outputFileName)
-print "Save_PV_Slice_data_to_picture_file ok"
+print( "Save_PV_Slice_data_to_picture_file ok")
 
 outputFileName="Save_PV_data_to_picture_file_"+fileNameVTK2
 Save_PV_data_to_picture_file(fileNameVTK2+'_0.vtu',fieldName2,'NODES',outputFileName)
-print "Save_PV_data_to_picture_file " + fileNameVTK2+ " ok"
+print( "Save_PV_data_to_picture_file " + fileNameVTK2+ " ok")
 
 outputFileName="Save_PV_data_to_picture_file_"+fileNameVTK3
 Save_PV_data_to_picture_file(fileNameVTK3+'_0.vtu',fieldName3,'NODES',outputFileName)
-print "Save_PV_data_to_picture_file " + fileNameVTK3+ " ok"
+print( "Save_PV_data_to_picture_file " + fileNameVTK3+ " ok")
 
 outputFileName="Save_PV_data_to_picture_file_"+fileNameVTK4
 Save_PV_data_to_picture_file(fileNameVTK4+'_0.vtu',fieldName4,'NODES',outputFileName)
-print "Save_PV_data_to_picture_file " + fileNameVTK4+ " ok"
+print( "Save_PV_data_to_picture_file " + fileNameVTK4+ " ok")
 
 outputFileName="Save_PV_data_to_picture_file_"+fileNameVTK5
 Save_PV_data_to_picture_file(fileNameVTK5+'_0.vtu',fieldName5,'CELLS',outputFileName)
-print "Save_PV_data_to_picture_file " + fileNameVTK5+ " ok"
+print( "Save_PV_data_to_picture_file " + fileNameVTK5+ " ok")
old mode 100644 (file)
new mode 100755 (executable)
index d7debc7..6be8e3c
@@ -67,40 +67,40 @@ resolution=100
 
 outputFileName="Extract_VTK_over_line_"+fileNameVTK1+".csv"
 Extract_VTK_data_over_line_to_txt_file('2D_structured_cell_field_0.vtu', outputFileName, point1, point2, resolution)
-print "Extract_VTK_over_line ok"
+print( "Extract_VTK_over_line ok")
 
 outputFileName="Extract_field_over_line_"+fileNameVTK2+".csv"
 Extract_field_data_over_line_to_txt_file(field2, point1, point2, resolution, outputFileName)
-print "Extract_field_over_line ok"
+print( "Extract_field_over_line ok")
 
 point=[0.5,0.5,0.5]
 normal=[-0.5,-0.5,-0.5]
 outputFileName="Slice_VTK_data_to_txt_file_"+fileNameVTK3+".csv"
 Slice_VTK_data_to_txt_file(fileNameVTK3+'_0.vtu', outputFileName, point, normal,resolution )
-print "Slice_VTK_data_to_txt_file ok"
+print( "Slice_VTK_data_to_txt_file ok")
 
 outputFileName="Slice_field_data_to_txt_file_"+fileNameVTK4+".csv"
 Slice_field_data_to_txt_file(field4, outputFileName, point, normal,resolution)
-print "Slice_field_data_to_txt_file ok"
+print( "Slice_field_data_to_txt_file ok")
 
 outputFileName="Slice_VTK_data_to_VTK_"+fileNameVTK5+'_0.vtu'
 Slice_VTK_data_to_VTK(fileNameVTK5+'_0.vtu',outputFileName,point, normal,resolution )
-print "Slice_VTK_data_to_VTK ok"
+print( "Slice_VTK_data_to_VTK ok")
 
 outputFileName="Clip_VTK_data_to_VTK_"+fileNameVTK5+'_0.vtu'
 Clip_VTK_data_to_VTK(fileNameVTK5+'_0.vtu',outputFileName,point, normal,resolution )
-print "Clip_VTK_data_to_VTK ok"
+print( "Clip_VTK_data_to_VTK ok")
 
 inputFileName="Slice_VTK_data_to_VTK_"+fileNameVTK5
 outputFileName="Save_Slice_VTK_data_to_VTK_"+fileNameVTK5
 Save_VTK_data_to_picture_file(inputFileName+'_0.vtu',"testfield5","CELLS",outputFileName)
-print "Save_VTK_Slice_data_to_picture_file ok"
+print( "Save_VTK_Slice_data_to_picture_file ok")
 
 inputFileName="Clip_VTK_data_to_VTK_"+fileNameVTK5
 outputFileName="Save_Clip_VTK_data_to_VTK_"+fileNameVTK5
 Save_VTK_data_to_picture_file(inputFileName+'_0.vtu',"testfield5","CELLS",outputFileName)
-print "Save_VTK_Clip_data_to_picture_file ok"
+print( "Save_VTK_Clip_data_to_picture_file ok")
 
 outputFileName="Save_VTK_data_to_picture_file_"+fileNameVTK5
 Save_VTK_data_to_picture_file(fileNameVTK5+'_0.vtu',"testfield5","CELLS",outputFileName)
-print "Save_VTK_data_to_picture_file ok"
+print( "Save_VTK_data_to_picture_file ok")
old mode 100644 (file)
new mode 100755 (executable)
index 34d5b0e..79858f7
@@ -23,8 +23,8 @@ solution = anSol.analyticalFunction_discretizer(mesh, output_dir="./tmp",
 
 print(solution.var_list)
 for varName in solution.var_dict:
-    print varName + "=", solution.var_eval[varName]
+    print( varName + "=", solution.var_eval[varName])
 
 solution.save_all_variables()
 
-print "done"
+print( "done" )
old mode 100644 (file)
new mode 100755 (executable)
index eeb0c27..7afdccf
@@ -109,7 +109,7 @@ IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
 
     install(
       DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
-      DESTINATION share/validation/${dir}
+      DESTINATION bin/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 share/doc/convergence/2DPoissonVF
+      DESTINATION doc/convergence_tests/2DPoissonVF
       FILES_MATCHING PATTERN "*_SQUARE.ipynb"
                      PATTERN "*_SQUARE.pdf"
     )
     install(
       DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
-      DESTINATION share/doc/convergence/2DPoissonVF/${dir}
+      DESTINATION 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 share/doc/convergence/2DWaveSystemVF_stationary
+      DESTINATION doc/convergence_tests/2DWaveSystemVF_stationary
       FILES_MATCHING PATTERN "*_SQUARE.ipynb"
                      PATTERN "*_SQUARE.pdf"
     )
     install(
       DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
-      DESTINATION share/doc/convergence/2DWaveSystemVF_stationary/${dir}
+      DESTINATION 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 share/doc/convergence/2DAnisotropicDiffusionVF
+      DESTINATION doc/convergence_tests/2DAnisotropicDiffusionVF
       FILES_MATCHING PATTERN "*_SQUARE.ipynb"
                      PATTERN "*_SQUARE.pdf"
     )
     install(
       DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
-      DESTINATION share/doc/convergence/2DAnisotropicDiffusionVF/${dir}
+      DESTINATION doc/convergence_tests/2DAnisotropicDiffusionVF/${dir}
       FILES_MATCHING PATTERN "*.png"
                      PATTERN "*.ipynb"
                      PATTERN "*.py"