}
+namespace TrilinosWrapper
+{
+ namespace types
+ {
+#ifdef DEAL_II_EPETRA_NO_64BIT_GLOBAL_INDICES
+ /**
+ * Declare type of integer used in the Epetra package of Trilinos.
+ */
+ typedef int int_type;
+#else
+ /**
+ * Declare type of integer used in the Epetra package of Trilinos.
+ */
+ typedef long long int_type;
+#endif
+ }
+}
+
// this part of the namespace numbers got moved to the bottom types.h file,
// because otherwise we get a circular inclusion of config.h, types.h, and
* an invalid array
* index, an invalid
* array size, and the
- * like.
+ * like. Invalid_size_type
+ * is equivalent to
+ * invalid_dof_index.
*/
- static const std::size_t
- invalid_size_type = static_cast<std::size_t> (-1);
+ const types::global_dof_index
+ invalid_size_type = static_cast<types::global_dof_index> (-1);
/**
* An invalid value for indices of degrees
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Default
* Specialized constructor for a
* structure with blocks of equal size.
*/
- explicit BlockIndices(const size_type n_blocks, const size_type block_size = 0);
+ explicit BlockIndices(const unsigned int n_blocks, const size_type block_size = 0);
/**
* Reinitialize the number of
* blocks and assign each block
* the same number of elements.
*/
- void reinit (const size_type n_blocks,
+ void reinit (const unsigned int n_blocks,
const size_type n_elements_per_block);
/**
/**
* Number of blocks in index field.
*/
- size_type size () const;
+ unsigned int size () const;
/**
* Return the total number of
* of the vector space of the
* block vector.
*/
- size_type total_size () const;
+ std::size_t total_size () const;
/**
* The size of the @p ith block.
*/
- size_type block_size (const size_type i) const;
+ std::size_t block_size (const size_type i) const;
//@}
* the block, the second the
* index within it.
*/
- std::pair<size_type,size_type>
+ std::pair<unsigned int,size_type>
global_to_local (const size_type i) const;
/**
* Return the global index of
* @p index in block @p block.
*/
- size_type local_to_global (const size_type block,
+ size_type local_to_global (const unsigned int block,
const size_type index) const;
/**
* we cache this value for faster
* access.
*/
- size_type n_blocks;
+ unsigned int n_blocks;
/**
* Global starting index of each
inline
void
-BlockIndices::reinit (const size_type nb,
+BlockIndices::reinit (const unsigned int nb,
const size_type block_size)
{
n_blocks = nb;
inline
BlockIndices::BlockIndices (
- const size_type n_blocks,
+ const unsigned int n_blocks,
const size_type block_size)
:
n_blocks(n_blocks),
inline
-std::pair<std::size_t,std::size_t>
+std::pair<unsigned int,BlockIndices::size_type>
BlockIndices::global_to_local (const size_type i) const
{
Assert (i<total_size(), ExcIndexRange(i, 0, total_size()));
inline
-std::size_t
-BlockIndices::local_to_global (const size_type block,
+BlockIndices::size_type
+BlockIndices::local_to_global (const unsigned int block,
const size_type index) const
{
Assert (block < n_blocks, ExcIndexRange(block, 0, n_blocks));
inline
-std::size_t
+unsigned int
BlockIndices::size () const
{
return n_blocks;
inline
-std::size_t
+BlockIndices::size_type
BlockIndices::block_start (const size_type block) const
{
Assert (block < n_blocks, ExcIndexRange(block, 0, n_blocks));
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/// The container for each index set
typedef std::vector<size_type> block_container;
for (size_type i=0; i<indices.size(); ++i)
{
- const types_global_dof_indices k = indices[i];
+ const size_type k = indices[i];
if (k==numbers::invalid_size_type)
continue;
if (selected[i] && std::find(index_sets[block].begin(), index_sets[block].end(), k-offset)
inline
-size_type
+BlockList::size_type
BlockList::size() const
{
return index_sets.size();
inline
-size_type
+BlockList::size_type
BlockList::block_size(size_type block) const
{
return index_sets[block].size();
inline
-size_type
-BlockList::local_index(size_type block, size_type int index) const
+BlockList::size_type
+BlockList::local_index(size_type block, size_type index) const
{
AssertIndexRange(block, index_sets.size());
const block_container &b = index_sets[block];
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Default constructor creating a
: private BlockMatrixArray<number>
{
public:
+ /**
+ * Declare type for container size.
+ */
+ typedef types::global_dof_index size_type;
+
/**
* Default constructor creating a
* useless object. initialize()
class AccessorBase
{
public:
+ /**
+ * Declare type for container size.
+ */
+ typedef types::global_dof_index size_type;
+
/**
* Typedef the value type of the
* matrix we point into.
public AccessorBase<BlockMatrix>
{
public:
+ /**
+ * Declare type for container size.
+ */
+ typedef types::global_dof_index size_type;
+
/**
* Type of the matrix used in
* this accessor.
{
public:
/**
- * Thype of the matrix used in
+ * Declare type for container size.
+ */
+ typedef types::global_dof_index size_type;
+
+ /**
+ * Type of the matrix used in
* this accessor.
*/
typedef const BlockMatrix MatrixType;
typedef const value_type *const_pointer;
typedef value_type &reference;
typedef const value_type &const_reference;
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
typedef
MatrixIterator<BlockMatrixIterators::Accessor<BlockMatrixBase, false> >
template <class BlockMatrix>
inline
- size_type
+ typename AccessorBase<BlockMatrix>::size_type
AccessorBase<BlockMatrix>::block_row() const
{
Assert (row_block != numbers::invalid_size_type,
template <class BlockMatrix>
inline
- size_type
+ typename AccessorBase<BlockMatrix>::size_type
AccessorBase<BlockMatrix>::block_column() const
{
Assert (col_block != numbers::invalid_size_type,
template <class BlockMatrix>
inline
- size_type
+ typename Accessor<BlockMatrix, true>::size_type
Accessor<BlockMatrix, true>::row() const
{
Assert (this->row_block != numbers::invalid_size_type,
template <class BlockMatrix>
inline
- size_type
+ typename Accessor<BlockMatrix, true>::size_type
Accessor<BlockMatrix, true>::column() const
{
Assert (this->col_block != numbers::invalid_size_type,
template <class BlockMatrix>
inline
- size_type
+ typename Accessor<BlockMatrix, false>::size_type
Accessor<BlockMatrix, false>::row() const
{
Assert (this->row_block != numbers::invalid_size_type,
template <class BlockMatrix>
inline
- size_type
+ typename Accessor<BlockMatrix, false>::size_type
Accessor<BlockMatrix, false>::column() const
{
Assert (this->col_block != numbers::invalid_size_type,
void
Accessor<BlockMatrix, false>::set_value (typename Accessor<BlockMatrix, false>::value_type newval) const
{
- Assert (this->row_block != numbers::invalid_size_type
+ Assert (this->row_block != numbers::invalid_size_type,
ExcIteratorPastEnd());
Assert (this->col_block != numbers::invalid_size_type,
ExcIteratorPastEnd());
template <class MatrixType>
inline
-size_type
+typename BlockMatrixBase<MatrixType>::size_type
BlockMatrixBase<MatrixType>::m () const
{
return row_block_indices.total_size();
template <class MatrixType>
inline
-size_type
+typename BlockMatrixBase<MatrixType>::size_type
BlockMatrixBase<MatrixType>::n () const
{
return column_block_indices.total_size();
template <class MatrixType>
inline
-size_type
+typename BlockMatrixBase<MatrixType>::size_type
BlockMatrixBase<MatrixType>::n_block_cols () const
{
return column_block_indices.size();
template <class MatrixType>
inline
-size_type
+typename BlockMatrixBase<MatrixType>::size_type
BlockMatrixBase<MatrixType>::n_block_rows () const
{
return row_block_indices.size();
class BlockSparseMatrix : public BlockMatrixBase<SparseMatrix<number> >
{
public:
- /**
- * Declare type for container size.
- */
- typedef std::size_t size_type;
-
/**
* Typedef the base class for simpler
* access to its own typedefs.
template <typename number>
-size_type
+typename BlockSparseMatrix<number>::size_type
BlockSparseMatrix<number>::get_row_length (const size_type row) const
{
return sparsity_pattern->row_length(row);
template <typename number>
-size_type
+typename BlockSparseMatrix<number>::size_type
BlockSparseMatrix<number>::n_nonzero_elements () const
{
return sparsity_pattern->n_nonzero_elements ();
template <typename number>
-size_type
+typename BlockSparseMatrix<number>::size_type
BlockSparseMatrix<number>::n_actually_nonzero_elements (const double threshold) const
{
size_type count = 0;
/**
* Declare type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Default constructor. The
template <typename Number>
inline
-size_type
+typename BlockSparseMatrixEZ<Number>::size_type
BlockSparseMatrixEZ<Number>::n_block_rows () const
{
return row_indices.size();
template <typename Number>
inline
-size_type
+typename BlockSparseMatrixEZ<Number>::size_type
BlockSparseMatrixEZ<Number>::n_rows () const
{
return row_indices.total_size();
template <typename Number>
inline
-size_type
+typename BlockSparseMatrixEZ<Number>::size_type
BlockSparseMatrixEZ<Number>::n_block_cols () const
{
return column_indices.size();
template <typename Number>
inline
-size_type
+typename BlockSparseMatrixEZ<Number>::size_type
BlockSparseMatrixEZ<Number>::n_cols () const
{
return column_indices.total_size();
template <typename Number>
inline
-size_type
+typename BlockSparseMatrixEZ<Number>::size_type
BlockSparseMatrixEZ<Number>::m () const
{
return n_rows();
template <typename Number>
inline
-size_type
+typename BlockSparseMatrixEZ<Number>::size_type
BlockSparseMatrixEZ<Number>::n () const
{
return n_cols();
/**
* Declare type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Define a value which is used
template <class SparsityPatternBase>
inline
-size_type
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
BlockSparsityPatternBase<SparsityPatternBase>::
row_length (const size_type row) const
{
template <class SparsityPatternBase>
inline
-size_type
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
BlockSparsityPatternBase<SparsityPatternBase>::n_block_cols () const
{
return columns;
template <class SparsityPatternBase>
inline
-size_type
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
BlockSparsityPatternBase<SparsityPatternBase>::n_block_rows () const
{
return rows;
inline
-size_type
+BlockCompressedSimpleSparsityPattern::size_type
BlockCompressedSimpleSparsityPattern::column_number (const size_type row,
const size_type index) const
{
* use blocks of different
* sizes.
*/
- explicit BlockVector (const size_type num_blocks = 0,
+ explicit BlockVector (const unsigned int num_blocks = 0,
const size_type block_size = 0);
/**
template <typename Number>
-void BlockVector<Number>::reinit (const size_type n_bl,
- const szie_type bl_sz,
- const bool fast)
+void BlockVector<Number>::reinit (const unsigned int n_bl,
+ const size_type bl_sz,
+ const bool fast)
{
std::vector<size_type> n(n_bl, bl_sz);
reinit(n, fast);
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Type of the number this
typedef dealii::internal::BlockVectorIterators::Iterator<BlockVectorBase,true> const_iterator;
typedef typename BlockType::reference reference;
typedef typename BlockType::const_reference const_reference;
-
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Declare a type that has holds
* is the sum of the dimensions of all
* components.
*/
- size_type size () const;
+ std::size_t size () const;
/**
* Return an iterator pointing to
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Type of matrix entries. In analogy to
template <typename number>
inline
-size_type ChunkSparseMatrix<number>::m () const
+typename ChunkSparseMatrix<number>::size_type
+ChunkSparseMatrix<number>::m () const
{
Assert (cols != 0, ExcNotInitialized());
return cols->rows;
template <typename number>
inline
-size_type ChunkSparseMatrix<number>::n () const
+typename ChunkSparseMatrix<number>::size_type
+ChunkSparseMatrix<number>::n () const
{
Assert (cols != 0, ExcNotInitialized());
return cols->cols;
template <typename number>
inline
-size_type
+typename ChunkSparseMatrix<number>::size_type
ChunkSparseMatrix<number>::compute_location (const size_type i,
const size_type j) const
{
// by hand or by using, for example, optimized BLAS versions for them.
namespace ChunkSparseMatrix
{
+ /**
+ * Declare type for container size.
+ */
+ typedef types::global_dof_index size_type;
+
/**
* Add the result of multiplying a chunk
* of size chunk_size times chunk_size by
template <typename number>
-size_type
+typename ChunkSparseMatrix<number>::size_type
ChunkSparseMatrix<number>::n_nonzero_elements () const
{
Assert (cols != 0, ExcNotInitialized());
template <typename number>
-size_type
+typename ChunkSparseMatrix<number>::size_type
ChunkSparseMatrix<number>::n_actually_nonzero_elements () const
{
Assert (cols != 0, ExcNotInitialized());
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Define a value which is used
inline
-size_type
+ChunkSparsityPattern::size_type
ChunkSparsityPattern::n_rows () const
{
return rows;
inline
-size_type
+ChunkSparsityPattern::size_type
ChunkSparsityPattern::n_cols () const
{
return cols;
inline
-size_type
+ChunkSparsityPattern::size_type
ChunkSparsityPattern::get_chunk_size () const
{
return chunk_size;
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* An iterator that can be used to
inline
-size_type
+CompressedSetSparsityPattern::size_type
CompressedSetSparsityPattern::n_rows () const
{
return rows;
inline
-size_type
+CompressedSetSparsityPattern::size_type
CompressedSetSparsityPattern::n_cols () const
{
return cols;
inline
-size_type
+CompressedSetSparsityPattern::size_type
CompressedSetSparsityPattern::row_length (const size_type row) const
{
Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* An iterator that can be used to
inline
-std::size_t
+CompressedSimpleSparsityPattern::size_type
CompressedSimpleSparsityPattern::n_rows () const
{
return rows;
inline
-std::size_t
+types::global_dof_index
CompressedSimpleSparsityPattern::n_cols () const
{
return cols;
inline
-std::size_t
+types::global_dof_index
CompressedSimpleSparsityPattern::row_length (const size_type row) const
{
Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
inline
-std::size_t
+types::global_dof_index
CompressedSimpleSparsityPattern::column_number (const size_type row,
const size_type index) const
{
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* An iterator that can be used to
inline
-std::size_t
+types::global_dof_index
CompressedSparsityPattern::n_rows () const
{
return rows;
inline
-std::size_t
+types::global_dof_index
CompressedSparsityPattern::n_cols () const
{
return cols;
inline
-std::size_t
+types::global_dof_index
CompressedSparsityPattern::row_length (const size_type row) const
{
Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
inline
-std::size_t
+types::global_dof_index
CompressedSparsityPattern::column_number (const size_type row,
const size_type index) const
{
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* An enum that describes what should
* consumption (in bytes) of this
* object.
*/
- size_type memory_consumption () const;
+ std::size_t memory_consumption () const;
/**
* @}
inline
-std::size_t
+types::global_dof_index
ConstraintMatrix::n_constraints () const
{
return lines.size();
inline
-const std::vector<std::pair<std::size_t,double> > *
+const std::vector<std::pair<types::global_dof_index,double> > *
ConstraintMatrix::get_constraint_entries (const size_type line) const
{
// check whether the entry is
-inline std::size_t
+inline types::global_dof_index
ConstraintMatrix::calculate_line_index (const size_type line) const
{
//IndexSet is unused (serial case)
{
namespace
{
+ typedef types::global_dof_index size_type;
+
// TODO: in general we should iterate over the constraints and not over all DoFs
// for performance reasons
template<class VEC>
// local_to_global functions.
namespace internals
{
+ typedef types::global_dof_index size_type;
+
// this struct contains all the information
// we need to store about each of the
// global entries (global_row): are they
/**
* Declare type of container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Standardized data struct to
/**
* Declare the type of container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Accessor class for iterators
template<class VECTOR>
inline
-size_type
+types::global_dof_index
FilteredMatrix<VECTOR>::Accessor::row() const
{
return matrix->constraints[index].first;
template<class VECTOR>
inline
-size_type
+types::global_dof_index
FilteredMatrix<VECTOR>::Accessor::column() const
{
return matrix->constraints[index].first;
/**
* Declare type of container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Type of matrix entries. In analogy to
template <typename number>
inline
-std::size_t
+types::global_dof_index
FullMatrix<number>::m() const
{
return this->n_rows();
template <typename number>
inline
-std::size_t
+types::global_dof_index
FullMatrix<number>::n() const
{
return this->n_cols();
template <typename number>
inline
-std::size_t
+types::global_dof_index
FullMatrix<number>::Accessor::row() const
{
return a_row;
template <typename number>
inline
-std::size_t
+types::global_dof_index
FullMatrix<number>::Accessor::column() const
{
return a_col;
typedef const value_type *const_iterator;
typedef value_type &reference;
typedef const value_type &const_reference;
- typedef size_t size_type;
+ typedef types::global_dof_index size_type;
typedef typename numbers::NumberTraits<Number>::real_type real_type;
/**
template <typename Number>
inline
- std::size_t Vector<Number>::size () const
+ typename Vector<Number>::size_type
+ Vector<Number>::size () const
{
return partitioner->size();
}
template <typename Number>
inline
- std::size_t Vector<Number>::local_size () const
+ typename Vector<Number>::size_type
+ Vector<Number>::local_size () const
{
return partitioner->local_size();
}
template <typename Number>
inline
- std::pair<std::size_t,std::size_t>
+ std::pair<typename Vector<Number>::size_type,
+ typename Vector<Number>::size_type>
Vector<Number>::local_range () const
{
return partitioner->local_range();
template <typename Number>
inline
- std::size_t
+ typename Vector<Number>::size_type
Vector<Number>::n_ghost_entries () const
{
return partitioner->n_ghost_indices();
*/
typedef PetscScalar value_type;
typedef PetscReal real_type;
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
typedef internal::VectorReference reference;
typedef const internal::VectorReference const_reference;
/**
* Declare type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* @name Constructors and initalization.
#ifndef DOXYGEN
template<typename number>
-size_type
+types::global_dof_index
TridiagonalMatrix<number>::m() const
{
return diagonal.size();
template<typename number>
-size_type
+types::global_dof_index
TridiagonalMatrix<number>::n() const
{
return diagonal.size();
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
-
-#ifdef DEAL_II_EPETRA_NO_64BIT_GLOBAL_INDICES
- /**
- * Declare the type of integer.
- */
- typedef int int_type;
-#else
- /**
- * Declare the type of integer.
- */
- typedef long long int_type;
-#endif
+ typedef types::global_dof_index size_type;
/**
* Typedef the base class for simpler
class BlockVector : public BlockVectorBase<Vector>
{
public:
- /**
- * Declare the type for container size.
- */
- typedef std::size_t size_type;
-
/**
* Typedef the base class for simpler
* access to its own typedefs.
class BlockVector : public BlockVectorBase<Vector>
{
public:
- /**
- * Declare the type for container size.
- */
- typedef std::size_t size_type;
-
/**
* Typedef the base class for simpler
* access to its own typedefs.
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
-
-#ifdef DEAL_II_EPETRA_NO_64BIT_GLOBAL_INDICES
- /**
- * Declare type of integer.
- */
- typedef int int_type;
-#else
- /**
- * Declare type of integer.
- */
- typedef long long int_type;
-#endif
+ typedef 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<int_type>(dst.size()),
+ AssertDimension (static_cast<TrilinosWrapper::types::int_type>(dst.size()),
preconditioner->OperatorDomainMap().NumMyElements());
- AssertDimension (static_cast<int_type>(src.size()),
+ AssertDimension (static_cast<TrilinosWrapper::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<int_type>(dst.size()),
+ AssertDimension (static_cast<TrilinosWrapper::types::int_type>(dst.size()),
preconditioner->OperatorDomainMap().NumMyElements());
- AssertDimension (static_cast<int_type>(src.size()),
+ AssertDimension (static_cast<TrilinosWrapper::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<int_type>(dst.local_size()),
+ AssertDimension (static_cast<TrilinosWrapper::types::int_type>(dst.local_size()),
preconditioner->OperatorDomainMap().NumMyElements());
- AssertDimension (static_cast<int_type>(src.local_size()),
+ AssertDimension (static_cast<TrilinosWrapper::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<int_type>(dst.local_size()),
+ AssertDimension (static_cast<TrilinosWrapper::types::int_type>(dst.local_size()),
preconditioner->OperatorDomainMap().NumMyElements());
- AssertDimension (static_cast<int_type>(src.local_size()),
+ AssertDimension (static_cast<TrilinosWrapper::types::int_type>(src.local_size()),
preconditioner->OperatorRangeMap().NumMyElements());
Epetra_Vector tril_dst (View, preconditioner->OperatorDomainMap(),
dst.begin());
/**
* Declare the type for container size.
*/
- typedef std::size_t size_type;
-
-#ifdef DEAL_II_EPETRA_NO_64BIT_GLOBAL_INDICES
- /**
- * Declare type of integer.
- */
- typedef int int_type;
-#else
- /**
- * Declare type of integer.
- */
- typedef long long int_type;
-#endif
+ typedef types::global_dof_index size_type;
/**
* Constructor.
/**
* Declare type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Typedef for the matrix type
bool
SparseMatrix::in_local_range (const size_type index) const
{
- int_type begin, end;
+ TrilinosWrapper::types::int_type begin, end;
begin = matrix->RowMap().MinMyGID();
end = matrix->RowMap().MaxMyGID()+1;
last_action = Insert;
- int_type *col_index_ptr;
+ TrilinosWrapper::types::int_type *col_index_ptr;
TrilinosScalar const *col_value_ptr;
- int_type n_columns;
+ TrilinosWrapper::types::int_typeint_type n_columns;
// If we don't elide zeros, the pointers
// are already available...
if (elide_zero_values == false)
{
- col_index_ptr = (int_type *)col_indices;
+ col_index_ptr = (TrilinosWrapper::types::int_type *)col_indices;
col_value_ptr = values;
n_columns = n_cols;
}
}
}
- Assert(n_columns <= (int_type)n_cols, ExcInternalError());
+ Assert(n_columns <= (TrilinosWrapper::types::int_type)n_cols, ExcInternalError());
- col_index_ptr = (int_type *)&column_indices[0];
+ col_index_ptr = (TrilinosWrapper::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<int_type>(row)) == true)
+ if (row_partitioner().MyGID(static_cast<TrilinosWrapper::types::int_type>(row)) == true)
{
if (matrix->Filled() == false)
{
if (matrix->Filled() == false)
{
- ierr = matrix->InsertGlobalValues (1, (int_type *)&row,
+ ierr = matrix->InsertGlobalValues (1,
+ (TrilinosWrapper::types::int_type *)&row,
n_columns, col_index_ptr,
&col_value_ptr,
Epetra_FECrsMatrix::ROW_MAJOR);
ierr = 0;
}
else
- ierr = matrix->ReplaceGlobalValues (1, (int_type *)&row,
+ ierr = matrix->ReplaceGlobalValues (1,
+ (TrilinosWrapper::types::int_type *)&row,
n_columns, col_index_ptr,
&col_value_ptr,
Epetra_FECrsMatrix::ROW_MAJOR);
last_action = Add;
- int_type *col_index_ptr;
+ TrilinosWrapper::types::int_type *col_index_ptr;
TrilinosScalar const *col_value_ptr;
- int_type n_columns;
+ TrilinosWrapper::types::int_type n_columns;
// If we don't elide zeros, the pointers
// are already available...
if (elide_zero_values == false)
{
- col_index_ptr = (int_type *)col_indices;
+ col_index_ptr = (TrilinosWrapper::types::int_type *)col_indices;
col_value_ptr = values;
n_columns = n_cols;
#ifdef DEBUG
}
}
- Assert(n_columns <= (int_type)n_cols, ExcInternalError());
+ Assert(n_columns <= (TrilinosWrapper::types::int_type)n_cols, ExcInternalError());
- col_index_ptr = (int_type *)&column_indices[0];
+ col_index_ptr = (TrilinosWrapper::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<int_type>(row)) == true)
+ if (row_partitioner().MyGID(static_cast<TrilinosWrapper::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, (int_type *)&row, n_columns,
+ ierr = matrix->SumIntoGlobalValues (1,
+ (TrilinosWrapper::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 (int_type i=0; i<n_columns; ++i)
+ for (TrilinosWrapper::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;
- int_type n_indices, *indices;
- trilinos_sparsity_pattern().ExtractMyRowView(row_partitioner().LID(static_cast<int_type>(row)),
+ TrilinosWrapper::types::int_type n_indices, *indices;
+ trilinos_sparsity_pattern().ExtractMyRowView(row_partitioner().LID(static_cast<TrilinosWrapper::types::int_type>(row)),
n_indices,
indices);
- for (int_type i=0; i<n_indices; ++i)
+ for (TrilinosWrapper::types::int_type i=0; i<n_indices; ++i)
std::cout << indices[i] << " ";
std::cout << endl << std::endl;
Assert (ierr <= 0,
/**
* Declare type for container size.
*/
- typedef std::size_t size_type;
-
-#ifdef DEAL_II_EPETRA_NO_64BIT_GLOBAL_INDICES
- /**
- * Declare type of integer.
- */
- typedef int int_type;
-#else
- /**
- * Declare type of integer.
- */
- typedef long long int_type;
-#endif
-
+ typedef types::global_dof_index size_type;
/**
* Constructor.
bool
SparsityPattern::in_local_range (const size_type index) const
{
- int_type begin, end;
+ TrilinosWrapper::types::int_type begin, end;
begin = graph->RowMap().MinMyGID();
end = graph->RowMap().MaxMyGID()+1;
if (begin == end)
return;
- int_type *col_index_ptr = (int_type *)(&*begin);
- const int_type n_cols = static_cast<int_type>(end - begin);
+ 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);
compressed = false;
- const int ierr = graph->InsertGlobalIndices (1, (int_type *)&row,
+ const int ierr = graph->InsertGlobalIndices (1,
+ (TrilinosWrapper::types::int_type *)&row,
n_cols, col_index_ptr);
AssertThrow (ierr >= 0, ExcTrilinosError(ierr));
SparsityPattern::reinit (const IndexSet &row_parallel_partitioning,
const IndexSet &col_parallel_partitioning,
const MPI_Comm &communicator,
- const std::vector<int_type> &n_entries_per_row)
+ const std::vector<TrilinosWrapper::types::int_type> &n_entries_per_row)
{
Epetra_Map row_map =
row_parallel_partitioning.make_trilinos_map (communicator, false);
/**
* Declare type for container size.
*/
- typedef std::size_t size_type;
-
-#ifdef DEAL_II_EPETRA_NO_64BIT_GLOBAL_INDICES
- /**
- * Declare type of integer.
- */
- typedef int int_type;
-#else
- /**
- * Declare type of integer.
- */
- typedef long long int_type;
-#endif
-
+ typedef types::global_dof_index size_type;
/**
* @name Basic constructors and initalization.
has_ghosts = vector->Map().UniqueGIDs()==false;
- const int_type size = parallel_partitioner.NumMyElements();
+ const TrilinosWrapper::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 (int_type i=0; i<size; ++i)
+ for (Trilinos::Wrapper::Types::int_type i=0; i<size; ++i)
(*vector)[0][i] = v(parallel_partitioner.GID(i));
}
class Vector : public VectorBase
{
public:
-#ifdef EPETRA_NO_64BIT_GLOBAL_INDICES
- /**
- * Declare type for container size.
- */
- typedef unsigned int size_type;
-
- /**
- * Declare type of integer.
- */
- typedef int int_type;
-#else
- /**
- * Declare type for container size.
- */
- typedef uint64_t size_type;
-
- /**
- * Declare type of integer.
- */
- typedef long long int_type;
-#endif
+ /**
+ * Declare type for container size.
+ */
+ typedef types::global_dof_index size_type;
/**
* Default constructor that
template <typename number>
Vector::Vector (const dealii::Vector<number> &v)
{
- Epetra_LocalMap map ((int_type)v.size(), 0, Utilities::Trilinos::comm_self());
+ Epetra_LocalMap map ((TrilinosWrapper::types::int_type)v.size(), 0, Utilities::Trilinos::comm_self());
vector.reset (new Epetra_FEVector(map));
*this = v;
}
{
vector.reset();
- Epetra_LocalMap map ((int_type)v.size(), 0,
+ Epetra_LocalMap map ((TrilinosWrapper::types::int_type)v.size(), 0,
Utilities::Trilinos::comm_self());
vector.reset (new Epetra_FEVector(map));
}
const Epetra_Map &map = vector_partitioner();
- const int_type size = map.NumMyElements();
+ const TrilinosWrapper::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 (int_type i=0; i<size; ++i)
+ for (TrilinosWrapper::types::int_type i=0; i<size; ++i)
(*vector)[0][i] = v(i);
return *this;
/**
* Declare type for container size.
*/
- typedef std::size_t size_type;
-
-#ifdef DEAL_II_EPETRA_NO_64BIT_GLOBAL_INDICES
- /**
- * Declare type of integer.
- */
- typedef int int_type;
-#else
- /**
- * Declare type of integer.
- */
- typedef long long int_type;
-#endif
+ typedef types::global_dof_index size_type;
/**
* This looks like a copy
*/
typedef TrilinosScalar value_type;
typedef TrilinosScalar real_type;
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
typedef internal::VectorReference reference;
typedef const internal::VectorReference const_reference;
-#ifdef EPETRA_NO_64BIT_GLOBAL_INDICES
- /**
- * Declare type of integer.
- */
- typedef int int_type;
-#else
- /**
- * Declare type of integer.
- */
- typedef long long int_type;
-#endif
-
/**
* @name 1: Basic Object-handling
*/
for (size_type i=0; i<n_elements; ++i)
{
const size_type row = indices[i];
- const int_type local_row = vector->Map().LID(static_cast<int_type>(row));
+ const TrilinosWrapper::types::int_type local_row = vector->Map().LID(static_cast<TrilinosWrapper::Types::int_type>(row));
if (local_row == -1)
{
const int ierr = vector->ReplaceGlobalValues (1,
- (const int_type *)(&row),
+ (const TrilinosWrapper::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 int_type local_row = vector->Map().LID(static_cast<int_type>(row));
+ const TrilinosWrapper::types::int_type local_row = vector->Map().LID(static_cast<TrilinosWrapper::Types::int_type>(row));
if (local_row == -1)
{
const int ierr = vector->SumIntoGlobalValues (1,
- (const int_type *)(&row),
+ (const TrilinosWrapper::types::int_type *)(&row),
&values[i]);
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
compressed = false;
std::pair<size_type, size_type>
VectorBase::local_range () const
{
- int_type begin, end;
+ TrilinosWrapper::types::int_type begin, end;
begin = vector->Map().MinMyGID();
end = vector->Map().MaxMyGID()+1;
return std::make_pair (begin, end);
typedef const value_type *const_iterator;
typedef value_type &reference;
typedef const value_type &const_reference;
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Declare a type that has holds
/**
* Return dimension of the vector.
*/
- size_type size () const;
+ std::size_t size () const;
/**
* Return whether the vector contains only
* memory consumption (in bytes)
* of this object.
*/
- size_type memory_consumption () const;
+ std::size_t memory_consumption () const;
//@}
/**
{
namespace Vector
{
+ typedef types::global_dof_index size_type;
+
template<typename T>
void set_subrange (const T s,
const size_type begin,
template <typename Number>
-size_type
+std::size_t
Vector<Number>::memory_consumption () const
{
return sizeof(*this) + (max_vec_size * sizeof(Number));
/**
* Declare type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Constructor. The argument
/**
* Declare type for container size.
*/
- typedef std::size_t size_type;
+ typedef types::global_dof_index size_type;
/**
* Read write constructor. Takes the size
template <typename Number>
struct ConstraintValues
{
- /**
- * In the definition of next_constraint and constraints below,
- * there is an argument that is in fact the size of constraints.
- * To be clarified, we explicitly use the size_type of the
- * std::map container as the type. We define the size_type for
- * a container that contains <int, int> rather than the real
- * types in the `constraints' object to avoid self-recursiveness.
- */
- typedef std::map<int, int>::size_type size_type;
-
ConstraintValues();
/**
std::vector<std::pair<types::global_dof_index, double> > constraint_entries;
std::vector<types::global_dof_index> constraint_indices;
- std::pair<std::vector<Number>, size_type> next_constraint;
- std::map<std::vector<Number>, size_type, FPArrayComparator<double> > constraints;
+ std::pair<std::vector<Number>, types::global_dof_index> next_constraint;
+ std::map<std::vector<Number>, types::global_dof_index, FPArrayComparator<double> > constraints;
};
constraint_entries = entries;
std::sort(constraint_entries.begin(), constraint_entries.end(),
ConstraintComparator());
- for (size_type j=0; j<constraint_entries.size(); j++)
+ for (types::global_dof_index j=0; j<constraint_entries.size(); j++)
{
// copy the indices of the constraint entries after sorting.
constraint_indices[j] = constraint_entries[j].first;
// equal. this was quite lenghty and now we use a std::map with a
// user-defined comparator to compare floating point arrays to a
// tolerance 1e-13.
- std::pair<typename std::map<std::vector<double>, size_type,
+ std::pair<typename std::map<std::vector<double>, types::global_dof_index,
FPArrayComparator<double> >::iterator,
bool> it = constraints.insert(next_constraint);
- size_type insert_position = deal_II_numbers::invalid_unsigned_int;
+ types::global_dof_index insert_position = deal_II_numbers::invalid_dof_index;
if (it.second == false)
insert_position = it.first->second;
else
template <typename number>
-size_type
+typename BlockMatrixArray<number>::size_type
BlockMatrixArray<number>::n_block_rows () const
{
return block_rows;
template <typename number>
-size_type
+typename BlockMatrixArray<number>::size_type
BlockMatrixArray<number>::n_block_cols () const
{
return block_cols;
template <class SparsityPatternBase>
-size_type
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
BlockSparsityPatternBase<SparsityPatternBase>::max_entries_per_row () const
{
size_type max_entries = 0;
template <class SparsityPatternBase>
-size_type
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
BlockSparsityPatternBase<SparsityPatternBase>::n_rows () const
{
// only count in first column, since
template <class SparsityPatternBase>
-size_type
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
BlockSparsityPatternBase<SparsityPatternBase>::n_cols () const
{
// only count in first row, since
template <class SparsityPatternBase>
-size_type
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
BlockSparsityPatternBase<SparsityPatternBase>::n_nonzero_elements () const
{
size_type count = 0;
ChunkSparsityPattern::ChunkSparsityPattern (
- const types::global_dof_index m,
+ const size_type m,
const std::vector<size_type> &row_lengths,
const size_type chunk_size,
const bool)
void
ChunkSparsityPattern::reinit (
- const types::global_dof_index m,
- const types::global_dof_index n,
+ const size_type m,
+ const size_type n,
const VectorSlice<const std::vector<size_type> > &row_lengths,
const size_type chunk_size,
const bool)
{
namespace
{
+ /**
+ * Declare type for container size.
+ */
+ typedef 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>
-size_type
+ChunkSparsityPattern::size_type
ChunkSparsityPattern::max_entries_per_row () const
{
return sparsity_pattern.max_entries_per_row() * chunk_size;
-size_type
+ChunkSparsityPattern::size_type
ChunkSparsityPattern::row_length (const size_type i) const
{
Assert (i<rows, ExcIndexRange(i,0,rows));
-size_type
+ChunkSparsityPattern::size_type
ChunkSparsityPattern::n_nonzero_elements () const
{
if ((n_rows() % chunk_size == 0)
-size_type
+ChunkSparsityPattern::size_type
ChunkSparsityPattern::bandwidth () const
{
// calculate the bandwidth from that of the
-size_type
+CompressedSetSparsityPattern::size_type
CompressedSetSparsityPattern::max_entries_per_row () const
{
size_type m = 0;
-size_type
+CompressedSetSparsityPattern::size_type
CompressedSetSparsityPattern::bandwidth () const
{
size_type b=0;
-size_type
+CompressedSetSparsityPattern::size_type
CompressedSetSparsityPattern::n_nonzero_elements () const
{
size_type n=0;
}
-std::size_t
+CompressedSimpleSparsityPattern::size_type
CompressedSimpleSparsityPattern::Line::memory_consumption () const
{
return entries.capacity()*sizeof(size_type)+sizeof(Line);
-size_type
+CompressedSimpleSparsityPattern::size_type
CompressedSimpleSparsityPattern::max_entries_per_row () const
{
size_type m = 0;
-size_type
+CompressedSimpleSparsityPattern::size_type
CompressedSimpleSparsityPattern::bandwidth () const
{
size_type b=0;
-size_type
+CompressedSimpleSparsityPattern::size_type
CompressedSimpleSparsityPattern::n_nonzero_elements () const
{
size_type n=0;
}
-size_type
+CompressedSimpleSparsityPattern::size_type
CompressedSimpleSparsityPattern::memory_consumption () const
{
//TODO: IndexSet...
-size_type
+CompressedSparsityPattern::size_type
CompressedSparsityPattern::max_entries_per_row () const
{
size_type m = 0;
-size_type
+CompressedSparsityPattern::size_type
CompressedSparsityPattern::bandwidth () const
{
size_type b=0;
-size_type
+CompressedSparsityPattern::size_type
CompressedSparsityPattern::n_nonzero_elements () const
{
size_type n=0;
-size_type
+std::size_t
ConstraintMatrix::ConstraintLine::memory_consumption () const
{
return (MemoryConsumption::memory_consumption (line) +
// in debug mode: check whether we really
// set the pointers correctly.
for (size_type i=0; i<lines_cache.size(); ++i)
- if (lines_cache[i] != numbers::invalid_size_int)
+ if (lines_cache[i] != numbers::invalid_size_type)
Assert (i == calculate_line_index(lines[lines_cache[i]].line),
ExcInternalError());
-size_type ConstraintMatrix::max_constraint_indirections () const
+ConstraintMatrix::size_type
+ConstraintMatrix::max_constraint_indirections () const
{
size_type return_value = 0;
for (std::vector<ConstraintLine>::const_iterator i=lines.begin();
-size_type
+std::size_t
ConstraintMatrix::memory_consumption () const
{
return (MemoryConsumption::memory_consumption (lines) +
#define PARALLEL_VECTOR_FUNCTIONS(VectorType) \
template void ConstraintMatrix:: \
distribute_local_to_global<VectorType > (const Vector<double> &, \
- const std::vector<std::size_t> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
VectorType &, \
const FullMatrix<double> &) const
template void ConstraintMatrix:: \
distribute_local_to_global<MatrixType,VectorType > (const FullMatrix<double> &, \
const Vector<double> &, \
- const std::vector<std::size_t> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
MatrixType &, \
VectorType &, \
bool , \
template void ConstraintMatrix:: \
distribute_local_to_global<MatrixType,Vector<double> > (const FullMatrix<double> &, \
const Vector<double> &, \
- const std::vector<std::size_t> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
MatrixType &, \
Vector<double> &, \
bool , \
template void ConstraintMatrix:: \
distribute_local_to_global<MatrixType,VectorType > (const FullMatrix<double> &, \
const Vector<double> &, \
- const std::vector<std::size_t> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
MatrixType &, \
VectorType &, \
bool , \
template void ConstraintMatrix:: \
distribute_local_to_global<MatrixType,Vector<double> > (const FullMatrix<double> &, \
const Vector<double> &, \
- const std::vector<std::size_t> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
MatrixType &, \
Vector<double> &, \
bool , \
#define SPARSITY_FUNCTIONS(SparsityType) \
template void ConstraintMatrix::add_entries_local_to_global<SparsityType> (\
- const std::vector<std::size_t> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
SparsityType &, \
const bool, \
const Table<2,bool> &, \
internal::bool2type<false>) const; \
template void ConstraintMatrix::add_entries_local_to_global<SparsityType> (\
- const std::vector<std::size_t> &, \
- const std::vector<std::size_t> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
SparsityType &, \
const bool, \
const Table<2,bool> &) const
#define BLOCK_SPARSITY_FUNCTIONS(SparsityType) \
template void ConstraintMatrix::add_entries_local_to_global<SparsityType> (\
- const std::vector<std::size_t> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
SparsityType &, \
const bool, \
const Table<2,bool> &, \
internal::bool2type<true>) const; \
template void ConstraintMatrix::add_entries_local_to_global<SparsityType> (\
- const std::vector<std::size_t> &, \
- const std::vector<std::size_t> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
SparsityType &, \
const bool, \
const Table<2,bool> &) const
#define ONLY_MATRIX_FUNCTIONS(MatrixType) \
template void ConstraintMatrix::distribute_local_to_global<MatrixType > (\
const FullMatrix<double> &, \
- const std::vector<std::size_t> &, \
- const std::vector<std::size_t> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
+ const std::vector<ConstraintMatrix::size_type> &, \
MatrixType &) const
ONLY_MATRIX_FUNCTIONS(SparseMatrix<float>);
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<int_type>(block_sparsity_pattern.block(i,0).n_rows()),
+ (Epetra_Map(static_cast<TrilinosWrapper::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<int_type>(dealii_block_sparse_matrix.block(i,0).m()),
+ parallel_partitioning.push_back (Epetra_Map(static_cast<TrilinosWrapper::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)
{
- int_type global_row_id = constant_modes_are_global ? domain_map.GID(row) : row;
+ TrilinosWrapper::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<int_type>(n_rows), 0, communicator));
+ vector_distributor.reset (new Epetra_Map(static_cast<TrilinosWrapper::types::int_type>(n_rows),
+ 0, communicator));
if (trilinos_matrix.get() == 0)
trilinos_matrix.reset (new SparseMatrix());
// get a representation of the present
// row
- int_type ncols;
- int_type colnums = matrix->n();
+ TrilinosWrapper::types::int_type ncols;
+ TrilinosWrapper::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((int_type)this->a_row,
+ ExtractGlobalRowCopy((TrilinosWrapper::types::int_type)this->a_row,
colnums,
ncols, &((*value_cache)[0]),
- reinterpret_cast<int_type *>(&((*colnum_cache)[0])));
+ reinterpret_cast<TrilinosWrapper::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,
- int_type(n_max_entries_per_row), false)),
+ TrilinosWrapper::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,
- (int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
+ (TrilinosWrapper::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,
- int_type(n_max_entries_per_row), false)),
+ TrilinosWrapper::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,
- (int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
+ (TrilinosWrapper::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<int_type>(n), 0,
+ column_space_map (new Epetra_Map (static_cast<TrilinosWrapper::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<int_type>(m), 0,
+ Epetra_Map (static_cast<TrilinosWrapper::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<int_type>(n), 0,
+ column_space_map (new Epetra_Map (static_cast<TrilinosWrapper::types::int_type>(n), 0,
Utilities::Trilinos::comm_self())),
matrix (new Epetra_FECrsMatrix(Copy,
- Epetra_Map (static_cast<int_type>(m), 0,
+ Epetra_Map (static_cast<TrilinosWrapper::types::int_type>(m), 0,
Utilities::Trilinos::comm_self()),
*column_space_map,
- (int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
+ (TrilinosWrapper::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,
- (int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
+ (TrilinosWrapper::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),
- (int_type *)const_cast<size_type *>(&(n_entries_per_row[0])),
+ (TrilinosWrapper::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<int_type>(sparsity_pattern.n_rows()),
+ const Epetra_Map rows (static_cast<TrilinosWrapper::types::int_type>(sparsity_pattern.n_rows()),
0,
Utilities::Trilinos::comm_self());
- const Epetra_Map columns (static_cast<int_type>(sparsity_pattern.n_cols()),
+ const Epetra_Map columns (static_cast<TrilinosWrapper::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<int_type> &row_indices)
+ std::vector<TrilinosWrapper::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_int row,
- std::vector<int_type> &row_indices)
+ std::vector<TrilinosWrapper::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<int_type> n_entries_per_row(last_row-first_row);
+ std::vector<TrilinosWrapper::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<int_type> row_indices;
+ std::vector<TrilinosWrapper::types::int_type> row_indices;
for (size_type row=first_row; row<last_row; ++row)
{
- const int_type row_length = sparsity_pattern.row_length(row);
+ const TrilinosWrapper::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<int_type>(dealii_sparse_matrix.m()),
+ const Epetra_Map rows (static_cast<TrilinosWrapper::types::int_type>(dealii_sparse_matrix.m()),
0,
Utilities::Trilinos::comm_self());
- const Epetra_Map columns (static_cast<int_type>(dealii_sparse_matrix.n()),
+ const Epetra_Map columns (static_cast<TrilinosWrapper::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() == (int_type)n_rows,
+ Assert (input_row_map.NumGlobalElements() == (TrilinosWrapper::types::int_type)n_rows,
ExcDimensionMismatch (input_row_map.NumGlobalElements(),
n_rows));
- Assert (input_col_map.NumGlobalElements() == (int_type)dealii_sparse_matrix.n(),
+ Assert (input_col_map.NumGlobalElements() == (TrilinosWrapper::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<int_type>(row)) == true)
+ if (input_row_map.MyGID(static_cast<TrilinosWrapper::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.
- int_type local_row = matrix->LRID(static_cast<int_type>(row));
+ TrilinosWrapper::types::int_type local_row =
+ matrix->LRID(static_cast<TrilinosWrapper::types::int_type>(row));
if (local_row >= 0)
{
TrilinosScalar *values;
- int_type *col_indices;
- int_type num_entries;
+ TrilinosWrapper::types::int_type *col_indices;
+ TrilinosWrapper::types::int_type num_entries;
const int ierr = matrix->ExtractMyRowView(local_row, num_entries,
values, col_indices);
Assert (ierr == 0,
ExcTrilinosError(ierr));
- int_type *diag_find = std::find(col_indices,col_indices+num_entries,
- local_row);
- int_type diag_index = (int_type)(diag_find - col_indices);
+ TrilinosWrapper::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);
- for (int_type j=0; j<num_entries; ++j)
+ for (TrilinosWrapper::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.
- int_type trilinos_i = matrix->LRID(static_cast<int_type>(i)),
- trilinos_j = matrix->LCID(static_cast<int_type>(j));
+ 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));
TrilinosScalar value = 0.;
// If the data is not on the
// Prepare pointers for extraction
// of a view of the row.
- int_type nnz_present = matrix->NumMyEntries(trilinos_i);
- int_type nnz_extracted;
- int_type *col_indices;
+ TrilinosWrapper::types::int_type nnz_present = matrix->NumMyEntries(trilinos_i);
+ TrilinosWrapper::types::int_type nnz_extracted;
+ TrilinosWrapper::types::int_type *col_indices;
TrilinosScalar *values;
// Generate the view and make
// look for the value, and then
// finally get it.
- int_type *el_find = std::find(col_indices, col_indices + nnz_present,
- trilinos_j);
+ TrilinosWrapper::types::int_type *el_find = std::find(col_indices,
+ col_indices + nnz_present, trilinos_j);
- int_type local_col_index = (int_type)(el_find - col_indices);
+ TrilinosWrapper::types::int_type local_col_index =
+ (TrilinosWrapper::types::int_type)(el_find - col_indices);
// This is actually the only
// difference to the el(i,j)
{
// Extract local indices in
// the matrix.
- int_type trilinos_i = matrix->LRID(static_cast<int_type>(i)), trilinos_j = matrix->LCID(static_cast<int_type>(j));
+ 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));
TrilinosScalar value = 0.;
// If the data is not on the
// Prepare pointers for extraction
// of a view of the row.
- int_type nnz_present = matrix->NumMyEntries(trilinos_i);
- int_type nnz_extracted;
- int_type *col_indices;
+ TrilinosWrapper::types::int_type nnz_present = matrix->NumMyEntries(trilinos_i);
+ TrilinosWrapper::types::int_type nnz_extracted;
+ TrilinosWrapper::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.
- int_type *el_find = std::find(col_indices, col_indices + nnz_present,
- trilinos_j);
+ TrilinosWrapper::types::int_type *el_find = std::find(col_indices,
+ col_indices + nnz_present, trilinos_j);
- int_type local_col_index = (int_type)(el_find - col_indices);
+ TrilinosWrapper::types::int_type local_col_index =
+ (TrilinosWrapper::types::int_type)(el_find - col_indices);
// This is actually the only
// get a representation of the
// present row
- int_type ncols = -1;
- int_type local_row = matrix->LRID(static_cast<int_type>(row));
+ TrilinosWrapper::types::int_type ncols = -1;
+ TrilinosWrapper::types::int_type local_row =
+ matrix->LRID(static_cast<TrilinosWrapper::types::int_type>(row));
// on the processor who owns this
// row, we'll have a non-negative
ExcMessage ("Parallel distribution of matrix B and vector V "
"does not match."));
- const int_type local_N = inputright.local_size();
- for (int_type i=0; i<local_N; ++i)
+ const TrilinosWrapper::types::int_type local_N = inputright.local_size();
+ for (TrilinosWrapper::types::int_type i=0; i<local_N; ++i)
{
- int_type N_entries = -1;
+ TrilinosWrapper::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 (int_type j=0; j<N_entries; ++j)
+ for (TrilinosWrapper::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)
{
- int_type num_entries, * indices;
+ TrilinosWrapper::types::int_type num_entries, * indices;
inputleft.trilinos_sparsity_pattern().ExtractMyRowView(i, num_entries,
indices);
Assert (num_entries >= 0, ExcInternalError());
const sizretype GID = inputleft.row_partitioner().GID(i);
- for (int_type j=0; j<num_entries; ++j)
+ for (TrilinosWrapper::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)
{
- int_type num_entries, * indices;
+ TrilinosWrapper::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 (int_type j=0; j<num_entries; ++j)
+ for (TrilinosWrapper::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;
- int_type max_per_proc;
- int_type N_input_vector = B_->invec_leng;
+ TrilinosWrapper::types::int_type max_per_proc;
+ TrilinosWrapper::types::int_type N_input_vector = B_->invec_leng;
getrow_comm = B_->getrow->pre_comm;
if ( getrow_comm != NULL)
- for (int_type i = 0; i < getrow_comm->N_neighbors; i++)
- for (int_type j = 0; j < getrow_comm->neighbors[i].N_send; j++)
+ 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++)
AssertThrow (getrow_comm->neighbors[i].send_list[j] < N_input_vector,
ExcInternalError());
ExcDimensionMismatch(matrix->NumGlobalEntries(row),
rhs.matrix->NumGlobalEntries(row)));
- const int_type row_local = matrix->RowMap().LID(static_cast<int_type>(row));
- int_type n_entries, rhs_n_entries;
+ 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;
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
- int_type *index_ptr, *rhs_index_ptr;
+ TrilinosWrapper::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 (int_type i=0; i<n_entries; ++i)
+ for (TrilinosWrapper::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<int_type> column_indices (max_row_length);
+ std::vector<TrilinosWrapper::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 int_type row_local = matrix->RowMap().LID(static_cast<int_type>(row));
- int_type n_entries;
+ const TrilinosWrapper::types::int_type row_local =
+ matrix->RowMap().LID(static_cast<TrilinosWrapper::types::int_type>(row));
+ TrilinosWrapper::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 (int_type i=0; i<n_entries; ++i)
+ for (TrilinosWrapper::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)
{
- int_type n_entries;
+ TrilinosWrapper::types::int_type n_entries;
ierr = rhs.matrix->Epetra_CrsMatrix::ExtractGlobalRowCopy
- ((int_type)row, max_row_length, n_entries, &values[0], &column_indices[0]);
+ ((TrilinosWrapper::types::int_type)row, max_row_length,
+ n_entries, &values[0], &column_indices[0]);
Assert (ierr == 0, ExcTrilinosError(ierr));
- for (int_type i=0; i<n_entries; ++i)
+ for (TrilinosWrapper::types::int_type i=0; i<n_entries; ++i)
values[i] *= factor;
ierr = matrix->Epetra_CrsMatrix::SumIntoGlobalValues
- ((int_type)row, n_entries, &values[0], &column_indices[0]);
+ ((TrilinosWrapper::types::int_type)row, n_entries,
+ &values[0], &column_indices[0]);
Assert (ierr == 0, ExcTrilinosError(ierr));
}
compress ();
else
{
double *values;
- int_type *indices;
- int_type num_entries;
+ TrilinosWrapper::types::int_type *indices;
+ TrilinosWrapper::types::int_type num_entries;
- for (int_type i=0; i<matrix->NumMyRows(); ++i)
+ for (TrilinosWrapper::types::int_type i=0; i<matrix->NumMyRows(); ++i)
{
matrix->ExtractMyRowView (i, num_entries, values, indices);
- for (int_type j=0; j<num_entries; ++j)
+ for (TrilinosWrapper::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(int_type))*matrix->NumMyNonzeros() +
- sizeof(int)*local_size() +
- static_memory);
+ return ((sizeof(TrilinosScalar)+sizeof(TrilinosWrapper::types::int_type))*
+ matrix->NumMyNonzeros() + sizeof(int)*local_size() + static_memory);
}
// get a representation of the present
// row
- int_type ncols;
- int_type colnums = sparsity_pattern->n_cols();
+ TrilinosWrapper::types::int_type ncols;
+ TrilinosWrapper::types::int_type colnums = sparsity_pattern->n_cols();
int ierr;
- ierr = sparsity_pattern->graph->ExtractGlobalRowCopy((int_type)this->a_row,
+ ierr = sparsity_pattern->graph->ExtractGlobalRowCopy((TrilinosWrapper::types::int_type)this->a_row,
colnums,
ncols,
- (int_type *)&(*colnum_cache)[0]);
+ (TrilinosWrapper::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<int_type>(m), 0, Utilities::Trilinos::comm_self());
- const Epetra_Map columns (static_cast<int_type>(n), 0, Utilities::Trilinos::comm_self());
+ 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());
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<int_type>(m), 0, Utilities::Trilinos::comm_self());
- const Epetra_Map columns (static_cast<int_type>(n), 0, Utilities::Trilinos::comm_self());
+ 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());
reinit (rows, columns, n_entries_per_row);
}
void
SparsityPattern::reinit (const Epetra_Map &input_row_map,
const Epetra_Map &input_col_map,
- const std::vector<int_type> &n_entries_per_row)
+ const std::vector<TrilinosWrapper::types::int_type> &n_entries_per_row)
{
// release memory before reallocation
graph.reset ();
template <typename Sparsity>
void copy_row (const Sparsity &csp,
const size_type row,
- std::vector<int_type> &row_indices)
+ std::vector<TrilinosWrapper::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<int_type> &row_indices)
+ std::vector<TrilinosWrapper::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<int_type> n_entries_per_row(last_row - first_row);
+ std::vector<TrilinosWrapper::type::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<int_type> row_indices;
+ std::vector<TrilinosWrapper::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 int_type row_length = sp.row_length(row);
+ const TrilinosWrapper::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 int_type row_length = sp.row_length(row);
+ const TrilinosWrapper::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<int_type *>(&row),
+ graph->InsertGlobalIndices (1,
+ reinterpret_cast<TrilinosWrapper::types::int_type *>(&row),
row_length, &row_indices[0]);
}
void
SparsityPattern::copy_from (const SparsityType &sp)
{
- const Epetra_Map rows (static_cast<int_type>(sp.n_rows()), 0, Utilities::Trilinos::comm_self());
- const Epetra_Map columns (static_cast<int_type>(sp.n_cols()), 0, Utilities::Trilinos::comm_self());
+ 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());
reinit (rows, columns, sp);
}
{
// Extract local indices in
// the matrix.
- int_type trilinos_i = graph->LRID(static_cast<int_type>(i)), trilinos_j = graph->LCID(static_cast<int_type>(j));
+ 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));
// If the data is not on the
// present processor, we throw
// local indices.
if (graph->Filled() == false)
{
- int_type nnz_present = graph->NumGlobalIndices(i);
- int_type nnz_extracted;
- int_type *col_indices;
+ TrilinosWrapper::types::int_type nnz_present = graph->NumGlobalIndices(i);
+ TrilinosWrapper::types::int_type nnz_extracted;
+ TrilinosWrapper::types::int_type *col_indices;
// Generate the view and make
// sure that we have not generated
ExcDimensionMismatch(nnz_present, nnz_extracted));
// Search the index
- int_type *el_find = std::find(col_indices, col_indices + nnz_present,
- trilinos_j);
+ TrilinosWrapper::types::int_type *el_find =
+ std::find(col_indices, col_indices + nnz_present, trilinos_j);
- int_type local_col_index = (int_type)(el_find - col_indices);
+ TrilinosWrapper::types::int_type local_col_index =
+ (TrilinosWrapper::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.
- int_type nnz_present = graph->NumGlobalIndices(i);
- int_type nnz_extracted;
- int_type *col_indices;
+ TrilinosWrapper::types::int_type nnz_present = graph->NumGlobalIndices(i);
+ TrilinosWrapper::types::int_type nnz_extracted;
+ TrilinosWrapper::types::int_type *col_indices;
// Generate the view and make
// sure that we have not generated
ExcDimensionMismatch(nnz_present, nnz_extracted));
// Search the index
- int_type *el_find = std::find(col_indices, col_indices + nnz_present,
- trilinos_j);
+ TrilinosWrapper::types::int_type *el_find = std::find(col_indices,
+ col_indices + nnz_present, trilinos_j);
- int_type local_col_index = (int_type)(el_find - col_indices);
+ TrilinosWrapper::types::int_type local_col_index =
+ (TrilinosWrapper::types::int_type)(el_find - col_indices);
if (local_col_index == nnz_present)
return false;
SparsityPattern::bandwidth () const
{
size_type local_b=0;
- int_type global_b=0;
+ TrilinosWrapper::types::int_type global_b=0;
for (size_type i=0; i<local_size(); ++i)
{
- int_type *indices;
- int_type num_entries;
+ TrilinosWrapper::types::int_type *indices;
+ TrilinosWrapper::types::int_type num_entries;
graph->ExtractMyRowView(i, num_entries, indices);
for (size_type j=0; j<(size_type)num_entries; ++j)
{
local_b = std::abs(static_cast<size_type>(i-indices[j]));
}
}
- graph->Comm().MaxAll((int_type *)&local_b, &global_b, 1);
+ graph->Comm().MaxAll((TrilinosWrapper::types::int_type *)&local_b, &global_b, 1);
return static_cast<size_type>(global_b);
}
size_type
SparsityPattern::n_rows () const
{
- const int_type n_rows = graph -> NumGlobalRows();
+ const TrilinosWrapper::types::int_type n_rows = graph -> NumGlobalRows();
return n_rows;
}
size_type
SparsityPattern::n_cols () const
{
- int_type n_cols;
+ TrilinosWrapper::types::int_type n_cols;
if (graph->Filled() == true)
n_cols = graph -> NumGlobalCols();
else
size_type
SparsityPattern::local_size () const
{
- int_type n_rows = graph -> NumMyRows();
+ TrilinosWrapper::types::int_type n_rows = graph -> NumMyRows();
return n_rows;
}
size_type
SparsityPattern::n_nonzero_elements () const
{
- int_type nnz = graph->NumGlobalEntries();
+ TrilinosWrapper::types::int_type nnz = graph->NumGlobalEntries();
return static_cast<size_type>(nnz);
}
size_type
SparsityPattern::max_entries_per_row () const
{
- int_type nnz = graph->MaxNumIndices();
+ TrilinosWrapper::types::int_type nnz = graph->MaxNumIndices();
return static_cast<size_type>(nnz);
}
// get a representation of the
// present row
- int_type ncols = -1;
- int_type local_row = graph->LRID(static_cast<int_type>(row));
+ TrilinosWrapper::types::int_type ncols = -1;
+ TrilinosWrapper::types::int_type local_row =
+ graph->LRID(static_cast<TrilinosWrapper::types::int_type>(row));
// on the processor who owns this
// row, we'll have a non-negative
out << *graph;
else
{
- int_type *indices;
- int_type num_entries;
+ TrilinosWrapper::types::int_type *indices;
+ TrilinosWrapper::types::int_type num_entries;
- for (int_type i=0; i<graph->NumMyRows(); ++i)
+ for (TrilinosWrapper::types::int_type i=0; i<graph->NumMyRows(); ++i)
{
graph->ExtractMyRowView (i, num_entries, indices);
- for (int_type j=0; j<num_entries; ++j)
+ for (TrilinosWrapper::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)
{
- signed int_type *indices;
- int_type num_entries;
+ signed TrilinosWrapper::types::int_type *indices;
+ TrilinosWrapper::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<int_type>(j))] << " " << -static_cast<signed int_type>(row)
- << std::endl;
+ out << indices[graph->GRID(static_cast<TrilinosWrapper::types::int_type>(j))]
+ << " " << -static_cast<signed TrilinosWrapper::types::int_type>(row)
+ << std::endl;
}
AssertThrow (out, ExcIO());
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<int_type> global_ids (n_elements, -1);
+ std::vector<TrilinosWrapper::types::int_type> global_ids (n_elements, -1);
for (size_type block=0; block<v.n_blocks(); ++block)
{
- int_type *glob_elements =
+ TrilinosWrapper::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 ((int_type)n, 0, Utilities::Trilinos::comm_self());
+ Epetra_LocalMap map ((TrilinosWrapper::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<int_type>(partitioning.size()),
+ Epetra_LocalMap map (static_cast<TrilinosWrapper::types::int_type>(partitioning.size()),
0,
#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
Epetra_MpiComm(communicator));
{
if (size() != n)
{
- Epetra_LocalMap map ((int_type)n, 0,
+ Epetra_LocalMap map ((TrilinosWrapper::types::int_type)n, 0,
Utilities::Trilinos::comm_self());
vector.reset (new Epetra_FEVector (map));
}
const bool fast)
{
if (vector->Map().NumGlobalElements() !=
- static_cast<int_type>(partitioning.size()))
+ static_cast<TrilinosWrapper::types::int_type>(partitioning.size()))
{
- Epetra_LocalMap map (static_cast<int_type>(partitioning.size()),
+ Epetra_LocalMap map (static_cast<TrilinosWrapper::types::int_type>(partitioning.size()),
0,
#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
Epetra_MpiComm(communicator));
// we can use []. Note that we
// can only get local values.
- const int_type local_index =
- vector.vector->Map().LID(static_cast<int_type>(index));
+ const TrilinosWrapper::types::int_type local_index =
+ vector.vector->Map().LID(static_cast<TrilinosWrapper::types::int_type>(index));
Assert (local_index >= 0,
ExcAccessToNonLocalElement (index,
vector.vector->Map().MinMyGID(),
{
// Extract local indices in
// the vector.
- int_type trilinos_i = vector->Map().LID(static_cast<int_type>(index));
+ TrilinosWrapper::types::int_type trilinos_i =
+ vector->Map().LID(static_cast<TrilinosWrapper::types::int_type>(index));
TrilinosScalar value = 0.;
// If the element is not
{
// Extract local indices in
// the vector.
- int_type trilinos_i = vector->Map().LID(static_cast<int_type>(index));
+ TrilinosWrapper::types::int_type trilinos_i =
+ vector->Map().LID(static_cast<TrilinosWrapper::types::int_type>(index));
TrilinosScalar value = 0.;
// If the element is not present
//one index and the value per local
//entry.
return sizeof(*this)
- + this->local_size()*( sizeof(double)+sizeof(int_type) );
+ + this->local_size()*( sizeof(double)+
+ sizeof(TrilinosWrapper::types::int_type) );
}
} /* end of namespace TrilinosWrappers */