just take the second as hints but errors out if LAPACK can't
be used with the given library (if you are sure that the path works, you
can then omit the first command). An example of use is to select BLAS
- and LAPACK as follows:
+ and LAPACK as follows (here, these libraries have been compiled with the
+ gfortran compiler and need its support library):
<pre>
cmake -DBLAS_FOUND=true \
- -DBLAS_LIBRARIES=/apps/GotoBLAS/lib64/libgoto.so \
+ -DBLAS_LIBRARIES="-L/apps/GotoBLAS/lib64 -lgoto -lgfortran" \
-DLAPACK_FOUND=true \
- -DLAPACK_LIBRARIES=/apps/lapack-3.2.1/lib64/liblapack.so
+ -DLAPACK_LIBRARIES="-L/apps/lapack-3.2.1/lib64 -llapack -L/apps/GotoBLAS/lib64 -lgoto -lgfortran"
</pre>
You can set these values on the command line, with <code>ccmake</code>
}
-namespace TrilinosWrapper
+namespace TrilinosWrappers
{
namespace types
{
* Representation of the
* largest number that
* can be put into a
- * size_type. This value
- * is used throughout
- * the library as a
+ * size_type. This value
+ * is used throughout
+ * the library as a
* marker for an
* invalid size_type
* value, such as
//---------------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 2008, 2010, 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
public:
/**
* Declare the type for container size.
- */
- typedef types::global_dof_index size_type;
+ */
+ typedef dealii::types::global_dof_index size_type;
/**
* Standardized data struct to
void PreconditionBase::vmult (dealii::Vector<double> &dst,
const dealii::Vector<double> &src) const
{
- AssertDimension (static_cast<TrilinosWrapper::types::int_type>(dst.size()),
+ AssertDimension (static_cast<TrilinosWrappers::types::int_type>(dst.size()),
preconditioner->OperatorDomainMap().NumMyElements());
- AssertDimension (static_cast<TrilinosWrapper::types::int_type>(src.size()),
+ AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.size()),
preconditioner->OperatorRangeMap().NumMyElements());
Epetra_Vector tril_dst (View, preconditioner->OperatorDomainMap(),
dst.begin());
void PreconditionBase::Tvmult (dealii::Vector<double> &dst,
const dealii::Vector<double> &src) const
{
- AssertDimension (static_cast<TrilinosWrapper::types::int_type>(dst.size()),
+ AssertDimension (static_cast<TrilinosWrappers::types::int_type>(dst.size()),
preconditioner->OperatorDomainMap().NumMyElements());
- AssertDimension (static_cast<TrilinosWrapper::types::int_type>(src.size()),
+ AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.size()),
preconditioner->OperatorRangeMap().NumMyElements());
Epetra_Vector tril_dst (View, preconditioner->OperatorDomainMap(),
dst.begin());
PreconditionBase::vmult (parallel::distributed::Vector<double> &dst,
const parallel::distributed::Vector<double> &src) const
{
- AssertDimension (static_cast<TrilinosWrapper::types::int_type>(dst.local_size()),
+ AssertDimension (static_cast<TrilinosWrappers::types::int_type>(dst.local_size()),
preconditioner->OperatorDomainMap().NumMyElements());
- AssertDimension (static_cast<TrilinosWrapper::types::int_type>(src.local_size()),
+ AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.local_size()),
preconditioner->OperatorRangeMap().NumMyElements());
Epetra_Vector tril_dst (View, preconditioner->OperatorDomainMap(),
dst.begin());
PreconditionBase::Tvmult (parallel::distributed::Vector<double> &dst,
const parallel::distributed::Vector<double> &src) const
{
- AssertDimension (static_cast<TrilinosWrapper::types::int_type>(dst.local_size()),
+ AssertDimension (static_cast<TrilinosWrappers::types::int_type>(dst.local_size()),
preconditioner->OperatorDomainMap().NumMyElements());
- AssertDimension (static_cast<TrilinosWrapper::types::int_type>(src.local_size()),
+ AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.local_size()),
preconditioner->OperatorRangeMap().NumMyElements());
Epetra_Vector tril_dst (View, preconditioner->OperatorDomainMap(),
dst.begin());
//---------------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008, 2009, 2010, 2011, 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
/**
* Declare the type for container size.
*/
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
/**
* Constructor.
/**
* Declare type for container size.
*/
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
/**
* Typedef for the matrix type
/**
* Declare the type for container size.
*/
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
/**
* A structure that describes
bool
SparseMatrix::in_local_range (const size_type index) const
{
- TrilinosWrapper::types::int_type begin, end;
+ TrilinosWrappers::types::int_type begin, end;
begin = matrix->RowMap().MinMyGID();
end = matrix->RowMap().MaxMyGID()+1;
last_action = Insert;
- TrilinosWrapper::types::int_type *col_index_ptr;
+ TrilinosWrappers::types::int_type *col_index_ptr;
TrilinosScalar const *col_value_ptr;
- TrilinosWrapper::types::int_type n_columns;
+ TrilinosWrappers::types::int_type n_columns;
// If we don't elide zeros, the pointers
// are already available...
if (elide_zero_values == false)
{
- col_index_ptr = (TrilinosWrapper::types::int_type *)col_indices;
+ col_index_ptr = (TrilinosWrappers::types::int_type *)col_indices;
col_value_ptr = values;
n_columns = n_cols;
}
}
}
- Assert(n_columns <= (TrilinosWrapper::types::int_type)n_cols, ExcInternalError());
+ Assert(n_columns <= (TrilinosWrappers::types::int_type)n_cols, ExcInternalError());
- col_index_ptr = (TrilinosWrapper::types::int_type *)&column_indices[0];
+ col_index_ptr = (TrilinosWrappers::types::int_type *)&column_indices[0];
col_value_ptr = &column_values[0];
}
// add the possibility to insert new values,
// and in the second we just replace
// data.
- if (row_partitioner().MyGID(static_cast<TrilinosWrapper::types::int_type>(row)) == true)
+ if (row_partitioner().MyGID(static_cast<TrilinosWrappers::types::int_type>(row)) == true)
{
if (matrix->Filled() == false)
{
if (matrix->Filled() == false)
{
- ierr = matrix->InsertGlobalValues (1,
- (TrilinosWrapper::types::int_type *)&row,
+ ierr = matrix->InsertGlobalValues (1,
+ (TrilinosWrappers::types::int_type *)&row,
n_columns, col_index_ptr,
&col_value_ptr,
Epetra_FECrsMatrix::ROW_MAJOR);
ierr = 0;
}
else
- ierr = matrix->ReplaceGlobalValues (1,
- (TrilinosWrapper::types::int_type *)&row,
+ ierr = matrix->ReplaceGlobalValues (1,
+ (TrilinosWrappers::types::int_type *)&row,
n_columns, col_index_ptr,
&col_value_ptr,
Epetra_FECrsMatrix::ROW_MAJOR);
last_action = Add;
- TrilinosWrapper::types::int_type *col_index_ptr;
+ TrilinosWrappers::types::int_type *col_index_ptr;
TrilinosScalar const *col_value_ptr;
- TrilinosWrapper::types::int_type n_columns;
+ TrilinosWrappers::types::int_type n_columns;
// If we don't elide zeros, the pointers
// are already available...
if (elide_zero_values == false)
{
- col_index_ptr = (TrilinosWrapper::types::int_type *)col_indices;
+ col_index_ptr = (TrilinosWrappers::types::int_type *)col_indices;
col_value_ptr = values;
n_columns = n_cols;
#ifdef DEBUG
}
}
- Assert(n_columns <= (TrilinosWrapper::types::int_type)n_cols, ExcInternalError());
+ Assert(n_columns <= (TrilinosWrappers::types::int_type)n_cols, ExcInternalError());
- col_index_ptr = (TrilinosWrapper::types::int_type *)&column_indices[0];
+ col_index_ptr = (TrilinosWrappers::types::int_type *)&column_indices[0];
col_value_ptr = &column_values[0];
}
// can directly call the Epetra_CrsMatrix
// input function, which is much faster
// than the Epetra_FECrsMatrix function.
- if (row_partitioner().MyGID(static_cast<TrilinosWrapper::types::int_type>(row)) == true)
+ if (row_partitioner().MyGID(static_cast<TrilinosWrappers::types::int_type>(row)) == true)
{
ierr = matrix->Epetra_CrsMatrix::SumIntoGlobalValues(row, n_columns,
const_cast<double *>(col_value_ptr),
// one element at a time).
compressed = false;
- ierr = matrix->SumIntoGlobalValues (1,
- (TrilinosWrapper::types::int_type *)&row, n_columns,
+ ierr = matrix->SumIntoGlobalValues (1,
+ (TrilinosWrappers::types::int_type *)&row, n_columns,
col_index_ptr,
&col_value_ptr,
Epetra_FECrsMatrix::ROW_MAJOR);
std::cout << "Got error " << ierr << " in row " << row
<< " of proc " << row_partitioner().Comm().MyPID()
<< " when trying to add the columns:" << std::endl;
- for (TrilinosWrapper::types::int_type i=0; i<n_columns; ++i)
+ for (TrilinosWrappers::types::int_type i=0; i<n_columns; ++i)
std::cout << col_index_ptr[i] << " ";
std::cout << std::endl << std::endl;
std::cout << "Matrix row has the following indices:" << std::endl;
- TrilinosWrapper::types::int_type n_indices, *indices;
- trilinos_sparsity_pattern().ExtractMyRowView(row_partitioner().LID(static_cast<TrilinosWrapper::types::int_type>(row)),
+ TrilinosWrappers::types::int_type n_indices, *indices;
+ trilinos_sparsity_pattern().ExtractMyRowView(row_partitioner().LID(static_cast<TrilinosWrappers::types::int_type>(row)),
n_indices,
indices);
- for (TrilinosWrapper::types::int_type i=0; i<n_indices; ++i)
+ for (TrilinosWrappers::types::int_type i=0; i<n_indices; ++i)
std::cout << indices[i] << " ";
std::cout << endl << std::endl;
Assert (ierr <= 0,
//---------------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008, 2009, 2010, 2011, 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
/**
* Declare type for container size.
*/
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
/**
* Constructor.
/**
* Declare type for container size.
*/
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
/**
* Constructor. Create an
/**
* Declare type for container size.
*/
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
/**
* Declare a typedef for the
bool
SparsityPattern::in_local_range (const size_type index) const
{
- TrilinosWrapper::types::int_type begin, end;
+ TrilinosWrappers::types::int_type begin, end;
begin = graph->RowMap().MinMyGID();
end = graph->RowMap().MaxMyGID()+1;
if (begin == end)
return;
- TrilinosWrapper::types::int_type *col_index_ptr =
- (TrilinosWrapper::types::int_type *)(&*begin);
- const TrilinosWrapper::types::int_type n_cols =
- static_cast<TrilinosWrapper::types::int_type>(end - begin);
+ TrilinosWrappers::types::int_type *col_index_ptr =
+ (TrilinosWrappers::types::int_type *)(&*begin);
+ const TrilinosWrappers::types::int_type n_cols =
+ static_cast<TrilinosWrappers::types::int_type>(end - begin);
compressed = false;
- const int ierr = graph->InsertGlobalIndices (1,
- (TrilinosWrapper::types::int_type *)&row,
+ const int ierr = graph->InsertGlobalIndices (1,
+ (TrilinosWrappers::types::int_type *)&row,
n_cols, col_index_ptr);
AssertThrow (ierr >= 0, ExcTrilinosError(ierr));
//---------------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2008, 2009, 2010, 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
/**
* Declare type for container size.
*/
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
/**
* @name Basic constructors and initalization.
has_ghosts = vector->Map().UniqueGIDs()==false;
- const TrilinosWrapper::types::int_type size = parallel_partitioner.NumMyElements();
+ const TrilinosWrappers::types::int_type size = parallel_partitioner.NumMyElements();
// Need to copy out values, since the
// deal.II might not use doubles, so
// that a direct access is not possible.
- for (TrilinosWrapper::types::int_type i=0; i<size; ++i)
+ for (TrilinosWrappers::types::int_type i=0; i<size; ++i)
(*vector)[0][i] = v(parallel_partitioner.GID(i));
}
/**
* Declare type for container size.
*/
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
/**
* Default constructor that
template <typename number>
Vector::Vector (const dealii::Vector<number> &v)
{
- Epetra_LocalMap map ((TrilinosWrapper::types::int_type)v.size(), 0, Utilities::Trilinos::comm_self());
+ Epetra_LocalMap map ((TrilinosWrappers::types::int_type)v.size(), 0, Utilities::Trilinos::comm_self());
vector.reset (new Epetra_FEVector(map));
*this = v;
}
{
vector.reset();
- Epetra_LocalMap map ((TrilinosWrapper::types::int_type)v.size(), 0,
+ Epetra_LocalMap map ((TrilinosWrappers::types::int_type)v.size(), 0,
Utilities::Trilinos::comm_self());
vector.reset (new Epetra_FEVector(map));
}
const Epetra_Map &map = vector_partitioner();
- const TrilinosWrapper::types::int_type size = map.NumMyElements();
+ const TrilinosWrappers::types::int_type size = map.NumMyElements();
Assert (map.MaxLID() == size-1,
ExcDimensionMismatch(map.MaxLID(), size-1));
// Need to copy out values, since the
// deal.II might not use doubles, so
// that a direct access is not possible.
- for (TrilinosWrapper::types::int_type i=0; i<size; ++i)
+ for (TrilinosWrappers::types::int_type i=0; i<size; ++i)
(*vector)[0][i] = v(i);
return *this;
//---------------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008, 2009, 2010, 2011, 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
/**
* Declare type for container size.
*/
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
/**
* This class implements a
*/
typedef TrilinosScalar value_type;
typedef TrilinosScalar real_type;
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
typedef internal::VectorReference reference;
typedef const internal::VectorReference const_reference;
for (size_type i=0; i<n_elements; ++i)
{
const size_type row = indices[i];
- const TrilinosWrapper::types::int_type local_row = vector->Map().LID(static_cast<TrilinosWrapper::types::int_type>(row));
+ const TrilinosWrappers::types::int_type local_row = vector->Map().LID(static_cast<TrilinosWrappers::types::int_type>(row));
if (local_row == -1)
{
const int ierr = vector->ReplaceGlobalValues (1,
- (const TrilinosWrapper::types::int_type *)(&row),
+ (const TrilinosWrappers::types::int_type *)(&row),
&values[i]);
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
compressed = false;
for (size_type i=0; i<n_elements; ++i)
{
const size_type row = indices[i];
- const TrilinosWrapper::types::int_type local_row = vector->Map().LID(static_cast<TrilinosWrapper::types::int_type>(row));
+ const TrilinosWrappers::types::int_type local_row = vector->Map().LID(static_cast<TrilinosWrappers::types::int_type>(row));
if (local_row == -1)
{
const int ierr = vector->SumIntoGlobalValues (1,
- (const TrilinosWrapper::types::int_type *)(&row),
+ (const TrilinosWrappers::types::int_type *)(&row),
&values[i]);
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
compressed = false;
std::pair<VectorBase::size_type, VectorBase::size_type>
VectorBase::local_range () const
{
- TrilinosWrapper::types::int_type begin, end;
+ TrilinosWrappers::types::int_type begin, end;
begin = vector->Map().MinMyGID();
end = vector->Map().MaxMyGID()+1;
return std::make_pair (begin, end);
std::vector<Epetra_Map> parallel_partitioning;
for (size_type i=0; i<block_sparsity_pattern.n_block_rows(); ++i)
parallel_partitioning.push_back
- (Epetra_Map(static_cast<TrilinosWrapper::types::int_type>(block_sparsity_pattern.block(i,0).n_rows()),
+ (Epetra_Map(static_cast<TrilinosWrappers::types::int_type>(block_sparsity_pattern.block(i,0).n_rows()),
0,
Utilities::Trilinos::comm_self()));
std::vector<Epetra_Map> parallel_partitioning;
for (size_type i=0; i<dealii_block_sparse_matrix.n_block_rows(); ++i)
- parallel_partitioning.push_back (Epetra_Map(static_cast<TrilinosWrapper::types::int_type>(dealii_block_sparse_matrix.block(i,0).m()),
+ parallel_partitioning.push_back (Epetra_Map(static_cast<TrilinosWrappers::types::int_type>(dealii_block_sparse_matrix.block(i,0).m()),
0,
trilinos_communicator));
for (size_type d=0; d<constant_modes_dimension; ++d)
for (size_type row=0; row<my_size; ++row)
{
- TrilinosWrapper::types::int_type global_row_id =
+ TrilinosWrappers::types::int_type global_row_id =
constant_modes_are_global ? domain_map.GID(row) : row;
distributed_constant_modes[d][row] =
additional_data.constant_modes[d][global_row_id];
// equidistributed map; avoid
// storing the nonzero
// elements.
- vector_distributor.reset (new Epetra_Map(static_cast<TrilinosWrapper::types::int_type>(n_rows),
+ vector_distributor.reset (new Epetra_Map(static_cast<TrilinosWrappers::types::int_type>(n_rows),
0, communicator));
if (trilinos_matrix.get() == 0)
// get a representation of the present
// row
- TrilinosWrapper::types::int_type ncols;
- TrilinosWrapper::types::int_type colnums = matrix->n();
+ TrilinosWrappers::types::int_type ncols;
+ TrilinosWrappers::types::int_type colnums = matrix->n();
if (value_cache.get() == 0)
{
value_cache.reset (new std::vector<TrilinosScalar> (matrix->n()));
}
int ierr = matrix->trilinos_matrix().
- ExtractGlobalRowCopy((TrilinosWrapper::types::int_type)this->a_row,
+ ExtractGlobalRowCopy((TrilinosWrappers::types::int_type)this->a_row,
colnums,
ncols, &((*value_cache)[0]),
- reinterpret_cast<TrilinosWrapper::types::int_type *>(&((*colnum_cache)[0])));
+ reinterpret_cast<TrilinosWrappers::types::int_type *>(&((*colnum_cache)[0])));
value_cache->resize (ncols);
colnum_cache->resize (ncols);
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
:
column_space_map (new Epetra_Map (input_map)),
matrix (new Epetra_FECrsMatrix(Copy, *column_space_map,
- TrilinosWrapper::types::int_type(n_max_entries_per_row), false)),
+ TrilinosWrappers::types::int_type(n_max_entries_per_row), false)),
last_action (Zero),
compressed (false)
{}
column_space_map (new Epetra_Map (input_map)),
matrix (new Epetra_FECrsMatrix
(Copy, *column_space_map,
- (TrilinosWrapper::types::int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
+ (TrilinosWrappers::types::int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
false)),
last_action (Zero),
compressed (false)
:
column_space_map (new Epetra_Map (input_col_map)),
matrix (new Epetra_FECrsMatrix(Copy, input_row_map,
- TrilinosWrapper::types::int_type(n_max_entries_per_row), false)),
+ TrilinosWrappers::types::int_type(n_max_entries_per_row), false)),
last_action (Zero),
compressed (false)
{}
:
column_space_map (new Epetra_Map (input_col_map)),
matrix (new Epetra_FECrsMatrix(Copy, input_row_map,
- (TrilinosWrapper::types::int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
+ (TrilinosWrappers::types::int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
false)),
last_action (Zero),
compressed (false)
const size_type n,
const size_type n_max_entries_per_row)
:
- column_space_map (new Epetra_Map (static_cast<TrilinosWrapper::types::int_type>(n), 0,
+ column_space_map (new Epetra_Map (static_cast<TrilinosWrappers::types::int_type>(n), 0,
Utilities::Trilinos::comm_self())),
// on one processor only, we know how the
// information from columns is only
// available when entries have been added
matrix (new Epetra_FECrsMatrix(Copy,
- Epetra_Map (static_cast<TrilinosWrapper::types::int_type>(m), 0,
+ Epetra_Map (static_cast<TrilinosWrappers::types::int_type>(m), 0,
Utilities::Trilinos::comm_self()),
*column_space_map,
n_max_entries_per_row,
const size_type n,
const std::vector<size_type> &n_entries_per_row)
:
- column_space_map (new Epetra_Map (static_cast<TrilinosWrapper::types::int_type>(n), 0,
+ column_space_map (new Epetra_Map (static_cast<TrilinosWrappers::types::int_type>(n), 0,
Utilities::Trilinos::comm_self())),
matrix (new Epetra_FECrsMatrix(Copy,
- Epetra_Map (static_cast<TrilinosWrapper::types::int_type>(m), 0,
+ Epetra_Map (static_cast<TrilinosWrappers::types::int_type>(m), 0,
Utilities::Trilinos::comm_self()),
*column_space_map,
- (TrilinosWrapper::types::int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
+ (TrilinosWrappers::types::int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
false)),
last_action (Zero),
compressed (false)
make_trilinos_map(communicator, false))),
matrix (new Epetra_FECrsMatrix(Copy,
*column_space_map,
- (TrilinosWrapper::types::int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
+ (TrilinosWrappers::types::int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
false)),
last_action (Zero),
compressed (false)
matrix (new Epetra_FECrsMatrix(Copy,
row_parallel_partitioning.
make_trilinos_map(communicator, false),
- (TrilinosWrapper::types::int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
+ (TrilinosWrappers::types::int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
false)),
last_action (Zero),
compressed (false)
void
SparseMatrix::reinit (const SparsityType &sparsity_pattern)
{
- const Epetra_Map rows (static_cast<TrilinosWrapper::types::int_type>(sparsity_pattern.n_rows()),
+ const Epetra_Map rows (static_cast<TrilinosWrappers::types::int_type>(sparsity_pattern.n_rows()),
0,
Utilities::Trilinos::comm_self());
- const Epetra_Map columns (static_cast<TrilinosWrapper::types::int_type>(sparsity_pattern.n_cols()),
+ const Epetra_Map columns (static_cast<TrilinosWrappers::types::int_type>(sparsity_pattern.n_cols()),
0,
Utilities::Trilinos::comm_self());
template <typename Sparsity>
void copy_row (const Sparsity &csp,
const size_type row,
- std::vector<TrilinosWrapper::types::int_type> &row_indices)
+ std::vector<TrilinosWrappers::types::int_type> &row_indices)
{
typename Sparsity::row_iterator col_num = csp.row_begin (row);
for (size_type col=0; col_num != csp.row_end (row); ++col_num, ++col)
void copy_row (const dealii::SparsityPattern &csp,
const size_type row,
- std::vector<TrilinosWrapper::types::int_type> &row_indices)
+ std::vector<TrilinosWrappers::types::int_type> &row_indices)
{
dealii::SparsityPattern::iterator col_num = csp.begin (row);
for (size_type col=0; col_num != csp.end (row); ++col_num, ++col)
const size_t first_row = input_row_map.MinMyGID(),
last_row = input_row_map.MaxMyGID()+1;
- std::vector<TrilinosWrapper::types::int_type> n_entries_per_row(last_row-first_row);
+ std::vector<TrilinosWrappers::types::int_type> n_entries_per_row(last_row-first_row);
for (size_type row=first_row; row<last_row; ++row)
n_entries_per_row[row-first_row] = sparsity_pattern.row_length(row);
// distributed.
// now insert the indices
- std::vector<TrilinosWrapper::types::int_type> row_indices;
+ std::vector<TrilinosWrappers::types::int_type> row_indices;
for (size_type row=first_row; row<last_row; ++row)
{
- const TrilinosWrapper::types::int_type row_length = sparsity_pattern.row_length(row);
+ const TrilinosWrappers::types::int_type row_length = sparsity_pattern.row_length(row);
if (row_length == 0)
continue;
const bool copy_values,
const ::dealii::SparsityPattern *use_this_sparsity)
{
- const Epetra_Map rows (static_cast<TrilinosWrapper::types::int_type>(dealii_sparse_matrix.m()),
+ const Epetra_Map rows (static_cast<TrilinosWrappers::types::int_type>(dealii_sparse_matrix.m()),
0,
Utilities::Trilinos::comm_self());
- const Epetra_Map columns (static_cast<TrilinosWrapper::types::int_type>(dealii_sparse_matrix.n()),
+ const Epetra_Map columns (static_cast<TrilinosWrappers::types::int_type>(dealii_sparse_matrix.n()),
0,
Utilities::Trilinos::comm_self());
reinit (rows, columns, dealii_sparse_matrix, drop_tolerance,
const size_type n_rows = dealii_sparse_matrix.m();
- Assert (input_row_map.NumGlobalElements() == (TrilinosWrapper::types::int_type)n_rows,
+ Assert (input_row_map.NumGlobalElements() == (TrilinosWrappers::types::int_type)n_rows,
ExcDimensionMismatch (input_row_map.NumGlobalElements(),
n_rows));
- Assert (input_col_map.NumGlobalElements() == (TrilinosWrapper::types::int_type)dealii_sparse_matrix.n(),
+ Assert (input_col_map.NumGlobalElements() == (TrilinosWrappers::types::int_type)dealii_sparse_matrix.n(),
ExcDimensionMismatch (input_col_map.NumGlobalElements(),
dealii_sparse_matrix.n()));
for (size_type row=0; row<n_rows; ++row)
// see if the row is locally stored on this processor
- if (input_row_map.MyGID(static_cast<TrilinosWrapper::types::int_type>(row)) == true)
+ if (input_row_map.MyGID(static_cast<TrilinosWrappers::types::int_type>(row)) == true)
{
::dealii::SparsityPattern::iterator select_index =
sparsity_pattern.begin(row);
// Only do this on the rows owned
// locally on this processor.
- TrilinosWrapper::types::int_type local_row =
- matrix->LRID(static_cast<TrilinosWrapper::types::int_type>(row));
+ TrilinosWrappers::types::int_type local_row =
+ matrix->LRID(static_cast<TrilinosWrappers::types::int_type>(row));
if (local_row >= 0)
{
TrilinosScalar *values;
- TrilinosWrapper::types::int_type *col_indices;
- TrilinosWrapper::types::int_type num_entries;
+ TrilinosWrappers::types::int_type *col_indices;
+ TrilinosWrappers::types::int_type num_entries;
const int ierr = matrix->ExtractMyRowView(local_row, num_entries,
values, col_indices);
Assert (ierr == 0,
ExcTrilinosError(ierr));
- TrilinosWrapper::types::int_type *diag_find = std::find(col_indices,
+ TrilinosWrappers::types::int_type *diag_find = std::find(col_indices,
col_indices+num_entries,local_row);
- TrilinosWrapper::types::int_type diag_index =
- (TrilinosWrapper::types::int_type)(diag_find - col_indices);
+ TrilinosWrappers::types::int_type diag_index =
+ (TrilinosWrappers::types::int_type)(diag_find - col_indices);
- for (TrilinosWrapper::types::int_type j=0; j<num_entries; ++j)
+ for (TrilinosWrappers::types::int_type j=0; j<num_entries; ++j)
if (diag_index != j || new_diag_value == 0)
values[j] = 0.;
{
// Extract local indices in
// the matrix.
- TrilinosWrapper::types::int_type trilinos_i = matrix->LRID(static_cast<TrilinosWrapper::types::int_type>(i)),
- trilinos_j = matrix->LCID(static_cast<TrilinosWrapper::types::int_type>(j));
+ TrilinosWrappers::types::int_type trilinos_i = matrix->LRID(static_cast<TrilinosWrappers::types::int_type>(i)),
+ trilinos_j = matrix->LCID(static_cast<TrilinosWrappers::types::int_type>(j));
TrilinosScalar value = 0.;
// If the data is not on the
// Prepare pointers for extraction
// of a view of the row.
- TrilinosWrapper::types::int_type nnz_present = matrix->NumMyEntries(trilinos_i);
- TrilinosWrapper::types::int_type nnz_extracted;
- TrilinosWrapper::types::int_type *col_indices;
+ TrilinosWrappers::types::int_type nnz_present = matrix->NumMyEntries(trilinos_i);
+ TrilinosWrappers::types::int_type nnz_extracted;
+ TrilinosWrappers::types::int_type *col_indices;
TrilinosScalar *values;
// Generate the view and make
// look for the value, and then
// finally get it.
- TrilinosWrapper::types::int_type *el_find = std::find(col_indices,
+ TrilinosWrappers::types::int_type *el_find = std::find(col_indices,
col_indices + nnz_present, trilinos_j);
- TrilinosWrapper::types::int_type local_col_index =
- (TrilinosWrapper::types::int_type)(el_find - col_indices);
+ TrilinosWrappers::types::int_type local_col_index =
+ (TrilinosWrappers::types::int_type)(el_find - col_indices);
// This is actually the only
// difference to the el(i,j)
{
// Extract local indices in
// the matrix.
- TrilinosWrapper::types::int_type trilinos_i =
- matrix->LRID(static_cast<TrilinosWrapper::types::int_type>(i)),
- trilinos_j = matrix->LCID(static_cast<TrilinosWrapper::types::int_type>(j));
+ TrilinosWrappers::types::int_type trilinos_i =
+ matrix->LRID(static_cast<TrilinosWrappers::types::int_type>(i)),
+ trilinos_j = matrix->LCID(static_cast<TrilinosWrappers::types::int_type>(j));
TrilinosScalar value = 0.;
// If the data is not on the
// Prepare pointers for extraction
// of a view of the row.
- TrilinosWrapper::types::int_type nnz_present = matrix->NumMyEntries(trilinos_i);
- TrilinosWrapper::types::int_type nnz_extracted;
- TrilinosWrapper::types::int_type *col_indices;
+ TrilinosWrappers::types::int_type nnz_present = matrix->NumMyEntries(trilinos_i);
+ TrilinosWrappers::types::int_type nnz_extracted;
+ TrilinosWrappers::types::int_type *col_indices;
TrilinosScalar *values;
// Generate the view and make
// Search the index where we
// look for the value, and then
// finally get it.
- TrilinosWrapper::types::int_type *el_find = std::find(col_indices,
+ TrilinosWrappers::types::int_type *el_find = std::find(col_indices,
col_indices + nnz_present, trilinos_j);
- TrilinosWrapper::types::int_type local_col_index =
- (TrilinosWrapper::types::int_type)(el_find - col_indices);
+ TrilinosWrappers::types::int_type local_col_index =
+ (TrilinosWrappers::types::int_type)(el_find - col_indices);
// This is actually the only
// get a representation of the
// present row
- TrilinosWrapper::types::int_type ncols = -1;
- TrilinosWrapper::types::int_type local_row =
- matrix->LRID(static_cast<TrilinosWrapper::types::int_type>(row));
+ TrilinosWrappers::types::int_type ncols = -1;
+ TrilinosWrappers::types::int_type local_row =
+ matrix->LRID(static_cast<TrilinosWrappers::types::int_type>(row));
// on the processor who owns this
// row, we'll have a non-negative
namespace internals
{
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
void perform_mmult (const SparseMatrix &inputleft,
const SparseMatrix &inputright,
ExcMessage ("Parallel distribution of matrix B and vector V "
"does not match."));
- const TrilinosWrapper::types::int_type local_N = inputright.local_size();
- for (TrilinosWrapper::types::int_type i=0; i<local_N; ++i)
+ const TrilinosWrappers::types::int_type local_N = inputright.local_size();
+ for (TrilinosWrappers::types::int_type i=0; i<local_N; ++i)
{
- TrilinosWrapper::types::int_type N_entries = -1;
+ TrilinosWrappers::types::int_type N_entries = -1;
double *new_data, *B_data;
mod_B->ExtractMyRowView (i, N_entries, new_data);
inputright.trilinos_matrix().ExtractMyRowView (i, N_entries, B_data);
double value = V.trilinos_vector()[0][i];
- for (TrilinosWrapper::types::int_type j=0; j<N_entries; ++j)
+ for (TrilinosWrappers::types::int_type j=0; j<N_entries; ++j)
new_data[j] = value * B_data[j];
}
}
ExcMessage("Matrix must be partitioned contiguously between procs."));
for (size_type i=0; i<inputleft.local_size(); ++i)
{
- TrilinosWrapper::types::int_type num_entries, * indices;
+ TrilinosWrappers::types::int_type num_entries, * indices;
inputleft.trilinos_sparsity_pattern().ExtractMyRowView(i, num_entries,
indices);
Assert (num_entries >= 0, ExcInternalError());
const size_type GID = inputleft.row_partitioner().GID(i);
- for (TrilinosWrapper::types::int_type j=0; j<num_entries; ++j)
+ for (TrilinosWrappers::types::int_type j=0; j<num_entries; ++j)
sparsity_transposed.add (inputleft.col_partitioner().GID(indices[j]),
GID);
}
transposed_mat.reinit (sparsity_transposed);
for (size_type i=0; i<inputleft.local_size(); ++i)
{
- TrilinosWrapper::types::int_type num_entries, * indices;
+ TrilinosWrappers::types::int_type num_entries, * indices;
double *values;
inputleft.trilinos_matrix().ExtractMyRowView(i, num_entries,
values, indices);
Assert (num_entries >= 0, ExcInternalError());
const size_type GID = inputleft.row_partitioner().GID(i);
- for (TrilinosWrapper::types::int_type j=0; j<num_entries; ++j)
+ for (TrilinosWrappers::types::int_type j=0; j<num_entries; ++j)
transposed_mat.set (inputleft.col_partitioner().GID(indices[j]),
GID, values[j]);
}
// import data if necessary
ML_Operator *Btmp, *Ctmp, *Ctmp2, *tptr;
ML_CommInfoOP *getrow_comm;
- TrilinosWrapper::types::int_type max_per_proc;
- TrilinosWrapper::types::int_type N_input_vector = B_->invec_leng;
+ TrilinosWrappers::types::int_type max_per_proc;
+ TrilinosWrappers::types::int_type N_input_vector = B_->invec_leng;
getrow_comm = B_->getrow->pre_comm;
if ( getrow_comm != NULL)
- for (TrilinosWrapper::types::int_type i = 0; i < getrow_comm->N_neighbors; i++)
- for (TrilinosWrapper::types::int_type j = 0; j < getrow_comm->neighbors[i].N_send; j++)
+ for (TrilinosWrappers::types::int_type i = 0; i < getrow_comm->N_neighbors; i++)
+ for (TrilinosWrappers::types::int_type j = 0; j < getrow_comm->neighbors[i].N_send; j++)
AssertThrow (getrow_comm->neighbors[i].send_list[j] < N_input_vector,
ExcInternalError());
ExcDimensionMismatch(matrix->NumGlobalEntries(row),
rhs.matrix->NumGlobalEntries(row)));
- const TrilinosWrapper::types::int_type row_local =
- matrix->RowMap().LID(static_cast<TrilinosWrapper::types::int_type>(row));
- TrilinosWrapper::types::int_type n_entries, rhs_n_entries;
+ const TrilinosWrappers::types::int_type row_local =
+ matrix->RowMap().LID(static_cast<TrilinosWrappers::types::int_type>(row));
+ TrilinosWrappers::types::int_type n_entries, rhs_n_entries;
TrilinosScalar *value_ptr, *rhs_value_ptr;
// In debug mode, we want to check
// indices is relatively slow compared to
// just working with the values.
#ifdef DEBUG
- TrilinosWrapper::types::int_type *index_ptr, *rhs_index_ptr;
+ TrilinosWrappers::types::int_type *index_ptr, *rhs_index_ptr;
ierr = rhs.matrix->ExtractMyRowView (row_local, rhs_n_entries,
rhs_value_ptr, rhs_index_ptr);
Assert (ierr == 0, ExcTrilinosError(ierr));
AssertThrow (n_entries == rhs_n_entries,
ExcDimensionMismatch (n_entries, rhs_n_entries));
- for (TrilinosWrapper::types::int_type i=0; i<n_entries; ++i)
+ for (TrilinosWrappers::types::int_type i=0; i<n_entries; ++i)
{
*value_ptr++ += *rhs_value_ptr++ * factor;
#ifdef DEBUG
= std::max (max_row_length,
static_cast<size_type>(rhs.matrix->NumGlobalEntries(row)));
- std::vector<TrilinosWrapper::types::int_type> column_indices (max_row_length);
+ std::vector<TrilinosWrappers::types::int_type> column_indices (max_row_length);
std::vector<TrilinosScalar> values (max_row_length);
if (matrix->Filled() == true && rhs.matrix->Filled() == true &&
for (size_type row=local_range.first;
row < local_range.second; ++row)
{
- const TrilinosWrapper::types::int_type row_local =
- matrix->RowMap().LID(static_cast<TrilinosWrapper::types::int_type>(row));
- TrilinosWrapper::types::int_type n_entries;
+ const TrilinosWrappers::types::int_type row_local =
+ matrix->RowMap().LID(static_cast<TrilinosWrappers::types::int_type>(row));
+ TrilinosWrappers::types::int_type n_entries;
ierr = rhs.matrix->ExtractMyRowCopy (row_local, max_row_length,
n_entries,
&column_indices[0]);
Assert (ierr == 0, ExcTrilinosError(ierr));
- for (TrilinosWrapper::types::int_type i=0; i<n_entries; ++i)
+ for (TrilinosWrappers::types::int_type i=0; i<n_entries; ++i)
values[i] *= factor;
TrilinosScalar *value_ptr = &values[0];
for (size_type row=local_range.first;
row < local_range.second; ++row)
{
- TrilinosWrapper::types::int_type n_entries;
+ TrilinosWrappers::types::int_type n_entries;
ierr = rhs.matrix->Epetra_CrsMatrix::ExtractGlobalRowCopy
- ((TrilinosWrapper::types::int_type)row, max_row_length,
+ ((TrilinosWrappers::types::int_type)row, max_row_length,
n_entries, &values[0], &column_indices[0]);
Assert (ierr == 0, ExcTrilinosError(ierr));
- for (TrilinosWrapper::types::int_type i=0; i<n_entries; ++i)
+ for (TrilinosWrappers::types::int_type i=0; i<n_entries; ++i)
values[i] *= factor;
ierr = matrix->Epetra_CrsMatrix::SumIntoGlobalValues
- ((TrilinosWrapper::types::int_type)row, n_entries,
+ ((TrilinosWrappers::types::int_type)row, n_entries,
&values[0], &column_indices[0]);
Assert (ierr == 0, ExcTrilinosError(ierr));
}
else
{
double *values;
- TrilinosWrapper::types::int_type *indices;
- TrilinosWrapper::types::int_type num_entries;
+ TrilinosWrappers::types::int_type *indices;
+ TrilinosWrappers::types::int_type num_entries;
- for (TrilinosWrapper::types::int_type i=0; i<matrix->NumMyRows(); ++i)
+ for (TrilinosWrappers::types::int_type i=0; i<matrix->NumMyRows(); ++i)
{
matrix->ExtractMyRowView (i, num_entries, values, indices);
- for (TrilinosWrapper::types::int_type j=0; j<num_entries; ++j)
+ for (TrilinosWrappers::types::int_type j=0; j<num_entries; ++j)
out << "(" << matrix->GRID(i) << "," << matrix->GCID(indices[j]) << ") "
<< values[j] << std::endl;
}
{
size_type static_memory = sizeof(this) + sizeof (*matrix)
+ sizeof(*matrix->Graph().DataPtr());
- return ((sizeof(TrilinosScalar)+sizeof(TrilinosWrapper::types::int_type))*
+ return ((sizeof(TrilinosScalar)+sizeof(TrilinosWrappers::types::int_type))*
matrix->NumMyNonzeros() + sizeof(int)*local_size() + static_memory);
}
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008, 2009, 2010, 2011, 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
// get a representation of the present
// row
- TrilinosWrapper::types::int_type ncols;
- TrilinosWrapper::types::int_type colnums = sparsity_pattern->n_cols();
+ TrilinosWrappers::types::int_type ncols;
+ TrilinosWrappers::types::int_type colnums = sparsity_pattern->n_cols();
int ierr;
- ierr = sparsity_pattern->graph->ExtractGlobalRowCopy((TrilinosWrapper::types::int_type)this->a_row,
+ ierr = sparsity_pattern->graph->ExtractGlobalRowCopy((TrilinosWrappers::types::int_type)this->a_row,
colnums,
ncols,
- (TrilinosWrapper::types::int_type *)&(*colnum_cache)[0]);
+ (TrilinosWrappers::types::int_type *)&(*colnum_cache)[0]);
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
// copy it into our caches if the
const size_type n,
const size_type n_entries_per_row)
{
- const Epetra_Map rows (static_cast<TrilinosWrapper::types::int_type>(m), 0, Utilities::Trilinos::comm_self());
- const Epetra_Map columns (static_cast<TrilinosWrapper::types::int_type>(n), 0, Utilities::Trilinos::comm_self());
+ const Epetra_Map rows (static_cast<TrilinosWrappers::types::int_type>(m), 0, Utilities::Trilinos::comm_self());
+ const Epetra_Map columns (static_cast<TrilinosWrappers::types::int_type>(n), 0, Utilities::Trilinos::comm_self());
reinit (rows, columns, n_entries_per_row);
}
const size_type n,
const std::vector<size_type> &n_entries_per_row)
{
- const Epetra_Map rows (static_cast<TrilinosWrapper::types::int_type>(m), 0,
+ const Epetra_Map rows (static_cast<TrilinosWrappers::types::int_type>(m), 0,
Utilities::Trilinos::comm_self());
- const Epetra_Map columns (static_cast<TrilinosWrapper::types::int_type>(n), 0,
+ const Epetra_Map columns (static_cast<TrilinosWrappers::types::int_type>(n), 0,
Utilities::Trilinos::comm_self());
reinit (rows, columns, n_entries_per_row);
{
namespace
{
- typedef types::global_dof_index size_type;
+ typedef dealii::types::global_dof_index size_type;
// distinguish between compressed sparsity types that define row_begin()
// and SparsityPattern that uses begin() as iterator type
template <typename Sparsity>
void copy_row (const Sparsity &csp,
const size_type row,
- std::vector<TrilinosWrapper::types::int_type> &row_indices)
+ std::vector<TrilinosWrappers::types::int_type> &row_indices)
{
typename Sparsity::row_iterator col_num = csp.row_begin (row);
for (size_type col=0; col_num != csp.row_end (row); ++col_num, ++col)
void copy_row (const dealii::SparsityPattern &csp,
const size_type row,
- std::vector<TrilinosWrapper::types::int_type> &row_indices)
+ std::vector<TrilinosWrappers::types::int_type> &row_indices)
{
dealii::SparsityPattern::iterator col_num = csp.begin (row);
for (size_type col=0; col_num != csp.end (row); ++col_num, ++col)
const size_type first_row = input_row_map.MinMyGID(),
last_row = input_row_map.MaxMyGID()+1;
- std::vector<TrilinosWrapper::types::int_type> n_entries_per_row(last_row - first_row);
+ std::vector<TrilinosWrappers::types::int_type> n_entries_per_row(last_row - first_row);
for (size_type row=first_row; row<last_row; ++row)
n_entries_per_row[row-first_row] = sp.row_length(row);
AssertDimension (sp.n_rows(),
static_cast<size_type>(graph->NumGlobalRows()));
- std::vector<TrilinosWrapper::types::int_type> row_indices;
+ std::vector<TrilinosWrappers::types::int_type> row_indices;
// Include possibility to exchange data
// since CompressedSimpleSparsityPattern is
if (exchange_data==false)
for (size_type row=first_row; row<last_row; ++row)
{
- const TrilinosWrapper::types::int_type row_length = sp.row_length(row);
+ const TrilinosWrappers::types::int_type row_length = sp.row_length(row);
if (row_length == 0)
continue;
else
for (size_type row=0; row<sp.n_rows(); ++row)
{
- const TrilinosWrapper::types::int_type row_length = sp.row_length(row);
+ const TrilinosWrappers::types::int_type row_length = sp.row_length(row);
if (row_length == 0)
continue;
row_indices.resize (row_length, -1);
internal::copy_row(sp, row, row_indices);
- graph->InsertGlobalIndices (1,
- reinterpret_cast<TrilinosWrapper::types::int_type *>(&row),
+ graph->InsertGlobalIndices (1,
+ reinterpret_cast<TrilinosWrappers::types::int_type *>(&row),
row_length, &row_indices[0]);
}
void
SparsityPattern::copy_from (const SparsityType &sp)
{
- const Epetra_Map rows (static_cast<TrilinosWrapper::types::int_type>(sp.n_rows()), 0, Utilities::Trilinos::comm_self());
- const Epetra_Map columns (static_cast<TrilinosWrapper::types::int_type>(sp.n_cols()), 0, Utilities::Trilinos::comm_self());
+ const Epetra_Map rows (static_cast<TrilinosWrappers::types::int_type>(sp.n_rows()), 0, Utilities::Trilinos::comm_self());
+ const Epetra_Map columns (static_cast<TrilinosWrappers::types::int_type>(sp.n_cols()), 0, Utilities::Trilinos::comm_self());
reinit (rows, columns, sp);
}
{
// Extract local indices in
// the matrix.
- TrilinosWrapper::types::int_type trilinos_i =
- graph->LRID(static_cast<TrilinosWrapper::types::int_type>(i)),
- trilinos_j = graph->LCID(static_cast<TrilinosWrapper::types::int_type>(j));
+ TrilinosWrappers::types::int_type trilinos_i =
+ graph->LRID(static_cast<TrilinosWrappers::types::int_type>(i)),
+ trilinos_j = graph->LCID(static_cast<TrilinosWrappers::types::int_type>(j));
// If the data is not on the
// present processor, we throw
// local indices.
if (graph->Filled() == false)
{
- TrilinosWrapper::types::int_type nnz_present = graph->NumGlobalIndices(i);
- TrilinosWrapper::types::int_type nnz_extracted;
- TrilinosWrapper::types::int_type *col_indices;
+ TrilinosWrappers::types::int_type nnz_present = graph->NumGlobalIndices(i);
+ TrilinosWrappers::types::int_type nnz_extracted;
+ TrilinosWrappers::types::int_type *col_indices;
// Generate the view and make
// sure that we have not generated
ExcDimensionMismatch(nnz_present, nnz_extracted));
// Search the index
- TrilinosWrapper::types::int_type *el_find =
+ TrilinosWrappers::types::int_type *el_find =
std::find(col_indices, col_indices + nnz_present, trilinos_j);
- TrilinosWrapper::types::int_type local_col_index =
- (TrilinosWrapper::types::int_type)(el_find - col_indices);
+ TrilinosWrappers::types::int_type local_col_index =
+ (TrilinosWrappers::types::int_type)(el_find - col_indices);
if (local_col_index == nnz_present)
return false;
{
// Prepare pointers for extraction
// of a view of the row.
- TrilinosWrapper::types::int_type nnz_present = graph->NumGlobalIndices(i);
- TrilinosWrapper::types::int_type nnz_extracted;
- TrilinosWrapper::types::int_type *col_indices;
+ TrilinosWrappers::types::int_type nnz_present = graph->NumGlobalIndices(i);
+ TrilinosWrappers::types::int_type nnz_extracted;
+ TrilinosWrappers::types::int_type *col_indices;
// Generate the view and make
// sure that we have not generated
ExcDimensionMismatch(nnz_present, nnz_extracted));
// Search the index
- TrilinosWrapper::types::int_type *el_find = std::find(col_indices,
+ TrilinosWrappers::types::int_type *el_find = std::find(col_indices,
col_indices + nnz_present, trilinos_j);
- TrilinosWrapper::types::int_type local_col_index =
- (TrilinosWrapper::types::int_type)(el_find - col_indices);
+ TrilinosWrappers::types::int_type local_col_index =
+ (TrilinosWrappers::types::int_type)(el_find - col_indices);
if (local_col_index == nnz_present)
return false;
SparsityPattern::bandwidth () const
{
size_type local_b=0;
- TrilinosWrapper::types::int_type global_b=0;
+ TrilinosWrappers::types::int_type global_b=0;
for (size_type i=0; i<local_size(); ++i)
{
- TrilinosWrapper::types::int_type *indices;
- TrilinosWrapper::types::int_type num_entries;
+ TrilinosWrappers::types::int_type *indices;
+ TrilinosWrappers::types::int_type num_entries;
graph->ExtractMyRowView(i, num_entries, indices);
for (size_type j=0; j<(size_type)num_entries; ++j)
{
- if (static_cast<size_type>(std::abs(static_cast<TrilinosWrapper::types::int_type>(i-indices[j]))) > local_b)
- local_b = std::abs(static_cast<TrilinosWrapper::types::int_type>(i-indices[j]));
+ if (static_cast<size_type>(std::abs(static_cast<TrilinosWrappers::types::int_type>(i-indices[j]))) > local_b)
+ local_b = std::abs(static_cast<TrilinosWrappers::types::int_type>(i-indices[j]));
}
}
- graph->Comm().MaxAll((TrilinosWrapper::types::int_type *)&local_b, &global_b, 1);
+ graph->Comm().MaxAll((TrilinosWrappers::types::int_type *)&local_b, &global_b, 1);
return static_cast<size_type>(global_b);
}
SparsityPattern::size_type
SparsityPattern::n_rows () const
{
- const TrilinosWrapper::types::int_type n_rows = graph -> NumGlobalRows();
+ const TrilinosWrappers::types::int_type n_rows = graph -> NumGlobalRows();
return n_rows;
}
SparsityPattern::size_type
SparsityPattern::n_cols () const
{
- TrilinosWrapper::types::int_type n_cols;
+ TrilinosWrappers::types::int_type n_cols;
if (graph->Filled() == true)
n_cols = graph -> NumGlobalCols();
else
SparsityPattern::size_type
SparsityPattern::local_size () const
{
- TrilinosWrapper::types::int_type n_rows = graph -> NumMyRows();
+ TrilinosWrappers::types::int_type n_rows = graph -> NumMyRows();
return n_rows;
}
SparsityPattern::size_type
SparsityPattern::n_nonzero_elements () const
{
- TrilinosWrapper::types::int_type nnz = graph->NumGlobalEntries();
+ TrilinosWrappers::types::int_type nnz = graph->NumGlobalEntries();
return static_cast<size_type>(nnz);
}
SparsityPattern::size_type
SparsityPattern::max_entries_per_row () const
{
- TrilinosWrapper::types::int_type nnz = graph->MaxNumIndices();
+ TrilinosWrappers::types::int_type nnz = graph->MaxNumIndices();
return static_cast<size_type>(nnz);
}
// get a representation of the
// present row
- TrilinosWrapper::types::int_type ncols = -1;
- TrilinosWrapper::types::int_type local_row =
- graph->LRID(static_cast<TrilinosWrapper::types::int_type>(row));
+ TrilinosWrappers::types::int_type ncols = -1;
+ TrilinosWrappers::types::int_type local_row =
+ graph->LRID(static_cast<TrilinosWrappers::types::int_type>(row));
// on the processor who owns this
// row, we'll have a non-negative
out << *graph;
else
{
- TrilinosWrapper::types::int_type *indices;
- TrilinosWrapper::types::int_type num_entries;
+ TrilinosWrappers::types::int_type *indices;
+ TrilinosWrappers::types::int_type num_entries;
- for (TrilinosWrapper::types::int_type i=0; i<graph->NumMyRows(); ++i)
+ for (TrilinosWrappers::types::int_type i=0; i<graph->NumMyRows(); ++i)
{
graph->ExtractMyRowView (i, num_entries, indices);
- for (TrilinosWrapper::types::int_type j=0; j<num_entries; ++j)
+ for (TrilinosWrappers::types::int_type j=0; j<num_entries; ++j)
out << "(" << i << "," << indices[graph->GRID(j)] << ") "
<< std::endl;
}
Assert (graph->Filled() == true, ExcInternalError());
for (size_type row=0; row<local_size(); ++row)
{
- TrilinosWrapper::types::int_type *indices;
- TrilinosWrapper::types::int_type num_entries;
+ TrilinosWrappers::types::int_type *indices;
+ TrilinosWrappers::types::int_type num_entries;
graph->ExtractMyRowView (row, num_entries, indices);
for (size_type j=0; j<(size_type)num_entries; ++j)
// j horizontal, gnuplot output is
// x-y, that is we have to exchange
// the order of output
- out << indices[graph->GRID(static_cast<TrilinosWrapper::types::int_type>(j))]
- << " " << -static_cast<TrilinosWrapper::types::int_type>(row)
+ out << indices[graph->GRID(static_cast<TrilinosWrappers::types::int_type>(j))]
+ << " " << -static_cast<TrilinosWrappers::types::int_type>(row)
<< std::endl;
}
size_type n_elements = 0, added_elements = 0, block_offset = 0;
for (size_type block=0; block<v.n_blocks(); ++block)
n_elements += v.block(block).local_size();
- std::vector<TrilinosWrapper::types::int_type> global_ids (n_elements, -1);
+ std::vector<TrilinosWrappers::types::int_type> global_ids (n_elements, -1);
for (size_type block=0; block<v.n_blocks(); ++block)
{
- TrilinosWrapper::types::int_type *glob_elements =
+ TrilinosWrappers::types::int_type *glob_elements =
v.block(block).vector_partitioner().MyGlobalElements();
for (size_type i=0; i<v.block(block).local_size(); ++i)
global_ids[added_elements++] = glob_elements[i] + block_offset;
Vector::Vector (const size_type n)
{
last_action = Zero;
- Epetra_LocalMap map ((TrilinosWrapper::types::int_type)n, 0, Utilities::Trilinos::comm_self());
+ Epetra_LocalMap map ((TrilinosWrappers::types::int_type)n, 0, Utilities::Trilinos::comm_self());
vector.reset (new Epetra_FEVector (map));
}
const MPI_Comm &communicator)
{
last_action = Zero;
- Epetra_LocalMap map (static_cast<TrilinosWrapper::types::int_type>(partitioning.size()),
+ Epetra_LocalMap map (static_cast<TrilinosWrappers::types::int_type>(partitioning.size()),
0,
#ifdef DEAL_II_WITH_MPI
Epetra_MpiComm(communicator));
{
if (size() != n)
{
- Epetra_LocalMap map ((TrilinosWrapper::types::int_type)n, 0,
+ Epetra_LocalMap map ((TrilinosWrappers::types::int_type)n, 0,
Utilities::Trilinos::comm_self());
vector.reset (new Epetra_FEVector (map));
}
const bool fast)
{
if (vector->Map().NumGlobalElements() !=
- static_cast<TrilinosWrapper::types::int_type>(partitioning.size()))
+ static_cast<TrilinosWrappers::types::int_type>(partitioning.size()))
{
- Epetra_LocalMap map (static_cast<TrilinosWrapper::types::int_type>(partitioning.size()),
+ Epetra_LocalMap map (static_cast<TrilinosWrappers::types::int_type>(partitioning.size()),
0,
#ifdef DEAL_II_WITH_MPI
Epetra_MpiComm(communicator));
// we can use []. Note that we
// can only get local values.
- const TrilinosWrapper::types::int_type local_index =
- vector.vector->Map().LID(static_cast<TrilinosWrapper::types::int_type>(index));
+ const TrilinosWrappers::types::int_type local_index =
+ vector.vector->Map().LID(static_cast<TrilinosWrappers::types::int_type>(index));
Assert (local_index >= 0,
ExcAccessToNonLocalElement (index,
vector.vector->Map().MinMyGID(),
{
// Extract local indices in
// the vector.
- TrilinosWrapper::types::int_type trilinos_i =
- vector->Map().LID(static_cast<TrilinosWrapper::types::int_type>(index));
+ TrilinosWrappers::types::int_type trilinos_i =
+ vector->Map().LID(static_cast<TrilinosWrappers::types::int_type>(index));
TrilinosScalar value = 0.;
// If the element is not
{
// Extract local indices in
// the vector.
- TrilinosWrapper::types::int_type trilinos_i =
- vector->Map().LID(static_cast<TrilinosWrapper::types::int_type>(index));
+ TrilinosWrappers::types::int_type trilinos_i =
+ vector->Map().LID(static_cast<TrilinosWrappers::types::int_type>(index));
TrilinosScalar value = 0.;
// If the element is not present
//entry.
return sizeof(*this)
+ this->local_size()*( sizeof(double)+
- sizeof(TrilinosWrapper::types::int_type) );
+ sizeof(TrilinosWrappers::types::int_type) );
}
} /* end of namespace TrilinosWrappers */