Skip to content

Commit

Permalink
Add consistency test for reading Gmsh binary
Browse files Browse the repository at this point in the history
input msh file.
  • Loading branch information
richb2k committed Dec 21, 2024
1 parent b597bdc commit 34ac241
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fem/tests/ElmerGridConvertGmshBinary/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
INCLUDE(test_macros)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/fem/src)

CONFIGURE_FILE(case.sif case.sif COPYONLY)

file(COPY ELMERSOLVER_STARTINFO binary.msh DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/")

ADD_ELMER_TEST(ElmerGridConvertGmshBinary LABELS quick)
1 change: 1 addition & 0 deletions fem/tests/ElmerGridConvertGmshBinary/ELMERSOLVER_STARTINFO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
case.sif
12 changes: 12 additions & 0 deletions fem/tests/ElmerGridConvertGmshBinary/binary.geo
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Gmsh project created on Sat Dec 21 08:30:08 2024
SetFactory("OpenCASCADE");
//+
Box(1) = {0, 0, 0, 20, 20, 20};
//+
Physical Surface("side", 13) = {6};
//+
Physical Surface("top", 14) = {4};
//+
Physical Surface("other", 15) = {1, 5, 2, 3};
//+
Physical Volume("body1", 16) = {1};
Binary file added fem/tests/ElmerGridConvertGmshBinary/binary.msh
Binary file not shown.
78 changes: 78 additions & 0 deletions fem/tests/ElmerGridConvertGmshBinary/case.sif
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
! Consistency test for workflow where Gmsh binary file is converted with ElmerGrid
!
! R.B. 21.12.2024

Header
CHECK KEYWORDS Warn
Mesh DB "." "mesh"
Include Path ""
Results Directory ""
End

Simulation
Max Output Level = 5
Coordinate System = "Cartesian"
Simulation Type = "Steady State"
Steady State Max Iterations = 1
Output Intervals = 0

Post File = case.vtu
End

Constants
Gravity(4) = 0 -1 0 9.82
Stefan Boltzmann = 5.67e-08
End

Body 1
Name = "Body"
Body Force = 1
Equation = 1
Material = 1
End

Equation 1
Name = "Equations"
Active Solvers(1) = 2
End

Solver 1
Equation = "CheckMesh"
Procedure = "MeshChecksum" "MeshChecksum"
Reference Values(8) = 2667 584640 1160 1051425 164832 92 222847 10438.792297017142
End

Solver 2
Equation = "Heat Equation"
Variable = "Temperature"
Procedure = "HeatSolve" "HeatSolver"

Linear System Solver = "Iterative"
Linear System Iterative Method = "BiCGStab"
Linear System Max Iterations = 1000
Linear System Convergence Tolerance = 1.0e-08
Linear System Abort Not Converged = True
Linear System Preconditioning = "ILU0"
Linear System Residual Output = 0
Nonlinear System Max Iterations = 1
End

Material 1
Name = "Material"
Density = 1
Heat Conductivity = 1
End

Body Force 1
Name = "BodyForce"
Heat Source = 1
End

Boundary Condition 1
Name = "Constraint"
Target Boundaries(1) = 1
Temperature = 0
End

Solver 1 :: Reference Norm = 1.0
Solver 2 :: Reference Norm = 1.44365965E+02
3 changes: 3 additions & 0 deletions fem/tests/ElmerGridConvertGmshBinary/runtest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include(test_macros)
execute_process(COMMAND ${ELMERGRID_BIN} 14 2 binary.msh -autoclean -out mesh)
RUN_ELMER_TEST()

0 comments on commit 34ac241

Please sign in to comment.