for (size_type i = 0; i < n_elements; ++i)
{
- const size_type row = indices[i];
- const TrilinosWrappers::types::int_type local_row = vector->Map().LID(
- static_cast<TrilinosWrappers::types::int_type>(row));
+ const TrilinosWrappers::types::int_type row = indices[i];
+ const TrilinosWrappers::types::int_type local_row =
+ vector->Map().LID(row);
if (local_row != -1)
(*vector)[0][local_row] = values[i];
else
{
- const int ierr = vector->ReplaceGlobalValues(
- 1,
- reinterpret_cast<const TrilinosWrappers::types::int_type *>(
- &row),
- &values[i]);
+ const int ierr = vector->ReplaceGlobalValues(1, &row, &values[i]);
AssertThrow(ierr == 0, ExcTrilinosError(ierr));
compressed = false;
}
TrilinosWrappers::types::int_type *col_index_ptr;
TrilinosScalar * col_value_ptr;
+ TrilinosWrappers::types::int_type trilinos_row = row;
TrilinosWrappers::types::int_type n_columns;
boost::container::small_vector<TrilinosScalar, 200> local_value_array(
if (matrix->Filled() == false)
{
- ierr = matrix->InsertGlobalValues(
- 1,
- reinterpret_cast<TrilinosWrappers::types::int_type *>(
- const_cast<size_type *>(&row)),
- n_columns,
- col_index_ptr,
- &col_value_ptr,
- Epetra_FECrsMatrix::ROW_MAJOR);
+ ierr = matrix->InsertGlobalValues(1,
+ &trilinos_row,
+ n_columns,
+ col_index_ptr,
+ &col_value_ptr,
+ Epetra_FECrsMatrix::ROW_MAJOR);
if (ierr > 0)
ierr = 0;
}
else
- ierr = matrix->ReplaceGlobalValues(
- 1,
- reinterpret_cast<TrilinosWrappers::types::int_type *>(
- const_cast<size_type *>(&row)),
- n_columns,
- col_index_ptr,
- &col_value_ptr,
- Epetra_FECrsMatrix::ROW_MAJOR);
+ ierr = matrix->ReplaceGlobalValues(1,
+ &trilinos_row,
+ n_columns,
+ col_index_ptr,
+ &col_value_ptr,
+ Epetra_FECrsMatrix::ROW_MAJOR);
// use the FECrsMatrix facilities for set even in the case when we
// have explicitly set the off-processor rows because that only works
// properly when adding elements, not when setting them (since we want
TrilinosWrappers::types::int_type *col_index_ptr;
TrilinosScalar * col_value_ptr;
+ TrilinosWrappers::types::int_type trilinos_row = row;
TrilinosWrappers::types::int_type n_columns;
boost::container::small_vector<TrilinosScalar, 100> local_value_array(
// a time).
compressed = false;
- ierr = matrix->SumIntoGlobalValues(
- 1,
- reinterpret_cast<TrilinosWrappers::types::int_type *>(
- const_cast<size_type *>(&row)),
- n_columns,
- col_index_ptr,
- &col_value_ptr,
- Epetra_FECrsMatrix::ROW_MAJOR);
+ ierr = matrix->SumIntoGlobalValues(1,
+ &trilinos_row,
+ n_columns,
+ col_index_ptr,
+ &col_value_ptr,
+ Epetra_FECrsMatrix::ROW_MAJOR);
AssertThrow(ierr == 0, ExcTrilinosError(ierr));
}
++p;
}
}
- graph->InsertGlobalIndices(
- 1,
- reinterpret_cast<TrilinosWrappers::types::int_type *>(&row),
- row_length,
- row_indices.data());
+ const TrilinosWrappers::types::int_type trilinos_row = row;
+ graph->InsertGlobalIndices(1,
+ &trilinos_row,
+ row_length,
+ row_indices.data());
}
// TODO A dynamic_cast fails here, this is suspicious.
nonlocal_graph->IndicesAreGlobal() == true,
ExcInternalError());
- // TODO A dynamic_cast fails here, this is suspicious.
- const auto &range_map =
- static_cast<const Epetra_Map &>(graph->RangeMap());
- nonlocal_graph->FillComplete(*column_space_map, range_map);
+ nonlocal_graph->FillComplete(*column_space_map, graph->RangeMap());
nonlocal_graph->OptimizeStorage();
Epetra_Export exporter(nonlocal_graph->RowMap(), graph->RowMap());
ierr = graph->Export(*nonlocal_graph, exporter, Add);
AssertThrow(ierr == 0, ExcTrilinosError(ierr));
- ierr = graph->FillComplete(*column_space_map, range_map);
+ ierr = graph->FillComplete(*column_space_map, graph->RangeMap());
AssertThrow(ierr == 0, ExcTrilinosError(ierr));
}
else