]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use correct Trilinos function to avoid an exception being thrown.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 26 Mar 2013 00:06:21 +0000 (00:06 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 26 Mar 2013 00:06:21 +0000 (00:06 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29032 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/lac/trilinos_vector.cc

index 807e73630ff9da4cef5dbae777825013b24003fd..be2e9666cb5a91038fc72592b79e1c28a4580e66 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2008, 2009, 2012 by the deal.II authors
+//    Copyright (C) 2008, 2009, 2012, 2013 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -234,7 +234,7 @@ namespace TrilinosWrappers
       std::vector<TrilinosWrappers::types::int_type> global_ids (n_elements, -1);
       for (size_type block=0; block<v.n_blocks(); ++block)
         {
-          TrilinosWrappers::types::int_type *glob_elements = 
+          TrilinosWrappers::types::int_type *glob_elements =
             v.block(block).vector_partitioner().MyGlobalElements64();
           for (size_type i=0; i<v.block(block).local_size(); ++i)
             global_ids[added_elements++] = glob_elements[i] + block_offset;
@@ -603,7 +603,14 @@ namespace TrilinosWrappers
   {
     if (size() != v.size())
       {
-        Epetra_LocalMap map (v.vector->Map().NumGlobalElements(),
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+       const int n_global_elements
+         = v.vector->Map().NumGlobalElements();
+#else
+       const long long int n_global_elements
+         = v.vector->Map().NumGlobalElements64();
+#endif
+        Epetra_LocalMap map (n_global_elements,
                              v.vector->Map().IndexBase(),
                              v.vector->Comm());
         vector.reset (new Epetra_FEVector(map));

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.