From 56492d8f8b5988eeb08ebf733c4ce4d4a999f0de Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 27 Mar 2013 13:03:14 +0000 Subject: [PATCH] Add an assertion. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29068 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/deal.II/lac/trilinos_sparsity_pattern.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h b/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h index 76b6a32d0f..fd4079e289 100644 --- a/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h +++ b/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h @@ -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(end - begin); -- 2.39.5