]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Update several tests.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 23 Oct 2008 03:10:32 +0000 (03:10 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 23 Oct 2008 03:10:32 +0000 (03:10 +0000)
git-svn-id: https://svn.dealii.org/trunk@17310 0785d39b-7218-0410-832d-ea1e28bc413d

21 files changed:
tests/trilinos/08.cc
tests/trilinos/18.cc
tests/trilinos/25.cc
tests/trilinos/26.cc
tests/trilinos/27.cc
tests/trilinos/28.cc
tests/trilinos/31.cc
tests/trilinos/32.cc
tests/trilinos/33.cc
tests/trilinos/48.cc
tests/trilinos/49.cc
tests/trilinos/50.cc
tests/trilinos/51.cc
tests/trilinos/61.cc
tests/trilinos/70.cc
tests/trilinos/full_matrix_08.cc
tests/trilinos/full_matrix_vector_05.cc
tests/trilinos/full_matrix_vector_06.cc
tests/trilinos/sparse_matrix_vector_05.cc
tests/trilinos/sparse_matrix_vector_06.cc
tests/trilinos/vector_assign_02.cc

index cca957f515fd253e4fe1c4444c34ceedbe5eda85..9df997d40d83667b2012567a70695b3d4ac80e3a 100644 (file)
@@ -24,7 +24,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
 {
                                    // first set a few entries. count how many
                                    // entries we have
-  PetscScalar norm = 0;
+  TrilinosScalar norm = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
index 7d493bb1109de7c58ff8ed17dfe8086a9734487a..e28164c4e44fdba3d5a64a67d5298739f4fc1328 100644 (file)
@@ -24,7 +24,7 @@
 void test (TrilinosWrappers::Vector &v)
 {
                                    // set some elements of the vector
-  PetscScalar norm = 0;
+  TrilinosScalar norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
       v(i) = i;
@@ -33,7 +33,7 @@ void test (TrilinosWrappers::Vector &v)
   v.compress ();
 
                                    // then check the norm
-  const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
+  const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (fabs(v.l2_norm()-std::sqrt(norm))<eps, ExcInternalError());
 
   deallog << "OK" << std::endl;
index 619e449181e053acce285e7b1d1984889bc6a77d..0825cc5be7d9f690d3c22a575f0fe35f8ac4e357 100644 (file)
@@ -12,7 +12,7 @@
 //----------------------------  trilinos_25.cc  ---------------------------
 
 
-// check TrilinosWrappers::Vector::operator = (PetscScalar) with setting to zero
+// check TrilinosWrappers::Vector::operator = (TrilinosScalar) with setting to zero
 
 #include "../tests.h"
 #include <lac/trilinos_vector.h>    
index 746618f1e0425863fa96edd7b14ec6bdb2f0fb7a..3c5fbe528101682b20ddb95df9a22bd2fd941995 100644 (file)
@@ -12,7 +12,7 @@
 //----------------------------  trilinos_26.cc  ---------------------------
 
 
-// check TrilinosWrappers::Vector::operator = (PetscScalar) with setting to a
+// check TrilinosWrappers::Vector::operator = (TrilinosScalar) with setting to a
 // nonzero value
 
 #include "../tests.h"
index a61cb30be1df21062c1722172c154cd17b7d90b7..f7e2b99fd0db299d2aee2671e54a6ee40ce2d788 100644 (file)
@@ -36,7 +36,7 @@ void test (TrilinosWrappers::Vector &v)
                                    // make sure they're equal
   deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
           << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
-  const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
+  const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < eps*(v*w),
           ExcInternalError());
 
index 207305a7f368ca1b1b1b9a096ef6dc14387ad0a6..fb2edc2df33256a30c0597b206c76a8ccce057cc 100644 (file)
@@ -38,7 +38,7 @@ void test (TrilinosWrappers::Vector &v)
                                    // make sure they're equal
   deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
           << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
-  const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
+  const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < eps*(v*w),
           ExcInternalError());
 
index 3003e8a74b9060fd56ee9fc9c759733b84fbd39b..f3740039cb52cf28176968f8a830d5b3732229ee 100644 (file)
@@ -24,7 +24,7 @@
 void test (TrilinosWrappers::Vector &v)
 {
                                    // set some elements of the vector
-  PetscScalar norm = 0;
+  TrilinosScalar norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
       v(i) = i;
@@ -33,7 +33,7 @@ void test (TrilinosWrappers::Vector &v)
   v.compress ();
 
                                    // then check the norm
-  const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
+  const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v.norm_sqr() - norm) < eps*norm,
           ExcInternalError());
 
index d404ff4cf8923d4f0502793d4ceeefa362e60892..2128fd5f82e61d95b713dc83b4bb53574b99464c 100644 (file)
@@ -24,7 +24,7 @@
 void test (TrilinosWrappers::Vector &v)
 {
                                    // set some elements of the vector
-  PetscScalar sum = 0;
+  TrilinosScalar sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
       v(i) = i;
@@ -33,7 +33,7 @@ void test (TrilinosWrappers::Vector &v)
   v.compress ();
 
                                    // then check the norm
-  const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
+  const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v.mean_value() - sum/v.size()) < eps*sum/v.size(),
           ExcInternalError());
 
index 2dce462b44ad697be25455f261cc61f635152026..732f43b8784c57d6a3f72f585d8cba7ff77a12ad 100644 (file)
@@ -24,7 +24,7 @@
 void test (TrilinosWrappers::Vector &v)
 {
                                    // set some elements of the vector
-  PetscScalar sum = 0;
+  TrilinosScalar sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
       v(i) = i;
@@ -33,8 +33,8 @@ void test (TrilinosWrappers::Vector &v)
   v.compress ();
 
                                    // then check the norm
-  const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
-  const double true_value=std::pow(sum, static_cast<PetscScalar> (1./3.));
+  const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
+  const double true_value=std::pow(sum, static_cast<TrilinosScalar> (1./3.));
   Assert (std::fabs(v.lp_norm(3) - true_value) < eps*true_value,
           ExcInternalError());
 
index 6dc840d9fe34a504fb6a4a212efa4bf4024fde14..1c854d98fbb2596cecc2ecf7f8d01889981ddef5 100644 (file)
@@ -39,7 +39,7 @@ void test (TrilinosWrappers::Vector &v,
   v.ratio (w, x);
 
                                    // make sure we get the expected result
-  const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
+  const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
index fbaf8839fd1487b7c2695c71112c6bdbe2afc50f..16043371fe87a21f69849cf04f42a63d31c96f62 100644 (file)
@@ -24,7 +24,7 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-  Vector<PetscScalar> w (v.size());
+  Vector<TrilinosScalar> w (v.size());
 
   for (unsigned int i=0; i<w.size(); ++i)
     w(i) = i;
index dad97fa2488e04eca48bd252661fd7bd09ce88a7..660613ba473789140b05ba52a3ea8de65ee5f09d 100644 (file)
@@ -12,7 +12,7 @@
 //----------------------------  trilinos_50.cc  ---------------------------
 
 
-// check TrilinosWrappers::operator = (Vector<T>) with T!=PetscScalar
+// check TrilinosWrappers::operator = (Vector<T>) with T!=TrilinosScalar
 
 #include "../tests.h"
 #include <lac/trilinos_vector.h>
@@ -38,7 +38,7 @@ void test (TrilinosWrappers::Vector &v)
                                    // and do the same. in at least one of the
                                    // two cases, the template argument to
                                    // Vector<T> must be different from
-                                   // PetscScalar
+                                   // TrilinosScalar
   v = w;
   for (unsigned int i=0; i<v.size(); ++i)
     {
index 39e64e9ebc91818d30625919979537a057fec650..f04271f485862d5047b5cab673ea89223fc4f74b 100644 (file)
@@ -36,7 +36,7 @@ void test (TrilinosWrappers::Vector &v)
                                    // make sure they're equal
   deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
           << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
-  const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
+  const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < eps*(v*w),
           ExcInternalError());
 
index 19a058e3a77b68df51ac5e9882f3f76997fba0bd..576ee46117e27e848bcd4296bf7e5bedbc5daef6 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2004, 2005 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2008 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -36,11 +36,11 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-  Vector<double> w; w=v;
-  Vector<float>  x; x=v;
+  Vector<double> w(v.size()); w=v;
+  Vector<float>  x(v.size()); x=v;
 
-  TrilinosWrappers::Vector w1; w1=w;
-  TrilinosWrappers::Vector x1; x1=x;
+  TrilinosWrappers::Vector w1(v.size()); w1=w;
+  TrilinosWrappers::Vector x1(v.size()); x1=x;
   
   for (unsigned int i=0; i<v.size(); ++i)
     {
index 8536246ac1bb02389705c2346978747a666166e5..c2ce5fba8727fed3443e95aa79cf3ffdc98be077 100644 (file)
@@ -12,7 +12,7 @@
 //----------------------------  trilinos_70.cc  ---------------------------
 
 
-// check PetscScalar
+// check TrilinosScalar
 
 #include "../tests.h"
 #include <base/logstream.h>
@@ -27,9 +27,9 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  if (typeid(PetscScalar)==typeid(double))
+  if (typeid(TrilinosScalar)==typeid(double))
     deallog << "double" << std::endl;
-  else if (typeid(PetscScalar)==typeid(float))
+  else if (typeid(TrilinosScalar)==typeid(float))
     deallog << "float" << std::endl;
   else
     Assert(false, ExcNotImplemented());
index 586c1650f4e9a5d9ecede0b0826f48a312c7daa6..2c14a8b95c9ecb1913864bb54bea2dccf68ab3fd 100644 (file)
@@ -24,7 +24,7 @@ void test (TrilinosWrappers::FullMatrix &m)
 {
                                    // first set a few entries. count how many
                                    // entries we have
-  PetscScalar norm = 0;
+  TrilinosScalar norm = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
index 9ebf850f09388f0b5ed0bafc70f13e4ff59e209a..f3e9ba38ed414af50a5097c5ac04822e74d86028 100644 (file)
@@ -41,7 +41,7 @@ void test (TrilinosWrappers::Vector &v,
   w.compress ();
 
                                    // <w,Mv>
-  const PetscScalar s = m.matrix_scalar_product (w,v);
+  const TrilinosScalar s = m.matrix_scalar_product (w,v);
 
                                    // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
@@ -50,7 +50,7 @@ void test (TrilinosWrappers::Vector &v,
       Assert (w(i) == i+1, ExcInternalError());
     }
 
-  PetscScalar result = 0;
+  TrilinosScalar result = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       result += (i+2*j)*j*(i+1);
index a493342180aa672226c01ea71b1a87cec27adeb5..443ef8a74d4d7938c3f9350fa4f5f45bbb95c3c3 100644 (file)
@@ -36,13 +36,13 @@ void test (TrilinosWrappers::Vector &v)
   v.compress ();
 
                                    // <w,Mv>
-  const PetscScalar s = m.matrix_norm_square (v);
+  const TrilinosScalar s = m.matrix_norm_square (v);
 
                                    // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == i, ExcInternalError());
 
-  PetscScalar result = 0;
+  TrilinosScalar result = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       result += (i+2*j)*j*i;
index 73ed9050c3806fcf34e92321e627d70d622cfc85..e02e70e0768cc37aa8f649e2cbf28967d38062aa 100644 (file)
@@ -41,7 +41,7 @@ void test (TrilinosWrappers::Vector &v,
   w.compress ();
 
                                    // <w,Mv>
-  const PetscScalar s = m.matrix_scalar_product (w,v);
+  const TrilinosScalar s = m.matrix_scalar_product (w,v);
 
                                    // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
@@ -50,7 +50,7 @@ void test (TrilinosWrappers::Vector &v,
       Assert (w(i) == i+1, ExcInternalError());
     }
 
-  PetscScalar result = 0;
+  TrilinosScalar result = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       result += (i+2*j)*j*(i+1);
index cf224eb6555d037874d6b05cd783bf6557d1540d..978645b40646e87dfb4b7cf9dd281b5d7184c716 100644 (file)
@@ -36,13 +36,13 @@ void test (TrilinosWrappers::Vector &v)
   v.compress ();
 
                                    // <w,Mv>
-  const PetscScalar s = m.matrix_norm_square (v);
+  const TrilinosScalar s = m.matrix_norm_square (v);
 
                                    // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == i, ExcInternalError());
 
-  PetscScalar result = 0;
+  TrilinosScalar result = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       result += (i+2*j)*j*i;
index ed21e3fddff8524cc87a9f65a33eba8c6ea806f7..1f7d04bf442e4ccbd4d192d0c3324dd6c68d37ab 100644 (file)
@@ -15,7 +15,7 @@
 // this is equivalent to the trilinos_vector_assign_02 test, except that we use
 // operator+= instead of operator=. Now, this does not present a problem,
 // since the compiler does not automatically generate a version of this
-// operator, but simply performs the conversion to PetscScalar, i.e. the
+// operator, but simply performs the conversion to TrilinosScalar, i.e. the
 // argument to the user-defined operator+=. This is not exciting, but since I
 // wrote the test to make sure it works this way, let's keep it then...
 

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.