std::vector<types::global_dof_index> &dof_indices,
const unsigned int fe_index) const
{
- for (types::global_dof_index i=0; i<dof_indices.size(); ++i)
+ for (unsigned int i=0; i<dof_indices.size(); ++i)
dof_indices[i]
= dealii::internal::DoFAccessor::Implementation::get_vertex_dof_index (
*dof_handler,
for (unsigned int d=0; d<dofs_per_vertex; ++d, ++index)
accessor.set_vertex_dof_index(vertex,d,
local_dof_indices[index]);
+ //TODO[bt] the function dof_index expects two unsigned int (I am not
+ //sure what should be the type of fe_index) but the following loop
+ //seems to do nothing but incrementing index.
for (unsigned int d=0; d<dofs_per_line; ++d, ++index)
accessor.dof_index(d, local_dof_indices[index]);
* computation, then this
* equals n_global_dofs.
*/
- types::global_dof_index n_locally_owned_dofs;
+ unsigned int n_locally_owned_dofs;
/**
* An index set denoting the
* element represented by
* this object.
*/
- size_type block_row() const;
+ unsigned int block_row() const;
/**
* Block column of the
* element represented by
* this object.
*/
- size_type block_column() const;
+ unsigned int block_column() const;
protected:
/**
* Block row into which we presently
* point.
*/
- size_type row_block;
+ unsigned int row_block;
/**
* Block column into which we
* presently point.
*/
- size_type col_block;
+ unsigned int col_block;
/**
* Let the iterator class be a
template <class BlockMatrix>
inline
- typename AccessorBase<BlockMatrix>::size_type
+ unsigned int
AccessorBase<BlockMatrix>::block_row() const
{
- Assert (row_block != numbers::invalid_size_type,
+ Assert (row_block != numbers::invalid_unsigned_int,
ExcIteratorPastEnd());
return row_block;
template <class BlockMatrix>
inline
- typename AccessorBase<BlockMatrix>::size_type
+ unsigned int
AccessorBase<BlockMatrix>::block_column() const
{
- Assert (col_block != numbers::invalid_size_type,
+ Assert (col_block != numbers::invalid_unsigned_int,
ExcIteratorPastEnd());
return col_block;
inline
Accessor<BlockMatrix, true>::Accessor (
const BlockMatrix *matrix,
- const size_type row,
- const size_type col)
+ const size_type row,
+ const size_type col)
:
matrix(matrix),
base_iterator(matrix->block(0,0).begin())
// the end of the matrix
if (row < matrix->m())
{
- const std::pair<size_type,size_type> indices
+ const std::pair<unsigned int,size_type> indices
= matrix->row_block_indices.global_to_local(row);
// find the first block that does
{
// we were asked to create the end
// iterator for this matrix
- this->row_block = numbers::invalid_size_type;
- this->col_block = numbers::invalid_size_type;
+ this->row_block = numbers::invalid_unsigned_int;
+ this->col_block = numbers::invalid_unsigned_int;
}
}
typename Accessor<BlockMatrix, true>::size_type
Accessor<BlockMatrix, true>::row() const
{
- Assert (this->row_block != numbers::invalid_size_type,
+ Assert (this->row_block != numbers::invalid_unsigned_int,
ExcIteratorPastEnd());
return (matrix->row_block_indices.local_to_global(this->row_block, 0) +
typename Accessor<BlockMatrix, true>::size_type
Accessor<BlockMatrix, true>::column() const
{
- Assert (this->col_block != numbers::invalid_size_type,
+ Assert (this->col_block != numbers::invalid_unsigned_int,
ExcIteratorPastEnd());
return (matrix->column_block_indices.local_to_global(this->col_block,0) +
typename Accessor<BlockMatrix, true>::value_type
Accessor<BlockMatrix, true>::value () const
{
- Assert (this->row_block != numbers::invalid_size_type,
+ Assert (this->row_block != numbers::invalid_unsigned_int,
ExcIteratorPastEnd());
- Assert (this->col_block != numbers::invalid_size_type,
+ Assert (this->col_block != numbers::invalid_unsigned_int,
ExcIteratorPastEnd());
return base_iterator->value();
void
Accessor<BlockMatrix, true>::advance ()
{
- Assert (this->row_block != numbers::invalid_size_type,
+ Assert (this->row_block != numbers::invalid_unsigned_int,
ExcIteratorPastEnd());
- Assert (this->col_block != numbers::invalid_size_type,
+ Assert (this->col_block != numbers::invalid_unsigned_int,
ExcIteratorPastEnd());
// Remember current row inside block
++this->row_block;
if (this->row_block == matrix->n_block_rows())
{
- this->row_block = numbers::invalid_size_type;
- this->col_block = numbers::invalid_size_type;
+ this->row_block = numbers::invalid_unsigned_int;
+ this->col_block = numbers::invalid_unsigned_int;
return;
}
}
// have to have the same
// base_iterator representation, but
// valid iterators have to
- return (((this->row_block == numbers::invalid_size_type)
+ return (((this->row_block == numbers::invalid_unsigned_int)
&&
- (this->col_block == numbers::invalid_size_type))
+ (this->col_block == numbers::invalid_unsigned_int))
||
(base_iterator == a.base_iterator));
// the end of the matrix
if (row < matrix->m())
{
- const std::pair<size_type,size_type> indices
+ const std::pair<unsigned int,size_type> indices
= matrix->row_block_indices.global_to_local(row);
// find the first block that does
Assert (numbers::is_finite(value), ExcNumberNotFinite());
- const std::pair<size_type,size_type>
+ const std::pair<unsigned int,size_type>
row_index = row_block_indices.global_to_local (i),
col_index = column_block_indices.global_to_local (j);
block(row_index.first,col_index.first).set (row_index.second,
if (value == 0 && elide_zero_values == true)
continue;
- const std::pair<size_type, size_type>
+ const std::pair<unsigned int, size_type>
col_index = this->column_block_indices.global_to_local(col_indices[j]);
const size_type local_index = counter_within_block[col_index.first]++;
// where we should start reading out
// data. Now let's write the data into
// the individual blocks!
- const std::pair<size_type,size_type>
+ const std::pair<unsigned int,size_type>
row_index = this->row_block_indices.global_to_local (row);
for (unsigned int block_col=0; block_col<n_block_cols(); ++block_col)
{
(value == value_type()))
return;
- const std::pair<size_type,size_type>
+ const std::pair<unsigned int,size_type>
row_index = row_block_indices.global_to_local (i),
col_index = column_block_indices.global_to_local (j);
block(row_index.first,col_index.first).add (row_index.second,
else
before = col_indices[i];
#endif
- const std::pair<size_type,size_type>
+ const std::pair<unsigned int,size_type>
row_index = this->row_block_indices.global_to_local (row);
if (this->n_block_cols() > 1)
if (value == 0 && elide_zero_values == true)
continue;
- const std::pair<size_type, size_type>
+ const std::pair<unsigned int, size_type>
col_index = this->column_block_indices.global_to_local(col_indices[j]);
const size_type local_index = counter_within_block[col_index.first]++;
// where we should start reading out
// data. Now let's write the data into
// the individual blocks!
- const std::pair<size_type,size_type>
+ const std::pair<unsigned int,size_type>
row_index = this->row_block_indices.global_to_local (row);
for (unsigned int block_col=0; block_col<n_block_cols(); ++block_col)
{
BlockMatrixBase<MatrixType>::operator () (const size_type i,
const size_type j) const
{
- const std::pair<size_type,size_type>
+ const std::pair<unsigned int,size_type>
row_index = row_block_indices.global_to_local (i),
col_index = column_block_indices.global_to_local (j);
return block(row_index.first,col_index.first) (row_index.second,
BlockMatrixBase<MatrixType>::el (const size_type i,
const size_type j) const
{
- const std::pair<size_type,size_type>
+ const std::pair<unsigned int,size_type>
row_index = row_block_indices.global_to_local (i),
col_index = column_block_indices.global_to_local (j);
return block(row_index.first,col_index.first).el (row_index.second,
Assert (n_block_rows() == n_block_cols(),
ExcNotQuadratic());
- const std::pair<size_type,size_type>
+ const std::pair<unsigned int,size_type>
index = row_block_indices.global_to_local (i);
return block(index.first,index.first).diag_element(index.second);
}
* blocks themselves still have
* zero dimension.
*/
- BlockSparseMatrixEZ (const size_type block_rows,
- const size_type block_cols);
+ BlockSparseMatrixEZ (const unsigned int block_rows,
+ const unsigned int block_cols);
/**
* Copy constructor. This is
* called to update internal data
* structures.
*/
- void reinit (const size_type n_block_rows,
- const size_type n_block_cols);
+ void reinit (const unsigned int n_block_rows,
+ const unsigned int n_block_cols);
/**
* This function collects the
* sizes of the sub-objects and
* given coordinates.
*/
SparseMatrixEZ<Number> &
- block (const size_type row,
- const size_type column);
+ block (const unsigned int row,
+ const unsigned int column);
/**
* constant objects.
*/
const SparseMatrixEZ<Number> &
- block (const size_type row,
- const size_type column) const;
+ block (const unsigned int row,
+ const unsigned int column) const;
/**
* Return the number of blocks in a
* column.
*/
- size_type n_block_rows () const;
+ unsigned int n_block_rows () const;
/**
* Return the number of blocks in a
* row.
*/
- size_type n_block_cols () const;
+ unsigned int n_block_cols () const;
/**
* Return whether the object is
template <typename Number>
inline
-typename BlockSparseMatrixEZ<Number>::size_type
+unsigned int
BlockSparseMatrixEZ<Number>::n_block_rows () const
{
return row_indices.size();
template <typename Number>
inline
-typename BlockSparseMatrixEZ<Number>::size_type
+unsigned int
BlockSparseMatrixEZ<Number>::n_block_cols () const
{
return column_indices.size();
template <typename Number>
inline
SparseMatrixEZ<Number> &
-BlockSparseMatrixEZ<Number>::block (const size_type row,
- const size_type column)
+BlockSparseMatrixEZ<Number>::block (const unsigned int row,
+ const unsigned int column)
{
Assert (row<n_block_rows(), ExcIndexRange (row, 0, n_block_rows()));
Assert (column<n_block_cols(), ExcIndexRange (column, 0, n_block_cols()));
template <typename Number>
inline
const SparseMatrixEZ<Number> &
-BlockSparseMatrixEZ<Number>::block (const size_type row,
- const size_type column) const
+BlockSparseMatrixEZ<Number>::block (const unsigned int row,
+ const unsigned int column) const
{
Assert (row<n_block_rows(), ExcIndexRange (row, 0, n_block_rows()));
Assert (column<n_block_cols(), ExcIndexRange (column, 0, n_block_cols()));
Assert (numbers::is_finite(value), ExcNumberNotFinite());
- const std::pair<size_type,size_type>
+ const std::pair<unsigned int,size_type>
row_index = row_indices.global_to_local (i),
col_index = column_indices.global_to_local (j);
block(row_index.first,col_index.first).add (row_index.second,
dst = 0.;
- for (size_type row=0; row<n_block_rows(); ++row)
- for (size_type col=0; col<n_block_cols(); ++col)
+ for (unsigned int row=0; row<n_block_rows(); ++row)
+ for (unsigned int col=0; col<n_block_cols(); ++col)
block(row,col).Tvmult_add (dst.block(col),
src.block(row));
}
Assert (src.n_blocks() == n_block_rows(),
ExcDimensionMismatch(src.n_blocks(), n_block_rows()));
- for (size_type row=0; row<n_block_rows(); ++row)
- {
- for (size_type col=0; col<n_block_cols(); ++col)
+ for (unsigned int row=0; row<n_block_rows(); ++row)
+ for (unsigned int col=0; col<n_block_cols(); ++col)
block(row,col).Tvmult_add (dst.block(col),
src.block(row));
- };
}
template <typename number>
BlockSparseMatrixEZ<number>::
-BlockSparseMatrixEZ (const size_type rows,
- const size_type cols)
+BlockSparseMatrixEZ (const unsigned int rows,
+ const unsigned int cols)
:
row_indices (rows, 0),
column_indices (cols, 0)
// anything except than checking
// whether the base objects want to
// do something
- for (size_type r=0; r<n_block_rows(); ++r)
- for (size_type c=0; c<n_block_cols(); ++c)
+ for (unsigned int r=0; r<n_block_rows(); ++r)
+ for (unsigned int c=0; c<n_block_cols(); ++c)
block(r,c) = m.block(r,c);
return *this;
}
{
Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
- for (size_type r=0; r<n_block_rows(); ++r)
- for (size_type c=0; c<n_block_cols(); ++c)
+ for (unsigned int r=0; r<n_block_rows(); ++r)
+ for (unsigned int c=0; c<n_block_cols(); ++c)
block(r,c) = 0;
return *this;
template <typename number>
void
-BlockSparseMatrixEZ<number>::reinit (const size_type rows,
- const size_type cols)
+BlockSparseMatrixEZ<number>::reinit (const unsigned int rows,
+ const unsigned int cols)
{
row_indices.reinit(rows, 0);
column_indices.reinit(cols, 0);
bool
BlockSparseMatrixEZ<number>::empty () const
{
- for (size_type r=0; r<n_block_rows(); ++r)
- for (size_type c=0; c<n_block_cols(); ++c)
+ for (unsigned int r=0; r<n_block_rows(); ++r)
+ for (unsigned int c=0; c<n_block_cols(); ++c)
if (block(r,c).empty () == false)
return false;
return true;
void
BlockSparseMatrixEZ<number>::collect_sizes ()
{
- const size_type rows = n_block_rows();
- const size_type columns = n_block_cols();
+ const unsigned int rows = n_block_rows();
+ const unsigned int columns = n_block_cols();
std::vector<size_type> row_sizes (rows);
std::vector<size_type> col_sizes (columns);
// first find out the row sizes
// from the first block column
- for (size_type r=0; r<rows; ++r)
+ for (unsigned int r=0; r<rows; ++r)
row_sizes[r] = blocks[r][0].m();
// then check that the following
// block columns have the same
// sizes
- for (size_type c=1; c<columns; ++c)
- for (size_type r=0; r<rows; ++r)
+ for (unsigned int c=1; c<columns; ++c)
+ for (unsigned int r=0; r<rows; ++r)
Assert (row_sizes[r] == blocks[r][c].m(),
ExcDimensionMismatch (row_sizes[r], blocks[r][c].m()));
// then do the same with the columns
- for (size_type c=0; c<columns; ++c)
+ for (unsigned int c=0; c<columns; ++c)
col_sizes[c] = blocks[0][c].n();
- for (size_type r=1; r<rows; ++r)
- for (size_type c=0; c<columns; ++c)
+ for (unsigned int r=1; r<rows; ++r)
+ for (unsigned int c=0; c<columns; ++c)
Assert (col_sizes[c] == blocks[r][c].n(),
ExcDimensionMismatch (col_sizes[c], blocks[r][c].n()));
inline
MatrixBlock<MATRIX>::MatrixBlock()
:
- row(deal_II_numbers::invalid_size_type),
- column(deal_II_numbers::invalid_size_type)
+ row(deal_II_numbers::invalid_unsigned_int),
+ column(deal_II_numbers::invalid_unsigned_int)
{}