<h3>lac</h3>
<ol>
+
+ <li><p> Improved: BlockVector and several of the block sparsity
+ patterns can now be initialized with BlockIndices
+ objects. Therefore, if an application needs such an object, it does
+ not have to store a vector of block sizes separately.
+ <br>
+ (GK 2009/08/26)
+ </p>
+ </li>
+
<li>
<p>
Fixed: Crash or strange behaviour (wrong matrix entries written) in
<h3>deal.II</h3>
<ol>
+
+ <li><p> FETools::compute_block_renumbering() can nor return block sizes instead of
+ start indices.
+ <br>
+ (GK 2009/08/26)
+ </p>
+ </li>
+
<li>
<p>
New: The function GridGenerator::truncated_cone() and the class ConeBoundary
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
BlockCompressedSparsityPattern (const std::vector<unsigned int>& row_block_sizes,
const std::vector<unsigned int>& col_block_sizes);
+ /**
+ * Initialize the pattern with
+ * two BlockIndices for the block
+ * structures of matrix rows and
+ * columns.
+ */
+ BlockCompressedSparsityPattern (const BlockIndices& row_indices,
+ const BlockIndices& col_indices);
+
/**
* Resize the matrix to a tensor
* product of matrices with
void reinit (const std::vector< unsigned int > &row_block_sizes,
const std::vector< unsigned int > &col_block_sizes);
+ /**
+ * Resize the matrix to a tensor
+ * product of matrices with
+ * dimensions defined by the
+ * arguments. The two
+ * BlockIndices objects must be
+ * initialized and the sparsity
+ * pattern will have the
+ * same block structure afterwards.
+ */
+ void reinit (const BlockIndices& row_indices, const BlockIndices& col_indices);
+
/**
* Allow the use of the reinit
* functions of the base class as
* you assign them sizes.
*/
BlockCompressedSetSparsityPattern (const unsigned int n_rows,
- const unsigned int n_columns);
+ const unsigned int n_columns);
/**
* Initialize the pattern with
* values.
*/
BlockCompressedSetSparsityPattern (const std::vector<unsigned int>& row_block_sizes,
- const std::vector<unsigned int>& col_block_sizes);
+ const std::vector<unsigned int>& col_block_sizes);
+
+ /**
+ * Initialize the pattern with
+ * two BlockIndices for the block
+ * structures of matrix rows and
+ * columns.
+ */
+ BlockCompressedSetSparsityPattern (const BlockIndices& row_indices,
+ const BlockIndices& col_indices);
/**
* Resize the matrix to a tensor
void reinit (const std::vector< unsigned int > &row_block_sizes,
const std::vector< unsigned int > &col_block_sizes);
+ /**
+ * Resize the matrix to a tensor
+ * product of matrices with
+ * dimensions defined by the
+ * arguments. The two
+ * BlockIndices objects must be
+ * initialized and the sparsity
+ * pattern will have the
+ * same block structure afterwards.
+ */
+ void reinit (const BlockIndices& row_indices, const BlockIndices& col_indices);
+
/**
* Allow the use of the reinit
* functions of the base class as
*/
BlockVector (const std::vector<unsigned int> &block_sizes);
+ /**
+ * Constructor. Initialize vector
+ * to the structure found in the
+ * BlockIndices argument.
+ */
+ BlockVector (const BlockIndices& block_indices);
+
/**
* Constructor. Set the number of
* blocks to
*/
void reinit (const std::vector<unsigned int> &N,
const bool fast=false);
+
+ /**
+ * Reinitialize the BlockVector
+ * to reflect the structure found
+ * in BlockIndices.
+ *
+ * If the number of blocks is the
+ * same as before this function
+ * was called, all vectors remain
+ * the same and reinit() is
+ * called for each vector.
+ *
+ * If <tt>fast==false</tt>, the vector
+ * is filled with zeros.
+ */
+ void reinit (const BlockIndices& block_indices,
+ const bool fast=false);
/**
* Change the dimension to that
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
}
+template <typename Number>
+BlockVector<Number>::BlockVector (const BlockIndices& n)
+{
+ reinit (n, false);
+}
+
+
template <typename Number>
BlockVector<Number>::BlockVector (const BlockVector<Number>& v)
:
}
+template <typename Number>
+void BlockVector<Number>::reinit (
+ const BlockIndices& n,
+ const bool fast)
+{
+ this->block_indices = n;
+ if (this->components.size() != this->n_blocks())
+ this->components.resize(this->n_blocks());
+
+ for (unsigned int i=0; i<this->n_blocks(); ++i)
+ this->components[i].reinit(n.block_size(i), fast);
+}
+
+
template <typename Number>
template <typename Number2>
void BlockVector<Number>::reinit (const BlockVector<Number2>& v,
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
BlockCompressedSparsityPattern::
-BlockCompressedSparsityPattern (const unsigned int n_rows,
- const unsigned int n_columns)
+BlockCompressedSparsityPattern (
+ const unsigned int n_rows,
+ const unsigned int n_columns)
:
BlockSparsityPatternBase<CompressedSparsityPattern>(n_rows,
n_columns)
BlockCompressedSparsityPattern::
-BlockCompressedSparsityPattern (const std::vector<unsigned int>& row_indices,
- const std::vector<unsigned int>& col_indices)
- :
- BlockSparsityPatternBase<CompressedSparsityPattern>(row_indices.size(),
- col_indices.size())
+BlockCompressedSparsityPattern (
+ const std::vector<unsigned int>& row_indices,
+ const std::vector<unsigned int>& col_indices)
{
- for (unsigned int i=0;i<row_indices.size();++i)
- for (unsigned int j=0;j<col_indices.size();++j)
- this->block(i,j).reinit(row_indices[i],col_indices[j]);
- this->collect_sizes();
+ reinit(row_indices, col_indices);
+}
+
+
+BlockCompressedSparsityPattern::
+BlockCompressedSparsityPattern (
+ const BlockIndices& row_indices,
+ const BlockIndices& col_indices)
+{
+ reinit(row_indices, col_indices);
}
+void
+BlockCompressedSparsityPattern::reinit (
+ const BlockIndices& row_indices,
+ const BlockIndices& col_indices)
+{
+ BlockSparsityPatternBase<CompressedSparsityPattern>::reinit(row_indices.size(),
+ col_indices.size());
+ for (unsigned int i=0;i<row_indices.size();++i)
+ for (unsigned int j=0;j<col_indices.size();++j)
+ this->block(i,j).reinit(row_indices.block_size(i),
+ col_indices.block_size(j));
+ this->collect_sizes();
+}
+
+
+
BlockCompressedSetSparsityPattern::BlockCompressedSetSparsityPattern ()
{}
BlockCompressedSetSparsityPattern::
-BlockCompressedSetSparsityPattern (const unsigned int n_rows,
- const unsigned int n_columns)
+BlockCompressedSetSparsityPattern (
+ const unsigned int n_rows,
+ const unsigned int n_columns)
:
BlockSparsityPatternBase<CompressedSetSparsityPattern>(n_rows,
- n_columns)
+ n_columns)
{}
BlockCompressedSetSparsityPattern::
-BlockCompressedSetSparsityPattern (const std::vector<unsigned int>& row_indices,
- const std::vector<unsigned int>& col_indices)
- :
- BlockSparsityPatternBase<CompressedSetSparsityPattern>(row_indices.size(),
- col_indices.size())
+BlockCompressedSetSparsityPattern (
+ const std::vector<unsigned int>& row_indices,
+ const std::vector<unsigned int>& col_indices)
{
- for (unsigned int i=0;i<row_indices.size();++i)
- for (unsigned int j=0;j<col_indices.size();++j)
- this->block(i,j).reinit(row_indices[i],col_indices[j]);
- this->collect_sizes();
+ reinit(row_indices, col_indices);
+}
+
+
+BlockCompressedSetSparsityPattern::
+BlockCompressedSetSparsityPattern (
+ const BlockIndices& row_indices,
+ const BlockIndices& col_indices)
+{
+ reinit(row_indices, col_indices);
}
+void
+BlockCompressedSetSparsityPattern::reinit (
+ const BlockIndices& row_indices,
+ const BlockIndices& col_indices)
+{
+ BlockSparsityPatternBase<CompressedSetSparsityPattern>::reinit(row_indices.size(),
+ col_indices.size());
+ for (unsigned int i=0;i<row_indices.size();++i)
+ for (unsigned int j=0;j<col_indices.size();++j)
+ this->block(i,j).reinit(row_indices.block_size(i),
+ col_indices.block_size(j));
+ this->collect_sizes();
+}
+
+
+
BlockCompressedSimpleSparsityPattern::BlockCompressedSimpleSparsityPattern ()
{}