]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add an assertion.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Mar 2013 13:03:14 +0000 (13:03 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Mar 2013 13:03:14 +0000 (13:03 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29068 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h

index 76b6a32d0f13b0d5f16af6d80872c5a6b950bd59..fd4079e289bde05f44ef45dbe0469b2e7c88abef 100644 (file)
@@ -1647,6 +1647,18 @@ namespace TrilinosWrappers
     if (begin == end)
       return;
 
+    // verify that the size of the data type Trilinos expects matches that the
+    // iterator points to. we allow for some slippage between signed and
+    // unsigned and only compare that they are both eiter 32 or 64 bit. to
+    // write this test properly, not that we cannot compare the size of
+    // '*begin' because 'begin' may be an iterator and '*begin' may be an
+    // accessor class. consequently, we need to somehow get an actual value
+    // from it which we can by evaluating an expression such as when
+    // multiplying the value produced by 2
+    Assert (sizeof(TrilinosWrappers::types::int_type) ==
+           sizeof((*begin)*2),
+           ExcNotImplemented());
+
     TrilinosWrappers::types::int_type *col_index_ptr =
       (TrilinosWrappers::types::int_type *)(&*begin);
     const int n_cols = static_cast<int>(end - begin);

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.