]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add GMSH quicktest 5679/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 28 Dec 2017 14:20:58 +0000 (15:20 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 28 Dec 2017 15:49:01 +0000 (16:49 +0100)
tests/gmsh/create_tria_01.cc
tests/quick_tests/CMakeLists.txt
tests/quick_tests/gmsh.cc [new file with mode: 0644]

index fb790848c790d110ea7273cbfc1332e10bbec2ec..a48d393fe49905aa73a9fffe526456a3d2adfd65 100644 (file)
@@ -62,6 +62,8 @@ int main ()
   Assert(ierr==0, ExcInternalError());
   gmsh_grid<2>("file.msh");
   cat_file("file.msh");
+  std::remove("file.log");
+  std::remove("file_warn.log");
 
   return 0;
 }
index 0e81ba8e8dc981db36c549cdf5d35e01ae013e37..5b01681858d773d2b7b1ddfb72dbeea0e756447e 100644 (file)
@@ -183,6 +183,11 @@ IF (DEAL_II_WITH_ZLIB)
 make_quicktest("boost_zlib" ${_mybuild} "")
 ENDIF()
 
+# Test GMSH
+IF (DEAL_II_WITH_GMSH)
+  make_quicktest("gmsh" ${_mybuild} "")
+ENDIF()
+
 # A custom test target:
 ADD_CUSTOM_TARGET(test
   COMMAND ${CMAKE_COMMAND} -D ALL_TESTS="${ALL_TESTS}" -P ${CMAKE_CURRENT_SOURCE_DIR}/run.cmake
diff --git a/tests/quick_tests/gmsh.cc b/tests/quick_tests/gmsh.cc
new file mode 100644 (file)
index 0000000..85c9d68
--- /dev/null
@@ -0,0 +1,47 @@
+//-----------------------------------------------------------
+//
+//    Copyright (C) 2014 - 2017 by the deal.II authors
+//
+//    This file is subject to LGPL and may not be distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//-----------------------------------------------------------
+
+// Test that the GMSH executable actually works.
+// This is a reduced version of gmsh/create_tria_01.
+
+#include <deal.II/grid/grid_in.h>
+#include <deal.II/grid/tria.h>
+
+#include <fstream>
+
+int main ()
+{
+  std::ofstream geo("file.geo");
+
+  geo << "Lx = 25.0;" << std::endl
+      << "Ly = 1.0;" << std::endl
+      << "Point(1) = {0, 0, 0, Lx};" << std::endl
+      << "Point(2) = {Lx, 0, 0, Lx};" << std::endl
+      << "Point(3) = {Lx, Ly, 0, Lx};" << std::endl
+      << "Point(4) = {0, Ly, 0, Lx};" << std::endl
+      << "Line(1) = {1, 2};" << std::endl
+      << "Line(2) = {2, 3};" << std::endl
+      << "Line(3) = {3, 4};" << std::endl
+      << "Line(4) = {4, 1};" << std::endl
+      << "Line Loop(5) = {3, 4, 1, 2};" << std::endl
+      << "Plane Surface(0) = {5};" << std::endl
+      << "Transfinite Surface{0} = {5};" << std::endl
+      << "Recombine Surface {0};" << std::endl;
+  geo.close();
+
+  const int ierr = std::system(DEAL_II_GMSH_EXECUTABLE_PATH " -2 file.geo 1>file.log 2>file_warn.log");
+  Assert(ierr==0, dealii::ExcInternalError());
+
+  std::remove ("file.geo");
+  std::remove ("file.log");
+  std::remove ("file_warn.log");
+  return 0;
+}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.