]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Corrected wave system tests
authormichael <michael@localhost.localdomain>
Sun, 18 Oct 2020 03:57:33 +0000 (05:57 +0200)
committermichael <michael@localhost.localdomain>
Sun, 18 Oct 2020 03:57:33 +0000 (05:57 +0200)
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/CMakeLists.txt
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemCentered/WaveSystemCentered.py
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/CMakeLists.txt
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemPStag/WaveSystemPStag.py
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/CMakeLists.txt
CDMATH/tests/examples/WaveSystem_Shock/WaveSystemUpwind/WaveSystemUpwind.py
CDMATH/tests/examples/WaveSystem_Stationary/WaveSystemCentered/WaveSystemCentered.py

index e9774796b78a2e8c281e81b1123efcc53ee753b3..1e929f73ffe952f860d6621b6d38ad7de1bbc573 100755 (executable)
@@ -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)
 
 
index d541fe928397bafd81f7e5c4bf82f72a8a7e2bc2..b728be943229387d47f6fc439f32ab47cbdc8c96 100755 (executable)
@@ -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]
index 807989bb68ff51465332410673dce6ac4a717e97..3b5873b3ec73eaeda900bc12853227f81e57e909 100755 (executable)
@@ -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)
 
 
index ea333350b2fc8fdf3c4041e15a3dfbe943806a50..b4793e86010e6119cdaabe3fbc739fea6d9604c1 100755 (executable)
@@ -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]
index 56bd397be77b489bf78e4e05fd2db115707f404f..a97eaf8309e3a201fc3b1008b2d4a5c666e2246c 100755 (executable)
@@ -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  )
index fdf741684a842b1b3024b6adbe21552bdfeef6a8..5eb768859b6b7c1c7a91ffb252d86feee93a0409 100755 (executable)
@@ -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))
index f1ad05b6b0d704d44568524646f98e6391002c8e..5480f1f49fb8f4746f994ea2d673500177c62851 100755 (executable)
@@ -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]