From: michael Date: Sun, 18 Oct 2020 03:57:33 +0000 (+0200) Subject: Corrected wave system tests X-Git-Tag: V9_6_0~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=00145fe7b06aa98d319a218bb7c305d40b353365;p=tools%2Fsolverlab.git Corrected wave system tests --- diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt index e977479..1e929f7 100755 --- a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt +++ b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt @@ -48,6 +48,10 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) ADD_TEST(ExampleWaveSystem_2DShock_Centered_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) + SET(MESH_FILE ../../../ressources/meshHexagonWithTriangles.med ) + + ADD_TEST(ExampleWaveSystem_2DShock_Centered_HEXAGON_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemCentered.py ${MESH_FILE}) + endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/WaveSystemCentered.py b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/WaveSystemCentered.py index d541fe9..b728be9 100755 --- a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/WaveSystemCentered.py +++ b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/WaveSystemCentered.py @@ -171,11 +171,11 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution): 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): 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, Hexagon or disk") for k in range(nbCells): Un[k*(dim+1)+0] = pressure_field[k] diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt index 807989b..3b5873b 100755 --- a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt +++ b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt @@ -48,6 +48,10 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) ADD_TEST(ExampleWaveSystem_2DShock_PStag_DISK_hexagons ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) + SET(MESH_FILE ../../../ressources/meshHexagonWithTriangles.med ) + + ADD_TEST(ExampleWaveSystem_2DShock_PStag_HEXAGON_triangles ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/WaveSystemPStag.py ${MESH_FILE}) + endif (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/WaveSystemPStag.py b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/WaveSystemPStag.py index ea33335..b4793e8 100755 --- a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/WaveSystemPStag.py +++ b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/WaveSystemPStag.py @@ -174,11 +174,11 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution): 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): 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, Hexagon or disk") for k in range(nbCells): Un[k*(dim+1)+0] = pressure_field[k] diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt index 56bd397..a97eaf8 100755 --- a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt +++ b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt @@ -50,6 +50,10 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) 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 ) + + 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 ) diff --git a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/WaveSystemUpwind.py b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/WaveSystemUpwind.py index fdf7416..5eb7688 100755 --- a/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/WaveSystemUpwind.py +++ b/CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/WaveSystemUpwind.py @@ -32,11 +32,11 @@ def initial_conditions_shock(my_mesh, isCircle): nbCells = my_mesh.getNumberOfCells() rayon = 0.15 - if(not isCircle): + if(not isCircle):#Case of a square domain xcentre = 0.5 ycentre = 0.5 zcentre = 0.5 - else: + else:#Case of a disk or a hexagonal domain xcentre = 0. ycentre = 0. zcentre = 0. @@ -162,11 +162,11 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution, is 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): 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, hexagon or disk") #iteration vectors Un =cdmath.Vector(nbCells*(dim+1)) diff --git a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/WaveSystemCentered.py b/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/WaveSystemCentered.py index f1ad05b..5480f1f 100755 --- a/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/WaveSystemCentered.py +++ b/CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/WaveSystemCentered.py @@ -174,11 +174,11 @@ def WaveSystemVF(ntmax, tmax, cfl, my_mesh, output_freq, filename,resolution): print("Construction of the initial condition …") if(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_square_vortex(my_mesh) - 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): pressure_field, velocity_field = initial_conditions_disk_vortex(my_mesh) 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, Hexagon or disk") for k in range(nbCells): Un[k*(dim+1)+0] = pressure_field[k]