getfem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-commits] (no subject)


From: Tetsuo Koyama
Subject: [Getfem-commits] (no subject)
Date: Wed, 6 May 2020 19:59:31 -0400 (EDT)

branch: devel-tetsuo-xml
commit 7cd755bda62addc8a4708811cb33ac2055c5b450
Author: Tetsuo Koyama <address@hidden>
AuthorDate: Sat Apr 25 14:49:53 2020 +0000

    :test_tube: vtu_export
---
 tests/Makefile.am    |  4 ++++
 tests/test_export.cc | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/test_export.pl | 30 +++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 761201a..d40e39c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -37,6 +37,7 @@ check_PROGRAMS =                   \
        test_rtree                 \
        test_mesh                  \
        test_slice                 \
+       test_export                \
        integration                \
        geo_trans_inv              \
        test_mat_elem              \
@@ -105,6 +106,7 @@ test_condensation_SOURCES = test_condensation.cc
 test_tree_sorted_SOURCES = test_tree_sorted.cc
 test_mat_elem_SOURCES = test_mat_elem.cc
 test_slice_SOURCES = test_slice.cc
+test_export_SOURCES = test_export.cc
 test_range_basis_SOURCES = test_range_basis.cc
 schwarz_additive_SOURCES = schwarz_additive.cc
 plasticity_SOURCES = plasticity.cc
@@ -138,6 +140,7 @@ TESTS = \
        test_interpolation.pl         \
        test_mat_elem.pl              \
        test_slice.pl                 \
+       test_export.pl                \
        integration.pl                \
        test_assembly.pl              \
        test_assembly_assignment.pl   \
@@ -221,6 +224,7 @@ EXTRA_DIST =                                                
\
        wave_equation.pl                                        \
        wave_equation.param                                     \
        cyl_slicer.pl                                           \
+       test_export.pl                                          \
        test_continuation.param                                 \
        test_continuation.pl                                    \
        make_gmm_test.pl                                        \
diff --git a/tests/test_export.cc b/tests/test_export.cc
new file mode 100644
index 0000000..1d71533
--- /dev/null
+++ b/tests/test_export.cc
@@ -0,0 +1,53 @@
+/*===========================================================================
+
+ Copyright (C) 2020-2020 Tetsuo Koyama
+
+ This file is a part of GetFEM
+
+ GetFEM  is  free software;  you  can  redistribute  it  and/or modify it
+ under  the  terms  of the  GNU  Lesser General Public License as published
+ by  the  Free Software Foundation;  either version 3 of the License,  or
+ (at your option) any later version along with the GCC Runtime Library
+ Exception either version 3.1 or (at your option) any later version.
+ This program  is  distributed  in  the  hope  that it will be useful,  but
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or  FITNESS  FOR  A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ License and GCC Runtime Library Exception for more details.
+ You  should  have received a copy of the GNU Lesser General Public License
+ along  with  this program;  if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
+
+===========================================================================*/
+#include "getfem/getfem_regular_meshes.h"
+#include "getfem/getfem_export.h"
+
+using bgeot::base_node;
+
+int main(void) {
+
+  getfem::mesh m0;
+
+  base_node org(1);
+  org[0] = 0.0;
+
+  bgeot::base_small_vector h(1);
+  h[0] = 1;
+  std::vector<bgeot::base_small_vector> vect(1);
+  vect[0] = bgeot::base_small_vector(h);
+
+  std::vector<int> ref(1);
+  ref[0] = 1;
+
+  getfem::parallelepiped_regular_simplex_mesh(m0, 1, org, vect.begin(), 
ref.begin());
+
+  getfem::vtk_export vtk_exp("m0.vtk", true);
+  vtk_exp.exporting(m0);
+  vtk_exp.write_mesh();
+
+  getfem::vtu_export vtu_exp("m0.vtu", true);
+  vtu_exp.exporting(m0);
+  vtu_exp.write_mesh();
+
+  return 0;
+}
+
diff --git a/tests/test_export.pl b/tests/test_export.pl
new file mode 100644
index 0000000..9747c9b
--- /dev/null
+++ b/tests/test_export.pl
@@ -0,0 +1,30 @@
+# Copyright (C) 2020-2020 Tetsuo Koyama
+#
+# This file is a part of GetFEM
+#
+# GetFEM  is  free software;  you  can  redistribute  it  and/or modify it
+# under  the  terms  of the  GNU  Lesser General Public License as published
+# by  the  Free Software Foundation;  either version 3 of the License,  or
+# (at your option) any later version along with the GCC Runtime Library
+# Exception either version 3.1 or (at your option) any later version.
+# This program  is  distributed  in  the  hope  that it will be useful,  but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or  FITNESS  FOR  A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License and GCC Runtime Library Exception for more details.
+# You  should  have received a copy of the GNU Lesser General Public License
+# along  with  this program;  if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
+
+$er = 0;
+open F, "./test_export -quick 2>&1 |" or die;
+while (<F>) {
+  # print $_;
+  if ($_ =~ /error has been detected/)
+  {
+    $er = 1;
+    print " =============================================================\n";
+    print $_, <F>;
+  }
+}
+close(F); if ($?) { exit(1); }
+if ($er == 1) { exit(1); }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]