]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fixes for trilinos 11. EPetra now supports long and int which causes ambiguous calls...
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 22 Oct 2012 21:05:40 +0000 (21:05 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 22 Oct 2012 21:05:40 +0000 (21:05 +0000)
git-svn-id: https://svn.dealii.org/trunk@27170 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/trilinos_sparse_matrix.h
deal.II/include/deal.II/lac/trilinos_vector_base.h
deal.II/source/base/index_set.cc
deal.II/source/lac/trilinos_block_sparse_matrix.cc
deal.II/source/lac/trilinos_precondition.cc
deal.II/source/lac/trilinos_sparse_matrix.cc
deal.II/source/lac/trilinos_sparsity_pattern.cc
deal.II/source/lac/trilinos_vector.cc
deal.II/source/lac/trilinos_vector_base.cc

index beb6b1515e40d43bc2ff23e2a27f5293262e7d5d..dad014f8ac5c3303b285d51b1a23eb7d7db3c26b 100644 (file)
@@ -2775,7 +2775,7 @@ namespace TrilinosWrappers
                                    // add the possibility to insert new values,
                                    // and in the second we just replace
                                    // data.
-    if (row_partitioner().MyGID(row) == true)
+    if (row_partitioner().MyGID(static_cast<int>(row)) == true)
       {
         if (matrix->Filled() == false)
           {
@@ -2992,7 +2992,7 @@ namespace TrilinosWrappers
                                    // can directly call the Epetra_CrsMatrix
                                    // input function, which is much faster
                                    // than the Epetra_FECrsMatrix function.
-    if (row_partitioner().MyGID(row) == true)
+    if (row_partitioner().MyGID(static_cast<int>(row)) == true)
       {
         ierr = matrix->Epetra_CrsMatrix::SumIntoGlobalValues(row, n_columns,
                                          const_cast<double*>(col_value_ptr),
@@ -3031,7 +3031,7 @@ namespace TrilinosWrappers
         std::cout << std::endl << std::endl;
         std::cout << "Matrix row has the following indices:" << std::endl;
         int n_indices, *indices;
-        trilinos_sparsity_pattern().ExtractMyRowView(row_partitioner().LID(row),
+        trilinos_sparsity_pattern().ExtractMyRowView(row_partitioner().LID(static_cast<int>(row)),
                                                      n_indices,
                                                      indices);
         for (int i=0; i<n_indices; ++i)
index f7e1450221c75fb50f5ce04281037777a639ddc7..f3a7bee54a113f25139187fa6333e727ca445e4c 100644 (file)
@@ -1361,7 +1361,7 @@ namespace TrilinosWrappers
     for (unsigned int i=0; i<n_elements; ++i)
       {
         const unsigned int row = indices[i];
-        const int local_row = vector->Map().LID(indices[i]);
+        const int local_row = vector->Map().LID(static_cast<int>(row));
         if (local_row == -1)
           {
             const int ierr = vector->ReplaceGlobalValues (1,
@@ -1429,7 +1429,7 @@ namespace TrilinosWrappers
     for (unsigned int i=0; i<n_elements; ++i)
       {
         const unsigned int row = indices[i];
-        const int local_row = vector->Map().LID(row);
+        const int local_row = vector->Map().LID(static_cast<int>(row));
         if (local_row == -1)
           {
             const int ierr = vector->SumIntoGlobalValues (1,
index 3e51051a27039e55ad0ad50d1cead2f6ee5ba789..cc40d2b0c91a4685e9fe4455a7e673da618a12d8 100644 (file)
@@ -381,8 +381,8 @@ IndexSet::make_trilinos_map (const MPI_Comm &communicator,
   compress ();
 
   if ((is_contiguous() == true) && (!overlapping))
-    return Epetra_Map (size(),
-                       n_elements(),
+    return Epetra_Map (static_cast<int>(size()),
+                       static_cast<int>(n_elements()),
                        0,
 #ifdef DEAL_II_COMPILER_SUPPORTS_MPI
                        Epetra_MpiComm(communicator));
@@ -395,7 +395,7 @@ IndexSet::make_trilinos_map (const MPI_Comm &communicator,
       fill_index_vector(indices);
 
       return Epetra_Map (-1,
-                         n_elements(),
+                         static_cast<int>(n_elements()),
                          (n_elements() > 0
                           ?
                           reinterpret_cast<int*>(&indices[0])
index e6452b6b8f599a3b1ee81e615bc56fede7ae6bfd..6908edc845340588bdc99f16fa61a9bdd6e297bb 100644 (file)
@@ -148,7 +148,7 @@ namespace TrilinosWrappers
     std::vector<Epetra_Map> parallel_partitioning;
     for (unsigned int i=0; i<block_sparsity_pattern.n_block_rows(); ++i)
       parallel_partitioning.push_back
-        (Epetra_Map(block_sparsity_pattern.block(i,0).n_rows(),
+        (Epetra_Map(static_cast<int>(block_sparsity_pattern.block(i,0).n_rows()),
                     0,
                     Utilities::Trilinos::comm_self()));
 
@@ -240,7 +240,7 @@ namespace TrilinosWrappers
 
     std::vector<Epetra_Map> parallel_partitioning;
     for (unsigned int i=0; i<dealii_block_sparse_matrix.n_block_rows(); ++i)
-      parallel_partitioning.push_back (Epetra_Map(dealii_block_sparse_matrix.block(i,0).m(),
+      parallel_partitioning.push_back (Epetra_Map(static_cast<int>(dealii_block_sparse_matrix.block(i,0).m()),
                                        0,
                                        trilinos_communicator));
 
index 0f53f7bc00a0ea2a131e2d385a97298d11b3605d..d7ac5d46129c434f4011658b30f8eedb9b65ff3e 100644 (file)
@@ -662,7 +662,7 @@ namespace TrilinosWrappers
                                         // equidistributed map; avoid
                                         // storing the nonzero
                                         // elements.
-    vector_distributor.reset (new Epetra_Map(n_rows, 0, communicator));
+    vector_distributor.reset (new Epetra_Map(static_cast<int>(n_rows), 0, communicator));
 
     if (trilinos_matrix.get() == 0)
       trilinos_matrix.reset (new SparseMatrix());
index 2534911edc1ad5ee8ff7a502c9315c4d6b3b399c..449562d108abd54bc93bd4704c0aa315aa226c11 100644 (file)
@@ -169,7 +169,7 @@ namespace TrilinosWrappers
                               const unsigned int n,
                               const unsigned int n_max_entries_per_row)
                   :
-                  column_space_map (new Epetra_Map (n, 0,
+                  column_space_map (new Epetra_Map (static_cast<int>(n), 0,
                                                     Utilities::Trilinos::comm_self())),
 
                                    // on one processor only, we know how the
@@ -181,7 +181,7 @@ namespace TrilinosWrappers
                                    // information from columns is only
                                    // available when entries have been added
                   matrix (new Epetra_FECrsMatrix(Copy,
-                                                 Epetra_Map (m, 0,
+                                                 Epetra_Map (static_cast<int>(m), 0,
                                                              Utilities::Trilinos::comm_self()),
                                                  *column_space_map,
                                                  n_max_entries_per_row,
@@ -196,10 +196,10 @@ namespace TrilinosWrappers
                               const unsigned int               n,
                               const std::vector<unsigned int> &n_entries_per_row)
                   :
-                  column_space_map (new Epetra_Map (n, 0,
+                  column_space_map (new Epetra_Map (static_cast<int>(n), 0,
                                                     Utilities::Trilinos::comm_self())),
                   matrix (new Epetra_FECrsMatrix(Copy,
-                                                 Epetra_Map (m, 0,
+                                                 Epetra_Map (static_cast<int>(m), 0,
                                                              Utilities::Trilinos::comm_self()),
                                                  *column_space_map,
                            (int*)const_cast<unsigned int*>(&(n_entries_per_row[0])),
@@ -339,10 +339,10 @@ namespace TrilinosWrappers
   void
   SparseMatrix::reinit (const SparsityType &sparsity_pattern)
   {
-    const Epetra_Map rows (sparsity_pattern.n_rows(),
+    const Epetra_Map rows (static_cast<int>(sparsity_pattern.n_rows()),
                            0,
                            Utilities::Trilinos::comm_self());
-    const Epetra_Map columns (sparsity_pattern.n_cols(),
+    const Epetra_Map columns (static_cast<int>(sparsity_pattern.n_cols()),
                               0,
                               Utilities::Trilinos::comm_self());
 
@@ -527,10 +527,10 @@ namespace TrilinosWrappers
                         const bool                            copy_values,
                         const ::dealii::SparsityPattern      *use_this_sparsity)
   {
-    const Epetra_Map rows (dealii_sparse_matrix.m(),
+    const Epetra_Map rows (static_cast<int>(dealii_sparse_matrix.m()),
                            0,
                            Utilities::Trilinos::comm_self());
-    const Epetra_Map columns (dealii_sparse_matrix.n(),
+    const Epetra_Map columns (static_cast<int>(dealii_sparse_matrix.n()),
                               0,
                               Utilities::Trilinos::comm_self());
     reinit (rows, columns, dealii_sparse_matrix, drop_tolerance,
@@ -621,7 +621,7 @@ namespace TrilinosWrappers
     std::size_t in_index, index;
 
     for (unsigned int row=0; row<n_rows; ++row)
-      if (input_row_map.MyGID(row))
+      if (input_row_map.MyGID(static_cast<int>(row)))
         {
           index = rowstart_indices[row];
           in_index = in_rowstart_indices[row];
@@ -718,7 +718,7 @@ namespace TrilinosWrappers
 
                                   // Only do this on the rows owned
                                   // locally on this processor.
-    int local_row = matrix->LRID(row);
+    int local_row = matrix->LRID(static_cast<int>(row));
     if (local_row >= 0)
       {
         TrilinosScalar *values;
@@ -770,7 +770,7 @@ namespace TrilinosWrappers
   {
                                       // Extract local indices in
                                       // the matrix.
-    int trilinos_i = matrix->LRID(i), trilinos_j = matrix->LCID(j);
+    int trilinos_i = matrix->LRID(static_cast<int>(i)), trilinos_j = matrix->LCID(static_cast<int>(j));
     TrilinosScalar value = 0.;
 
                                       // If the data is not on the
@@ -844,7 +844,7 @@ namespace TrilinosWrappers
   {
                                       // Extract local indices in
                                       // the matrix.
-    int trilinos_i = matrix->LRID(i), trilinos_j = matrix->LCID(j);
+    int trilinos_i = matrix->LRID(static_cast<int>(i)), trilinos_j = matrix->LCID(static_cast<int>(j));
     TrilinosScalar value = 0.;
 
                                       // If the data is not on the
@@ -936,7 +936,7 @@ namespace TrilinosWrappers
                                   // get a representation of the
                                   // present row
     int ncols = -1;
-    int local_row = matrix->LRID(row);
+    int local_row = matrix->LRID(static_cast<int>(row));
 
                                   // on the processor who owns this
                                   // row, we'll have a non-negative
@@ -1210,7 +1210,7 @@ namespace TrilinosWrappers
                   ExcDimensionMismatch(matrix->NumGlobalEntries(row),
                                        rhs.matrix->NumGlobalEntries(row)));
 
-          const int row_local = matrix->RowMap().LID(row);
+          const int row_local = matrix->RowMap().LID(static_cast<int>(row));
           int n_entries, rhs_n_entries;
           TrilinosScalar *value_ptr, *rhs_value_ptr;
 
@@ -1272,7 +1272,7 @@ namespace TrilinosWrappers
           for (unsigned int row=local_range.first;
                row < local_range.second; ++row)
             {
-              const int row_local = matrix->RowMap().LID(row);
+              const int row_local = matrix->RowMap().LID(static_cast<int>(row));
               int n_entries;
 
               ierr = rhs.matrix->ExtractMyRowCopy (row_local, max_row_length,
index 22e6117fed4b2c7c2b10474fe950e02950ea946d..60a144b79b106638837fb08ea6f1e1f263804570 100644 (file)
@@ -177,8 +177,8 @@ namespace TrilinosWrappers
                            const unsigned int  n,
                            const unsigned int  n_entries_per_row)
   {
-    const Epetra_Map rows (m, 0, Utilities::Trilinos::comm_self());
-    const Epetra_Map columns (n, 0, Utilities::Trilinos::comm_self());
+    const Epetra_Map rows (static_cast<int>(m), 0, Utilities::Trilinos::comm_self());
+    const Epetra_Map columns (static_cast<int>(n), 0, Utilities::Trilinos::comm_self());
 
     reinit (rows, columns, n_entries_per_row);
   }
@@ -227,8 +227,8 @@ namespace TrilinosWrappers
                            const unsigned int  n,
                            const std::vector<unsigned int> &n_entries_per_row)
   {
-    const Epetra_Map rows (m, 0, Utilities::Trilinos::comm_self());
-    const Epetra_Map columns (n, 0, Utilities::Trilinos::comm_self());
+    const Epetra_Map rows (static_cast<int>(m), 0, Utilities::Trilinos::comm_self());
+    const Epetra_Map columns (static_cast<int>(n), 0, Utilities::Trilinos::comm_self());
 
     reinit (rows, columns, n_entries_per_row);
   }
@@ -368,8 +368,8 @@ namespace TrilinosWrappers
   void
   SparsityPattern::copy_from (const SparsityType &sp)
   {
-    const Epetra_Map rows (sp.n_rows(), 0, Utilities::Trilinos::comm_self());
-    const Epetra_Map columns (sp.n_cols(), 0, Utilities::Trilinos::comm_self());
+    const Epetra_Map rows (static_cast<int>(sp.n_rows()), 0, Utilities::Trilinos::comm_self());
+    const Epetra_Map columns (static_cast<int>(sp.n_cols()), 0, Utilities::Trilinos::comm_self());
 
     reinit (rows, columns, sp);
   }
@@ -417,7 +417,7 @@ namespace TrilinosWrappers
   {
                                       // Extract local indices in
                                       // the matrix.
-    int trilinos_i = graph->LRID(i), trilinos_j = graph->LCID(j);
+    int trilinos_i = graph->LRID(static_cast<int>(i)), trilinos_j = graph->LCID(static_cast<int>(j));
 
                                       // If the data is not on the
                                       // present processor, we throw
@@ -587,7 +587,7 @@ namespace TrilinosWrappers
                                   // get a representation of the
                                   // present row
     int ncols = -1;
-    int local_row = graph->LRID(row);
+    int local_row = graph->LRID(static_cast<int>(row));
 
                                   // on the processor who owns this
                                   // row, we'll have a non-negative
@@ -652,7 +652,7 @@ namespace TrilinosWrappers
                                          // j horizontal, gnuplot output is
                                          // x-y, that is we have to exchange
                                          // the order of output
-          out << indices[graph->GRID(j)] << " " << -static_cast<signed int>(row)
+          out << indices[graph->GRID(static_cast<int>(j))] << " " << -static_cast<signed int>(row)
               << std::endl;
       }
 
index 3d8f1a05ad38efebe1a822c0ecba54ca79d8f1af..2f4611cc6490100736822904ccaabdd39962cc56 100644 (file)
@@ -397,7 +397,7 @@ namespace TrilinosWrappers
                   const MPI_Comm &communicator)
   {
     last_action = Zero;
-    Epetra_LocalMap map (partitioning.size(),
+    Epetra_LocalMap map (static_cast<int>(partitioning.size()),
                          0,
 #ifdef DEAL_II_COMPILER_SUPPORTS_MPI
                          Epetra_MpiComm(communicator));
@@ -489,7 +489,7 @@ namespace TrilinosWrappers
     if (vector->Map().NumGlobalElements() !=
         static_cast<int>(partitioning.size()))
       {
-        Epetra_LocalMap map (partitioning.size(),
+        Epetra_LocalMap map (static_cast<int>(partitioning.size()),
                              0,
 #ifdef DEAL_II_COMPILER_SUPPORTS_MPI
                              Epetra_MpiComm(communicator));
index a90bb9e0ae05ff9f48e1b96fedc8b0fc0d6597b8..7e545c4f17ea7a5896c1260dc616e383e3a6df40 100644 (file)
@@ -40,7 +40,7 @@ namespace TrilinosWrappers
                                         // we can use []. Note that we
                                         // can only get local values.
 
-      const int local_index = vector.vector->Map().LID(index);
+      const int local_index = vector.vector->Map().LID(static_cast<int>(index));
       Assert (local_index >= 0,
               ExcAccessToNonLocalElement (index,
                                           vector.vector->Map().MinMyGID(),
@@ -167,7 +167,7 @@ namespace TrilinosWrappers
   {
                                         // Extract local indices in
                                         // the vector.
-    int trilinos_i = vector->Map().LID(index);
+    int trilinos_i = vector->Map().LID(static_cast<int>(index));
     TrilinosScalar value = 0.;
 
                                         // If the element is not
@@ -195,7 +195,7 @@ namespace TrilinosWrappers
   {
                                         // Extract local indices in
                                         // the vector.
-    int trilinos_i = vector->Map().LID(index);
+    int trilinos_i = vector->Map().LID(static_cast<int>(index));
     TrilinosScalar value = 0.;
 
                                         // If the element is not present

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.