From 525f44dcc48adfb8bced4d34ba3db1f58a553436 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 13 Sep 2021 13:47:45 +0200 Subject: [PATCH] Restructured example folder --- CDMATH/tests/CMakeLists.txt | 8 +- .../examples/BurgersEquation1D/CMakeLists.txt | 5 + .../examples/EulerEquations/CMakeLists.txt | 3 + .../FullEulerSystem/CMakeLists.txt | 12 + .../CMakeLists.txt | 2 +- .../Euler_complet_HeatedChanel.py | 981 ++++++++++++++++++ .../CMakeLists.txt | 2 +- .../Euler_complet_RP.py | 642 ++++++++++++ .../IsentropicEulerSystem/CMakeLists.txt | 15 + .../CMakeLists.txt | 8 + .../EulerSystem1DConservativeStaggered.py | 0 .../EulerSystem1DUpwind/CMakeLists.txt | 8 + .../EulerSystem1DUpwind.py | 0 .../CMakeLists.txt | 8 + .../EulerSystem1DUpwindEntrCorr.py | 0 .../EulerSystemStaggered/CMakeLists.txt | 0 ...EulerIsothermal_2DConservativeStaggered.py | 0 .../EulerSystemUpwind/CMakeLists.txt | 46 +- .../EulerSystemUpwind/EulerSystemUpwind.py | 44 +- .../CMakeLists.txt | 8 - .../examples/HeatEquation/CMakeLists.txt | 14 + .../HeatEquation1DExplicit/CMakeLists.txt | 0 .../HeatEquation1DExplicit.py | 0 .../HeatEquation1DImplicit/CMakeLists.txt | 0 .../HeatEquation1DImplicit.py | 0 .../examples/PoissonEquation/CMakeLists.txt | 30 + .../Poisson1DEF/CMakeLists.txt | 0 .../Poisson1DEF/FiniteElements1DPoisson.py | 0 .../Poisson1DVF/CMakeLists.txt | 0 .../Poisson1DVF/FiniteVolumes1DPoisson.py | 0 .../Poisson2DEF/CMakeLists.txt | 2 +- .../FiniteElements2DPoisson_SQUARE.py | 0 .../Poisson2DEF_DISK/CMakeLists.txt | 2 +- .../FiniteElements2DPoisson_DISK.py | 0 .../Poisson2DEF_DISK_StiffBC/CMakeLists.txt | 2 +- .../FiniteElements2DPoisson_DISK_StiffBC.py | 0 .../Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt | 2 +- .../FiniteElements2DPoisson_SQUARE_StiffBC.py | 0 .../Poisson2DVF/CMakeLists.txt | 12 +- .../FiniteVolumes2DPoisson_SQUARE.py | 0 .../Poisson2DVF_DISK/CMakeLists.txt | 8 +- .../FiniteVolumes2DPoisson_DISK.py | 0 .../Poisson2DVF_DISK_StiffBC/CMakeLists.txt | 8 +- .../FiniteVolumes2DPoisson_DISK_StiffBC.py | 0 .../Poisson3DCubeSkinEF/CMakeLists.txt | 2 +- .../FiniteElements3DPoissonCubeSkin.py | 0 .../Poisson3DEF/CMakeLists.txt | 2 +- .../FiniteElements3DPoisson_CUBE.py | 0 .../Poisson3DEF_BALL/CMakeLists.txt | 2 +- .../FiniteElements3DPoisson_BALL.py | 0 .../CMakeLists.txt | 0 ...lements3DPoisson_CUBE_RadiatorAndWindow.py | 0 .../Mesh_RadiatorAndWindow.med | Bin .../Poisson3DSphereEF/CMakeLists.txt | 2 +- .../FiniteElements3DPoissonSphere.py | 0 .../Poisson3DTorusEF/CMakeLists.txt | 2 +- .../FiniteElements3DPoissonTorus.py | 0 .../Poisson3DVF/CMakeLists.txt | 6 +- .../FiniteVolumes3DPoisson_CUBE.py | 0 .../Poisson3DVF_BALL/CMakeLists.txt | 2 +- .../FiniteVolumes3DPoisson_BALL.py | 0 .../examples/SpectrumLaplace/CMakeLists.txt | 15 + .../SpectrumLaplace2DEF/CMakeLists.txt | 6 +- .../SpectrumLaplace2DEF_SQUARE.py | 0 .../SpectrumLaplace2DVF/CMakeLists.txt | 10 +- .../SpectrumLaplace2DVF_SQUARE.py | 0 .../CMakeLists.txt | 6 +- ...pectrumFiniteElements3DLaplace-Beltrami.py | 0 .../examples/TransportEquation/CMakeLists.txt | 16 +- .../TransportEquation/CMakeLists.txt | 8 + .../TransportEquationUpwind.py | 0 .../1DTransportEquationCenteredExplicit.py | 0 .../CMakeLists.txt | 0 .../1DTransportEquationCenteredImplicit.py | 0 .../CMakeLists.txt | 0 .../1DTransportEquationUpwindExplicit.py | 0 .../CMakeLists.txt | 0 .../1DTransportEquationUpwindImplicit.py | 0 .../CMakeLists.txt | 0 .../thermique1d/main.cxx | 0 .../thermique1d/makefile | 0 .../transport1d/main.cxx | 0 .../transport1d/main.py | 0 .../transport1d/makefile | 0 .../transport2d_ns/main.cxx | 0 .../transport2d_ns/main.py | 0 .../transport2d_ns/main2.cxx | 0 .../transport2d_ns/makefile | 0 .../transport2d_s/main.cxx | 0 .../transport2d_s/main.py | 0 .../transport2d_s/makefile | 0 .../tests/examples/WaveSystem/CMakeLists.txt | 36 + .../CMakeLists.txt | 0 .../WaveSystem1DStaggered_RiemannProblem.py | 0 .../WaveSystem1DUpwind/CMakeLists.txt | 0 .../WaveSystem1DUpwind/WaveSystem1DUpwind.py | 0 .../CMakeLists.txt | 0 .../WaveSystem1DUpwind_RiemannProblem.py | 0 .../CMakeLists.txt | 33 +- .../WaveSystemUpwind.py | 0 .../WaveSystemCentered/CMakeLists.txt | 30 +- .../WaveSystemCentered/WaveSystemCentered.py | 0 .../WaveSystemPStag/CMakeLists.txt | 30 +- .../WaveSystemPStag/WaveSystemPStag.py | 0 .../WaveSystemStaggered/CMakeLists.txt | 0 .../WaveSystemStaggered.py | 0 .../WaveSystemUpwind/CMakeLists.txt | 46 +- .../WaveSystemUpwind/WaveSystemUpwind.py | 0 .../WaveSystemCentered/CMakeLists.txt | 28 +- .../WaveSystemCentered/WaveSystemCentered.py | 0 .../WaveSystemPStag/CMakeLists.txt | 28 +- .../WaveSystemPStag/WaveSystemPStag.py | 0 .../WaveSystemStaggered/CMakeLists.txt | 0 .../WaveSystemStaggered.py | 0 .../WaveSystemUpwind/CMakeLists.txt | 44 +- .../WaveSystemUpwind/WaveSystemUpwind.py | 0 CDMATH/tests/ressources/CMakeLists.txt | 7 +- 117 files changed, 1962 insertions(+), 271 deletions(-) create mode 100644 CDMATH/tests/examples/EulerEquations/CMakeLists.txt create mode 100755 CDMATH/tests/examples/EulerEquations/FullEulerSystem/CMakeLists.txt rename CDMATH/tests/examples/{EulerSystem1D/EulerSystem1DUpwindEntrCorr => EulerEquations/FullEulerSystem/EulerSystem1D_HeatedChannel}/CMakeLists.txt (50%) create mode 100644 CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_HeatedChannel/Euler_complet_HeatedChanel.py rename CDMATH/tests/examples/{EulerSystem1D/EulerSystem1DUpwind => EulerEquations/FullEulerSystem/EulerSystem1D_RiemannProblem}/CMakeLists.txt (53%) create mode 100644 CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_RiemannProblem/Euler_complet_RP.py create mode 100755 CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/CMakeLists.txt create mode 100755 CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DConservativeStaggered/CMakeLists.txt rename CDMATH/tests/examples/{ => EulerEquations/IsentropicEulerSystem}/EulerSystem1D/EulerSystem1DConservativeStaggered/EulerSystem1DConservativeStaggered.py (100%) create mode 100755 CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwind/CMakeLists.txt rename CDMATH/tests/examples/{ => EulerEquations/IsentropicEulerSystem}/EulerSystem1D/EulerSystem1DUpwind/EulerSystem1DUpwind.py (100%) create mode 100755 CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwindEntrCorr/CMakeLists.txt rename CDMATH/tests/examples/{ => EulerEquations/IsentropicEulerSystem}/EulerSystem1D/EulerSystem1DUpwindEntrCorr/EulerSystem1DUpwindEntrCorr.py (100%) rename CDMATH/tests/examples/{ => EulerEquations/IsentropicEulerSystem}/EulerSystem_Shock/EulerSystemStaggered/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => EulerEquations/IsentropicEulerSystem}/EulerSystem_Shock/EulerSystemStaggered/EulerIsothermal_2DConservativeStaggered.py (100%) rename CDMATH/tests/examples/{ => EulerEquations/IsentropicEulerSystem}/EulerSystem_Shock/EulerSystemUpwind/CMakeLists.txt (69%) rename CDMATH/tests/examples/{ => EulerEquations/IsentropicEulerSystem}/EulerSystem_Shock/EulerSystemUpwind/EulerSystemUpwind.py (92%) delete mode 100755 CDMATH/tests/examples/EulerSystem1D/EulerSystem1DConservativeStaggered/CMakeLists.txt create mode 100755 CDMATH/tests/examples/HeatEquation/CMakeLists.txt rename CDMATH/tests/examples/{ => HeatEquation}/HeatEquation1DExplicit/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => HeatEquation}/HeatEquation1DExplicit/HeatEquation1DExplicit.py (100%) rename CDMATH/tests/examples/{ => HeatEquation}/HeatEquation1DImplicit/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => HeatEquation}/HeatEquation1DImplicit/HeatEquation1DImplicit.py (100%) create mode 100755 CDMATH/tests/examples/PoissonEquation/CMakeLists.txt rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson1DEF/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson1DEF/FiniteElements1DPoisson.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson1DVF/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson1DVF/FiniteVolumes1DPoisson.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DEF/CMakeLists.txt (90%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DEF/FiniteElements2DPoisson_SQUARE.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DEF_DISK/CMakeLists.txt (91%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DEF_DISK/FiniteElements2DPoisson_DISK.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DEF_DISK_StiffBC/CMakeLists.txt (91%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DEF_DISK_StiffBC/FiniteElements2DPoisson_DISK_StiffBC.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt (91%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DEF_SQUARE_StiffBC/FiniteElements2DPoisson_SQUARE_StiffBC.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DVF/CMakeLists.txt (75%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DVF/FiniteVolumes2DPoisson_SQUARE.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DVF_DISK/CMakeLists.txt (74%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DVF_DISK/FiniteVolumes2DPoisson_DISK.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DVF_DISK_StiffBC/CMakeLists.txt (76%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson2DVF_DISK_StiffBC/FiniteVolumes2DPoisson_DISK_StiffBC.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DCubeSkinEF/CMakeLists.txt (92%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DCubeSkinEF/FiniteElements3DPoissonCubeSkin.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DEF/CMakeLists.txt (92%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DEF/FiniteElements3DPoisson_CUBE.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DEF_BALL/CMakeLists.txt (90%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DEF_BALL/FiniteElements3DPoisson_BALL.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DEF_RadiatorAndWindow/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DEF_RadiatorAndWindow/FiniteElements3DPoisson_CUBE_RadiatorAndWindow.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DEF_RadiatorAndWindow/Mesh_RadiatorAndWindow.med (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DSphereEF/CMakeLists.txt (92%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DSphereEF/FiniteElements3DPoissonSphere.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DTorusEF/CMakeLists.txt (92%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DTorusEF/FiniteElements3DPoissonTorus.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DVF/CMakeLists.txt (77%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DVF/FiniteVolumes3DPoisson_CUBE.py (100%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DVF_BALL/CMakeLists.txt (85%) rename CDMATH/tests/examples/{ => PoissonEquation}/Poisson3DVF_BALL/FiniteVolumes3DPoisson_BALL.py (100%) create mode 100755 CDMATH/tests/examples/SpectrumLaplace/CMakeLists.txt rename CDMATH/tests/examples/{ => SpectrumLaplace}/SpectrumLaplace2DEF/CMakeLists.txt (80%) rename CDMATH/tests/examples/{ => SpectrumLaplace}/SpectrumLaplace2DEF/SpectrumLaplace2DEF_SQUARE.py (100%) rename CDMATH/tests/examples/{ => SpectrumLaplace}/SpectrumLaplace2DVF/CMakeLists.txt (77%) rename CDMATH/tests/examples/{ => SpectrumLaplace}/SpectrumLaplace2DVF/SpectrumLaplace2DVF_SQUARE.py (100%) rename CDMATH/tests/examples/{ => SpectrumLaplace}/SpectrumLaplaceBeltrami3DEF/CMakeLists.txt (82%) rename CDMATH/tests/examples/{ => SpectrumLaplace}/SpectrumLaplaceBeltrami3DEF/SpectrumFiniteElements3DLaplace-Beltrami.py (100%) create mode 100755 CDMATH/tests/examples/TransportEquation/TransportEquation/CMakeLists.txt rename CDMATH/tests/examples/TransportEquation/{ => TransportEquation}/TransportEquationUpwind.py (100%) rename CDMATH/tests/examples/{ => TransportEquation}/TransportEquation1DCenteredExplicit/1DTransportEquationCenteredExplicit.py (100%) rename CDMATH/tests/examples/{ => TransportEquation}/TransportEquation1DCenteredExplicit/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => TransportEquation}/TransportEquation1DCenteredImplicit/1DTransportEquationCenteredImplicit.py (100%) rename CDMATH/tests/examples/{ => TransportEquation}/TransportEquation1DCenteredImplicit/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => TransportEquation}/TransportEquation1DUpwindExplicit/1DTransportEquationUpwindExplicit.py (100%) rename CDMATH/tests/examples/{ => TransportEquation}/TransportEquation1DUpwindExplicit/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => TransportEquation}/TransportEquation1DUpwindImplicit/1DTransportEquationUpwindImplicit.py (100%) rename CDMATH/tests/examples/{ => TransportEquation}/TransportEquation1DUpwindImplicit/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => TransportEquation}/thermique1d/main.cxx (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => TransportEquation}/thermique1d/makefile (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => TransportEquation}/transport1d/main.cxx (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => TransportEquation}/transport1d/main.py (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => TransportEquation}/transport1d/makefile (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => TransportEquation}/transport2d_ns/main.cxx (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => TransportEquation}/transport2d_ns/main.py (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => TransportEquation}/transport2d_ns/main2.cxx (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => TransportEquation}/transport2d_ns/makefile (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => TransportEquation}/transport2d_s/main.cxx (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => TransportEquation}/transport2d_s/main.py (100%) mode change 100644 => 100755 rename CDMATH/tests/examples/{ => TransportEquation}/transport2d_s/makefile (100%) mode change 100644 => 100755 create mode 100755 CDMATH/tests/examples/WaveSystem/CMakeLists.txt rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem1DStaggered_RiemannProblem/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem1DStaggered_RiemannProblem/WaveSystem1DStaggered_RiemannProblem.py (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem1DUpwind/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem1DUpwind/WaveSystem1DUpwind.py (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem1DUpwind_RiemannProblem/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem1DUpwind_RiemannProblem/WaveSystem1DUpwind_RiemannProblem.py (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem2DUpwind_RiemannProblem/CMakeLists.txt (70%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem2DUpwind_RiemannProblem/WaveSystemUpwind.py (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt (63%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Shock/WaveSystemCentered/WaveSystemCentered.py (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt (62%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Shock/WaveSystemPStag/WaveSystemPStag.py (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Shock/WaveSystemStaggered/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Shock/WaveSystemStaggered/WaveSystemStaggered.py (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt (69%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Shock/WaveSystemUpwind/WaveSystemUpwind.py (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Stationary/WaveSystemCentered/CMakeLists.txt (62%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Stationary/WaveSystemCentered/WaveSystemCentered.py (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Stationary/WaveSystemPStag/CMakeLists.txt (61%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Stationary/WaveSystemPStag/WaveSystemPStag.py (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Stationary/WaveSystemStaggered/CMakeLists.txt (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Stationary/WaveSystemStaggered/WaveSystemStaggered.py (100%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Stationary/WaveSystemUpwind/CMakeLists.txt (69%) rename CDMATH/tests/examples/{ => WaveSystem}/WaveSystem_Stationary/WaveSystemUpwind/WaveSystemUpwind.py (100%) diff --git a/CDMATH/tests/CMakeLists.txt b/CDMATH/tests/CMakeLists.txt index 8a98ca6..dc2db80 100755 --- a/CDMATH/tests/CMakeLists.txt +++ b/CDMATH/tests/CMakeLists.txt @@ -52,14 +52,14 @@ IF (CDMATH_WITH_TESTS) ENDIF (CDMATH_WITH_TESTS) ADD_SUBDIRECTORY(ressources) +SET(MED_MESHES ${CMAKE_CURRENT_SOURCE_DIR}/ressources ) FILE(COPY doc/ DESTINATION share/doc/) if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - # Examples tests - set (examples_dir ${CDMATH_SOURCE_DIR}/tests/examples) - add_subdirectory (${examples_dir}) - add_subdirectory (validation) + + add_subdirectory (examples) #basic test that run a single calculation + add_subdirectory (validation) # convergence studies (several runs) add_custom_target (tests_CDMATH COMMAND ctest -O testsCDMATH.log) add_custom_target (check COMMAND ctest -E 'validation|Example')# may be replace ctest -E with ctest -LE diff --git a/CDMATH/tests/examples/BurgersEquation1D/CMakeLists.txt b/CDMATH/tests/examples/BurgersEquation1D/CMakeLists.txt index 69df6ba..f20907b 100755 --- a/CDMATH/tests/examples/BurgersEquation1D/CMakeLists.txt +++ b/CDMATH/tests/examples/BurgersEquation1D/CMakeLists.txt @@ -1,3 +1,8 @@ +file(GLOB BurgersEquation_EXAMPLES_TO_INSTALL + BurgersEquation1D # 1D Burgers' equation +) + +install(DIRECTORY ${BurgersEquation_EXAMPLES_TO_INSTALL} DESTINATION share/examples/BurgersEquation) if (CDMATH_WITH_PYTHON ) diff --git a/CDMATH/tests/examples/EulerEquations/CMakeLists.txt b/CDMATH/tests/examples/EulerEquations/CMakeLists.txt new file mode 100644 index 0000000..6e94c5f --- /dev/null +++ b/CDMATH/tests/examples/EulerEquations/CMakeLists.txt @@ -0,0 +1,3 @@ + + ADD_SUBDIRECTORY(IsentropicEulerSystem) + ADD_SUBDIRECTORY( FullEulerSystem) diff --git a/CDMATH/tests/examples/EulerEquations/FullEulerSystem/CMakeLists.txt b/CDMATH/tests/examples/EulerEquations/FullEulerSystem/CMakeLists.txt new file mode 100755 index 0000000..cb95639 --- /dev/null +++ b/CDMATH/tests/examples/EulerEquations/FullEulerSystem/CMakeLists.txt @@ -0,0 +1,12 @@ +file(GLOB FullEulerEquations_EXAMPLES_TO_INSTALL +EulerSystem1D/EulerSystem1DUpwind EulerSystem1D/EulerSystem1DUpwindEntrCorr EulerSystem1D/EulerSystem1DConservativeStaggered EulerSystem_Shock/EulerSystemStaggered EulerSystem_Shock/EulerSystemUpwind +) + +install(DIRECTORY ${FullEulerEquations_EXAMPLES_TO_INSTALL} DESTINATION share/examples/EulerEquations/FullEulerEquations) + +IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + ADD_SUBDIRECTORY(EulerSystem1D_RiemannProblem) + ADD_SUBDIRECTORY(EulerSystem1D_HeatedChannel) +ENDIF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + diff --git a/CDMATH/tests/examples/EulerSystem1D/EulerSystem1DUpwindEntrCorr/CMakeLists.txt b/CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_HeatedChannel/CMakeLists.txt similarity index 50% rename from CDMATH/tests/examples/EulerSystem1D/EulerSystem1DUpwindEntrCorr/CMakeLists.txt rename to CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_HeatedChannel/CMakeLists.txt index 655c40f..8415053 100755 --- a/CDMATH/tests/examples/EulerSystem1D/EulerSystem1DUpwindEntrCorr/CMakeLists.txt +++ b/CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_HeatedChannel/CMakeLists.txt @@ -1,7 +1,7 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - ADD_TEST(ExampleEulerSystem_1DShock_UpwindExplicit_EntrCorr ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystem1DUpwindEntrCorr.py ) + ADD_TEST(ExampleFullEulerSystem_1DHeatedChannel_Roe ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Euler_complet_HeatedChanel.py ) endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) diff --git a/CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_HeatedChannel/Euler_complet_HeatedChanel.py b/CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_HeatedChannel/Euler_complet_HeatedChanel.py new file mode 100644 index 0000000..e63c38c --- /dev/null +++ b/CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_HeatedChannel/Euler_complet_HeatedChanel.py @@ -0,0 +1,981 @@ +#!/usr/bin/env python3 +# -*-coding:utf-8 -* + +""" +Created on Mon Aug 30 2021 +@author: Michael NDJINGA, Katia Ait Ameur, Coraline Mounier + +Euler system with heating source term (phi) in one dimension on regular domain [a,b] +Riemann problemn with ghost cell boundary condition +Left : Inlet boundary condition (velocity and temperature imposed) +Right : Outlet boundary condition (pressure imposed) +Roe scheme +Regular square mesh + +State law Stiffened gaz : p = (gamma - 1) * rho * (e - q) - gamma * p0 +4 choices of parameters gamma and p0 are available : + - Lagrange interpolation (with q=0) + - Hermite interpolation with reference point at 575K (with q=0) + - Hermite interpolation with reference point at 590K (with q=0) + - Hermite interpolation with reference point at 617.94K (saturation at 155 bar) with q=0 + +Linearized enthalpy : h = h_sat + cp * (T - T_sat) +Values for cp and T_sat parameters are taken at the reference point chosen for the state law + +To do correct the computation of the time step : lambda_max (maximum eigenvalue) should be computed first) +""" + +import cdmath +import numpy as np +import matplotlib + +matplotlib.use("Agg") +import matplotlib.pyplot as plt +import matplotlib.animation as manimation +import sys +from math import sqrt, atan, pi +from numpy import sign + + +#### Initial and boundary condition (T in K, v in m/s, p in Pa) +T_inlet = 565. +v_inlet = 5. +p_outlet = 155.0 * 10**5 + +#initial parameters are determined from boundary conditions +p_0 = p_outlet #initial pressure +v_0 = v_inlet #initial velocity +T_0 = T_inlet #initial temperature +### Heating source term +phi=1.e8 + +## Numerical parameter +precision = 1e-6 + +#state law parameter : can be 'Lagrange', 'Hermite590K', 'Hermite617K', or 'FLICA' +state_law = "Hermite575K" + +def state_law_parameters(state_law): + #state law Stiffened Gaz : p = (gamma - 1) * rho * e - gamma * p0 + global gamma + global p0 + global q + global c0 + global cp + global h_sat + global T_sat + + if state_law == "Lagrange": + # reference values for Lagrange interpolation + p_ref = 155. * 10**5 #Reference pressure in a REP 900 nuclear power plant + p1 = 153. * 10**5 # value of pressure at inlet of a 900 MWe PWR vessel + rho_ref = 594.38 #density of water at saturation temperature of 617.94K and 155 bars + rho1 = 742.36 # value of density at inlet of a 900 MWe PWR vessel (T1 = 565K) + e_ref = 1603.8 * 10**3 #internal energy of water at saturation temperature of 617.94K and 155 bars + e1 = 1273.6 * 10**3 # value of internal energy at inlet of a 900 MWe PWR vessel + + gamma = (p1 - p_ref) / (rho1 * e1 - rho_ref *e_ref) + 1. + p0 = - 1. / gamma * ( - (gamma - 1) * rho_ref * e_ref + p_ref) + q=0. + c0 = sqrt((gamma - 1) * (e_ref + p_ref / rho_ref)) + + cp = 8950. + h_sat = 1.63 * 10 ** 6 # saturation enthalpy of water at 155 bars + T_sat = 617.94 + + elif state_law == "Hermite617K": + # reference values for Hermite interpolation + p_ref = 155. * 10**5 #Reference pressure in a REP 900 nuclear power plant + T_ref = 617.94 #Reference temperature for interpolation at 617.94K + rho_ref = 594.38 #density of water at saturation temperature of 617.94K and 155 bars + e_ref = 1603.8 * 10**3 #internal energy of water at saturation temperature of 617.94K and 155 bars + h_ref = e_ref + p_ref / rho_ref + c_ref = 621.43 #sound speed for water at 155 bars and 617.94K + + gamma = 1. + c_ref * c_ref / (e_ref + p_ref / rho_ref) # From the sound speed formula + p0 = 1. / gamma * ( (gamma - 1) * rho_ref * e_ref - p_ref) + q=0. + c0 = sqrt((gamma - 1) * (e_ref + p_ref / rho_ref)) + + cp = 8950. # value at 155 bar and 617.94K + h_sat = 1.63 * 10 ** 6 # saturation enthalpy of water at 155 bars + T_sat = 617.94 + + elif state_law == 'Hermite590K': + # reference values for Hermite interpolation + p_ref = 155. * 10**5 #Reference pressure in a REP 900 nuclear power plant + T_ref = 590. #Reference temperature for interpolation at 590K + rho_ref = 688.3 #density of water at 590K and 155 bars + e_ref = 1411.4 * 10**3 #internal energy of water at 590K and 155 bars + h_ref = e_ref + p_ref / rho_ref + c_ref = 866.29 #sound speed for water at 155 bars and 590K + + gamma = 1. + c_ref * c_ref / (e_ref + p_ref / rho_ref) # From the sound speed formula + p0 = 1. / gamma * ( (gamma - 1) * rho_ref * e_ref - p_ref) + q=0. + c0 = sqrt((gamma - 1) * (e_ref + p_ref / rho_ref)) + + cp = 5996.8 # value at 155 bar and 590K + h_sat = 1433.9 * 10 ** 3 # saturation enthalpy of water at 155 bars + T_sat = 590. + + elif state_law == 'Hermite575K': + # reference values for Hermite interpolation + p_ref = 155 * 10**5 #Reference pressure in a REP 900 nuclear power plant + T_ref = 575 #Reference temperature at inlet in a REP 900 nuclear power plant + #Remaining values determined using iapws python package + rho_ref = 722.66 #density of water at 575K and 155 bars + e_ref = 1326552.66 #internal energy of water at 575K and 155 bars + h_ref = e_ref + p_ref / rho_ref + c_ref = 959.28 #sound speed for water at 155 bars and 575K + + gamma = 1 + c_ref * c_ref / (e_ref + p_ref / rho_ref) # From the sound speed formula + p0 = 1 / gamma * ( (gamma - 1) * rho_ref * e_ref - p_ref) + q=0. + c0 = sqrt((gamma - 1) * (e_ref + p_ref / rho_ref))#This is actually c_ref + + cp = 5504.05 # value at 155 bar and 590K + h_sat = h_ref # saturation enthalpy of water at 155 bars + T_sat = T_ref + else: + raise ValueError("Incorrect value for parameter state_law") + +def initial_conditions_Riemann_problem(a, b, nx): + 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) + + p_initial = np.array([ p_0 for xi in x]) + v_initial = np.array([ v_0 for xi in x]) + T_initial = np.array([ T_0 for xi in x]) + + rho_initial = p_to_rho_StiffenedGaz(p_initial, T_initial) + q_initial = rho_initial * v_initial + rho_E_initial = T_to_rhoE_StiffenedGaz(T_initial, rho_initial, q_initial) + + return rho_initial, q_initial, rho_E_initial, p_initial, v_initial, T_initial + +def p_to_rho_StiffenedGaz(p_field, T_field): + rho_field = (p_field + p0) * gamma / (gamma - 1) * 1. / (h_sat + cp * (T_field - T_sat)) + return rho_field + +def T_to_rhoE_StiffenedGaz(T_field, rho_field, q_field): + rho_E_field = 1. / 2. * (q_field) ** 2 / rho_field + p0 + rho_field / gamma * (h_sat + cp * (T_field- T_sat)) + return rho_E_field + +def rhoE_to_T_StiffenedGaz(rho_field, q_field, rho_E_field): + T_field = T_sat + 1 / cp * (gamma * (rho_E_field / rho_field - 1 / 2 * (q_field / rho_field) ** 2) - gamma * p0 / rho_field - h_sat) + return T_field + +def rho_to_p_StiffenedGaz(rho_field, q_field, rho_E_field): + p_field = (gamma - 1) * (rho_E_field - 1. / 2 * q_field ** 2 / rho_field) - gamma * p0 + return p_field + +def T_to_E_StiffenedGaz(p_field, T_field, v_field): + rho_field = p_to_rho_StiffenedGaz(p_field, T_field) + E_field = (p_field + gamma * p0) / ((gamma-1) * rho_field) + 0.5 * v_field **2 + return E_field + +def dp_drho_e_const_StiffenedGaz( e ): + return (gamma-1)*(e-q) + +def dp_de_rho_const_StiffenedGaz( rho ): + return (gamma-1)*rho + +def sound_speed_StiffenedGaz( h ): + return np.sqrt((gamma-1)*(h-q)) + +def rho_h_to_p_StiffenedGaz( rho, h ): + return (gamma - 1) * rho * ( h - q ) / gamma - p0 + +def MatRoe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r): + RoeMat = cdmath.Matrix(3, 3) + + u_l = q_l / rho_l + u_r = q_r / rho_r + p_l = rho_to_p_StiffenedGaz(rho_l, q_l, rho_E_l) + p_r = rho_to_p_StiffenedGaz(rho_r, q_r, rho_E_r) + H_l = rho_E_l / rho_l + p_l / rho_l + H_r = rho_E_r / rho_r + p_r / rho_r + + # Roe averages + rho = np.sqrt(rho_l * rho_r) + u = (u_l * sqrt(rho_l) + u_r * sqrt(rho_r)) / (sqrt(rho_l) + sqrt(rho_r)) + H = (H_l * sqrt(rho_l) + H_r * sqrt(rho_r)) / (sqrt(rho_l) + sqrt(rho_r)) + + p = rho_h_to_p_StiffenedGaz( rho, H - u**2/2. ) + e = H - p / rho - 1./2 * u**2 + dp_drho = dp_drho_e_const_StiffenedGaz( e ) + dp_de = dp_de_rho_const_StiffenedGaz( rho ) + + RoeMat[0, 0] = 0 + RoeMat[0, 1] = 1 + RoeMat[0, 2] = 0 + RoeMat[1, 0] = dp_drho - u ** 2 + dp_de / rho * (u**2/2 - e) + RoeMat[1, 1] = 2 * u - u * dp_de / rho + RoeMat[1, 2] = dp_de / rho + RoeMat[2, 0] = -u * ( -dp_drho + H - dp_de / rho * (u**2/2 - e) ) + RoeMat[2, 1] = H - dp_de / rho * u ** 2 + RoeMat[2, 2] = (dp_de / rho +1) * u + + return(RoeMat) + + +def Droe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r): + Droe = cdmath.Matrix(3, 3) + + u_l = q_l / rho_l + u_r = q_r / rho_r + p_l = rho_to_p_StiffenedGaz(rho_l, q_l, rho_E_l) + p_r = rho_to_p_StiffenedGaz(rho_r, q_r, rho_E_r) + H_l = rho_E_l / rho_l + p_l / rho_l + H_r = rho_E_r / rho_r + p_r / rho_r + + # Roe averages + rho = np.sqrt(rho_l * rho_r) + u = (u_l * sqrt(rho_l) + u_r * sqrt(rho_r)) / (sqrt(rho_l) + sqrt(rho_r)) + H = (H_l * sqrt(rho_l) + H_r * sqrt(rho_r)) / (sqrt(rho_l) + sqrt(rho_r)) + + c = sound_speed_StiffenedGaz( H - u**2/2. ) + + lamb = cdmath.Vector(3) + lamb[0] = u-c + lamb[1] = u + lamb[2] = u+c + + r = cdmath.Matrix(3, 3) + r[0,0] = 1. + r[1,0] = u-c + r[2,0] = H-u*c + r[0,1] = 1. + r[1,1] = u + r[2,1] = H-c**2/(gamma-1) + r[0,2] = 1. + r[1,2] = u+c + r[2,2] = H+u*c + + l = cdmath.Matrix(3, 3) + l[0,0] = (1./(2*c**2))*(0.5*(gamma-1)*u**2+u*c) + l[1,0] = (1./(2*c**2))*(-u*(gamma-1)-c) + l[2,0] = (1./(2*c**2))*(gamma-1) + l[0,1] = ((gamma-1)/c**2)*(H-u**2) + l[1,1] = ((gamma-1)/c**2)*u + l[2,1] = -((gamma-1)/c**2) + l[0,2] = (1./(2*c**2))*(0.5*(gamma-1)*u**2-u*c) + l[1,2] = (1./(2*c**2))*(c-u*(gamma-1)) + l[2,2] = (1./(2*c**2))*(gamma-1) + + M1 = cdmath.Matrix(3, 3) #abs(lamb[0])*r[:,0].tensProduct(l[:,0]) + M2 = cdmath.Matrix(3, 3) #abs(lamb[1])*r[:,1].tensProduct(l[:,1]) + M3 = cdmath.Matrix(3, 3) #abs(lamb[2])*r[:,2].tensProduct(l[:,2]) + for i in range(3): + for j in range(3): + M1[i,j] = abs(lamb[0])*r[i,0]*l[j,0] + M2[i,j] = abs(lamb[1])*r[i,1]*l[j,1] + M3[i,j] = abs(lamb[2])*r[i,2]*l[j,2] + + Droe = M1+M2+M3 + + return(Droe) + + +def jacobianMatricesm(coeff, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r): + + if rho_l < 0 or rho_r < 0: + print("rho_l=", rho_l, " rho_r= ", rho_r) + raise ValueError("Negative density") + if rho_E_l < 0 or rho_E_r < 0: + print("rho_E_l=", rho_E_l, " rho_E_r= ", rho_E_r) + raise ValueError("Negative total energy") + + RoeMat = MatRoe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + Droe = Droe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + return (RoeMat - Droe) * coeff * 0.5 + + +def jacobianMatricesp(coeff, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r): + if rho_l < 0 or rho_r < 0: + print("rho_l=", rho_l, " rho_r= ", rho_r) + raise ValueError("Negative density") + if rho_E_l < 0 or rho_E_r < 0: + print("rho_E_l=", rho_E_l, " rho_E_r= ", rho_E_r) + raise ValueError("Negative total energy") + + RoeMat = MatRoe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + Droe = Droe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + return (RoeMat + Droe) * coeff * 0.5 + + +def FillEdges(j, Uk, nbComp, divMat, Rhs, Un, dt, dx, isImplicit): + dUi1 = cdmath.Vector(3) + dUi2 = cdmath.Vector(3) + temp1 = cdmath.Vector(3) + temp2 = cdmath.Vector(3) + + if (j == 0): + rho_l = Uk[j * nbComp + 0] + q_l = Uk[j * nbComp + 1] + rho_E_l = Uk[j * nbComp + 2] + rho_r = Uk[(j + 1) * nbComp + 0] + q_r = Uk[(j + 1) * nbComp + 1] + rho_E_r = Uk[(j + 1) * nbComp + 2] + + Am = jacobianMatricesm(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + divMat.addValue(j * nbComp, (j + 1) * nbComp, Am) + divMat.addValue(j * nbComp, j * nbComp, Am * (-1.)) + + p_inlet = rho_to_p_StiffenedGaz(Uk[j * nbComp + 0], Uk[j * nbComp + 1], Uk[j * nbComp + 2])# We take p from inside the domain + rho_l=p_to_rho_StiffenedGaz(p_inlet, T_inlet) # rho is computed from the temperature BC and the inner pressure + #rho_l = Uk[j * nbComp + 0] # We take rho from inside the domain + q_l = rho_l * v_inlet # q is imposed by the boundary condition v_inlet + rho_E_l = T_to_rhoE_StiffenedGaz(T_inlet, rho_l, q_l) #rhoE is obtained using the two boundary conditions v_inlet and e_inlet + rho_r = Uk[j * nbComp + 0] + q_r = Uk[j * nbComp + 1] + rho_E_r = Uk[j * nbComp + 2] + + Ap = jacobianMatricesp(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + divMat.addValue(j * nbComp, j * nbComp, Ap) + + if(isImplicit): + dUi1[0] = Uk[(j + 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi1[1] = Uk[(j + 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi1[2] = Uk[(j + 1) * nbComp + 2] - Uk[j * nbComp + 2] + temp1 = Am * dUi1 + + dUi2[0] = rho_l - Uk[(j ) * nbComp + 0] + dUi2[1] = q_l - Uk[(j ) * nbComp + 1] + dUi2[2] = rho_E_l - Uk[(j ) * nbComp + 2] + temp2 = Ap * dUi2 + else: + dUi2[0] = rho_l + dUi2[1] = q_l + dUi2[2] = rho_E_l + temp2 = Ap * dUi2 + + elif (j == nx - 1): + rho_l = Uk[(j - 1) * nbComp + 0] + q_l = Uk[(j - 1) * nbComp + 1] + rho_E_l = Uk[(j - 1) * nbComp + 2] + rho_r = Uk[j * nbComp + 0] + q_r = Uk[j * nbComp + 1] + rho_E_r = Uk[j * nbComp + 2] + + Ap = jacobianMatricesp(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + divMat.addValue(j * nbComp, j * nbComp, Ap) + divMat.addValue(j * nbComp, (j - 1) * nbComp, Ap * (-1.)) + + rho_l = Uk[j * nbComp + 0] + q_l = Uk[j * nbComp + 1] + rho_E_l = Uk[j * nbComp + 2] + rho_r = Uk[(j ) * nbComp + 0] # We take rho inside the domain + q_r = Uk[(j ) * nbComp + 1] # We take q from inside the domain + rho_E_r = (p_outlet+gamma*p0)/(gamma-1) + 0.5*q_r**2/rho_r # rhoE is obtained using the boundary condition p_outlet + + Am = jacobianMatricesm(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + divMat.addValue(j * nbComp, j * nbComp, Am * (-1.)) + + if(isImplicit): + dUi1[0] = rho_r - Uk[j * nbComp + 0] + dUi1[1] = q_r - Uk[j * nbComp + 1] + dUi1[2] = rho_E_r - Uk[j * nbComp + 2] + temp1 = Am * dUi1 + + dUi2[0] = Uk[(j - 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi2[1] = Uk[(j - 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi2[2] = Uk[(j - 1) * nbComp + 2] - Uk[j * nbComp + 2] + temp2 = Ap * dUi2 + else: + dUi1[0] = rho_r + dUi1[1] = q_r + dUi1[2] = rho_E_r + temp1 = Am * dUi1 + + if(isImplicit):#implicit scheme, contribution from the Newton scheme residual + Rhs[j * nbComp + 0] = -temp1[0] + temp2[0] - (Uk[j * nbComp + 0] - Un[j * nbComp + 0]) + Rhs[j * nbComp + 1] = -temp1[1] + temp2[1] - (Uk[j * nbComp + 1] - Un[j * nbComp + 1]) + Rhs[j * nbComp + 2] = -temp1[2] + temp2[2] - (Uk[j * nbComp + 2] - Un[j * nbComp + 2]) + else:#explicit scheme, contribution from the boundary data the right hand side + Rhs[j * nbComp + 0] = -temp1[0] + temp2[0] + Rhs[j * nbComp + 1] = -temp1[1] + temp2[1] + Rhs[j * nbComp + 2] = -temp1[2] + temp2[2] + +def FillInnerCell(j, Uk, nbComp, divMat, Rhs, Un, dt, dx, isImplicit): + + rho_l = Uk[(j - 1) * nbComp + 0] + q_l = Uk[(j - 1) * nbComp + 1] + rho_E_l = Uk[(j - 1) * nbComp + 2] + rho_r = Uk[j * nbComp + 0] + q_r = Uk[j * nbComp + 1] + rho_E_r = Uk[j * nbComp + 2] + Ap = jacobianMatricesp(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + rho_l = Uk[j * nbComp + 0] + q_l = Uk[j * nbComp + 1] + rho_E_l = Uk[j * nbComp + 2] + rho_r = Uk[(j + 1) * nbComp + 0] + q_r = Uk[(j + 1) * nbComp + 1] + rho_E_r = Uk[(j + 1) * nbComp + 2] + Am = jacobianMatricesm(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + divMat.addValue(j * nbComp, (j + 1) * nbComp, Am) + divMat.addValue(j * nbComp, j * nbComp, Am * (-1.)) + divMat.addValue(j * nbComp, j * nbComp, Ap) + divMat.addValue(j * nbComp, (j - 1) * nbComp, Ap * (-1.)) + + if(isImplicit): + dUi1 = cdmath.Vector(3) + dUi2 = cdmath.Vector(3) + + dUi1[0] = Uk[(j + 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi1[1] = Uk[(j + 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi1[2] = Uk[(j + 1) * nbComp + 2] - Uk[j * nbComp + 2] + + dUi2[0] = Uk[(j - 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi2[1] = Uk[(j - 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi2[2] = Uk[(j - 1) * nbComp + 2] - Uk[j * nbComp + 2] + + temp1 = Am * dUi1 + temp2 = Ap * dUi2 + + Rhs[j * nbComp + 0] = -temp1[0] + temp2[0] - (Uk[j * nbComp + 0] - Un[j * nbComp + 0]) + Rhs[j * nbComp + 1] = -temp1[1] + temp2[1] - (Uk[j * nbComp + 1] - Un[j * nbComp + 1]) + Rhs[j * nbComp + 2] = -temp1[2] + temp2[2] - (Uk[j * nbComp + 2] - Un[j * nbComp + 2]) + else: + Rhs[j * nbComp + 0] = 0 + Rhs[j * nbComp + 1] = 0 + Rhs[j * nbComp + 2] = 0 + +def SetPicture(rho_field_Roe, q_field_Roe, h_field_Roe, p_field_Roe, v_field_Roe, T_field_Roe, dx): + max_initial_rho = max(rho_field_Roe) + min_initial_rho = min(rho_field_Roe) + max_initial_q = max(q_field_Roe) + min_initial_q = min(q_field_Roe) + min_initial_h = min(h_field_Roe) + max_initial_h = max(h_field_Roe) + max_initial_p = max(p_field_Roe) + min_initial_p = min(p_field_Roe) + max_initial_v = max(v_field_Roe) + min_initial_v = min(v_field_Roe) + max_initial_T = max(T_field_Roe) + min_initial_T = min(T_field_Roe) + + fig, ([axDensity, axMomentum, axh],[axPressure, axVitesse, axTemperature]) = plt.subplots(2, 3,sharex=True, figsize=(14,10)) + plt.gcf().subplots_adjust(wspace = 0.5) + + lineDensity_Roe, = axDensity.plot([a+0.5*dx + i*dx for i in range(nx)], rho_field_Roe, label='Roe') + axDensity.set(xlabel='x (m)', ylabel='Densité (kg/m3)') + axDensity.set_xlim(a,b) + axDensity.set_ylim(680, 800) + axDensity.legend() + + lineMomentum_Roe, = axMomentum.plot([a+0.5*dx + i*dx for i in range(nx)], q_field_Roe, label='Roe') + axMomentum.set(xlabel='x (m)', ylabel='Momentum (kg/(m2.s))') + axMomentum.set_xlim(a,b) + axMomentum.set_ylim(3500, 4000) + axMomentum.legend() + + lineh_Roe, = axh.plot([a+0.5*dx + i*dx for i in range(nx)], h_field_Roe, label='Roe') + axh.set(xlabel='x (m)', ylabel='h (J/m3)') + axh.set_xlim(a,b) + axh.set_ylim(1.2 * 10**6, 1.5*10**6) + axh.legend() + + linePressure_Roe, = axPressure.plot([a+0.5*dx + i*dx for i in range(nx)], p_field_Roe, label='Roe') + axPressure.set(xlabel='x (m)', ylabel='Pression (bar)') + axPressure.set_xlim(a,b) + axPressure.set_ylim(155, 155.5) + axPressure.ticklabel_format(axis='y', style='sci', scilimits=(0,0)) + axPressure.legend() + + lineVitesse_Roe, = axVitesse.plot([a+0.5*dx + i*dx for i in range(nx)], v_field_Roe, label='Roe') + axVitesse.set(xlabel='x (m)', ylabel='Vitesse (m/s)') + axVitesse.set_xlim(a,b) + axVitesse.set_ylim(v_0-1, v_0+1) + axVitesse.ticklabel_format(axis='y', style='sci', scilimits=(0,0)) + axVitesse.legend() + + lineTemperature_Roe, = axTemperature.plot([a+0.5*dx + i*dx for i in range(nx)], T_field_Roe, label='Roe') + axTemperature.set(xlabel='x (m)', ylabel='Température (K)') + axTemperature.set_xlim(a,b) + axTemperature.set_ylim(T_0-10, T_0+30) + axTemperature.ticklabel_format(axis='y', style='sci', scilimits=(0,0)) + axTemperature.legend() + + return(fig, lineDensity_Roe, lineMomentum_Roe, lineh_Roe, linePressure_Roe, lineVitesse_Roe, lineTemperature_Roe) + + +def EulerSystemRoe(ntmax, tmax, cfl, a, b, nbCells, output_freq, meshName, state_law, isImplicit): + state_law_parameters(state_law) + dim = 1 + nbComp = 3 + dt = 0. + time = 0. + it = 0 + isStationary = False + dx = (b - a) / nx + dt = cfl * dx / c0 + #dt = 5*10**(-6) + nbVoisinsMax = 2 + + # iteration vectors + Un_Roe = cdmath.Vector(nbCells * (nbComp)) + dUn_Roe = cdmath.Vector(nbCells * (nbComp)) + dUk_Roe = cdmath.Vector(nbCells * (nbComp)) + Rhs_Roe = cdmath.Vector(nbCells * (nbComp)) + + # Initial conditions + print("Construction of the initial condition …") + + rho_field_Roe, q_field_Roe, rho_E_field_Roe, p_field_Roe, v_field_Roe, T_field_Roe = initial_conditions_Riemann_problem(a, b, nx) + h_field_Roe = (rho_E_field_Roe + p_field_Roe) / rho_field_Roe - 0.5 * (q_field_Roe / rho_field_Roe) **2 + p_field_Roe = p_field_Roe * 10 ** (-5) + + + for k in range(nbCells): + Un_Roe[k * nbComp + 0] = rho_field_Roe[k] + Un_Roe[k * nbComp + 1] = q_field_Roe[k] + Un_Roe[k * nbComp + 2] = rho_E_field_Roe[k] + + divMat_Roe = cdmath.SparseMatrixPetsc(nbCells * nbComp, nbCells * nbComp, (nbVoisinsMax + 1) * nbComp) + + # Picture settings + fig, lineDensity_Roe, lineMomentum_Roe, lineRhoE_Roe, linePressure_Roe, lineVitesse_Roe, lineTemperature_Roe = SetPicture( rho_field_Roe, q_field_Roe, h_field_Roe, p_field_Roe, v_field_Roe, T_field_Roe, dx) + + plt.savefig("EulerComplet_HeatedChannel_" + str(dim) + "D_Roe" + meshName + "0" + ".png") + iterGMRESMax = 50 + newton_max = 100 + + print("Starting computation of the non linear Euler non isentropic system with Roe scheme …") + # STARTING TIME LOOP + while (it < ntmax and time <= tmax and not isStationary): + dUn_Roe = Un_Roe.deepCopy() + Uk_Roe = Un_Roe.deepCopy() + residu_Roe = 1. + + k_Roe = 0 + while (k_Roe < newton_max and residu_Roe > precision): + # STARTING NEWTON LOOP + divMat_Roe.zeroEntries() #sets the matrix coefficients to zero + for j in range(nbCells): + + # traitements des bords + if (j == 0): + FillEdges(j, Uk_Roe, nbComp, divMat_Roe, Rhs_Roe, Un_Roe, dt, dx, isImplicit) + elif (j == nbCells - 1): + FillEdges(j, Uk_Roe, nbComp, divMat_Roe, Rhs_Roe, Un_Roe, dt, dx, isImplicit) + + # traitement des cellules internes + else: + FillInnerCell(j, Uk_Roe, nbComp, divMat_Roe, Rhs_Roe, Un_Roe, dt, dx, isImplicit) + + Rhs_Roe[j * nbComp + 2] += phi*dt + + if(isImplicit): + #solving the linear system divMat * dUk = Rhs + divMat_Roe.diagonalShift(1.) + LS_Roe = cdmath.LinearSolver(divMat_Roe, Rhs_Roe, iterGMRESMax, precision, "GMRES", "LU") + dUk_Roe = LS_Roe.solve() + vector_residu_Roe = dUk_Roe.maxVector(nbComp) + residu_Roe = max(abs(vector_residu_Roe[0])/rho0, abs(vector_residu_Roe[1])/(rho0*v_0), abs(vector_residu_Roe[2])/rhoE0 ) + else: + dUk_Roe=Rhs_Roe - divMat_Roe*Un_Roe + residu_Roe = 0.#Convergence schéma Newton + + if (isImplicit and (it == 1 or it % output_freq == 0 or it >= ntmax or isStationary or time >= tmax)): + print("Residu Newton at iteration ",k_Roe, " : ", residu_Roe) + print("Linear system converged in ", LS_Roe.getNumberOfIter(), " GMRES iterations") + + #updates for Newton loop + Uk_Roe += dUk_Roe + k_Roe = k_Roe + 1 + if (isImplicit and not LS_Roe.getStatus()): + print("Linear system did not converge ", LS_Roe.getNumberOfIter(), " GMRES iterations") + raise ValueError("No convergence of the linear system") + + if k_Roe == newton_max: + raise ValueError("No convergence of Newton Roe Scheme") + + #updating fields + Un_Roe = Uk_Roe.deepCopy() + dUn_Roe -= Un_Roe + + #Testing stationarity + residu_stat = dUn_Roe.maxVector(nbComp)#On prend le max de chaque composante + if (it % output_freq == 0 ): + print("Test de stationarité : Un+1-Un= ", max(abs(residu_stat[0])/rho0, abs(residu_stat[1])/(rho0*v_0), abs(residu_stat[2])/rhoE0 )) + + if ( it>1 and abs(residu_stat[0])/rho0= ntmax or isStationary or time >= tmax): + + print("-- Time step : " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)) + + print("Temperature gain between inlet and outlet is ", T_field_Roe[nbCells-1]-T_field_Roe[0],"\n") + + plt.savefig("EulerComplet_HeatedChannel_" + str(dim) + "D_Roe" + meshName + "Implicit"+str(isImplicit)+ str(it) + '_time' + str(time) + ".png") + + print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)+"\n") + + if (it >= ntmax): + print("Maximum number of time steps ntmax= ", ntmax, " reached") + return + + elif (isStationary): + print("Stationary regime reached at time step ", it, ", t= ", time) + print("------------------------------------------------------------------------------------") + np.savetxt("EulerComplet_HeatedChannel_" + str(dim) + "D_Roe" + meshName + "_rho_Stat.txt", rho_field_Roe, delimiter="\n") + np.savetxt("EulerComplet_HeatedChannel_" + str(dim) + "D_Roe" + meshName + "_q_Stat.txt", q_field_Roe, delimiter="\n") + np.savetxt("EulerComplet_HeatedChannel_" + str(dim) + "D_Roe" + meshName + "_rhoE_Stat.txt", rho_E_field_Roe, delimiter="\n") + np.savetxt("EulerComplet_HeatedChannel_" + str(dim) + "D_Roe" + meshName + "_p_Stat.txt", p_field_Roe, delimiter="\n") + plt.savefig("EulerComplet_HeatedChannel_" + str(dim) + "D_Roe" + meshName + "Implicit"+str(isImplicit)+"_Stat.png") + return + else: + print("Maximum time Tmax= ", tmax, " reached") + return + + +def solve(a, b, nx, meshName, meshType, cfl, state_law, isImplicit): + print("Simulation of a heated channel in dimension 1 on " + str(nx) + " cells") + print("State Law Stiffened Gaz, " + state_law) + print("Initial data : ", "constant fields") + print("Boundary conditions : ", "Inlet (Left), Outlet (Right)") + print("Mesh name : ", meshName, ", ", nx, " cells") + # Problem data + tmax = 10. + ntmax = 100000 + output_freq = 1000 + EulerSystemRoe(ntmax, tmax, cfl, a, b, nx, output_freq, meshName, state_law, isImplicit) + return + +def FillMatrixFromEdges(j, Uk, nbComp, divMat, dt, dx): + + if (j == 0): + rho_l = Uk[j * nbComp + 0] + q_l = Uk[j * nbComp + 1] + rho_E_l = Uk[j * nbComp + 2] + rho_r = Uk[(j + 1) * nbComp + 0] + q_r = Uk[(j + 1) * nbComp + 1] + rho_E_r = Uk[(j + 1) * nbComp + 2] + + Am = jacobianMatricesm(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + divMat.addValue(j * nbComp, (j + 1) * nbComp, Am) + divMat.addValue(j * nbComp, j * nbComp, Am * (-1.)) + + p_inlet = rho_to_p_StiffenedGaz(Uk[j * nbComp + 0], Uk[j * nbComp + 1], Uk[j * nbComp + 2])# We take p from inside the domain + rho_l=p_to_rho_StiffenedGaz(p_inlet, T_inlet) # rho is computed from the temperature BC and the inner pressure + #rho_l = Uk[j * nbComp + 0] # We take rho from inside the domain + q_l = rho_l * v_inlet # q is imposed by the boundary condition v_inlet + rho_E_l = T_to_rhoE_StiffenedGaz(T_inlet, rho_l, q_l) #rhoE is obtained using the two boundary conditions v_inlet and e_inlet + rho_r = Uk[j * nbComp + 0] + q_r = Uk[j * nbComp + 1] + rho_E_r = Uk[j * nbComp + 2] + + Ap = jacobianMatricesp(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + divMat.addValue(j * nbComp, j * nbComp, Ap) + + elif (j == nx - 1): + rho_l = Uk[j * nbComp + 0] + q_l = Uk[j * nbComp + 1] + rho_E_l = Uk[j * nbComp + 2] + rho_r = Uk[(j ) * nbComp + 0] # We take rho inside the domain + q_r = Uk[(j ) * nbComp + 1] # We take q from inside the domain + rho_E_r = (p_outlet+gamma*p0)/(gamma-1) + 0.5*q_r**2/rho_r # rhoE is obtained using the boundary condition p_outlet + + Am = jacobianMatricesm(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + divMat.addValue(j * nbComp, j * nbComp, Am * (-1.)) + + rho_l = Uk[(j - 1) * nbComp + 0] + q_l = Uk[(j - 1) * nbComp + 1] + rho_E_l = Uk[(j - 1) * nbComp + 2] + rho_r = Uk[j * nbComp + 0] + q_r = Uk[j * nbComp + 1] + rho_E_r = Uk[j * nbComp + 2] + + Ap = jacobianMatricesp(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + divMat.addValue(j * nbComp, j * nbComp, Ap) + divMat.addValue(j * nbComp, (j - 1) * nbComp, Ap * (-1.)) + + +def FillMatrixFromInnerCell(j, Uk, nbComp, divMat, dt, dx): + + rho_l = Uk[(j - 1) * nbComp + 0] + q_l = Uk[(j - 1) * nbComp + 1] + rho_E_l = Uk[(j - 1) * nbComp + 2] + rho_r = Uk[j * nbComp + 0] + q_r = Uk[j * nbComp + 1] + rho_E_r = Uk[j * nbComp + 2] + Ap = jacobianMatricesp(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + rho_l = Uk[j * nbComp + 0] + q_l = Uk[j * nbComp + 1] + rho_E_l = Uk[j * nbComp + 2] + rho_r = Uk[(j + 1) * nbComp + 0] + q_r = Uk[(j + 1) * nbComp + 1] + rho_E_r = Uk[(j + 1) * nbComp + 2] + Am = jacobianMatricesm(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + divMat.addValue(j * nbComp, (j + 1) * nbComp, Am) + divMat.addValue(j * nbComp, j * nbComp, Am * (-1.)) + divMat.addValue(j * nbComp, j * nbComp, Ap) + divMat.addValue(j * nbComp, (j - 1) * nbComp, Ap * (-1.)) + +def FillRHSFromEdges(j, Uk, nbComp, Rhs, Un, dt, dx, isImplicit): + dUi1 = cdmath.Vector(3) + dUi2 = cdmath.Vector(3) + temp1 = cdmath.Vector(3) + temp2 = cdmath.Vector(3) + + if (j == 0): + rho_l = Uk[j * nbComp + 0] + q_l = Uk[j * nbComp + 1] + rho_E_l = Uk[j * nbComp + 2] + rho_r = Uk[(j + 1) * nbComp + 0] + q_r = Uk[(j + 1) * nbComp + 1] + rho_E_r = Uk[(j + 1) * nbComp + 2] + + Am = jacobianMatricesm(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + p_inlet = rho_to_p_StiffenedGaz(Uk[j * nbComp + 0], Uk[j * nbComp + 1], Uk[j * nbComp + 2])# We take p from inside the domain + rho_l=p_to_rho_StiffenedGaz(p_inlet, T_inlet) # rho is computed from the temperature BC and the inner pressure + #rho_l = Uk[j * nbComp + 0] # We take rho from inside the domain + q_l = rho_l * v_inlet # q is imposed by the boundary condition v_inlet + rho_E_l = T_to_rhoE_StiffenedGaz(T_inlet, rho_l, q_l) #rhoE is obtained using the two boundary conditions v_inlet and e_inlet + rho_r = Uk[j * nbComp + 0] + q_r = Uk[j * nbComp + 1] + rho_E_r = Uk[j * nbComp + 2] + + Ap = jacobianMatricesp(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + if(isImplicit): + dUi1[0] = Uk[(j + 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi1[1] = Uk[(j + 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi1[2] = Uk[(j + 1) * nbComp + 2] - Uk[j * nbComp + 2] + temp1 = Am * dUi1 + + dUi2[0] = rho_l - Uk[(j ) * nbComp + 0] + dUi2[1] = q_l - Uk[(j ) * nbComp + 1] + dUi2[2] = rho_E_l - Uk[(j ) * nbComp + 2] + temp2 = Ap * dUi2 + else: + dUi2[0] = rho_l + dUi2[1] = q_l + dUi2[2] = rho_E_l + temp2 = Ap * dUi2 + + elif (j == nx - 1): + rho_l = Uk[(j - 1) * nbComp + 0] + q_l = Uk[(j - 1) * nbComp + 1] + rho_E_l = Uk[(j - 1) * nbComp + 2] + rho_r = Uk[j * nbComp + 0] + q_r = Uk[j * nbComp + 1] + rho_E_r = Uk[j * nbComp + 2] + + Ap = jacobianMatricesp(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + rho_l = Uk[j * nbComp + 0] + q_l = Uk[j * nbComp + 1] + rho_E_l = Uk[j * nbComp + 2] + rho_r = Uk[(j ) * nbComp + 0] # We take rho inside the domain + q_r = Uk[(j ) * nbComp + 1] # We take q from inside the domain + rho_E_r = (p_outlet+gamma*p0)/(gamma-1) + 0.5*q_r**2/rho_r # rhoE is obtained using the boundary condition p_outlet + + Am = jacobianMatricesm(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + if(isImplicit): + dUi1[0] = rho_r - Uk[j * nbComp + 0] + dUi1[1] = q_r - Uk[j * nbComp + 1] + dUi1[2] = rho_E_r - Uk[j * nbComp + 2] + temp1 = Am * dUi1 + + dUi2[0] = Uk[(j - 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi2[1] = Uk[(j - 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi2[2] = Uk[(j - 1) * nbComp + 2] - Uk[j * nbComp + 2] + temp2 = Ap * dUi2 + else: + dUi1[0] = rho_r + dUi1[1] = q_r + dUi1[2] = rho_E_r + temp1 = Am * dUi1 + + if(isImplicit): + Rhs[j * nbComp + 0] = -temp1[0] + temp2[0] - (Uk[j * nbComp + 0] - Un[j * nbComp + 0]) + Rhs[j * nbComp + 1] = -temp1[1] + temp2[1] - (Uk[j * nbComp + 1] - Un[j * nbComp + 1]) + Rhs[j * nbComp + 2] = -temp1[2] + temp2[2] - (Uk[j * nbComp + 2] - Un[j * nbComp + 2]) + else:#explicit scheme, contribution from the boundary data the right hand side + Rhs[j * nbComp + 0] = -temp1[0] + temp2[0] + Rhs[j * nbComp + 1] = -temp1[1] + temp2[1] + Rhs[j * nbComp + 2] = -temp1[2] + temp2[2] + +def FillRHSFromInnerCell(j, Uk, nbComp, Rhs, Un, dt, dx, isImplicit): + + rho_l = Uk[(j - 1) * nbComp + 0] + q_l = Uk[(j - 1) * nbComp + 1] + rho_E_l = Uk[(j - 1) * nbComp + 2] + rho_r = Uk[j * nbComp + 0] + q_r = Uk[j * nbComp + 1] + rho_E_r = Uk[j * nbComp + 2] + Ap = jacobianMatricesp(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + rho_l = Uk[j * nbComp + 0] + q_l = Uk[j * nbComp + 1] + rho_E_l = Uk[j * nbComp + 2] + rho_r = Uk[(j + 1) * nbComp + 0] + q_r = Uk[(j + 1) * nbComp + 1] + rho_E_r = Uk[(j + 1) * nbComp + 2] + Am = jacobianMatricesm(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + if(isImplicit):#Contribution to the right hand side if te scheme is implicit + dUi1 = cdmath.Vector(3) + dUi2 = cdmath.Vector(3) + + dUi1[0] = Uk[(j + 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi1[1] = Uk[(j + 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi1[2] = Uk[(j + 1) * nbComp + 2] - Uk[j * nbComp + 2] + + dUi2[0] = Uk[(j - 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi2[1] = Uk[(j - 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi2[2] = Uk[(j - 1) * nbComp + 2] - Uk[j * nbComp + 2] + + temp1 = Am * dUi1 + temp2 = Ap * dUi2 + + Rhs[j * nbComp + 0] = -temp1[0] + temp2[0] - (Uk[j * nbComp + 0] - Un[j * nbComp + 0]) + Rhs[j * nbComp + 1] = -temp1[1] + temp2[1] - (Uk[j * nbComp + 1] - Un[j * nbComp + 1]) + Rhs[j * nbComp + 2] = -temp1[2] + temp2[2] - (Uk[j * nbComp + 2] - Un[j * nbComp + 2]) + else: + Rhs[j * nbComp + 0] = 0 + Rhs[j * nbComp + 1] = 0 + Rhs[j * nbComp + 2] = 0 + + +def computeSystemMatrix(a,b,nx, cfl, Uk, isImplicit): + dim = 1 + nbComp = 3 + dx = (b - a) / nx + dt = cfl * dx / c0 + nbVoisinsMax = 2 + + nbCells = nx + divMat = cdmath.SparseMatrixPetsc(nbCells * nbComp, nbCells * nbComp, (nbVoisinsMax + 1) * nbComp) + + divMat.zeroEntries() #sets the matrix coefficients to zero + for j in range(nbCells): + + # traitements des bords + if (j == 0): + FillMatrixFromEdges(j, Uk, nbComp, divMat, dt, dx) + elif (j == nbCells - 1): + FillMatrixFromEdges(j, Uk, nbComp, divMat, dt, dx) + # traitement des cellules internes + else: + FillMatrixFromInnerCell(j, Uk, nbComp, divMat, dt, dx) + + if(isImplicit): + divMat.diagonalShift(1.) # add one on the diagonal + else: + divMat*=-1. + divMat.diagonalShift(1.) # add one on the diagonal + + return divMat + +def computeRHSVector(a,b,nx, cfl, Uk, Un, isImplicit): + dim = 1 + nbComp = 3 + dx = (b - a) / nx + dt = cfl * dx / c0 + nbVoisinsMax = 2 + + nbCells = nx + Rhs = cdmath.Vector(nbCells * (nbComp)) + + for j in range(nbCells): + + # traitements des bords + if (j == 0): + FillRHSFromEdges(j, Uk, nbComp, Rhs, Un, dt, dx, isImplicit) + elif (j == nbCells - 1): + FillRHSFromEdges(j, Uk, nbComp, Rhs, Un, dt, dx, isImplicit) + # traitement des cellules internes + else: + FillRHSFromInnerCell(j, Uk, nbComp, Rhs, Un, dt, dx, isImplicit) + + return Rhs + + +if __name__ == """__main__""": + nbComp=3 # number of equations + a = 0.# domain is interval [a,b] + b = 4.2# domain is interval [a,b] + nx = 10# number of cells + dx = (b - a) / nx # space step + x = [a + 0.5 * dx + i * dx for i in range(nx)] # array of cell center (1D mesh) + state_law = "Hermite575K" + state_law_parameters(state_law) + rho0=p_to_rho_StiffenedGaz(p_0, T_0) + rhoE0=T_to_rhoE_StiffenedGaz(T_0, rho0, rho0*v_0) + + +#### initial condition (T in K, v in m/s, p in Pa) + p_initial = np.array([ p_outlet for xi in x]) + v_initial = np.array([ v_inlet for xi in x]) + T_initial = np.array([ T_inlet for xi in x]) + + rho_field = p_to_rho_StiffenedGaz(p_initial, T_initial) + q_field = rho_field * v_initial + rho_E_field = rho_field * T_to_E_StiffenedGaz(p_initial, T_initial, v_initial) + + U = cdmath.Vector(nx * (nbComp))#Inutile à terme mais nécessaire pour le moment + + for k in range(nx): + U[k * nbComp + 0] = rho_field[k] + U[k * nbComp + 1] = q_field[k] + U[k * nbComp + 2] = rho_E_field[k] + print("\n Testing function computeSystemMatrix \n") + cfl = 0.5 + computeSystemMatrix(a, b, nx, cfl, U,True) #Implicit matrix + computeSystemMatrix(a, b, nx, cfl, U,False) #Explicit matrix + + print("\n Testing function computeRHSVector \n") + cfl = 0.5 + computeRHSVector(a, b, nx, cfl, U, U,True) #Implicit RHS + computeRHSVector(a, b, nx, cfl, U, U,False) #Explicit RHS + + print("\n Testing function solve (Implicit scheme) \n") + isImplicit=True + cfl = 1000. + solve(a, b, nx, "RegularSquares", "", cfl, state_law, isImplicit) + + print("\n Testing function solve (Explicit scheme) \n") + isImplicit=False + cfl = 0.5 + solve(a, b, nx, "RegularSquares", "", cfl, state_law, isImplicit) + diff --git a/CDMATH/tests/examples/EulerSystem1D/EulerSystem1DUpwind/CMakeLists.txt b/CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_RiemannProblem/CMakeLists.txt similarity index 53% rename from CDMATH/tests/examples/EulerSystem1D/EulerSystem1DUpwind/CMakeLists.txt rename to CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_RiemannProblem/CMakeLists.txt index 8b41b92..895c803 100755 --- a/CDMATH/tests/examples/EulerSystem1D/EulerSystem1DUpwind/CMakeLists.txt +++ b/CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_RiemannProblem/CMakeLists.txt @@ -1,7 +1,7 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - ADD_TEST(ExampleEulerSystem_1DShock_UpwindExplicit ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystem1DUpwind.py ) + ADD_TEST(ExampleFullEulerSystem_1DRiemammProblem_Roe ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Euler_complet_RP.py ) endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) diff --git a/CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_RiemannProblem/Euler_complet_RP.py b/CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_RiemannProblem/Euler_complet_RP.py new file mode 100644 index 0000000..8785225 --- /dev/null +++ b/CDMATH/tests/examples/EulerEquations/FullEulerSystem/EulerSystem1D_RiemannProblem/Euler_complet_RP.py @@ -0,0 +1,642 @@ +#!/usr/bin/env python3 +# -*-coding:utf-8 -* + +""" +Created on Mon Aug 30 2021 +@author: Michael NDJINGA, Katia Ait Ameur, Coraline Mounier + +Euler system without source term in one dimension on regular domain [a,b] +Riemann problemn with ghost cell boundary condition +Left and right: Neumann boundary condition +Roe scheme +Regular square mesh + +State law Stiffened gaz : p = (gamma - 1) * rho * (e - q) - gamma * p0 +4 choices of parameters gamma and p0 are available : + - Lagrange interpolation (with q=0) + - Hermite interpolation with reference point at 575K (with q=0) + - Hermite interpolation with reference point at 590K (with q=0) + - Hermite interpolation with reference point at 617.94K (saturation at 155 bar) with q=0 + +Linearized enthalpy : h = h_sat + cp * (T - T_sat) +Values for cp and T_sat parameters are taken at the reference point chosen for the state law + +To do correct the computation of the time step : lambda_max (maximum eigenvalue) should be computed first) +""" + +import cdmath +import numpy as np +import matplotlib + +matplotlib.use("Agg") +import matplotlib.pyplot as plt +import matplotlib.animation as manimation +import sys +from math import sqrt, atan, pi +from numpy import sign + + +## Numerical parameter +precision = 1e-5 + +#state law parameter : can be 'Lagrange', 'Hermite590K', 'Hermite617K', or 'FLICA' +state_law = "Hermite590K" + +#indicates with test case is simulated to compare with FLICA5 results +#num_test = 0 means there are no FLICA5 results given here +num_test = 0 + +#def state_law_parameters(state_law): +#state law Stiffened Gaz : p = (gamma - 1) * rho * e - gamma * p0 +global gamma +global p0 +global q +global c0 +global cp +global h_sat +global T_sat + +if state_law == "Lagrange": + # reference values for Lagrange interpolation + p_ref = 155. * 10**5 #Reference pressure in a REP 900 nuclear power plant + p1 = 153. * 10**5 # value of pressure at inlet of a 900 MWe PWR vessel + rho_ref = 594.38 #density of water at saturation temperature of 617.94K and 155 bars + rho1 = 742.36 # value of density at inlet of a 900 MWe PWR vessel (T1 = 565K) + e_ref = 1603.8 * 10**3 #internal energy of water at saturation temperature of 617.94K and 155 bars + e1 = 1273.6 * 10**3 # value of internal energy at inlet of a 900 MWe PWR vessel + + gamma = (p1 - p_ref) / (rho1 * e1 - rho_ref *e_ref) + 1. + p0 = - 1. / gamma * ( - (gamma - 1) * rho_ref * e_ref + p_ref) + q=0. + c0 = sqrt((gamma - 1) * (e_ref + p_ref / rho_ref)) + + cp = 8950. + h_sat = 1.63 * 10 ** 6 # saturation enthalpy of water at 155 bars + T_sat = 617.94 + +elif state_law == "Hermite617K": + # reference values for Hermite interpolation + p_ref = 155. * 10**5 #Reference pressure in a REP 900 nuclear power plant + T_ref = 617.94 #Reference temperature for interpolation at 617.94K + rho_ref = 594.38 #density of water at saturation temperature of 617.94K and 155 bars + e_ref = 1603.8 * 10**3 #internal energy of water at saturation temperature of 617.94K and 155 bars + h_ref = e_ref + p_ref / rho_ref + c_ref = 621.43 #sound speed for water at 155 bars and 617.94K + + gamma = 1. + c_ref * c_ref / (e_ref + p_ref / rho_ref) # From the sound speed formula + p0 = 1. / gamma * ( (gamma - 1) * rho_ref * e_ref - p_ref) + q=0. + c0 = sqrt((gamma - 1) * (e_ref + p_ref / rho_ref)) + + cp = 8950. # value at 155 bar and 617.94K + h_sat = 1.63 * 10 ** 6 # saturation enthalpy of water at 155 bars + T_sat = 617.94 + +elif state_law == 'Hermite590K': + # reference values for Hermite interpolation + p_ref = 155. * 10**5 #Reference pressure in a REP 900 nuclear power plant + T_ref = 590. #Reference temperature for interpolation at 590K + rho_ref = 688.3 #density of water at 590K and 155 bars + e_ref = 1411.4 * 10**3 #internal energy of water at 590K and 155 bars + h_ref = e_ref + p_ref / rho_ref + c_ref = 866.29 #sound speed for water at 155 bars and 590K + + gamma = 1. + c_ref * c_ref / (e_ref + p_ref / rho_ref) # From the sound speed formula + p0 = 1. / gamma * ( (gamma - 1) * rho_ref * e_ref - p_ref) + q=0. + c0 = sqrt((gamma - 1) * (e_ref + p_ref / rho_ref)) + + cp = 5996.8 # value at 155 bar and 590K + h_sat = 1433.9 * 10 ** 3 # saturation enthalpy of water at 155 bars + T_sat = 590. + +elif state_law == 'Hermite575K': + # reference values for Hermite interpolation + p_ref = 155 * 10**5 #Reference pressure in a REP 900 nuclear power plant + T_ref = 575 #Reference temperature at inlet in a REP 900 nuclear power plant + #Remaining values determined using iapws python package + rho_ref = 722.66 #density of water at 575K and 155 bars + e_ref = 1326552.66 #internal energy of water at 575K and 155 bars + h_ref = e_ref + p_ref / rho_ref + c_ref = 959.28 #sound speed for water at 155 bars and 575K + + gamma = 1 + c_ref * c_ref / (e_ref + p_ref / rho_ref) # From the sound speed formula + p0 = 1 / gamma * ( (gamma - 1) * rho_ref * e_ref - p_ref) + q=0. + c0 = sqrt((gamma - 1) * (e_ref + p_ref / rho_ref))#This is actually c_ref + + cp = 5504.05 # value at 155 bar and 590K + h_sat = h_ref # saturation enthalpy of water at 155 bars + T_sat = T_ref +else: + raise ValueError("Incorrect value for parameter state_law") + + +#initial parameters for Riemann problem (p in Pa, v in m/s, T in K) +p_L = 155. * 10**5 +p_R = 150. * 10**5 +v_L = 0. +v_R = 0. +h_L = 1.4963*10**6 +h_R = 1.4963*10**6 + +T_L = (h_L - h_sat ) / cp + T_sat +T_R = (h_R - h_sat ) / cp + T_sat + +def initial_conditions_Riemann_problem(a, b, nx): + 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) + + p_initial = np.array([ (xi < (a + b) / 2) * p_L + (xi >= (a + b) / 2) * p_R for xi in x]) + v_initial = np.array([ (xi < (a + b) / 2) * v_L + (xi >= (a + b) / 2) * v_R for xi in x]) + T_initial = np.array([ (xi < (a + b) / 2) * T_L + (xi >= (a + b) / 2) * T_R for xi in x]) + + rho_initial = p_to_rho_StiffenedGaz(p_initial, T_initial) + q_initial = rho_initial * v_initial + rho_E_initial = T_to_rhoE_StiffenedGaz(T_initial, rho_initial, q_initial) + + return rho_initial, q_initial, rho_E_initial, p_initial, v_initial, T_initial + +def rho_to_p_StiffenedGaz(rho_field, q_field, rho_E_field): + p_field = (gamma - 1) * ( rho_E_field - 1. / 2 * q_field ** 2 / rho_field - rho_field * q) - gamma * p0 + return p_field + + +def p_to_rho_StiffenedGaz(p_field, T_field): + rho_field = (p_field + p0) * gamma / (gamma - 1) * 1 / (h_sat + cp * (T_field - T_sat) - q) + return rho_field + + +def T_to_rhoE_StiffenedGaz(T_field, rho_field, q_field): + rho_E_field = 1 / 2 * (q_field) ** 2 / rho_field + p0 + rho_field / gamma * (h_sat + cp * (T_field- T_sat) + (gamma - 1) * q) + return rho_E_field + + +def rhoE_to_T_StiffenedGaz(rho_field, q_field, rho_E_field): + T_field = T_sat + 1 / cp * (gamma * (rho_E_field / rho_field - 1 / 2 * (q_field / rho_field) ** 2) - gamma * p0 / rho_field - (gamma - 1) * q - h_sat) + return T_field + +def dp_drho_e_const_StiffenedGaz( e ): + return (gamma-1)*(e-q) + +def dp_de_rho_const_StiffenedGaz( rho ): + return (gamma-1)*rho + +def sound_speed_StiffenedGaz( h ): + return np.sqrt((gamma-1)*(h-q)) + +def rho_h_to_p_StiffenedGaz( rho, h ): + return (gamma - 1) * rho * ( h - q ) / gamma - p0 + +def MatRoe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r): + RoeMat = cdmath.Matrix(3, 3) + + u_l = q_l / rho_l + u_r = q_r / rho_r + p_l = rho_to_p_StiffenedGaz(rho_l, q_l, rho_E_l) + p_r = rho_to_p_StiffenedGaz(rho_r, q_r, rho_E_r) + H_l = rho_E_l / rho_l + p_l / rho_l + H_r = rho_E_r / rho_r + p_r / rho_r + + # Roe averages + rho = np.sqrt(rho_l * rho_r) + u = (u_l * sqrt(rho_l) + u_r * sqrt(rho_r)) / (sqrt(rho_l) + sqrt(rho_r)) + H = (H_l * sqrt(rho_l) + H_r * sqrt(rho_r)) / (sqrt(rho_l) + sqrt(rho_r)) + + p = rho_h_to_p_StiffenedGaz( rho, H - u**2/2. ) + e = H - p / rho - 1./2 * u**2 + dp_drho = dp_drho_e_const_StiffenedGaz( e ) + dp_de = dp_de_rho_const_StiffenedGaz( rho ) + + RoeMat[0, 0] = 0 + RoeMat[0, 1] = 1 + RoeMat[0, 2] = 0 + RoeMat[1, 0] = dp_drho - u ** 2 + dp_de / rho * (u**2/2 - e) + RoeMat[1, 1] = 2 * u - u * dp_de / rho + RoeMat[1, 2] = dp_de / rho + RoeMat[2, 0] = -u * ( -dp_drho + H - dp_de / rho * (u**2/2 - e) ) + RoeMat[2, 1] = H - dp_de / rho * u ** 2 + RoeMat[2, 2] = (dp_de / rho +1) * u + + return(RoeMat) + + +def Droe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r): + Droe = cdmath.Matrix(3, 3) + + u_l = q_l / rho_l + u_r = q_r / rho_r + p_l = rho_to_p_StiffenedGaz(rho_l, q_l, rho_E_l) + p_r = rho_to_p_StiffenedGaz(rho_r, q_r, rho_E_r) + H_l = rho_E_l / rho_l + p_l / rho_l + H_r = rho_E_r / rho_r + p_r / rho_r + + # Roe averages + rho = np.sqrt(rho_l * rho_r) + u = (u_l * sqrt(rho_l) + u_r * sqrt(rho_r)) / (sqrt(rho_l) + sqrt(rho_r)) + H = (H_l * sqrt(rho_l) + H_r * sqrt(rho_r)) / (sqrt(rho_l) + sqrt(rho_r)) + + c = sound_speed_StiffenedGaz( H - u**2/2. ) + + lamb = cdmath.Vector(3) + lamb[0] = u-c + lamb[1] = u + lamb[2] = u+c + + r = cdmath.Matrix(3, 3) + r[0,0] = 1. + r[1,0] = u-c + r[2,0] = H-u*c + r[0,1] = 1. + r[1,1] = u + r[2,1] = H-c**2/(gamma-1) + r[0,2] = 1. + r[1,2] = u+c + r[2,2] = H+u*c + + l = cdmath.Matrix(3, 3) + l[0,0] = (1./(2*c**2))*(0.5*(gamma-1)*u**2+u*c) + l[1,0] = (1./(2*c**2))*(-u*(gamma-1)-c) + l[2,0] = (1./(2*c**2))*(gamma-1) + l[0,1] = ((gamma-1)/c**2)*(H-u**2) + l[1,1] = ((gamma-1)/c**2)*u + l[2,1] = -((gamma-1)/c**2) + l[0,2] = (1./(2*c**2))*(0.5*(gamma-1)*u**2-u*c) + l[1,2] = (1./(2*c**2))*(c-u*(gamma-1)) + l[2,2] = (1./(2*c**2))*(gamma-1) + + M1 = cdmath.Matrix(3, 3) #abs(lamb[0])*r[:,0].tensProduct(l[:,0]) + M2 = cdmath.Matrix(3, 3) #abs(lamb[1])*r[:,1].tensProduct(l[:,1]) + M3 = cdmath.Matrix(3, 3) #abs(lamb[2])*r[:,2].tensProduct(l[:,2]) + for i in range(3): + for j in range(3): + M1[i,j] = abs(lamb[0])*r[i,0]*l[j,0] + M2[i,j] = abs(lamb[1])*r[i,1]*l[j,1] + M3[i,j] = abs(lamb[2])*r[i,2]*l[j,2] + + Droe = M1+M2+M3 + + return(Droe) + + +def jacobianMatricesm(coeff, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r): + + if rho_l < 0 or rho_r < 0: + print("rho_l=", rho_l, " rho_r= ", rho_r) + raise ValueError("Negative density") + if rho_E_l < 0 or rho_E_r < 0: + print("rho_E_l=", rho_E_l, " rho_E_r= ", rho_E_r) + raise ValueError("Negative total energy") + + RoeMat = MatRoe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + Droe = Droe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + return (RoeMat - Droe) * coeff * 0.5 + + +def jacobianMatricesp(coeff, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r): + if rho_l < 0 or rho_r < 0: + print("rho_l=", rho_l, " rho_r= ", rho_r) + raise ValueError("Negative density") + if rho_E_l < 0 or rho_E_r < 0: + print("rho_E_l=", rho_E_l, " rho_E_r= ", rho_E_r) + raise ValueError("Negative total energy") + + RoeMat = MatRoe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + Droe = Droe_StiffenedGaz( rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + return (RoeMat + Droe) * coeff * 0.5 + + +def FillEdges(j, Uk, nbComp, divMat, Rhs, Un, dt, dx, isImplicit): + dUi = cdmath.Vector(3) + + if (j == 0): + rho_l = Uk[j * nbComp + 0] + q_l = Uk[j * nbComp + 1] + rho_E_l = Uk[j * nbComp + 2] + rho_r = Uk[(j + 1) * nbComp + 0] + q_r = Uk[(j + 1) * nbComp + 1] + rho_E_r = Uk[(j + 1) * nbComp + 2] + + Am = jacobianMatricesm(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + divMat.addValue(j * nbComp, (j + 1) * nbComp, Am) + divMat.addValue(j * nbComp, j * nbComp, Am * (-1.)) + + dUi[0] = Uk[(j + 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi[1] = Uk[(j + 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi[2] = Uk[(j + 1) * nbComp + 2] - Uk[j * nbComp + 2] + temp = Am * dUi + + if(isImplicit): + Rhs[j * nbComp + 0] = -temp[0] - (Uk[j * nbComp + 0] - Un[j * nbComp + 0]) + Rhs[j * nbComp + 1] = -temp[1] - (Uk[j * nbComp + 1] - Un[j * nbComp + 1]) + Rhs[j * nbComp + 2] = -temp[2] - (Uk[j * nbComp + 2] - Un[j * nbComp + 2]) + + elif (j == nx - 1): + rho_l = Uk[(j - 1) * nbComp + 0] + q_l = Uk[(j - 1) * nbComp + 1] + rho_E_l = Uk[(j - 1) * nbComp + 2] + rho_r = Uk[j * nbComp + 0] + q_r = Uk[j * nbComp + 1] + rho_E_r = Uk[j * nbComp + 2] + + Ap = jacobianMatricesp(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + divMat.addValue(j * nbComp, j * nbComp, Ap) + divMat.addValue(j * nbComp, (j - 1) * nbComp, Ap * (-1.)) + + dUi[0] = Uk[(j - 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi[1] = Uk[(j - 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi[2] = Uk[(j - 1) * nbComp + 2] - Uk[j * nbComp + 2] + + temp = Ap * dUi + + if(isImplicit): + Rhs[j * nbComp + 0] = temp[0] - (Uk[j * nbComp + 0] - Un[j * nbComp + 0]) + Rhs[j * nbComp + 1] = temp[1] - (Uk[j * nbComp + 1] - Un[j * nbComp + 1]) + Rhs[j * nbComp + 2] = temp[2] - (Uk[j * nbComp + 2] - Un[j * nbComp + 2]) + +def FillInnerCell(j, Uk, nbComp, divMat, Rhs, Un, dt, dx, isImplicit): + + rho_l = Uk[(j - 1) * nbComp + 0] + q_l = Uk[(j - 1) * nbComp + 1] + rho_E_l = Uk[(j - 1) * nbComp + 2] + rho_r = Uk[j * nbComp + 0] + q_r = Uk[j * nbComp + 1] + rho_E_r = Uk[j * nbComp + 2] + Ap = jacobianMatricesp(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + rho_l = Uk[j * nbComp + 0] + q_l = Uk[j * nbComp + 1] + rho_E_l = Uk[j * nbComp + 2] + rho_r = Uk[(j + 1) * nbComp + 0] + q_r = Uk[(j + 1) * nbComp + 1] + rho_E_r = Uk[(j + 1) * nbComp + 2] + Am = jacobianMatricesm(dt / dx, rho_l, q_l, rho_E_l, rho_r, q_r, rho_E_r) + + divMat.addValue(j * nbComp, (j + 1) * nbComp, Am) + divMat.addValue(j * nbComp, j * nbComp, Am * (-1.)) + divMat.addValue(j * nbComp, j * nbComp, Ap) + divMat.addValue(j * nbComp, (j - 1) * nbComp, Ap * (-1.)) + dUi1 = cdmath.Vector(3) + dUi2 = cdmath.Vector(3) + dUi1[0] = Uk[(j + 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi1[1] = Uk[(j + 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi1[2] = Uk[(j + 1) * nbComp + 2] - Uk[j * nbComp + 2] + + dUi2[0] = Uk[(j - 1) * nbComp + 0] - Uk[j * nbComp + 0] + dUi2[1] = Uk[(j - 1) * nbComp + 1] - Uk[j * nbComp + 1] + dUi2[2] = Uk[(j - 1) * nbComp + 2] - Uk[j * nbComp + 2] + temp1 = Am * dUi1 + temp2 = Ap * dUi2 + + if(isImplicit): + Rhs[j * nbComp + 0] = -temp1[0] + temp2[0] - (Uk[j * nbComp + 0] - Un[j * nbComp + 0]) + Rhs[j * nbComp + 1] = -temp1[1] + temp2[1] - (Uk[j * nbComp + 1] - Un[j * nbComp + 1]) + Rhs[j * nbComp + 2] = -temp1[2] + temp2[2] - (Uk[j * nbComp + 2] - Un[j * nbComp + 2]) + +def SetPicture(rho_field_Roe, q_field_Roe, h_field_Roe, p_field_Roe, v_field_Roe, T_field_Roe, dx): + max_initial_rho = max(rho_field_Roe) + min_initial_rho = min(rho_field_Roe) + max_initial_q = max(q_field_Roe) + min_initial_q = min(q_field_Roe) + min_initial_h = min(h_field_Roe) + max_initial_h = max(h_field_Roe) + max_initial_p = max(p_field_Roe) + min_initial_p = min(p_field_Roe) + max_initial_v = max(v_field_Roe) + min_initial_v = min(v_field_Roe) + max_initial_T = max(T_field_Roe) + min_initial_T = min(T_field_Roe) + + fig, ([axDensity, axMomentum, axRhoE],[axPressure, axVitesse, axTemperature]) = plt.subplots(2, 3,sharex=True, figsize=(14,10)) + plt.gcf().subplots_adjust(wspace = 0.5) + + lineDensity_Roe, = axDensity.plot([a+0.5*dx + i*dx for i in range(nx)], rho_field_Roe, label='Roe') + axDensity.set(xlabel='x (m)', ylabel='Densité (kg/m3)') + axDensity.set_xlim(a,b) + #axDensity.set_ylim(min_initial_rho - 0.1 * (max_initial_rho - min_initial_rho), 700.) + axDensity.set_ylim(657, 660.5) + axDensity.legend() + + lineMomentum_Roe, = axMomentum.plot([a+0.5*dx + i*dx for i in range(nx)], q_field_Roe, label='Roe') + axMomentum.set(xlabel='x (m)', ylabel='Momentum (kg/(m2.s))') + axMomentum.set_xlim(a,b) + #axMomentum.set_ylim(min_initial_q - 0.1*(max_initial_q-min_initial_q), max_initial_q * 2.5) + axMomentum.set_ylim(-50, 500) + axMomentum.legend() + + lineRhoE_Roe, = axRhoE.plot([a+0.5*dx + i*dx for i in range(nx)], h_field_Roe, label='Roe') + axRhoE.set(xlabel='x (m)', ylabel='h (J/m3)') + axRhoE.set_xlim(a,b) + #axRhoE.set_ylim(min_initial_h - 0.05*abs(min_initial_h), max_initial_h + 0.5*(max_initial_h-min_initial_h)) + axRhoE.set_ylim(1.495 * 10**6, 1.5*10**6) + axRhoE.legend() + + linePressure_Roe, = axPressure.plot([a+0.5*dx + i*dx for i in range(nx)], p_field_Roe, label='Roe') + axPressure.set(xlabel='x (m)', ylabel='Pression (bar)') + axPressure.set_xlim(a,b) + #axPressure.set_ylim(min_initial_p - 0.05*abs(min_initial_p), max_initial_p + 0.5*(max_initial_p-min_initial_p)) + axPressure.set_ylim(149, 156) + axPressure.ticklabel_format(axis='y', style='sci', scilimits=(0,0)) + axPressure.legend() + + lineVitesse_Roe, = axVitesse.plot([a+0.5*dx + i*dx for i in range(nx)], v_field_Roe, label='Roe') + axVitesse.set(xlabel='x (m)', ylabel='Vitesse (m/s)') + axVitesse.set_xlim(a,b) + #axVitesse.set_ylim(min_initial_v - 0.05*abs(min_initial_v), 15) + axVitesse.set_ylim(-0.5, 1) + axVitesse.ticklabel_format(axis='y', style='sci', scilimits=(0,0)) + axVitesse.legend() + + lineTemperature_Roe, = axTemperature.plot([a+0.5*dx + i*dx for i in range(nx)], T_field_Roe, label='Roe') + axTemperature.set(xlabel='x (m)', ylabel='Température (K)') + axTemperature.set_xlim(a,b) + #axTemperature.set_ylim(min_initial_T - 0.005*abs(min_initial_T), 604) + axTemperature.set_ylim(600, 601) + axTemperature.ticklabel_format(axis='y', style='sci', scilimits=(0,0)) + axTemperature.legend() + + return(fig, lineDensity_Roe, lineMomentum_Roe, lineRhoE_Roe, linePressure_Roe, lineVitesse_Roe, lineTemperature_Roe, lineDensity_Roe, lineMomentum_Roe, lineRhoE_Roe, linePressure_Roe, lineVitesse_Roe, lineTemperature_Roe) + + +def EulerSystemRoe(ntmax, tmax, cfl, a, b, nbCells, output_freq, meshName, state_law): + #state_law_parameters(state_law) + dim = 1 + nbComp = 3 + dt = 0. + time = 0. + it = 0 + isStationary = False + isImplicit = False + dx = (b - a) / nx + dt = cfl * dx / c0 + #dt = 5*10**(-6) + nbVoisinsMax = 2 + + # iteration vectors + Un_Roe = cdmath.Vector(nbCells * (nbComp)) + dUn_Roe = cdmath.Vector(nbCells * (nbComp)) + dUk_Roe = cdmath.Vector(nbCells * (nbComp)) + Rhs_Roe = cdmath.Vector(nbCells * (nbComp)) + + # Initial conditions + print("Construction of the initial condition …") + + rho_field_Roe, q_field_Roe, rho_E_field_Roe, p_field_Roe, v_field_Roe, T_field_Roe = initial_conditions_Riemann_problem(a, b, nx) + h_field_Roe = (rho_E_field_Roe + p_field_Roe) / rho_field_Roe - 0.5 * (q_field_Roe / rho_field_Roe) **2 + p_field_Roe = p_field_Roe * 10 ** (-5) + + + for k in range(nbCells): + Un_Roe[k * nbComp + 0] = rho_field_Roe[k] + Un_Roe[k * nbComp + 1] = q_field_Roe[k] + Un_Roe[k * nbComp + 2] = rho_E_field_Roe[k] + + divMat_Roe = cdmath.SparseMatrixPetsc(nbCells * nbComp, nbCells * nbComp, (nbVoisinsMax + 1) * nbComp) + + # Picture settings + fig, lineDensity, lineMomentum, lineRhoE, linePressure, lineVitesse, lineTemperature, lineDensity_Roe, lineMomentum_Roe, lineRhoE_Roe, linePressure_Roe, lineVitesse_Roe, lineTemperature_Roe = SetPicture( rho_field_Roe, q_field_Roe, h_field_Roe, p_field_Roe, v_field_Roe, T_field_Roe, dx) + + # Video settings + FFMpegWriter = manimation.writers['ffmpeg'] + metadata = dict(title="Roe scheme for the 1D Euler system", artist="CEA Saclay", comment="Shock tube") + writer = FFMpegWriter(fps=10, metadata=metadata, codec='h264') + with writer.saving(fig, "1DEuler_complet_RP_Roe" + ".mp4", ntmax): + writer.grab_frame() + plt.savefig("EulerComplet_RP_" + str(dim) + "D_Roe" + meshName + "0" + ".png") + np.savetxt( "EulerComplet_RP_" + str(dim) + "D_Roe" + meshName + "_rho" + "0" + ".txt", rho_field_Roe, delimiter="\n") + np.savetxt( "EulerComplet_RP_" + str(dim) + "D_Roe" + meshName + "_q" + "0" + ".txt", q_field_Roe, delimiter="\n") + iterGMRESMax = 50 + newton_max = 100 + + print("Starting computation of the non linear Euler non isentropic system with Roe scheme …") + # STARTING TIME LOOP + while (it < ntmax and time <= tmax and not isStationary): + dUn_Roe = Un_Roe.deepCopy() + Uk_Roe = Un_Roe.deepCopy() + residu_Roe = 1. + + k_Roe = 0 + while (k_Roe < newton_max and residu_Roe > precision): + # STARTING NEWTON LOOP + divMat_Roe.zeroEntries() #sets the matrix coefficients to zero + for j in range(nbCells): + + # traitements des bords + if (j == 0): + FillEdges(j, Uk_Roe, nbComp, divMat_Roe, Rhs_Roe, Un_Roe, dt, dx, isImplicit) + elif (j == nbCells - 1): + FillEdges(j, Uk_Roe, nbComp, divMat_Roe, Rhs_Roe, Un_Roe, dt, dx, isImplicit) + + # traitement des cellules internes + else: + FillInnerCell(j, Uk_Roe, nbComp, divMat_Roe, Rhs_Roe, Un_Roe, dt, dx, isImplicit) + + #solving the linear system divMat * dUk = Rhs + + if(isImplicit): + divMat_Roe.diagonalShift(1.) + LS_Roe = cdmath.LinearSolver(divMat_Roe, Rhs_Roe, iterGMRESMax, precision, "GMRES", "LU") + dUk_Roe = LS_Roe.solve() + residu_Roe = dUk_Roe.norm() + else: + dUk_Roe=Rhs_Roe - divMat_Roe*Un_Roe + residu_Roe = 0.#Convergence schéma Newton + + if (isImplicit and (it == 1 or it % output_freq == 0 or it >= ntmax or isStationary or time >= tmax)): + print("Residu Newton : ", residu_Roe) + print("Linear system converged in ", LS_Roe.getNumberOfIter(), " GMRES iterations") + + #updates for Newton loop + Uk_Roe += dUk_Roe + k_Roe = k_Roe + 1 + if (isImplicit and not LS_Roe.getStatus()): + print("Linear system did not converge ", LS_Roe.getNumberOfIter(), " GMRES iterations") + raise ValueError("No convergence of the linear system") + + if k_Roe == newton_max: + raise ValueError("No convergence of Newton Roe Scheme") + + #updating fields + Un_Roe = Uk_Roe.deepCopy() + dUn_Roe -= Un_Roe + if (dUn_Roe.norm()= ntmax or isStationary or time >= tmax): + + print("-- Time step : " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)) + + plt.savefig("EulerComplet_RP_" + str(dim) + "D_Roe" + meshName + str(it) + '_time' + str(time) + ".png") + + print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)) + if (it >= ntmax): + print("Maximum number of time steps ntmax= ", ntmax, " reached") + return + + elif (isStationary): + print("Stationary regime reached at time step ", it, ", t= ", time) + print("------------------------------------------------------------------------------------") + np.savetxt("EulerComplet_RP_" + str(dim) + "D_Roe" + meshName + "_rho_Stat.txt", rho_field_Roe, delimiter="\n") + np.savetxt("EulerComplet_RP_" + str(dim) + "D_Roe" + meshName + "_q_Stat.txt", q_field_Roe, delimiter="\n") + np.savetxt("EulerComplet_RP_" + str(dim) + "D_Roe" + meshName + "_rhoE_Stat.txt", rho_E_field_Roe, delimiter="\n") + np.savetxt("EulerComplet_RP_" + str(dim) + "D_Roe" + meshName + "_p_Stat.txt", p_field_Roe, delimiter="\n") + plt.savefig("EulerComplet_RP_" + str(dim) + "D_Roe" + meshName + "_Stat.png") + return + else: + print("Maximum time Tmax= ", tmax, " reached") + return + + +def solve(a, b, nx, meshName, meshType, cfl, state_law): + print("Resolution of the Euler System in dimension 1 on " + str(nx) + " cells") + print("State Law Stiffened Gaz, " + state_law) + print("Initial data : ", "Riemann problem") + print("Boundary conditions : ", "Neumann") + print("Mesh name : ", meshName, ", ", nx, " cells") + # Problem data + tmax = 10. + ntmax = 25 + output_freq = 1 + EulerSystemRoe(ntmax, tmax, cfl, a, b, nx, output_freq, meshName, state_law) + return + + +if __name__ == """__main__""": + a = 0. + b = 1. + nx = 50 + cfl = 0.5 + #state_law = "Hermite590K" + #state_law_parameters(state_law) + solve(a, b, nx, "RegularSquares", "", cfl, state_law) diff --git a/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/CMakeLists.txt b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/CMakeLists.txt new file mode 100755 index 0000000..0dfd1ee --- /dev/null +++ b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/CMakeLists.txt @@ -0,0 +1,15 @@ +file(GLOB IsentropicEulerEquations_EXAMPLES_TO_INSTALL +EulerSystem1D/EulerSystem1DUpwind EulerSystem1D/EulerSystem1DUpwindEntrCorr EulerSystem1D/EulerSystem1DConservativeStaggered EulerSystem_Shock/EulerSystemStaggered EulerSystem_Shock/EulerSystemUpwind +) + +install(DIRECTORY ${IsentropicEulerEquations_EXAMPLES_TO_INSTALL} DESTINATION share/examples/EulerEquations/IsentropicEulerEquations) + +IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + ADD_SUBDIRECTORY(EulerSystem1D/EulerSystem1DUpwind) + ADD_SUBDIRECTORY(EulerSystem1D/EulerSystem1DUpwindEntrCorr) + ADD_SUBDIRECTORY(EulerSystem1D/EulerSystem1DConservativeStaggered) + ADD_SUBDIRECTORY(EulerSystem_Shock/EulerSystemUpwind) + ADD_SUBDIRECTORY(EulerSystem_Shock/EulerSystemStaggered) +ENDIF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + diff --git a/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DConservativeStaggered/CMakeLists.txt b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DConservativeStaggered/CMakeLists.txt new file mode 100755 index 0000000..04ce58c --- /dev/null +++ b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DConservativeStaggered/CMakeLists.txt @@ -0,0 +1,8 @@ + +if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + ADD_TEST(ExampleIsentropicEulerSystem_1DShock_ConservativeStaggered ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystem1DConservativeStaggered.py ) + +endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + diff --git a/CDMATH/tests/examples/EulerSystem1D/EulerSystem1DConservativeStaggered/EulerSystem1DConservativeStaggered.py b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DConservativeStaggered/EulerSystem1DConservativeStaggered.py similarity index 100% rename from CDMATH/tests/examples/EulerSystem1D/EulerSystem1DConservativeStaggered/EulerSystem1DConservativeStaggered.py rename to CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DConservativeStaggered/EulerSystem1DConservativeStaggered.py diff --git a/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwind/CMakeLists.txt b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwind/CMakeLists.txt new file mode 100755 index 0000000..990582d --- /dev/null +++ b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwind/CMakeLists.txt @@ -0,0 +1,8 @@ + +if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + ADD_TEST(ExampleIsentropicEulerSystem_1DShock_UpwindExplicit ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystem1DUpwind.py ) + +endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + diff --git a/CDMATH/tests/examples/EulerSystem1D/EulerSystem1DUpwind/EulerSystem1DUpwind.py b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwind/EulerSystem1DUpwind.py similarity index 100% rename from CDMATH/tests/examples/EulerSystem1D/EulerSystem1DUpwind/EulerSystem1DUpwind.py rename to CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwind/EulerSystem1DUpwind.py diff --git a/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwindEntrCorr/CMakeLists.txt b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwindEntrCorr/CMakeLists.txt new file mode 100755 index 0000000..62fde1b --- /dev/null +++ b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwindEntrCorr/CMakeLists.txt @@ -0,0 +1,8 @@ + +if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + ADD_TEST(ExampleIsentropicEulerSystem_1DShock_UpwindExplicit_EntrCorr ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystem1DUpwindEntrCorr.py ) + +endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + diff --git a/CDMATH/tests/examples/EulerSystem1D/EulerSystem1DUpwindEntrCorr/EulerSystem1DUpwindEntrCorr.py b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwindEntrCorr/EulerSystem1DUpwindEntrCorr.py similarity index 100% rename from CDMATH/tests/examples/EulerSystem1D/EulerSystem1DUpwindEntrCorr/EulerSystem1DUpwindEntrCorr.py rename to CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem1D/EulerSystem1DUpwindEntrCorr/EulerSystem1DUpwindEntrCorr.py diff --git a/CDMATH/tests/examples/EulerSystem_Shock/EulerSystemStaggered/CMakeLists.txt b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem_Shock/EulerSystemStaggered/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/EulerSystem_Shock/EulerSystemStaggered/CMakeLists.txt rename to CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem_Shock/EulerSystemStaggered/CMakeLists.txt diff --git a/CDMATH/tests/examples/EulerSystem_Shock/EulerSystemStaggered/EulerIsothermal_2DConservativeStaggered.py b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem_Shock/EulerSystemStaggered/EulerIsothermal_2DConservativeStaggered.py similarity index 100% rename from CDMATH/tests/examples/EulerSystem_Shock/EulerSystemStaggered/EulerIsothermal_2DConservativeStaggered.py rename to CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem_Shock/EulerSystemStaggered/EulerIsothermal_2DConservativeStaggered.py diff --git a/CDMATH/tests/examples/EulerSystem_Shock/EulerSystemUpwind/CMakeLists.txt b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem_Shock/EulerSystemUpwind/CMakeLists.txt similarity index 69% rename from CDMATH/tests/examples/EulerSystem_Shock/EulerSystemUpwind/CMakeLists.txt rename to CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem_Shock/EulerSystemUpwind/CMakeLists.txt index 857c261..0e9b410 100755 --- a/CDMATH/tests/examples/EulerSystem_Shock/EulerSystemUpwind/CMakeLists.txt +++ b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem_Shock/EulerSystemUpwind/CMakeLists.txt @@ -1,16 +1,4 @@ -SET(MESH_MED - ../../../ressources/squareWithTriangles.med - ../../../ressources/meshCube.med - ../../../ressources/squareWithSquares.med - ../../../ressources/cubeWithCubes.med - ../../../ressources/diskWithTriangles.med - ../../../ressources/diskWithSquares.med - ../../../ressources/diskWithSpiderWeb.med - ../../../ressources/diskWithHexagons.med - ../../../ressources/ballWithTetrahedra.med - ) - file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/EulerSystemUpwind) @@ -18,73 +6,73 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) SET(IMPLICIT_SCHEME 0 ) - SET(MESH_FILE ../../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/meshCube.med ) + SET(MESH_FILE ${MED_MESHES}/meshCube.med ) #ADD_TEST(ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/cubeWithCubes.med ) + SET(MESH_FILE ${MED_MESHES}/cubeWithCubes.med ) #ADD_TEST(ExampleEulerSystem_3DShock_UpwindExplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/meshHexagonWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/meshHexagonWithTriangles.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindExplicit_HEXAGON_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) SET(IMPLICIT_SCHEME 1 ) - SET(MESH_FILE ../../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/meshCube.med ) + SET(MESH_FILE ${MED_MESHES}/meshCube.med ) #ADD_TEST(ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/cubeWithCubes.med ) + SET(MESH_FILE ${MED_MESHES}/cubeWithCubes.med ) #ADD_TEST(ExampleEulerSystem_3DShock_UpwindImplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExampleEulerSystem_2DShock_UpwindImplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) diff --git a/CDMATH/tests/examples/EulerSystem_Shock/EulerSystemUpwind/EulerSystemUpwind.py b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem_Shock/EulerSystemUpwind/EulerSystemUpwind.py similarity index 92% rename from CDMATH/tests/examples/EulerSystem_Shock/EulerSystemUpwind/EulerSystemUpwind.py rename to CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem_Shock/EulerSystemUpwind/EulerSystemUpwind.py index b969762..0b3dff2 100755 --- a/CDMATH/tests/examples/EulerSystem_Shock/EulerSystemUpwind/EulerSystemUpwind.py +++ b/CDMATH/tests/examples/EulerEquations/IsentropicEulerSystem/EulerSystem_Shock/EulerSystemUpwind/EulerSystemUpwind.py @@ -21,9 +21,8 @@ import PV_routines import VTK_routines import sys -p0=155e5#reference pressure in a pressurised nuclear vessel -c0=700.#reference sound speed for water at 155 bars, 600K -rho0=p0/c0*c0#reference density +p0=155e5#reference pressure in a pressurised nuclear vessel (used for initial data) +c0=700.#reference sound speed for water at 155 bars, 600K (used for eox p= rho c0**2 precision=1e-5 def initial_conditions_shock(my_mesh, isCircle): @@ -69,7 +68,7 @@ def initial_conditions_shock(my_mesh, isCircle): pressure_field[i] = p0 pass else: - pressure_field[i] = p0/2 + pressure_field[i] = p0 pass pass @@ -171,21 +170,20 @@ def computeDivergenceMatrix(my_mesh,implMat,Un): idMoinsJacCL=v.tensProduct(v)*2 implMat.addValue(j*nbComp,j*nbComp,Am*(-1.)*idMoinsJacCL) - elif( Fk.getGroupName() == "Periodic"):#Periodic boundary condition + indexFP=my_mesh.getIndexFacePeriodic(indexFace) + Fp = my_mesh.getFace(indexFP) + cellAutre = Fp.getCellsId()[0] + q_l[0]=Un[j*nbComp+1] q_l[1]=Un[j*nbComp+2] q_r[0]=Un[cellAutre*nbComp+1] q_r[1]=Un[cellAutre*nbComp+2] - Am, un=jacobianMatrices( normal,Fk.getMeasure()/Cj.getMeasure(),Un[j*nbComp],Un[j*nbComp+1],Un[j*nbComp+2],Un[cellAutre*nbComp],Un[cellAutre*nbComp+1],Un[cellAutre*nbComp+2]); + Am, un=jacobianMatrices( normal,Fk.getMeasure()/Cj.getMeasure(),Un[j*nbComp],q_l,Un[cellAutre*nbComp],q_r); - indexFP=my_mesh.getIndexFacePeriodic(indexFace) - Fp = my_mesh.getFace(indexFP) - cellAutre = Fp.getCellsId()[0] - 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 + elif( Fk.getGroupName() != "Neumann"):#Nothing to do for Neumann boundary condition print( Fk.getGroupName() ) raise ValueError("computeFluxes: Unknown boundary condition name"); @@ -208,24 +206,24 @@ def EulerSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, i print("Construction of the initial condition …") if(dim==1 or filename.find("square")>-1 or filename.find("Square")>-1 or filename.find("cube")>-1 or filename.find("Cube")>-1): pressure_field, velocity_field = initial_conditions_shock(my_mesh,False) - elif(filename.find("disk")>-1 or filename.find("Disk")>-1): + elif(filename.find("disk")>-1 or filename.find("Disk")>-1 or filename.find("Hexagon")>-1 or filename.find("HEXAON")>-1): pressure_field, velocity_field = initial_conditions_shock(my_mesh,True) else: print( "Mesh name : ", filename ) - raise ValueError("Mesh name should contain substring square, cube or disk") + raise ValueError("Mesh name should contain substring square, cube, disk or hexagon") #iteration vectors Un =cdmath.Vector(nbCells*(dim+1)) dUn=cdmath.Vector(nbCells*(dim+1)) for k in range(nbCells): - Un[k*(dim+1)+0] = pressure_field[k]/(c0*c0) - Un[k*(dim+1)+1] =rho0*velocity_field[k,0] + Un[k*(dim+1)+0] = pressure_field[k]/(c0*c0) + Un[k*(dim+1)+1] =Un[k*(dim+1)+0]*velocity_field[k,0] if(dim>=2): - Un[k*(dim+1)+2] = rho0*velocity_field[k,1] # value on the bottom face + Un[k*(dim+1)+2] = Un[k*(dim+1)+0]*velocity_field[k,1] if(dim==3): - Un[k*(dim+1)+3] = rho0*initial_velocity[k,2] - + Un[k*(dim+1)+3] = Un[k*(dim+1)+0]*velocity_field[k,2] + print(Un[k*(dim+1)+0],Un[k*(dim+1)+1],Un[k*(dim+1)+2]) #sauvegarde de la donnée initiale pressure_field.setTime(time,it); pressure_field.writeVTK("EulerSystem"+str(dim)+"DUpwind"+"_isImplicit"+str(isImplicit)+meshName+"_pressure"); @@ -260,6 +258,7 @@ def EulerSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, i else: dUn=divMat*Un +# print(Un) Un-=dUn time=time+dt; @@ -271,11 +270,12 @@ def EulerSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, i for k in range(nbCells): pressure_field[k] =Un[k*(dim+1)+0]*c0*c0 - velocity_field[k,0]=Un[k*(dim+1)+1]/rho0 + velocity_field[k,0]=Un[k*(dim+1)+1]/Un[k*(dim+1)+0] if(dim>1): - velocity_field[k,1]=Un[k*(dim+1)+2]/rho0 + velocity_field[k,1]=Un[k*(dim+1)+2]/Un[k*(dim+1)+0] if(dim>2): - velocity_field[k,2]=Un[k*(dim+1)+3]/rho0 + velocity_field[k,2]=Un[k*(dim+1)+3]/Un[k*(dim+1)+0] +# print(Un[k*(dim+1)+0],Un[k*(dim+1)+1],Un[k*(dim+1)+2]) pressure_field.setTime(time,it); pressure_field.writeVTK("EulerSystem"+str(dim)+"DUpwind"+"_isImplicit"+str(isImplicit)+meshName+"_pressure",False); @@ -317,7 +317,7 @@ def solve(my_mesh,filename,resolution, isImplicit): # Problem data tmax = 1. - ntmax = 100 + ntmax = 1 cfl = 1./my_mesh.getSpaceDimension() output_freq = 1 diff --git a/CDMATH/tests/examples/EulerSystem1D/EulerSystem1DConservativeStaggered/CMakeLists.txt b/CDMATH/tests/examples/EulerSystem1D/EulerSystem1DConservativeStaggered/CMakeLists.txt deleted file mode 100755 index a4899a3..0000000 --- a/CDMATH/tests/examples/EulerSystem1D/EulerSystem1DConservativeStaggered/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ - -if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - - ADD_TEST(ExampleEulerSystem_1DShock_ConservativeStaggered ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/EulerSystem1DConservativeStaggered.py ) - -endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - - diff --git a/CDMATH/tests/examples/HeatEquation/CMakeLists.txt b/CDMATH/tests/examples/HeatEquation/CMakeLists.txt new file mode 100755 index 0000000..d023248 --- /dev/null +++ b/CDMATH/tests/examples/HeatEquation/CMakeLists.txt @@ -0,0 +1,14 @@ +file(GLOB HeatEquation_EXAMPLES_TO_INSTALL + HeatEquation1DExplicit HeatEquation1DImplicit# 1D Heat equation +) + +install(DIRECTORY ${HeatEquation_EXAMPLES_TO_INSTALL} DESTINATION share/examples/HeatEquation) + +IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + ADD_SUBDIRECTORY(HeatEquation1DExplicit) + ADD_SUBDIRECTORY(HeatEquation1DImplicit) + +ENDIF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + diff --git a/CDMATH/tests/examples/HeatEquation1DExplicit/CMakeLists.txt b/CDMATH/tests/examples/HeatEquation/HeatEquation1DExplicit/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/HeatEquation1DExplicit/CMakeLists.txt rename to CDMATH/tests/examples/HeatEquation/HeatEquation1DExplicit/CMakeLists.txt diff --git a/CDMATH/tests/examples/HeatEquation1DExplicit/HeatEquation1DExplicit.py b/CDMATH/tests/examples/HeatEquation/HeatEquation1DExplicit/HeatEquation1DExplicit.py similarity index 100% rename from CDMATH/tests/examples/HeatEquation1DExplicit/HeatEquation1DExplicit.py rename to CDMATH/tests/examples/HeatEquation/HeatEquation1DExplicit/HeatEquation1DExplicit.py diff --git a/CDMATH/tests/examples/HeatEquation1DImplicit/CMakeLists.txt b/CDMATH/tests/examples/HeatEquation/HeatEquation1DImplicit/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/HeatEquation1DImplicit/CMakeLists.txt rename to CDMATH/tests/examples/HeatEquation/HeatEquation1DImplicit/CMakeLists.txt diff --git a/CDMATH/tests/examples/HeatEquation1DImplicit/HeatEquation1DImplicit.py b/CDMATH/tests/examples/HeatEquation/HeatEquation1DImplicit/HeatEquation1DImplicit.py similarity index 100% rename from CDMATH/tests/examples/HeatEquation1DImplicit/HeatEquation1DImplicit.py rename to CDMATH/tests/examples/HeatEquation/HeatEquation1DImplicit/HeatEquation1DImplicit.py diff --git a/CDMATH/tests/examples/PoissonEquation/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/CMakeLists.txt new file mode 100755 index 0000000..21334e7 --- /dev/null +++ b/CDMATH/tests/examples/PoissonEquation/CMakeLists.txt @@ -0,0 +1,30 @@ +file(GLOB PoissonEquation_EXAMPLES_TO_INSTALL + 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 +) + +install(DIRECTORY ${PoissonEquation_EXAMPLES_TO_INSTALL} DESTINATION share/examples/PoissonEquation) + +IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + ADD_SUBDIRECTORY(Poisson1DVF) + ADD_SUBDIRECTORY(Poisson1DEF) + ADD_SUBDIRECTORY(Poisson2DVF) + ADD_SUBDIRECTORY(Poisson2DVF_DISK) + ADD_SUBDIRECTORY(Poisson2DVF_DISK_StiffBC) + ADD_SUBDIRECTORY(Poisson2DEF) + ADD_SUBDIRECTORY(Poisson2DEF_DISK) + ADD_SUBDIRECTORY(Poisson2DEF_DISK_StiffBC) + ADD_SUBDIRECTORY(Poisson2DEF_SQUARE_StiffBC) + ADD_SUBDIRECTORY(Poisson3DSphereEF) + ADD_SUBDIRECTORY(Poisson3DTorusEF) + ADD_SUBDIRECTORY(Poisson3DCubeSkinEF) + ADD_SUBDIRECTORY(Poisson3DEF) + ADD_SUBDIRECTORY(Poisson3DEF_RadiatorAndWindow) + ADD_SUBDIRECTORY(Poisson3DEF_BALL) + ADD_SUBDIRECTORY(Poisson3DVF) + ADD_SUBDIRECTORY(Poisson3DVF_BALL) + +ENDIF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + diff --git a/CDMATH/tests/examples/Poisson1DEF/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson1DEF/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/Poisson1DEF/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson1DEF/CMakeLists.txt diff --git a/CDMATH/tests/examples/Poisson1DEF/FiniteElements1DPoisson.py b/CDMATH/tests/examples/PoissonEquation/Poisson1DEF/FiniteElements1DPoisson.py similarity index 100% rename from CDMATH/tests/examples/Poisson1DEF/FiniteElements1DPoisson.py rename to CDMATH/tests/examples/PoissonEquation/Poisson1DEF/FiniteElements1DPoisson.py diff --git a/CDMATH/tests/examples/Poisson1DVF/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson1DVF/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/Poisson1DVF/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson1DVF/CMakeLists.txt diff --git a/CDMATH/tests/examples/Poisson1DVF/FiniteVolumes1DPoisson.py b/CDMATH/tests/examples/PoissonEquation/Poisson1DVF/FiniteVolumes1DPoisson.py similarity index 100% rename from CDMATH/tests/examples/Poisson1DVF/FiniteVolumes1DPoisson.py rename to CDMATH/tests/examples/PoissonEquation/Poisson1DVF/FiniteVolumes1DPoisson.py diff --git a/CDMATH/tests/examples/Poisson2DEF/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF/CMakeLists.txt similarity index 90% rename from CDMATH/tests/examples/Poisson2DEF/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson2DEF/CMakeLists.txt index 47bd375..4948b54 100755 --- a/CDMATH/tests/examples/Poisson2DEF/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF/CMakeLists.txt @@ -1,6 +1,6 @@ SET(MESH_MED - ../../ressources/squareWithTriangles.med + ${MED_MESHES}/squareWithTriangles.med ) file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/CDMATH/tests/examples/Poisson2DEF/FiniteElements2DPoisson_SQUARE.py b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF/FiniteElements2DPoisson_SQUARE.py similarity index 100% rename from CDMATH/tests/examples/Poisson2DEF/FiniteElements2DPoisson_SQUARE.py rename to CDMATH/tests/examples/PoissonEquation/Poisson2DEF/FiniteElements2DPoisson_SQUARE.py diff --git a/CDMATH/tests/examples/Poisson2DEF_DISK/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF_DISK/CMakeLists.txt similarity index 91% rename from CDMATH/tests/examples/Poisson2DEF_DISK/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson2DEF_DISK/CMakeLists.txt index cfaa27b..e9da83e 100755 --- a/CDMATH/tests/examples/Poisson2DEF_DISK/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF_DISK/CMakeLists.txt @@ -1,6 +1,6 @@ SET(MESH_MED - ../../ressources/diskWithTriangles.med + ${MED_MESHES}/diskWithTriangles.med ) file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/CDMATH/tests/examples/Poisson2DEF_DISK/FiniteElements2DPoisson_DISK.py b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF_DISK/FiniteElements2DPoisson_DISK.py similarity index 100% rename from CDMATH/tests/examples/Poisson2DEF_DISK/FiniteElements2DPoisson_DISK.py rename to CDMATH/tests/examples/PoissonEquation/Poisson2DEF_DISK/FiniteElements2DPoisson_DISK.py diff --git a/CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF_DISK_StiffBC/CMakeLists.txt similarity index 91% rename from CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson2DEF_DISK_StiffBC/CMakeLists.txt index fb390a0..b9ca72d 100755 --- a/CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF_DISK_StiffBC/CMakeLists.txt @@ -1,6 +1,6 @@ SET(MESH_MED - ../../ressources/diskWithTriangles.med + ${MED_MESHES}/diskWithTriangles.med ) file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/FiniteElements2DPoisson_DISK_StiffBC.py b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF_DISK_StiffBC/FiniteElements2DPoisson_DISK_StiffBC.py similarity index 100% rename from CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/FiniteElements2DPoisson_DISK_StiffBC.py rename to CDMATH/tests/examples/PoissonEquation/Poisson2DEF_DISK_StiffBC/FiniteElements2DPoisson_DISK_StiffBC.py diff --git a/CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt similarity index 91% rename from CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt index 99f13a4..2c176f8 100755 --- a/CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt @@ -1,6 +1,6 @@ SET(MESH_MED - ../../ressources/squareWithTriangles.med + ${MED_MESHES}/squareWithTriangles.med ) file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/FiniteElements2DPoisson_SQUARE_StiffBC.py b/CDMATH/tests/examples/PoissonEquation/Poisson2DEF_SQUARE_StiffBC/FiniteElements2DPoisson_SQUARE_StiffBC.py similarity index 100% rename from CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/FiniteElements2DPoisson_SQUARE_StiffBC.py rename to CDMATH/tests/examples/PoissonEquation/Poisson2DEF_SQUARE_StiffBC/FiniteElements2DPoisson_SQUARE_StiffBC.py diff --git a/CDMATH/tests/examples/Poisson2DVF/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson2DVF/CMakeLists.txt similarity index 75% rename from CDMATH/tests/examples/Poisson2DVF/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson2DVF/CMakeLists.txt index e302ceb..750392c 100755 --- a/CDMATH/tests/examples/Poisson2DVF/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson2DVF/CMakeLists.txt @@ -3,27 +3,27 @@ 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(MESH_FILE ../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExamplePoisson_2DVF_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE}) - SET(MESH_FILE ../../ressources/squareWithLocRefSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithLocRefSquares.med ) ADD_TEST(ExamplePoisson_2DVF_SQUARE_loc_ref ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE}) - SET(MESH_FILE ../../ressources/squareWithCheckerboardSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithCheckerboardSquares.med ) ADD_TEST(ExamplePoisson_2DVF_SQUARE_checkerboard ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE}) - SET(MESH_FILE ../../ressources/squareWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithHexagons.med ) ADD_TEST(ExamplePoisson_2DVF_SQUARE_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE}) - SET(MESH_FILE ../../ressources/squareWithBrickWall.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithBrickWall.med ) ADD_TEST(ExamplePoisson_2DVF_SQUARE_brickwall ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE}) - SET(MESH_FILE ../../ressources/squareWithDeformedQuadrangles.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithDeformedQuadrangles.med ) ADD_TEST(ExamplePoisson_2DVF_SQUARE_deformed_quadrangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_SQUARE.py ${MESH_FILE}) diff --git a/CDMATH/tests/examples/Poisson2DVF/FiniteVolumes2DPoisson_SQUARE.py b/CDMATH/tests/examples/PoissonEquation/Poisson2DVF/FiniteVolumes2DPoisson_SQUARE.py similarity index 100% rename from CDMATH/tests/examples/Poisson2DVF/FiniteVolumes2DPoisson_SQUARE.py rename to CDMATH/tests/examples/PoissonEquation/Poisson2DVF/FiniteVolumes2DPoisson_SQUARE.py diff --git a/CDMATH/tests/examples/Poisson2DVF_DISK/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson2DVF_DISK/CMakeLists.txt similarity index 74% rename from CDMATH/tests/examples/Poisson2DVF_DISK/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson2DVF_DISK/CMakeLists.txt index 546f57e..25d1467 100755 --- a/CDMATH/tests/examples/Poisson2DVF_DISK/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson2DVF_DISK/CMakeLists.txt @@ -1,19 +1,19 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - SET(MESH_FILE ../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExamplePoisson_2DVF_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK.py ${MESH_FILE}) - SET(MESH_FILE ../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExamplePoisson_2DVF_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK.py ${MESH_FILE}) - SET(MESH_FILE ../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExamplePoisson_2DVF_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK.py ${MESH_FILE}) - SET(MESH_FILE ../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExamplePoisson_2DVF_DISK_spiderweb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK.py ${MESH_FILE}) diff --git a/CDMATH/tests/examples/Poisson2DVF_DISK/FiniteVolumes2DPoisson_DISK.py b/CDMATH/tests/examples/PoissonEquation/Poisson2DVF_DISK/FiniteVolumes2DPoisson_DISK.py similarity index 100% rename from CDMATH/tests/examples/Poisson2DVF_DISK/FiniteVolumes2DPoisson_DISK.py rename to CDMATH/tests/examples/PoissonEquation/Poisson2DVF_DISK/FiniteVolumes2DPoisson_DISK.py diff --git a/CDMATH/tests/examples/Poisson2DVF_DISK_StiffBC/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson2DVF_DISK_StiffBC/CMakeLists.txt similarity index 76% rename from CDMATH/tests/examples/Poisson2DVF_DISK_StiffBC/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson2DVF_DISK_StiffBC/CMakeLists.txt index f580a63..0762aca 100755 --- a/CDMATH/tests/examples/Poisson2DVF_DISK_StiffBC/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson2DVF_DISK_StiffBC/CMakeLists.txt @@ -1,19 +1,19 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - SET(MESH_FILE ../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExamplePoisson_2DVF_DISK_StiffBC_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK_StiffBC.py ${MESH_FILE}) - SET(MESH_FILE ../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExamplePoisson_2DVF_DISK_StiffBC_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK_StiffBC.py ${MESH_FILE}) - SET(MESH_FILE ../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExamplePoisson_2DVF_DISK_StiffBC_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK_StiffBC.py ${MESH_FILE}) - SET(MESH_FILE ../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExamplePoisson_2DVF_DISK_StiffBC_spiderweb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes2DPoisson_DISK_StiffBC.py ${MESH_FILE}) diff --git a/CDMATH/tests/examples/Poisson2DVF_DISK_StiffBC/FiniteVolumes2DPoisson_DISK_StiffBC.py b/CDMATH/tests/examples/PoissonEquation/Poisson2DVF_DISK_StiffBC/FiniteVolumes2DPoisson_DISK_StiffBC.py similarity index 100% rename from CDMATH/tests/examples/Poisson2DVF_DISK_StiffBC/FiniteVolumes2DPoisson_DISK_StiffBC.py rename to CDMATH/tests/examples/PoissonEquation/Poisson2DVF_DISK_StiffBC/FiniteVolumes2DPoisson_DISK_StiffBC.py diff --git a/CDMATH/tests/examples/Poisson3DCubeSkinEF/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson3DCubeSkinEF/CMakeLists.txt similarity index 92% rename from CDMATH/tests/examples/Poisson3DCubeSkinEF/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson3DCubeSkinEF/CMakeLists.txt index 3765230..3720053 100755 --- a/CDMATH/tests/examples/Poisson3DCubeSkinEF/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson3DCubeSkinEF/CMakeLists.txt @@ -1,6 +1,6 @@ SET(MESH_MED - ../../ressources/meshCubeSkin.med + ${MED_MESHES}/meshCubeSkin.med ) file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/CDMATH/tests/examples/Poisson3DCubeSkinEF/FiniteElements3DPoissonCubeSkin.py b/CDMATH/tests/examples/PoissonEquation/Poisson3DCubeSkinEF/FiniteElements3DPoissonCubeSkin.py similarity index 100% rename from CDMATH/tests/examples/Poisson3DCubeSkinEF/FiniteElements3DPoissonCubeSkin.py rename to CDMATH/tests/examples/PoissonEquation/Poisson3DCubeSkinEF/FiniteElements3DPoissonCubeSkin.py diff --git a/CDMATH/tests/examples/Poisson3DEF/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson3DEF/CMakeLists.txt similarity index 92% rename from CDMATH/tests/examples/Poisson3DEF/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson3DEF/CMakeLists.txt index 286cc1a..e9c8165 100755 --- a/CDMATH/tests/examples/Poisson3DEF/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson3DEF/CMakeLists.txt @@ -1,6 +1,6 @@ SET(MESH_MED - ../../ressources/meshCube.med + ${MED_MESHES}/meshCube.med ) file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/CDMATH/tests/examples/Poisson3DEF/FiniteElements3DPoisson_CUBE.py b/CDMATH/tests/examples/PoissonEquation/Poisson3DEF/FiniteElements3DPoisson_CUBE.py similarity index 100% rename from CDMATH/tests/examples/Poisson3DEF/FiniteElements3DPoisson_CUBE.py rename to CDMATH/tests/examples/PoissonEquation/Poisson3DEF/FiniteElements3DPoisson_CUBE.py diff --git a/CDMATH/tests/examples/Poisson3DEF_BALL/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson3DEF_BALL/CMakeLists.txt similarity index 90% rename from CDMATH/tests/examples/Poisson3DEF_BALL/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson3DEF_BALL/CMakeLists.txt index 1a05b09..3adada4 100755 --- a/CDMATH/tests/examples/Poisson3DEF_BALL/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson3DEF_BALL/CMakeLists.txt @@ -1,6 +1,6 @@ SET(MESH_MED - ../../ressources/ballWithTetrahedra.med + ${MED_MESHES}/ballWithTetrahedra.med ) file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/CDMATH/tests/examples/Poisson3DEF_BALL/FiniteElements3DPoisson_BALL.py b/CDMATH/tests/examples/PoissonEquation/Poisson3DEF_BALL/FiniteElements3DPoisson_BALL.py similarity index 100% rename from CDMATH/tests/examples/Poisson3DEF_BALL/FiniteElements3DPoisson_BALL.py rename to CDMATH/tests/examples/PoissonEquation/Poisson3DEF_BALL/FiniteElements3DPoisson_BALL.py diff --git a/CDMATH/tests/examples/Poisson3DEF_RadiatorAndWindow/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson3DEF_RadiatorAndWindow/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/Poisson3DEF_RadiatorAndWindow/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson3DEF_RadiatorAndWindow/CMakeLists.txt diff --git a/CDMATH/tests/examples/Poisson3DEF_RadiatorAndWindow/FiniteElements3DPoisson_CUBE_RadiatorAndWindow.py b/CDMATH/tests/examples/PoissonEquation/Poisson3DEF_RadiatorAndWindow/FiniteElements3DPoisson_CUBE_RadiatorAndWindow.py similarity index 100% rename from CDMATH/tests/examples/Poisson3DEF_RadiatorAndWindow/FiniteElements3DPoisson_CUBE_RadiatorAndWindow.py rename to CDMATH/tests/examples/PoissonEquation/Poisson3DEF_RadiatorAndWindow/FiniteElements3DPoisson_CUBE_RadiatorAndWindow.py diff --git a/CDMATH/tests/examples/Poisson3DEF_RadiatorAndWindow/Mesh_RadiatorAndWindow.med b/CDMATH/tests/examples/PoissonEquation/Poisson3DEF_RadiatorAndWindow/Mesh_RadiatorAndWindow.med old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/Poisson3DEF_RadiatorAndWindow/Mesh_RadiatorAndWindow.med rename to CDMATH/tests/examples/PoissonEquation/Poisson3DEF_RadiatorAndWindow/Mesh_RadiatorAndWindow.med diff --git a/CDMATH/tests/examples/Poisson3DSphereEF/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson3DSphereEF/CMakeLists.txt similarity index 92% rename from CDMATH/tests/examples/Poisson3DSphereEF/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson3DSphereEF/CMakeLists.txt index 1d8b478..efd716b 100755 --- a/CDMATH/tests/examples/Poisson3DSphereEF/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson3DSphereEF/CMakeLists.txt @@ -1,6 +1,6 @@ SET(MESH_MED - ../../ressources/meshSphere.med + ${MED_MESHES}/meshSphere.med ) file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/CDMATH/tests/examples/Poisson3DSphereEF/FiniteElements3DPoissonSphere.py b/CDMATH/tests/examples/PoissonEquation/Poisson3DSphereEF/FiniteElements3DPoissonSphere.py similarity index 100% rename from CDMATH/tests/examples/Poisson3DSphereEF/FiniteElements3DPoissonSphere.py rename to CDMATH/tests/examples/PoissonEquation/Poisson3DSphereEF/FiniteElements3DPoissonSphere.py diff --git a/CDMATH/tests/examples/Poisson3DTorusEF/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson3DTorusEF/CMakeLists.txt similarity index 92% rename from CDMATH/tests/examples/Poisson3DTorusEF/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson3DTorusEF/CMakeLists.txt index 7da0838..c56320b 100755 --- a/CDMATH/tests/examples/Poisson3DTorusEF/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson3DTorusEF/CMakeLists.txt @@ -1,6 +1,6 @@ SET(MESH_MED - ../../ressources/meshTorus.med + ${MED_MESHES}/meshTorus.med ) file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/CDMATH/tests/examples/Poisson3DTorusEF/FiniteElements3DPoissonTorus.py b/CDMATH/tests/examples/PoissonEquation/Poisson3DTorusEF/FiniteElements3DPoissonTorus.py similarity index 100% rename from CDMATH/tests/examples/Poisson3DTorusEF/FiniteElements3DPoissonTorus.py rename to CDMATH/tests/examples/PoissonEquation/Poisson3DTorusEF/FiniteElements3DPoissonTorus.py diff --git a/CDMATH/tests/examples/Poisson3DVF/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson3DVF/CMakeLists.txt similarity index 77% rename from CDMATH/tests/examples/Poisson3DVF/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson3DVF/CMakeLists.txt index 25bb884..caef0fe 100755 --- a/CDMATH/tests/examples/Poisson3DVF/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson3DVF/CMakeLists.txt @@ -3,15 +3,15 @@ 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(MESH_FILE ../../ressources/meshCube.med ) + SET(MESH_FILE ${MED_MESHES}/meshCube.med ) ADD_TEST(ExamplePoisson_3DVF_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes3DPoisson_CUBE.py) - SET(MESH_FILE ../../ressources/cubeWithLocRefCubes.med ) + SET(MESH_FILE ${MED_MESHES}/cubeWithLocRefCubes.med ) ADD_TEST(ExamplePoisson_3DVF_CUBE_loc_ref ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes3DPoisson_CUBE.py) - SET(MESH_FILE ../../ressources/3DCheckerboard/checkerboard_4x4x4.med ) + SET(MESH_FILE ${MED_MESHES}/3DCheckerboard/checkerboard_4x4x4.med ) ADD_TEST(ExamplePoisson_3DVF_CUBE_checkerboard ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/FiniteVolumes3DPoisson_CUBE.py) diff --git a/CDMATH/tests/examples/Poisson3DVF/FiniteVolumes3DPoisson_CUBE.py b/CDMATH/tests/examples/PoissonEquation/Poisson3DVF/FiniteVolumes3DPoisson_CUBE.py similarity index 100% rename from CDMATH/tests/examples/Poisson3DVF/FiniteVolumes3DPoisson_CUBE.py rename to CDMATH/tests/examples/PoissonEquation/Poisson3DVF/FiniteVolumes3DPoisson_CUBE.py diff --git a/CDMATH/tests/examples/Poisson3DVF_BALL/CMakeLists.txt b/CDMATH/tests/examples/PoissonEquation/Poisson3DVF_BALL/CMakeLists.txt similarity index 85% rename from CDMATH/tests/examples/Poisson3DVF_BALL/CMakeLists.txt rename to CDMATH/tests/examples/PoissonEquation/Poisson3DVF_BALL/CMakeLists.txt index e89f81e..3a41485 100755 --- a/CDMATH/tests/examples/Poisson3DVF_BALL/CMakeLists.txt +++ b/CDMATH/tests/examples/PoissonEquation/Poisson3DVF_BALL/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(MESH_FILE ../../ressources/ballWithTetrahedra.med ) +SET(MESH_FILE ${MED_MESHES}/ballWithTetrahedra.med ) file(COPY ${MESH_FILE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/CDMATH/tests/examples/Poisson3DVF_BALL/FiniteVolumes3DPoisson_BALL.py b/CDMATH/tests/examples/PoissonEquation/Poisson3DVF_BALL/FiniteVolumes3DPoisson_BALL.py similarity index 100% rename from CDMATH/tests/examples/Poisson3DVF_BALL/FiniteVolumes3DPoisson_BALL.py rename to CDMATH/tests/examples/PoissonEquation/Poisson3DVF_BALL/FiniteVolumes3DPoisson_BALL.py diff --git a/CDMATH/tests/examples/SpectrumLaplace/CMakeLists.txt b/CDMATH/tests/examples/SpectrumLaplace/CMakeLists.txt new file mode 100755 index 0000000..547d871 --- /dev/null +++ b/CDMATH/tests/examples/SpectrumLaplace/CMakeLists.txt @@ -0,0 +1,15 @@ +file(GLOB SpectrumLaplace_EXAMPLES_TO_INSTALL + SpectrumLaplace2DEF SpectrumLaplace2DVF SpectrumLaplaceBeltrami3DEF #Spectrum of Laplace operator +) + +install(DIRECTORY ${SpectrumLaplace_EXAMPLES_TO_INSTALL} DESTINATION share/examples/SpectrumLaplace) + +IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + ADD_SUBDIRECTORY(SpectrumLaplace2DEF) + ADD_SUBDIRECTORY(SpectrumLaplace2DVF) + ADD_SUBDIRECTORY(SpectrumLaplaceBeltrami3DEF) + +ENDIF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + diff --git a/CDMATH/tests/examples/SpectrumLaplace2DEF/CMakeLists.txt b/CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplace2DEF/CMakeLists.txt similarity index 80% rename from CDMATH/tests/examples/SpectrumLaplace2DEF/CMakeLists.txt rename to CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplace2DEF/CMakeLists.txt index 23bcad0..1f49db1 100755 --- a/CDMATH/tests/examples/SpectrumLaplace2DEF/CMakeLists.txt +++ b/CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplace2DEF/CMakeLists.txt @@ -4,15 +4,15 @@ 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(MESH_FILE ../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/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(MESH_FILE ../../ressources/2DFlatCrossTriangles/squareWithFlatCrossTriangles_0.med ) + SET(MESH_FILE ${MED_MESHES}/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(MESH_FILE ../../ressources/2DSkinnyTriangles/squareWithSkinnyTriangles_0.med ) + SET(MESH_FILE ${MED_MESHES}/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}) diff --git a/CDMATH/tests/examples/SpectrumLaplace2DEF/SpectrumLaplace2DEF_SQUARE.py b/CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplace2DEF/SpectrumLaplace2DEF_SQUARE.py similarity index 100% rename from CDMATH/tests/examples/SpectrumLaplace2DEF/SpectrumLaplace2DEF_SQUARE.py rename to CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplace2DEF/SpectrumLaplace2DEF_SQUARE.py diff --git a/CDMATH/tests/examples/SpectrumLaplace2DVF/CMakeLists.txt b/CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplace2DVF/CMakeLists.txt similarity index 77% rename from CDMATH/tests/examples/SpectrumLaplace2DVF/CMakeLists.txt rename to CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplace2DVF/CMakeLists.txt index 115277c..a4c51ae 100755 --- a/CDMATH/tests/examples/SpectrumLaplace2DVF/CMakeLists.txt +++ b/CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplace2DVF/CMakeLists.txt @@ -3,27 +3,27 @@ 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(MESH_FILE ../../ressources/squareWithLocRefSquares.med ) +# SET(MESH_FILE ${MED_MESHES}/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(MESH_FILE ../../ressources/squareWithCheckerboardSquares.med ) + SET(MESH_FILE ${MED_MESHES}/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(MESH_FILE ../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/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(MESH_FILE ../../ressources/2DFlatCrossTriangles/squareWithFlatCrossTriangles_0.med ) + SET(MESH_FILE ${MED_MESHES}/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(MESH_FILE ../../ressources/2DSkinnyTriangles/squareWithSkinnyTriangles_0.med ) + SET(MESH_FILE ${MED_MESHES}/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}) diff --git a/CDMATH/tests/examples/SpectrumLaplace2DVF/SpectrumLaplace2DVF_SQUARE.py b/CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplace2DVF/SpectrumLaplace2DVF_SQUARE.py similarity index 100% rename from CDMATH/tests/examples/SpectrumLaplace2DVF/SpectrumLaplace2DVF_SQUARE.py rename to CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplace2DVF/SpectrumLaplace2DVF_SQUARE.py diff --git a/CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/CMakeLists.txt b/CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplaceBeltrami3DEF/CMakeLists.txt similarity index 82% rename from CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/CMakeLists.txt rename to CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplaceBeltrami3DEF/CMakeLists.txt index cf124a8..0be7f11 100755 --- a/CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/CMakeLists.txt +++ b/CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplaceBeltrami3DEF/CMakeLists.txt @@ -1,17 +1,17 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - SET(MESH_FILE ../../ressources/meshSphere.med ) + SET(MESH_FILE ${MED_MESHES}/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(MESH_FILE ../../ressources/meshTorus.med ) + SET(MESH_FILE ${MED_MESHES}/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(MESH_FILE ../../ressources/meshCubeSkin.med ) + SET(MESH_FILE ${MED_MESHES}/meshCubeSkin.med ) SET(MESH_NAME "CubeSkin" ) ADD_TEST(ExampleSpectrumLaplaceBeltrami_3DFE_CUBESKIN ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SpectrumFiniteElements3DLaplace-Beltrami.py ${MESH_FILE} ${MESH_NAME} ) diff --git a/CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/SpectrumFiniteElements3DLaplace-Beltrami.py b/CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplaceBeltrami3DEF/SpectrumFiniteElements3DLaplace-Beltrami.py similarity index 100% rename from CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/SpectrumFiniteElements3DLaplace-Beltrami.py rename to CDMATH/tests/examples/SpectrumLaplace/SpectrumLaplaceBeltrami3DEF/SpectrumFiniteElements3DLaplace-Beltrami.py diff --git a/CDMATH/tests/examples/TransportEquation/CMakeLists.txt b/CDMATH/tests/examples/TransportEquation/CMakeLists.txt index de60200..e7a8915 100755 --- a/CDMATH/tests/examples/TransportEquation/CMakeLists.txt +++ b/CDMATH/tests/examples/TransportEquation/CMakeLists.txt @@ -1,8 +1,18 @@ +file(GLOB TransportEquation_EXAMPLES_TO_INSTALL + TransportEquation1DUpwindExplicit TransportEquation1DUpwindImplicit TransportEquation1DCenteredImplicit TransportEquation1DCenteredExplicit # 1D Transport equation + TransportEquation +) -if (CDMATH_WITH_PYTHON ) +install(DIRECTORY ${TransportEquation_EXAMPLES_TO_INSTALL} DESTINATION share/examples/TransportEquation) - ADD_TEST(ExampleTransportEquation_2DUpwind_Explicit ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/TransportEquationUpwind.py) +IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) -endif (CDMATH_WITH_PYTHON ) + ADD_SUBDIRECTORY(TransportEquation1DUpwindExplicit) + ADD_SUBDIRECTORY(TransportEquation1DUpwindImplicit) + ADD_SUBDIRECTORY(TransportEquation1DCenteredImplicit) + ADD_SUBDIRECTORY(TransportEquation1DCenteredExplicit) + ADD_SUBDIRECTORY(TransportEquation) + +ENDIF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) diff --git a/CDMATH/tests/examples/TransportEquation/TransportEquation/CMakeLists.txt b/CDMATH/tests/examples/TransportEquation/TransportEquation/CMakeLists.txt new file mode 100755 index 0000000..de60200 --- /dev/null +++ b/CDMATH/tests/examples/TransportEquation/TransportEquation/CMakeLists.txt @@ -0,0 +1,8 @@ + +if (CDMATH_WITH_PYTHON ) + + ADD_TEST(ExampleTransportEquation_2DUpwind_Explicit ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/TransportEquationUpwind.py) + +endif (CDMATH_WITH_PYTHON ) + + diff --git a/CDMATH/tests/examples/TransportEquation/TransportEquationUpwind.py b/CDMATH/tests/examples/TransportEquation/TransportEquation/TransportEquationUpwind.py similarity index 100% rename from CDMATH/tests/examples/TransportEquation/TransportEquationUpwind.py rename to CDMATH/tests/examples/TransportEquation/TransportEquation/TransportEquationUpwind.py diff --git a/CDMATH/tests/examples/TransportEquation1DCenteredExplicit/1DTransportEquationCenteredExplicit.py b/CDMATH/tests/examples/TransportEquation/TransportEquation1DCenteredExplicit/1DTransportEquationCenteredExplicit.py similarity index 100% rename from CDMATH/tests/examples/TransportEquation1DCenteredExplicit/1DTransportEquationCenteredExplicit.py rename to CDMATH/tests/examples/TransportEquation/TransportEquation1DCenteredExplicit/1DTransportEquationCenteredExplicit.py diff --git a/CDMATH/tests/examples/TransportEquation1DCenteredExplicit/CMakeLists.txt b/CDMATH/tests/examples/TransportEquation/TransportEquation1DCenteredExplicit/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/TransportEquation1DCenteredExplicit/CMakeLists.txt rename to CDMATH/tests/examples/TransportEquation/TransportEquation1DCenteredExplicit/CMakeLists.txt diff --git a/CDMATH/tests/examples/TransportEquation1DCenteredImplicit/1DTransportEquationCenteredImplicit.py b/CDMATH/tests/examples/TransportEquation/TransportEquation1DCenteredImplicit/1DTransportEquationCenteredImplicit.py similarity index 100% rename from CDMATH/tests/examples/TransportEquation1DCenteredImplicit/1DTransportEquationCenteredImplicit.py rename to CDMATH/tests/examples/TransportEquation/TransportEquation1DCenteredImplicit/1DTransportEquationCenteredImplicit.py diff --git a/CDMATH/tests/examples/TransportEquation1DCenteredImplicit/CMakeLists.txt b/CDMATH/tests/examples/TransportEquation/TransportEquation1DCenteredImplicit/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/TransportEquation1DCenteredImplicit/CMakeLists.txt rename to CDMATH/tests/examples/TransportEquation/TransportEquation1DCenteredImplicit/CMakeLists.txt diff --git a/CDMATH/tests/examples/TransportEquation1DUpwindExplicit/1DTransportEquationUpwindExplicit.py b/CDMATH/tests/examples/TransportEquation/TransportEquation1DUpwindExplicit/1DTransportEquationUpwindExplicit.py similarity index 100% rename from CDMATH/tests/examples/TransportEquation1DUpwindExplicit/1DTransportEquationUpwindExplicit.py rename to CDMATH/tests/examples/TransportEquation/TransportEquation1DUpwindExplicit/1DTransportEquationUpwindExplicit.py diff --git a/CDMATH/tests/examples/TransportEquation1DUpwindExplicit/CMakeLists.txt b/CDMATH/tests/examples/TransportEquation/TransportEquation1DUpwindExplicit/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/TransportEquation1DUpwindExplicit/CMakeLists.txt rename to CDMATH/tests/examples/TransportEquation/TransportEquation1DUpwindExplicit/CMakeLists.txt diff --git a/CDMATH/tests/examples/TransportEquation1DUpwindImplicit/1DTransportEquationUpwindImplicit.py b/CDMATH/tests/examples/TransportEquation/TransportEquation1DUpwindImplicit/1DTransportEquationUpwindImplicit.py similarity index 100% rename from CDMATH/tests/examples/TransportEquation1DUpwindImplicit/1DTransportEquationUpwindImplicit.py rename to CDMATH/tests/examples/TransportEquation/TransportEquation1DUpwindImplicit/1DTransportEquationUpwindImplicit.py diff --git a/CDMATH/tests/examples/TransportEquation1DUpwindImplicit/CMakeLists.txt b/CDMATH/tests/examples/TransportEquation/TransportEquation1DUpwindImplicit/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/TransportEquation1DUpwindImplicit/CMakeLists.txt rename to CDMATH/tests/examples/TransportEquation/TransportEquation1DUpwindImplicit/CMakeLists.txt diff --git a/CDMATH/tests/examples/thermique1d/main.cxx b/CDMATH/tests/examples/TransportEquation/thermique1d/main.cxx old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/thermique1d/main.cxx rename to CDMATH/tests/examples/TransportEquation/thermique1d/main.cxx diff --git a/CDMATH/tests/examples/thermique1d/makefile b/CDMATH/tests/examples/TransportEquation/thermique1d/makefile old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/thermique1d/makefile rename to CDMATH/tests/examples/TransportEquation/thermique1d/makefile diff --git a/CDMATH/tests/examples/transport1d/main.cxx b/CDMATH/tests/examples/TransportEquation/transport1d/main.cxx old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/transport1d/main.cxx rename to CDMATH/tests/examples/TransportEquation/transport1d/main.cxx diff --git a/CDMATH/tests/examples/transport1d/main.py b/CDMATH/tests/examples/TransportEquation/transport1d/main.py old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/transport1d/main.py rename to CDMATH/tests/examples/TransportEquation/transport1d/main.py diff --git a/CDMATH/tests/examples/transport1d/makefile b/CDMATH/tests/examples/TransportEquation/transport1d/makefile old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/transport1d/makefile rename to CDMATH/tests/examples/TransportEquation/transport1d/makefile diff --git a/CDMATH/tests/examples/transport2d_ns/main.cxx b/CDMATH/tests/examples/TransportEquation/transport2d_ns/main.cxx old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/transport2d_ns/main.cxx rename to CDMATH/tests/examples/TransportEquation/transport2d_ns/main.cxx diff --git a/CDMATH/tests/examples/transport2d_ns/main.py b/CDMATH/tests/examples/TransportEquation/transport2d_ns/main.py old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/transport2d_ns/main.py rename to CDMATH/tests/examples/TransportEquation/transport2d_ns/main.py diff --git a/CDMATH/tests/examples/transport2d_ns/main2.cxx b/CDMATH/tests/examples/TransportEquation/transport2d_ns/main2.cxx old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/transport2d_ns/main2.cxx rename to CDMATH/tests/examples/TransportEquation/transport2d_ns/main2.cxx diff --git a/CDMATH/tests/examples/transport2d_ns/makefile b/CDMATH/tests/examples/TransportEquation/transport2d_ns/makefile old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/transport2d_ns/makefile rename to CDMATH/tests/examples/TransportEquation/transport2d_ns/makefile diff --git a/CDMATH/tests/examples/transport2d_s/main.cxx b/CDMATH/tests/examples/TransportEquation/transport2d_s/main.cxx old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/transport2d_s/main.cxx rename to CDMATH/tests/examples/TransportEquation/transport2d_s/main.cxx diff --git a/CDMATH/tests/examples/transport2d_s/main.py b/CDMATH/tests/examples/TransportEquation/transport2d_s/main.py old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/transport2d_s/main.py rename to CDMATH/tests/examples/TransportEquation/transport2d_s/main.py diff --git a/CDMATH/tests/examples/transport2d_s/makefile b/CDMATH/tests/examples/TransportEquation/transport2d_s/makefile old mode 100644 new mode 100755 similarity index 100% rename from CDMATH/tests/examples/transport2d_s/makefile rename to CDMATH/tests/examples/TransportEquation/transport2d_s/makefile diff --git a/CDMATH/tests/examples/WaveSystem/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/CMakeLists.txt new file mode 100755 index 0000000..a4f396f --- /dev/null +++ b/CDMATH/tests/examples/WaveSystem/CMakeLists.txt @@ -0,0 +1,36 @@ +file(GLOB WaveSystem_EXAMPLES_TO_INSTALL + + 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 ${WaveSystem_EXAMPLES_TO_INSTALL} DESTINATION share/examples/WaveSystem) + +SET(MESH_MED + ${MED_MESHES}/squareWithTriangles.med + ${MED_MESHES}/squareWithSquares.med + ${MED_MESHES}/squareWithBrickWall.med + ${MED_MESHES}/squareWithCheckerboardSquares.med + ${MED_MESHES}/squareWithDeformedQuadrangles.med + ${MED_MESHES}/squareWithHexagons.med + ) + +IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + ADD_SUBDIRECTORY(WaveSystem1DUpwind) + ADD_SUBDIRECTORY(WaveSystem1DStaggered_RiemannProblem) + ADD_SUBDIRECTORY(WaveSystem1DUpwind_RiemannProblem) + ADD_SUBDIRECTORY(WaveSystem2DUpwind_RiemannProblem) + ADD_SUBDIRECTORY(WaveSystem_Stationary/WaveSystemUpwind) + ADD_SUBDIRECTORY(WaveSystem_Stationary/WaveSystemPStag) + ADD_SUBDIRECTORY(WaveSystem_Stationary/WaveSystemStaggered) + ADD_SUBDIRECTORY(WaveSystem_Stationary/WaveSystemCentered) + ADD_SUBDIRECTORY(WaveSystem_Shock/WaveSystemUpwind) + ADD_SUBDIRECTORY(WaveSystem_Shock/WaveSystemPStag) + ADD_SUBDIRECTORY(WaveSystem_Shock/WaveSystemStaggered) + ADD_SUBDIRECTORY(WaveSystem_Shock/WaveSystemCentered) + +ENDIF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) + + diff --git a/CDMATH/tests/examples/WaveSystem1DStaggered_RiemannProblem/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem1DStaggered_RiemannProblem/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/WaveSystem1DStaggered_RiemannProblem/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem1DStaggered_RiemannProblem/CMakeLists.txt diff --git a/CDMATH/tests/examples/WaveSystem1DStaggered_RiemannProblem/WaveSystem1DStaggered_RiemannProblem.py b/CDMATH/tests/examples/WaveSystem/WaveSystem1DStaggered_RiemannProblem/WaveSystem1DStaggered_RiemannProblem.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem1DStaggered_RiemannProblem/WaveSystem1DStaggered_RiemannProblem.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem1DStaggered_RiemannProblem/WaveSystem1DStaggered_RiemannProblem.py diff --git a/CDMATH/tests/examples/WaveSystem1DUpwind/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem1DUpwind/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/WaveSystem1DUpwind/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem1DUpwind/CMakeLists.txt diff --git a/CDMATH/tests/examples/WaveSystem1DUpwind/WaveSystem1DUpwind.py b/CDMATH/tests/examples/WaveSystem/WaveSystem1DUpwind/WaveSystem1DUpwind.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem1DUpwind/WaveSystem1DUpwind.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem1DUpwind/WaveSystem1DUpwind.py diff --git a/CDMATH/tests/examples/WaveSystem1DUpwind_RiemannProblem/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem1DUpwind_RiemannProblem/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/WaveSystem1DUpwind_RiemannProblem/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem1DUpwind_RiemannProblem/CMakeLists.txt diff --git a/CDMATH/tests/examples/WaveSystem1DUpwind_RiemannProblem/WaveSystem1DUpwind_RiemannProblem.py b/CDMATH/tests/examples/WaveSystem/WaveSystem1DUpwind_RiemannProblem/WaveSystem1DUpwind_RiemannProblem.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem1DUpwind_RiemannProblem/WaveSystem1DUpwind_RiemannProblem.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem1DUpwind_RiemannProblem/WaveSystem1DUpwind_RiemannProblem.py diff --git a/CDMATH/tests/examples/WaveSystem2DUpwind_RiemannProblem/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem2DUpwind_RiemannProblem/CMakeLists.txt similarity index 70% rename from CDMATH/tests/examples/WaveSystem2DUpwind_RiemannProblem/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem2DUpwind_RiemannProblem/CMakeLists.txt index fdc4fc0..d271c53 100755 --- a/CDMATH/tests/examples/WaveSystem2DUpwind_RiemannProblem/CMakeLists.txt +++ b/CDMATH/tests/examples/WaveSystem/WaveSystem2DUpwind_RiemannProblem/CMakeLists.txt @@ -1,13 +1,4 @@ -SET(MESH_MED - ../../ressources/squareWithTriangles.med - ../../ressources/squareWithSquares.med - ../../ressources/squareWithBrickWall.med - ../../ressources/squareWithCheckerboardSquares.med - ../../ressources/squareWithDeformedQuadrangles.med - ../../ressources/squareWithHexagons.med - ) - file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/WaveSystemUpwind) @@ -15,53 +6,53 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) SET(IMPLICIT_SCHEME 0 ) - SET(MESH_FILE ../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../ressources/squareWithBrickWall.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithBrickWall.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_brickwall ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../ressources/squareWithCheckerboardSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithCheckerboardSquares.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_checkerboard ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../ressources/squareWithDeformedQuadrangles.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithDeformedQuadrangles.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_deformedQuadrangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../ressources/squareWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithHexagons.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindExplicit_SQUARE_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) SET(IMPLICIT_SCHEME 1 ) - SET(MESH_FILE ../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../ressources/squareWithBrickWall.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithBrickWall.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_brickwall ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../ressources/squareWithCheckerboardSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithCheckerboardSquares.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_checkerboard ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../ressources/squareWithDeformedQuadrangles.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithDeformedQuadrangles.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_deformedQuadrangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../ressources/squareWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithHexagons.med ) ADD_TEST(ExampleWaveSystem_2DRiemannProblem_UpwindImplicit_SQUARE_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) diff --git a/CDMATH/tests/examples/WaveSystem2DUpwind_RiemannProblem/WaveSystemUpwind.py b/CDMATH/tests/examples/WaveSystem/WaveSystem2DUpwind_RiemannProblem/WaveSystemUpwind.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem2DUpwind_RiemannProblem/WaveSystemUpwind.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem2DUpwind_RiemannProblem/WaveSystemUpwind.py diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt similarity index 63% rename from CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt index 1a18ab0..f21cbe8 100755 --- a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt +++ b/CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt @@ -1,54 +1,42 @@ -SET(MESH_MED - ../../../ressources/squareWithTriangles.med - ../../../ressources/meshCube.med - ../../../ressources/squareWithSquares.med - ../../../ressources/cubeWithCubes.med - ../../../ressources/diskWithTriangles.med - ../../../ressources/diskWithSquares.med - ../../../ressources/diskWithSpiderWeb.med - ../../../ressources/diskWithHexagons.med - ../../../ressources/ballWithTetrahedra.med - ) - file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/WaveSystemCentered) if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - SET(MESH_FILE ../../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleWaveSystem_2DShock_Centered_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DShock_Centered_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/meshCube.med ) + SET(MESH_FILE ${MED_MESHES}/meshCube.med ) ADD_TEST(ExampleWaveSystem_3DShock_Centered_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/cubeWithCubes.med ) + SET(MESH_FILE ${MED_MESHES}/cubeWithCubes.med ) ADD_TEST(ExampleWaveSystem_3DShock_Centered_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExampleWaveSystem_2DShock_Centered_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DShock_Centered_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExampleWaveSystem_2DShock_Centered_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExampleWaveSystem_2DShock_Centered_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/meshHexagonWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/meshHexagonWithTriangles.med ) ADD_TEST(ExampleWaveSystem_2DShock_Centered_HEXAGON_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/WaveSystemCentered.py b/CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemCentered/WaveSystemCentered.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/WaveSystemCentered.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemCentered/WaveSystemCentered.py diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt similarity index 62% rename from CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt index 2f349fd..61c7332 100755 --- a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt +++ b/CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt @@ -1,54 +1,42 @@ -SET(MESH_MED - ../../../ressources/squareWithTriangles.med - ../../../ressources/meshCube.med - ../../../ressources/squareWithSquares.med - ../../../ressources/cubeWithCubes.med - ../../../ressources/diskWithTriangles.med - ../../../ressources/diskWithSquares.med - ../../../ressources/diskWithSpiderWeb.med - ../../../ressources/diskWithHexagons.med - ../../../ressources/ballWithTetrahedra.med - ) - file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/WaveSystemPStag) if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - SET(MESH_FILE ../../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleWaveSystem_2DShock_PStag_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DShock_PStag_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/meshCube.med ) + SET(MESH_FILE ${MED_MESHES}/meshCube.med ) ADD_TEST(ExampleWaveSystem_3DShock_PStag_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/cubeWithCubes.med ) + SET(MESH_FILE ${MED_MESHES}/cubeWithCubes.med ) ADD_TEST(ExampleWaveSystem_3DShock_PStag_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExampleWaveSystem_2DShock_PStag_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DShock_PStag_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExampleWaveSystem_2DShock_PStag_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExampleWaveSystem_2DShock_PStag_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/meshHexagonWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/meshHexagonWithTriangles.med ) ADD_TEST(ExampleWaveSystem_2DShock_PStag_HEXAGON_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/WaveSystemPStag.py b/CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemPStag/WaveSystemPStag.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/WaveSystemPStag.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemPStag/WaveSystemPStag.py diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemStaggered/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemStaggered/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/WaveSystem_Shock/WaveSystemStaggered/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemStaggered/CMakeLists.txt diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemStaggered/WaveSystemStaggered.py b/CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemStaggered/WaveSystemStaggered.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem_Shock/WaveSystemStaggered/WaveSystemStaggered.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemStaggered/WaveSystemStaggered.py diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt similarity index 69% rename from CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt index 5b36455..68313a5 100755 --- a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt +++ b/CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt @@ -1,16 +1,4 @@ -SET(MESH_MED - ../../../ressources/squareWithTriangles.med - ../../../ressources/meshCube.med - ../../../ressources/squareWithSquares.med - ../../../ressources/cubeWithCubes.med - ../../../ressources/diskWithTriangles.med - ../../../ressources/diskWithSquares.med - ../../../ressources/diskWithSpiderWeb.med - ../../../ressources/diskWithHexagons.med - ../../../ressources/ballWithTetrahedra.med - ) - file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/WaveSystemUpwind) @@ -18,73 +6,73 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) SET(IMPLICIT_SCHEME 0 ) - SET(MESH_FILE ../../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/meshCube.med ) + SET(MESH_FILE ${MED_MESHES}/meshCube.med ) ADD_TEST(ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/cubeWithCubes.med ) + SET(MESH_FILE ${MED_MESHES}/cubeWithCubes.med ) ADD_TEST(ExampleWaveSystem_3DShock_UpwindExplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/meshHexagonWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/meshHexagonWithTriangles.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindExplicit_HEXAGON_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) SET(IMPLICIT_SCHEME 1 ) - SET(MESH_FILE ../../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/meshCube.med ) + SET(MESH_FILE ${MED_MESHES}/meshCube.med ) ADD_TEST(ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/cubeWithCubes.med ) + SET(MESH_FILE ${MED_MESHES}/cubeWithCubes.med ) ADD_TEST(ExampleWaveSystem_3DShock_UpwindImplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExampleWaveSystem_2DShock_UpwindImplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/WaveSystemUpwind.py b/CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemUpwind/WaveSystemUpwind.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/WaveSystemUpwind.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Shock/WaveSystemUpwind/WaveSystemUpwind.py diff --git a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemCentered/CMakeLists.txt similarity index 62% rename from CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemCentered/CMakeLists.txt index d54c556..51f79f6 100755 --- a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/CMakeLists.txt +++ b/CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemCentered/CMakeLists.txt @@ -1,50 +1,38 @@ -SET(MESH_MED - ../../../ressources/squareWithTriangles.med - ../../../ressources/meshCube.med - ../../../ressources/squareWithSquares.med - ../../../ressources/cubeWithCubes.med - ../../../ressources/diskWithTriangles.med - ../../../ressources/diskWithSquares.med - ../../../ressources/diskWithSpiderWeb.med - ../../../ressources/diskWithHexagons.med - ../../../ressources/ballWithTetrahedra.med - ) - file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/WaveSystemCentered) if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - SET(MESH_FILE ../../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleWaveSystem_2DVortex_Centered_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DVortex_Centered_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/meshCube.med ) + SET(MESH_FILE ${MED_MESHES}/meshCube.med ) ADD_TEST(ExampleWaveSystem_3DVortex_Centered_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/cubeWithCubes.med ) + SET(MESH_FILE ${MED_MESHES}/cubeWithCubes.med ) ADD_TEST(ExampleWaveSystem_3DVortex_Centered_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExampleWaveSystem_2DVortex_Centered_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DVortex_Centered_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExampleWaveSystem_2DVortex_Centered_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExampleWaveSystem_2DVortex_Centered_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) diff --git a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/WaveSystemCentered.py b/CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemCentered/WaveSystemCentered.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/WaveSystemCentered.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemCentered/WaveSystemCentered.py diff --git a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemPStag/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemPStag/CMakeLists.txt similarity index 61% rename from CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemPStag/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemPStag/CMakeLists.txt index 3aa9d62..c272a17 100755 --- a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemPStag/CMakeLists.txt +++ b/CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemPStag/CMakeLists.txt @@ -1,50 +1,38 @@ -SET(MESH_MED - ../../../ressources/squareWithTriangles.med - ../../../ressources/meshCube.med - ../../../ressources/squareWithSquares.med - ../../../ressources/cubeWithCubes.med - ../../../ressources/diskWithTriangles.med - ../../../ressources/diskWithSquares.med - ../../../ressources/diskWithSpiderWeb.med - ../../../ressources/diskWithHexagons.med - ../../../ressources/ballWithTetrahedra.med - ) - file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/WaveSystemPStag) if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) - SET(MESH_FILE ../../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleWaveSystem_2DVortex_PStag_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DVortex_PStag_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/meshCube.med ) + SET(MESH_FILE ${MED_MESHES}/meshCube.med ) ADD_TEST(ExampleWaveSystem_3DVortex_PStag_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/cubeWithCubes.med ) + SET(MESH_FILE ${MED_MESHES}/cubeWithCubes.med ) ADD_TEST(ExampleWaveSystem_3DVortex_PStag_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExampleWaveSystem_2DVortex_PStag_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DVortex_PStag_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExampleWaveSystem_2DVortex_PStag_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) - SET(MESH_FILE ../../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExampleWaveSystem_2DVortex_PStag_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) diff --git a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemPStag/WaveSystemPStag.py b/CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemPStag/WaveSystemPStag.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemPStag/WaveSystemPStag.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemPStag/WaveSystemPStag.py diff --git a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemStaggered/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemStaggered/CMakeLists.txt similarity index 100% rename from CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemStaggered/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemStaggered/CMakeLists.txt diff --git a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemStaggered/WaveSystemStaggered.py b/CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemStaggered/WaveSystemStaggered.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemStaggered/WaveSystemStaggered.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemStaggered/WaveSystemStaggered.py diff --git a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemUpwind/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemUpwind/CMakeLists.txt similarity index 69% rename from CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemUpwind/CMakeLists.txt rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemUpwind/CMakeLists.txt index 376bb9d..912b52c 100755 --- a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemUpwind/CMakeLists.txt +++ b/CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemUpwind/CMakeLists.txt @@ -1,16 +1,4 @@ -SET(MESH_MED - ../../../ressources/squareWithTriangles.med - ../../../ressources/meshCube.med - ../../../ressources/squareWithSquares.med - ../../../ressources/cubeWithCubes.med - ../../../ressources/diskWithTriangles.med - ../../../ressources/diskWithSquares.med - ../../../ressources/diskWithSpiderWeb.med - ../../../ressources/diskWithHexagons.med - ../../../ressources/ballWithTetrahedra.med - ) - file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/WaveSystemUpwind) @@ -18,69 +6,69 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) SET(IMPLICIT_SCHEME 0 ) - SET(MESH_FILE ../../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/meshCube.med ) + SET(MESH_FILE ${MED_MESHES}/meshCube.med ) ADD_TEST(ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/cubeWithCubes.med ) + SET(MESH_FILE ${MED_MESHES}/cubeWithCubes.med ) ADD_TEST(ExampleWaveSystem_3DVortex_UpwindExplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindExplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) SET(IMPLICIT_SCHEME 0 ) - SET(MESH_FILE ../../../ressources/meshSquare.med ) + SET(MESH_FILE ${MED_MESHES}/meshSquare.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/squareWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/squareWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_SQUARE_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/meshCube.med ) + SET(MESH_FILE ${MED_MESHES}/meshCube.med ) ADD_TEST(ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_tetrahedra ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/cubeWithCubes.med ) + SET(MESH_FILE ${MED_MESHES}/cubeWithCubes.med ) ADD_TEST(ExampleWaveSystem_3DVortex_UpwindImplicit_CUBE_cubes ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithTriangles.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithTriangles.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSquares.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSquares.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_squares ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithSpiderWeb.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithSpiderWeb.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_spiderWeb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) - SET(MESH_FILE ../../../ressources/diskWithHexagons.med ) + SET(MESH_FILE ${MED_MESHES}/diskWithHexagons.med ) ADD_TEST(ExampleWaveSystem_2DVortex_UpwindImplicit_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemUpwind.py ${MESH_FILE} ${IMPLICIT_SCHEME}) diff --git a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemUpwind/WaveSystemUpwind.py b/CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemUpwind/WaveSystemUpwind.py similarity index 100% rename from CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemUpwind/WaveSystemUpwind.py rename to CDMATH/tests/examples/WaveSystem/WaveSystem_Stationary/WaveSystemUpwind/WaveSystemUpwind.py diff --git a/CDMATH/tests/ressources/CMakeLists.txt b/CDMATH/tests/ressources/CMakeLists.txt index acf794c..ad1b6cf 100755 --- a/CDMATH/tests/ressources/CMakeLists.txt +++ b/CDMATH/tests/ressources/CMakeLists.txt @@ -1,9 +1,6 @@ -SET(MESH_MED2 - ../ressources/ - ) -file(COPY ${MESH_MED2} DESTINATION ${CMAKE_BINARY_DIR}/CDMATH/tests/ressources) +file(COPY ${MED_MESHES} DESTINATION ${CMAKE_BINARY_DIR}/CDMATH/tests/ressources) -install(DIRECTORY ${MESH_MED2} DESTINATION share/meshes) +install(DIRECTORY ${MED_MESHES} DESTINATION share/meshes) -- 2.39.2