getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] r4965 - in /trunk/getfem/tests: Makefile.am schwarz_add


From: Yves . Renard
Subject: [Getfem-commits] r4965 - in /trunk/getfem/tests: Makefile.am schwarz_additive.cc test_norm.cc test_norm.pl
Date: Wed, 22 Apr 2015 17:02:17 -0000

Author: renard
Date: Wed Apr 22 19:02:16 2015
New Revision: 4965

URL: http://svn.gna.org/viewcvs/getfem?rev=4965&view=rev
Log:
updating demos

Removed:
    trunk/getfem/tests/test_norm.cc
    trunk/getfem/tests/test_norm.pl
Modified:
    trunk/getfem/tests/Makefile.am
    trunk/getfem/tests/schwarz_additive.cc

Modified: trunk/getfem/tests/Makefile.am
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/tests/Makefile.am?rev=4965&r1=4964&r2=4965&view=diff
==============================================================================
--- trunk/getfem/tests/Makefile.am      (original)
+++ trunk/getfem/tests/Makefile.am      Wed Apr 22 19:02:16 2015
@@ -24,7 +24,6 @@
        test_mat_elem              \
        test_interpolation         \
        test_assembly              \
-       test_norm                  \
        test_interpolated_fem      \
        test_range_basis           \
        laplacian                  \
@@ -85,7 +84,6 @@
 test_mat_elem_SOURCES = test_mat_elem.cc
 test_slice_SOURCES = test_slice.cc
 test_range_basis_SOURCES = test_range_basis.cc
-test_norm_SOURCES = test_norm.cc
 schwarz_additive_SOURCES = schwarz_additive.cc
 plasticity_SOURCES = plasticity.cc
 if QHULL
@@ -114,7 +112,6 @@
        test_kdtree.pl                \
        test_rtree.pl                 \
        geo_trans_inv.pl              \
-       test_norm.pl                  \
        test_mesh.pl                  \
        test_interpolation.pl         \
        test_mat_elem.pl              \
@@ -161,7 +158,6 @@
        test_int_set.pl                                         \
        test_interpolated_fem.pl                                \
        test_slice.pl                                           \
-       test_norm.pl                                            \
        test_mesh_im_level_set.pl                               \
        thermo_elasticity_electrical_coupling.pl                \
        thermo_elasticity_electrical_coupling.param             \

Modified: trunk/getfem/tests/schwarz_additive.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/tests/schwarz_additive.cc?rev=4965&r1=4964&r2=4965&view=diff
==============================================================================
--- trunk/getfem/tests/schwarz_additive.cc      (original)
+++ trunk/getfem/tests/schwarz_additive.cc      Wed Apr 22 19:02:16 2015
@@ -29,7 +29,6 @@
 #define GMM_USES_SUPERLU
 
 #include "getfem/getfem_assembling.h"
-#include "getfem/getfem_norm.h"
 #include "getfem/getfem_regular_meshes.h"
 #include "getfem/getfem_export.h"
 #include "gmm/gmm.h"

Removed: trunk/getfem/tests/test_norm.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/tests/test_norm.cc?rev=4964&view=auto
==============================================================================
--- trunk/getfem/tests/test_norm.cc     (original)
+++ trunk/getfem/tests/test_norm.cc     (removed)
@@ -1,114 +0,0 @@
-/*===========================================================================
- 
- Copyright (C) 2007-2012 Yves Renard, Julien Pommier.
- 
- 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_assembling.h" /* import assembly methods (and comp. of 
norms) */
-#include "getfem/getfem_assembling.h" /* import assembly methods (and comp. of 
norms) */
-#include "getfem/getfem_regular_meshes.h"
-#include "getfem/getfem_norm.h"
-using std::endl; using std::cout; using std::cerr;
-using std::ends; using std::cin;
-
-/* some Getfem++ types that we will be using */
-using bgeot::base_small_vector; /* special class for small(dim < 16) vectors */
-using bgeot::base_node; /* geometrical nodes (derived from base_small_vector)*/
-using bgeot::scalar_type; /* = double */
-using bgeot::size_type;   /* = unsigned long */
-
-scalar_type interp_fun(base_node x) {
-  scalar_type res = 0.;
-  for (size_type i=0; i < x.size(); ++i) {
-    res += sin(3*x[i]*scalar_type(i+1))+cos(3*x[i]/scalar_type(i+1));
-  }
-  return res;
-}
-
-void test_norm(bgeot::pgeometric_trans pgt, 
-              getfem::pfem pf, 
-              getfem::pintegration_method im, bool noised) {
-  getfem::mesh mesh1, mesh2;
-  std::vector<size_type> nsubdiv(pgt->dim());
-  std::fill(nsubdiv.begin(),nsubdiv.end(),13);
-  getfem::regular_unit_mesh(mesh1, nsubdiv, pgt, noised);
-  std::fill(nsubdiv.begin(),nsubdiv.end(),5);
-  getfem::regular_unit_mesh(mesh2, nsubdiv, pgt, noised);
-  getfem::mesh_im mim1(mesh1), mim2(mesh2);
-  getfem::mesh_fem mf1(mesh1), mf2(mesh2);
-  mim1.set_integration_method(mesh1.convex_index(), im);
-  mim2.set_integration_method(mesh2.convex_index(), im);  
-  mf1.set_finite_element(mesh1.convex_index(), pf);
-  mf2.set_finite_element(mesh2.convex_index(), pf);
-  std::vector<scalar_type> U1(mf1.nb_basic_dof()), U2(mf2.nb_basic_dof());
-  getfem::mesh_trans_inv gti(mf1.linked_mesh());
-  for (size_type d=0; d < mf1.nb_basic_dof(); ++d) {
-    U1[d] = interp_fun(mf1.point_of_basic_dof(d));
-    gti.add_point(mf1.point_of_basic_dof(d));
-  }
-  for (size_type d=0; d < mf2.nb_basic_dof(); ++d)
-    U2[d] = interp_fun(mf2.point_of_basic_dof(d));
-
-  std::vector<scalar_type> V1(mf1.nb_dof());
-  getfem::interpolation(mf1,gti,U1,V1);
-  scalar_type iterr = gmm::vect_dist2(U1,V1);
-  cout << "interpol error: " << iterr << "\n";
-  assert(iterr < 1e-10);
-  /*
-  cout << "interpol.."; cout.flush();
-  double t0;
-  t0 = ftool::uclock_sec();
-  getfem::interpolation(mf1,mf2,U1,U2);
-  cout << ftool::uclock_sec() - t0 << " sec -- " << gmm::vect_norm2(U1) << " " 
<< gmm::vect_norm2(U2) << "\n";
-  */
-  scalar_type U1_l2 = getfem::asm_L2_norm(mim1, mf1, U1);
-  scalar_type U1_h1 = getfem::asm_H1_norm(mim1, mf1, U1);
-  cout << "|U1|_l2=" << U1_l2 << "|U1|_h1=" << U1_h1 << "\n";
-  scalar_type U2_l2 = getfem::asm_L2_norm(mim2, mf2, U2);
-  scalar_type U2_h1 = getfem::asm_H1_norm(mim2, mf2, U2);
-  cout << "|U2|_l2=" << U2_l2 << "|U2|_h1=" << U2_h1 << "\n";
-
-  scalar_type d_l2, d_h1;
-  getfem::solutions_distance(mf2,U2,mf1,U1,im, &d_l2, &d_h1);
-  d_h1 = sqrt(gmm::sqr(d_l2) + gmm::sqr(d_h1));
-  cout << "distance_l2 = " << d_l2 << ", distance_h1 = " 
-       << d_h1 << "\n";
-  getfem::solutions_distance(mf1,U1,mf2,U2,im, &d_l2, &d_h1);
-  d_h1 = sqrt(gmm::sqr(d_l2) + gmm::sqr(d_h1));
-  cout << "distance_l2 = " << d_l2 << ", distance_h1 = " 
-       << d_h1 << "\n";
-  std::fill(U2.begin(), U2.end(),0.);
-  scalar_type d2_l2, d2_h1;
-  getfem::solutions_distance(mf1,U1,mf2,U2,im, &d2_l2, &d2_h1);  
-  d2_h1 = sqrt(gmm::sqr(d2_l2) + gmm::sqr(d2_h1));
-  cout << "norm_l2 = " << d2_l2 << "(diff=" << d2_l2 - U1_l2 
-       << "), norm_h1 = " << d2_h1 << " (diff=" << d2_h1 - U1_h1 << ")\n";
-  assert(gmm::abs(d2_l2 - U1_l2) < 1e-5);
-  assert(gmm::abs(d2_h1 - U1_h1) < 1e-5);
-}
-
-int main(int /*argc*/, char **/*argv*/) {
-
-  test_norm(bgeot::geometric_trans_descriptor("GT_PK(2,1)"),
-           getfem::fem_descriptor("FEM_PK(2,2)"),
-           getfem::int_method_descriptor("IM_TRIANGLE(3)"),false);
-  /*test_norm(bgeot::geometric_trans_descriptor("GT_PK(3,1)"),
-    getfem::fem_descriptor("FEM_PK(3,1)"),
-    getfem::int_method_descriptor("IM_TETRAHEDRON(1)"),false);*/
-  
-  return 0; 
-}

Removed: trunk/getfem/tests/test_norm.pl
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/tests/test_norm.pl?rev=4964&view=auto
==============================================================================
--- trunk/getfem/tests/test_norm.pl     (original)
+++ trunk/getfem/tests/test_norm.pl     (removed)
@@ -1,32 +0,0 @@
-# Copyright (C) 2001-2012 Yves Renard
-#
-# 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_norm -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]