* Leave it at its default zero, which will be reset to the size of
* <code>eigenvalues</code> internally.
*/
- template <typename VectorType, typename MATRIX1,
- typename MATRIX2, typename INVERSE>
- void solve (const MATRIX1 &A,
- const MATRIX2 &B,
+ template <typename VectorType, typename MatrixType1,
+ typename MatrixType2, typename INVERSE>
+ void solve (const MatrixType1 &A,
+ const MatrixType2 &B,
const INVERSE &inverse,
std::vector<std::complex<double> > &eigenvalues,
std::vector<VectorType> &eigenvectors,
- const unsigned int n_eigenvalues = 0);
+ const unsigned int n_eigenvalues = 0);
protected:
{}
-template <typename VectorType, typename MATRIX1,
- typename MATRIX2, typename INVERSE>
+template <typename VectorType, typename MatrixType1,
+ typename MatrixType2, typename INVERSE>
inline
-void ArpackSolver::solve (const MATRIX1 &system_matrix,
- const MATRIX2 &mass_matrix,
+void ArpackSolver::solve (const MatrixType1 &system_matrix,
+ const MatrixType2 &mass_matrix,
const INVERSE &inverse,
std::vector<std::complex<double> > &eigenvalues,
std::vector<VectorType> &eigenvectors,
- const unsigned int n_eigenvalues)
+ const unsigned int n_eigenvalues)
{
//inside the routines of ARPACK the
//values change magically, so store
* @ref GlossBlockLA "Block (linear algebra)"
* @author Guido Kanschat, 2000
*/
-template <class MATRIX>
+template <typename MatrixType>
class BlockDiagonalMatrix : public Subscriptor
{
public:
* Constructor for an @p n_blocks by @p n_blocks matrix with diagonal blocks
* @p M.
*/
- BlockDiagonalMatrix (const MATRIX &M,
+ BlockDiagonalMatrix (const MatrixType &M,
const unsigned int n_blocks);
/**
/**
* Diagonal entry.
*/
- SmartPointer<const MATRIX,BlockDiagonalMatrix<MATRIX> > matrix;
+ SmartPointer<const MatrixType,BlockDiagonalMatrix<MatrixType> > matrix;
};
/*@}*/
//---------------------------------------------------------------------------
-template <class MATRIX>
-BlockDiagonalMatrix<MATRIX>::BlockDiagonalMatrix (const MATRIX &M,
- const unsigned int num_blocks)
+template <typename MatrixType>
+BlockDiagonalMatrix<MatrixType>::BlockDiagonalMatrix (const MatrixType &M,
+ const unsigned int num_blocks)
:
num_blocks (num_blocks),
matrix(&M)
{}
-template <class MATRIX>
+template <typename MatrixType>
template <typename number1, typename number2>
void
-BlockDiagonalMatrix<MATRIX>::vmult (BlockVector<number1> &dst,
- const BlockVector<number2> &src) const
+BlockDiagonalMatrix<MatrixType>::vmult (BlockVector<number1> &dst,
+ const BlockVector<number2> &src) const
{
Assert (dst.n_blocks()==num_blocks,
ExcDimensionMismatch(dst.n_blocks(),num_blocks));
}
-template <class MATRIX>
+template <typename MatrixType>
template <typename number1, typename number2>
void
-BlockDiagonalMatrix<MATRIX>::Tvmult (BlockVector<number1> &dst,
- const BlockVector<number2> &src) const
+BlockDiagonalMatrix<MatrixType>::Tvmult (BlockVector<number1> &dst,
+ const BlockVector<number2> &src) const
{
Assert (dst.n_blocks()==num_blocks,
ExcDimensionMismatch(dst.n_blocks(),num_blocks));
* this class. If you need a preconditioner for a BlockMatrixArray object, use
* BlockTrianglePrecondition.
*
- * <h3>Requirements on MATRIX</h3>
+ * <h3>Requirements on MatrixType</h3>
*
- * The template argument <tt>MATRIX</tt> is a class providing the matrix-
+ * The template argument <tt>MatrixType</tt> is a class providing the matrix-
* vector multiplication functions vmult(), Tvmult(), vmult_add() and
* Tvmult_add() used in this class, but with arguments of type
* Vector<number> instead of BlockVector<number>. Every matrix
* entering a block of wrong dimension here will only lead to a
* ExcDimensionMismatch in one of the multiplication functions.
*/
- template <class MATRIX>
- void enter (const MATRIX &matrix,
+ template <typename MatrixType>
+ void enter (const MatrixType &matrix,
const unsigned int row,
const unsigned int col,
const number prefix = 1.,
* Constructor initializing all data fields. A PointerMatrix object is
* generated for <tt>matrix</tt>.
*/
- template<class MATRIX>
- Entry (const MATRIX &matrix,
- size_type row, size_type col,
- number prefix, bool transpose);
+ template<typename MatrixType>
+ Entry (const MatrixType &matrix,
+ size_type row,
+ size_type col,
+ number prefix,
+ bool transpose);
/**
* Copy constructor invalidating the old object. Since it is only used for
* Enter a block. This calls BlockMatrixArray::enter(). Remember that the
* diagonal blocks should actually be inverse matrices or preconditioners.
*/
- template <class MATRIX>
- void enter (const MATRIX &matrix,
- const size_type row,
- const size_type col,
- const number prefix = 1.,
- const bool transpose = false);
+ template <typename MatrixType>
+ void enter (const MatrixType &matrix,
+ const size_type row,
+ const size_type col,
+ const number prefix = 1.,
+ const bool transpose = false);
/**
* Preconditioning.
//---------------------------------------------------------------------------
template <typename number, typename BLOCK_VECTOR>
-template <class MATRIX>
+template <typename MatrixType>
inline
BlockMatrixArray<number, BLOCK_VECTOR>::Entry::Entry (
- const MATRIX &m,
- size_type row,
- size_type col,
- number prefix,
- bool transpose)
+ const MatrixType &m,
+ size_type row,
+ size_type col,
+ number prefix,
+ bool transpose)
:
row (row),
col (col),
template <typename number, typename BLOCK_VECTOR>
-template <class MATRIX>
+template <typename MatrixType>
inline
void
-BlockMatrixArray<number, BLOCK_VECTOR>::enter (
- const MATRIX &matrix,
- unsigned int row,
- unsigned int col,
- number prefix,
- bool transpose)
+BlockMatrixArray<number, BLOCK_VECTOR>::enter (const MatrixType &matrix,
+ unsigned int row,
+ unsigned int col,
+ number prefix,
+ bool transpose)
{
Assert(row<n_block_rows(), ExcIndexRange(row, 0, n_block_rows()));
Assert(col<n_block_cols(), ExcIndexRange(col, 0, n_block_cols()));
}
template <typename number, typename BLOCK_VECTOR>
-template <class MATRIX>
+template <typename MatrixType>
inline
void
-BlockTrianglePrecondition<number, BLOCK_VECTOR>::enter (const MATRIX &matrix,
- size_type row, size_type col,
- number prefix, bool transpose)
+BlockTrianglePrecondition<number, BLOCK_VECTOR>::enter (const MatrixType &matrix,
+ size_type row,
+ size_type col,
+ number prefix,
+ bool transpose)
{
BlockMatrixArray<number, BLOCK_VECTOR>::enter(matrix, row, col, prefix, transpose);
}
* approximated eigenvalue and @p x is the corresponding eigenvector,
* normalized with respect to the l2-norm.
*/
- template <class MATRIX>
+ template <typename MatrixType>
void
- solve (double &value,
- const MATRIX &A,
- VectorType &x);
+ solve (double &value,
+ const MatrixType &A,
+ VectorType &x);
protected:
/**
* eigenvalue and @p x is the corresponding eigenvector, normalized with
* respect to the l2-norm.
*/
- template <class MATRIX>
+ template <typename MatrixType>
void
- solve (double &value,
- const MATRIX &A,
- VectorType &x);
+ solve (double &value,
+ const MatrixType &A,
+ VectorType &x);
protected:
/**
template <class VectorType>
-template <class MATRIX>
+template <typename MatrixType>
void
-EigenPower<VectorType>::solve (double &value,
- const MATRIX &A,
- VectorType &x)
+EigenPower<VectorType>::solve (double &value,
+ const MatrixType &A,
+ VectorType &x)
{
SolverControl::State conv=SolverControl::iterate;
template <class VectorType>
-template <class MATRIX>
+template <typename MatrixType>
void
-EigenInverse<VectorType>::solve (double &value,
- const MATRIX &A,
- VectorType &x)
+EigenInverse<VectorType>::solve (double &value,
+ const MatrixType &A,
+ VectorType &x)
{
deallog.push("Wielandt");
SolverControl::State conv=SolverControl::iterate;
// Prepare matrix for solver
- ShiftedMatrix <MATRIX> A_s(A, -value);
+ ShiftedMatrix <MatrixType> A_s(A, -value);
// Define solver
ReductionControl inner_control (5000, 1.e-16, 1.e-5, false, false);
* @arg @p expect_constrained_source: See documentation of
* #expect_constrained_source.
*/
- template <class MATRIX>
- FilteredMatrix (const MATRIX &matrix,
- bool expect_constrained_source = false);
+ template <typename MatrixType>
+ FilteredMatrix (const MatrixType &matrix,
+ bool expect_constrained_source = false);
/**
* Copy operator. Take over matrix and constraints from the other object.
* @arg @p expect_constrained_source: See documentation of
* #expect_constrained_source.
*/
- template <class MATRIX>
- void initialize (const MATRIX &m,
- bool expect_constrained_source = false);
+ template <typename MatrixType>
+ void initialize (const MatrixType &m,
+ bool expect_constrained_source = false);
/**
* Delete all constraints and the matrix pointer.
template <typename VectorType>
-template <class MATRIX>
+template <typename MatrixType>
inline
void
-FilteredMatrix<VectorType>::initialize (const MATRIX &m, bool ecs)
+FilteredMatrix<VectorType>::initialize (const MatrixType &m, bool ecs)
{
matrix.reset (new_pointer_matrix_base(m, VectorType()));
template <typename VectorType>
-template <class MATRIX>
+template <typename MatrixType>
inline
FilteredMatrix<VectorType>::
-FilteredMatrix (const MATRIX &m, bool ecs)
+FilteredMatrix (const MatrixType &m, bool ecs)
{
initialize (m, ecs);
}
/**
* Assignment from different matrix classes. This assignment operator uses
- * iterators of the class MATRIX. Therefore, sparse matrices are possible
+ * iterators of the typename MatrixType. Therefore, sparse matrices are possible
* sources.
*/
- template <class MATRIX>
- void copy_from (const MATRIX &);
+ template <typename MatrixType>
+ void copy_from (const MatrixType &);
/**
* Transposing assignment from different matrix classes. This assignment
- * operator uses iterators of the class MATRIX. Therefore, sparse matrices
+ * operator uses iterators of the typename MatrixType. Therefore, sparse matrices
* are possible sources.
*/
- template <class MATRIX>
- void copy_transposed (const MATRIX &);
+ template <typename MatrixType>
+ void copy_transposed (const MatrixType &);
/**
* Fill matrix with elements extracted from a tensor, taking rows included
* this operation.
*/
template <typename MatrixType, typename index_type>
- void extract_submatrix_from (const MatrixType &matrix,
+ void extract_submatrix_from (const MatrixType &matrix,
const std::vector<index_type> &row_index_set,
const std::vector<index_type> &column_index_set);
void
scatter_matrix_to (const std::vector<index_type> &row_index_set,
const std::vector<index_type> &column_index_set,
- MatrixType &matrix) const;
+ MatrixType &matrix) const;
/**
* Fill rectangular block.
template <typename number>
-template <class MATRIX>
+template <typename MatrixType>
void
-FullMatrix<number>::copy_from (const MATRIX &M)
+FullMatrix<number>::copy_from (const MatrixType &M)
{
this->reinit (M.m(), M.n());
// copy them into the current object
for (size_type row = 0; row < M.m(); ++row)
{
- const typename MATRIX::const_iterator end_row = M.end(row);
- for (typename MATRIX::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator end_row = M.end(row);
+ for (typename MatrixType::const_iterator entry = M.begin(row);
entry != end_row; ++entry)
this->el(row, entry->column()) = entry->value();
}
template <typename number>
-template <class MATRIX>
+template <typename MatrixType>
void
-FullMatrix<number>::copy_transposed (const MATRIX &M)
+FullMatrix<number>::copy_transposed (const MatrixType &M)
{
this->reinit (M.n(), M.m());
// copy them into the current object
for (size_type row = 0; row < M.m(); ++row)
{
- const typename MATRIX::const_iterator end_row = M.end(row);
- for (typename MATRIX::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator end_row = M.end(row);
+ for (typename MatrixType::const_iterator entry = M.begin(row);
entry != end_row; ++entry)
this->el(entry->column(), row) = entry->value();
}
template <typename MatrixType, typename index_type>
inline
void
-FullMatrix<number>::extract_submatrix_from (const MatrixType &matrix,
+FullMatrix<number>::extract_submatrix_from (const MatrixType &matrix,
const std::vector<index_type> &row_index_set,
const std::vector<index_type> &column_index_set)
{
void
FullMatrix<number>::scatter_matrix_to (const std::vector<index_type> &row_index_set,
const std::vector<index_type> &column_index_set,
- MatrixType &matrix) const
+ MatrixType &matrix) const
{
AssertDimension(row_index_set.size(), this->n_rows());
AssertDimension(column_index_set.size(), this->n_cols());
const BlockVector<number2> &src) const;
/**
- * A wrapper to least_squares(), implementing the standard MATRIX interface.
+ * A wrapper to least_squares(), implementing the standard MatrixType
+ * interface.
*/
template<class VectorType>
void vmult (VectorType &dst, const VectorType &src) const;
* Initialization function. Provide a matrix and preconditioner for the
* solve in vmult().
*/
- template <class MATRIX, class PRECONDITION>
- void initialize (const MATRIX &, const PRECONDITION &);
+ template <typename MatrixType, class PRECONDITION>
+ void initialize (const MatrixType &, const PRECONDITION &);
/**
* Delete the pointers to matrix and preconditioner.
template <typename VectorType>
-template <class MATRIX, class PRECONDITION>
+template <typename MatrixType, class PRECONDITION>
inline
void
-IterativeInverse<VectorType>::initialize(const MATRIX &m, const PRECONDITION &p)
+IterativeInverse<VectorType>::initialize(const MatrixType &m, const PRECONDITION &p)
{
// dummy variable
VectorType *v = 0;
/**
* Assignment from different matrix classes, performing the usual conversion
* to the transposed format expected by LAPACK. This assignment operator
- * uses iterators of the class MATRIX. Therefore, sparse matrices are
+ * uses iterators of the typename MatrixType. Therefore, sparse matrices are
* possible sources.
*/
- template <class MATRIX>
- void copy_from (const MATRIX &);
+ template <typename MatrixType>
+ void copy_from (const MatrixType &);
/**
* Regenerate the current matrix by one that has the same properties as if
* The final two arguments allow to enter a multiple of the source or its
* transpose.
*/
- template<class MATRIX>
- void fill (const MATRIX &src,
+ template<typename MatrixType>
+ void fill (const MatrixType &src,
const size_type dst_offset_i = 0,
const size_type dst_offset_j = 0,
const size_type src_offset_i = 0,
}
template <typename number>
-template <class MATRIX>
+template <typename MatrixType>
inline void
-LAPACKFullMatrix<number>::copy_from (const MATRIX &M)
+LAPACKFullMatrix<number>::copy_from (const MatrixType &M)
{
this->reinit (M.m(), M.n());
// copy them into the current object
for (size_type row = 0; row < M.m(); ++row)
{
- const typename MATRIX::const_iterator end_row = M.end(row);
- for (typename MATRIX::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator end_row = M.end(row);
+ for (typename MatrixType::const_iterator entry = M.begin(row);
entry != end_row; ++entry)
this->el(row, entry->column()) = entry->value();
}
template <typename number>
-template <class MATRIX>
+template <typename MatrixType>
inline void
-LAPACKFullMatrix<number>::fill (
- const MATRIX &M,
- const size_type dst_offset_i,
- const size_type dst_offset_j,
- const size_type src_offset_i,
- const size_type src_offset_j,
- const number factor,
- const bool transpose)
+LAPACKFullMatrix<number>::fill (const MatrixType &M,
+ const size_type dst_offset_i,
+ const size_type dst_offset_j,
+ const size_type src_offset_i,
+ const size_type src_offset_j,
+ const number factor,
+ const bool transpose)
{
// loop over the elements of the argument matrix row by row, as suggested
// in the documentation of the sparse matrix iterator class
for (size_type row = src_offset_i; row < M.m(); ++row)
{
- const typename MATRIX::const_iterator end_row = M.end(row);
- for (typename MATRIX::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator end_row = M.end(row);
+ for (typename MatrixType::const_iterator entry = M.begin(row);
entry != end_row; ++entry)
{
const size_type i = transpose ? entry->column() : row;
DEAL_II_NAMESPACE_OPEN
-template <class MATRIX> class MatrixBlock;
+template <typename MatrixType> class MatrixBlock;
namespace internal
{
- template <class MATRIX>
+ template <typename MatrixType>
void
- reinit(MatrixBlock<MATRIX> &v,
+ reinit(MatrixBlock<MatrixType> &v,
const BlockSparsityPattern &p);
template <typename number>
*
* While the add() functions make a MatrixBlock appear like a block matrix for
* assembling, the functions vmult(), Tvmult(), vmult_add(), and Tvmult_add()
- * make it behave like a MATRIX, when it comes to applying it to a vector.
+ * make it behave like a MatrixType, when it comes to applying it to a vector.
* This behavior allows us to store MatrixBlock objects in vectors, for
* instance in MGLevelObject without extracting the #matrix first.
*
* @ref GlossBlockLA "Block (linear algebra)"
* @author Guido Kanschat, 2006
*/
-template <class MATRIX>
+template <typename MatrixType>
class MatrixBlock
: public Subscriptor
{
/**
* Declare a type for matrix entries.
*/
- typedef typename MATRIX::value_type value_type;
+ typedef typename MatrixType::value_type value_type;
/**
* Constructor rendering an uninitialized object.
/**
* Copy constructor.
*/
- MatrixBlock(const MatrixBlock<MATRIX> &M);
+ MatrixBlock(const MatrixBlock<MatrixType> &M);
/**
* Constructor setting block coordinates, but not initializing the matrix.
*/
void reinit(const BlockSparsityPattern &sparsity);
- operator MATRIX &();
- operator const MATRIX &() const;
+ operator MatrixType &();
+ operator const MatrixType &() const;
/**
* Add <tt>value</tt> to the element (<i>i,j</i>). Throws an error if the
* entry does not exist or if it is in a different block.
*/
- void add (const size_type i,
- const size_type j,
- const typename MATRIX::value_type value);
+ void add (const size_type i,
+ const size_type j,
+ const typename MatrixType::value_type value);
/**
* Add all elements in a FullMatrix into sparse matrix locations given by
const bool col_indices_are_sorted = false);
/**
- * Matrix-vector-multiplication, forwarding to the same function in MATRIX.
+ * Matrix-vector-multiplication, forwarding to the same function in MatrixType.
* No index computations are done, thus, the vectors need to have sizes
* matching #matrix.
*/
void vmult (VectorType &w, const VectorType &v) const;
/**
- * Matrix-vector-multiplication, forwarding to the same function in MATRIX.
+ * Matrix-vector-multiplication, forwarding to the same function in MatrixType.
* No index computations are done, thus, the vectors need to have sizes
* matching #matrix.
*/
void vmult_add (VectorType &w, const VectorType &v) const;
/**
- * Matrix-vector-multiplication, forwarding to the same function in MATRIX.
+ * Matrix-vector-multiplication, forwarding to the same function in MatrixType.
* No index computations are done, thus, the vectors need to have sizes
* matching #matrix.
*/
void Tvmult (VectorType &w, const VectorType &v) const;
/**
- * Matrix-vector-multiplication, forwarding to the same function in MATRIX.
+ * Matrix-vector-multiplication, forwarding to the same function in MatrixType.
* No index computations are done, thus, the vectors need to have sizes
* matching #matrix.
*/
/**
* The matrix itself
*/
- MATRIX matrix;
+ MatrixType matrix;
private:
/**
*/
BlockIndices column_indices;
- template <class OTHER_MATRIX>
+ template <class OTHER_MatrixType>
friend
- void dealii::internal::reinit(MatrixBlock<OTHER_MATRIX> &,
+ void dealii::internal::reinit(MatrixBlock<OTHER_MatrixType> &,
const BlockSparsityPattern &);
template <typename number>
* @ingroup vector_valued
* @author Baerbel Janssen, Guido Kanschat, 2010
*/
-template <class MATRIX>
+template <typename MatrixType>
class MatrixBlockVector
:
private AnyData
/**
* The type of object stored.
*/
- typedef MatrixBlock<MATRIX> value_type;
+ typedef MatrixBlock<MatrixType> value_type;
/**
* The pointer type used for storing the objects. We use a shard pointer,
/**
* Access the matrix at position <i>i</i> for read and write access.
*/
- MATRIX &matrix(size_type i);
+ MatrixType &matrix(size_type i);
/**
* import functions from private base class
* @ingroup vector_valued
* @author Baerbel Janssen, Guido Kanschat, 2010
*/
-template <class MATRIX>
+template <typename MatrixType>
class MGMatrixBlockVector
: public Subscriptor
{
/**
* The type of object stored.
*/
- typedef MGLevelObject<MatrixBlock<MATRIX> > value_type;
+ typedef MGLevelObject<MatrixBlock<MatrixType> > value_type;
/**
* Constructor, determining which matrices should be stored.
*
namespace internal
{
- template <class MATRIX>
+ template <typename MatrixType>
void
- reinit(MatrixBlock<MATRIX> &v,
+ reinit(MatrixBlock<MatrixType> &v,
const BlockSparsityPattern &p)
{
v.row_indices = p.get_row_indices();
}
-template <class MATRIX>
+template <typename MatrixType>
inline
-MatrixBlock<MATRIX>::MatrixBlock()
+MatrixBlock<MatrixType>::MatrixBlock ()
:
row(numbers::invalid_size_type),
column(numbers::invalid_size_type)
{}
-template <class MATRIX>
+template <typename MatrixType>
inline
-MatrixBlock<MATRIX>::MatrixBlock(const MatrixBlock<MATRIX> &M)
+MatrixBlock<MatrixType>::MatrixBlock (const MatrixBlock<MatrixType> &M)
:
Subscriptor(),
row(M.row),
{}
-template <class MATRIX>
+template <typename MatrixType>
inline
-MatrixBlock<MATRIX>::MatrixBlock(size_type i, size_type j)
+MatrixBlock<MatrixType>::MatrixBlock (size_type i, size_type j)
:
row(i), column(j)
{}
-template <class MATRIX>
+template <typename MatrixType>
inline
void
-MatrixBlock<MATRIX>::reinit(const BlockSparsityPattern &sparsity)
+MatrixBlock<MatrixType>::reinit (const BlockSparsityPattern &sparsity)
{
internal::reinit(*this, sparsity);
}
-template <class MATRIX>
+template <typename MatrixType>
inline
-MatrixBlock<MATRIX>::operator MATRIX &()
+MatrixBlock<MatrixType>::operator MatrixType &()
{
return matrix;
}
-template <class MATRIX>
+template <typename MatrixType>
inline
-MatrixBlock<MATRIX>::operator const MATRIX &() const
+MatrixBlock<MatrixType>::operator const MatrixType &() const
{
return matrix;
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-MatrixBlock<MATRIX>::add (
- const size_type gi,
- const size_type gj,
- const typename MATRIX::value_type value)
+MatrixBlock<MatrixType>::add (const size_type gi,
+ const size_type gj,
+ const typename MatrixType::value_type value)
{
Assert(row_indices.size() != 0, ExcNotInitialized());
Assert(column_indices.size() != 0, ExcNotInitialized());
}
-template <class MATRIX>
+template <typename MatrixType>
template <typename number>
inline
void
-MatrixBlock<MATRIX>::add (const std::vector<size_type> &r_indices,
- const std::vector<size_type> &c_indices,
- const FullMatrix<number> &values,
- const bool elide_zero_values)
+MatrixBlock<MatrixType>::add (const std::vector<size_type> &r_indices,
+ const std::vector<size_type> &c_indices,
+ const FullMatrix<number> &values,
+ const bool elide_zero_values)
{
Assert(row_indices.size() != 0, ExcNotInitialized());
Assert(column_indices.size() != 0, ExcNotInitialized());
}
-template <class MATRIX>
+template <typename MatrixType>
template <typename number>
inline
void
-MatrixBlock<MATRIX>::add (const size_type b_row,
- const size_type n_cols,
- const size_type *col_indices,
- const number *values,
- const bool,
- const bool)
+MatrixBlock<MatrixType>::add (const size_type b_row,
+ const size_type n_cols,
+ const size_type *col_indices,
+ const number *values,
+ const bool,
+ const bool)
{
Assert(row_indices.size() != 0, ExcNotInitialized());
Assert(column_indices.size() != 0, ExcNotInitialized());
}
-template <class MATRIX>
+template <typename MatrixType>
template <typename number>
inline
void
-MatrixBlock<MATRIX>::add (const std::vector<size_type> &indices,
- const FullMatrix<number> &values,
- const bool elide_zero_values)
+MatrixBlock<MatrixType>::add (const std::vector<size_type> &indices,
+ const FullMatrix<number> &values,
+ const bool elide_zero_values)
{
Assert(row_indices.size() != 0, ExcNotInitialized());
Assert(column_indices.size() != 0, ExcNotInitialized());
-template <class MATRIX>
+template <typename MatrixType>
template <typename number>
inline
void
-MatrixBlock<MATRIX>::add (const size_type row,
- const std::vector<size_type> &col_indices,
- const std::vector<number> &values,
- const bool elide_zero_values)
+MatrixBlock<MatrixType>::add (const size_type row,
+ const std::vector<size_type> &col_indices,
+ const std::vector<number> &values,
+ const bool elide_zero_values)
{
Assert(row_indices.size() != 0, ExcNotInitialized());
Assert(column_indices.size() != 0, ExcNotInitialized());
}
-template <class MATRIX>
+template <typename MatrixType>
template <class VectorType>
inline
void
-MatrixBlock<MATRIX>::vmult (VectorType &w, const VectorType &v) const
+MatrixBlock<MatrixType>::vmult (VectorType &w, const VectorType &v) const
{
matrix.vmult(w,v);
}
-template <class MATRIX>
+template <typename MatrixType>
template <class VectorType>
inline
void
-MatrixBlock<MATRIX>::vmult_add (VectorType &w, const VectorType &v) const
+MatrixBlock<MatrixType>::vmult_add (VectorType &w, const VectorType &v) const
{
matrix.vmult_add(w,v);
}
-template <class MATRIX>
+template <typename MatrixType>
template <class VectorType>
inline
void
-MatrixBlock<MATRIX>::Tvmult (VectorType &w, const VectorType &v) const
+MatrixBlock<MatrixType>::Tvmult (VectorType &w, const VectorType &v) const
{
matrix.Tvmult(w,v);
}
-template <class MATRIX>
+template <typename MatrixType>
template <class VectorType>
inline
void
-MatrixBlock<MATRIX>::Tvmult_add (VectorType &w, const VectorType &v) const
+MatrixBlock<MatrixType>::Tvmult_add (VectorType &w, const VectorType &v) const
{
matrix.Tvmult_add(w,v);
}
-template <class MATRIX>
+template <typename MatrixType>
inline
std::size_t
-MatrixBlock<MATRIX>::memory_consumption () const
+MatrixBlock<MatrixType>::memory_consumption () const
{
return (sizeof(*this)
+ MemoryConsumption::memory_consumption(matrix)
//----------------------------------------------------------------------//
-template <class MATRIX>
+template <typename MatrixType>
inline void
-MatrixBlockVector<MATRIX>::add(
- size_type row, size_type column,
- const std::string &name)
+MatrixBlockVector<MatrixType>::add(size_type row,
+ size_type column,
+ const std::string &name)
{
ptr_type p(new value_type(row, column));
AnyData::add(p, name);
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-MatrixBlockVector<MATRIX>::reinit(const BlockSparsityPattern &sparsity)
+MatrixBlockVector<MatrixType>::reinit (const BlockSparsityPattern &sparsity)
{
for (size_type i=0; i<this->size(); ++i)
{
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-MatrixBlockVector<MATRIX>::clear(bool really_clean)
+MatrixBlockVector<MatrixType>::clear (bool really_clean)
{
if (really_clean)
{
-template <class MATRIX>
-inline const MatrixBlock<MATRIX> &
-MatrixBlockVector<MATRIX>::block(size_type i) const
+template <typename MatrixType>
+inline const MatrixBlock<MatrixType> &
+MatrixBlockVector<MatrixType>::block (size_type i) const
{
return *this->read<ptr_type>(i);
}
-template <class MATRIX>
-inline MatrixBlock<MATRIX> &
-MatrixBlockVector<MATRIX>::block(size_type i)
+template <typename MatrixType>
+inline MatrixBlock<MatrixType> &
+MatrixBlockVector<MatrixType>::block (size_type i)
{
return *this->entry<ptr_type>(i);
}
-template <class MATRIX>
-inline MATRIX &
-MatrixBlockVector<MATRIX>::matrix(size_type i)
+template <typename MatrixType>
+inline MatrixType &
+MatrixBlockVector<MatrixType>::matrix (size_type i)
{
return this->entry<ptr_type>(i)->matrix;
}
//----------------------------------------------------------------------//
-template <class MATRIX>
+template <typename MatrixType>
inline
-MGMatrixBlockVector<MATRIX>::MGMatrixBlockVector(
- const bool e, const bool f)
+MGMatrixBlockVector<MatrixType>::MGMatrixBlockVector(const bool e, const bool f)
:
edge_matrices(e),
edge_flux_matrices(f)
{}
-template <class MATRIX>
+template <typename MatrixType>
inline
unsigned int
-MGMatrixBlockVector<MATRIX>::size () const
+MGMatrixBlockVector<MatrixType>::size () const
{
return matrices.size();
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-MGMatrixBlockVector<MATRIX>::add(
+MGMatrixBlockVector<MatrixType>::add(
size_type row, size_type column,
const std::string &name)
{
- MGLevelObject<MatrixBlock<MATRIX> > p(0, 1);
+ MGLevelObject<MatrixBlock<MatrixType> > p(0, 1);
p[0].row = row;
p[0].column = column;
}
-template <class MATRIX>
-inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block(size_type i) const
+template <typename MatrixType>
+inline const MGLevelObject<MatrixBlock<MatrixType> > &
+MGMatrixBlockVector<MatrixType>::block(size_type i) const
{
- return *matrices.read<const MGLevelObject<MATRIX>* >(i);
+ return *matrices.read<const MGLevelObject<MatrixType>* >(i);
}
-template <class MATRIX>
-inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block(size_type i)
+template <typename MatrixType>
+inline MGLevelObject<MatrixBlock<MatrixType> > &
+MGMatrixBlockVector<MatrixType>::block(size_type i)
{
- return *matrices.entry<MGLevelObject<MATRIX>* >(i);
+ return *matrices.entry<MGLevelObject<MatrixType>* >(i);
}
-template <class MATRIX>
-inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_in(size_type i) const
+template <typename MatrixType>
+inline const MGLevelObject<MatrixBlock<MatrixType> > &
+MGMatrixBlockVector<MatrixType>::block_in(size_type i) const
{
- return *matrices_in.read<const MGLevelObject<MATRIX>* >(i);
+ return *matrices_in.read<const MGLevelObject<MatrixType>* >(i);
}
-template <class MATRIX>
-inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_in(size_type i)
+template <typename MatrixType>
+inline MGLevelObject<MatrixBlock<MatrixType> > &
+MGMatrixBlockVector<MatrixType>::block_in(size_type i)
{
- return *matrices_in.entry<MGLevelObject<MATRIX>* >(i);
+ return *matrices_in.entry<MGLevelObject<MatrixType>* >(i);
}
-template <class MATRIX>
-inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_out(size_type i) const
+template <typename MatrixType>
+inline const MGLevelObject<MatrixBlock<MatrixType> > &
+MGMatrixBlockVector<MatrixType>::block_out(size_type i) const
{
- return *matrices_out.read<const MGLevelObject<MATRIX>* >(i);
+ return *matrices_out.read<const MGLevelObject<MatrixType>* >(i);
}
-template <class MATRIX>
-inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_out(size_type i)
+template <typename MatrixType>
+inline MGLevelObject<MatrixBlock<MatrixType> > &
+MGMatrixBlockVector<MatrixType>::block_out(size_type i)
{
- return *matrices_out.entry<MGLevelObject<MATRIX>* >(i);
+ return *matrices_out.entry<MGLevelObject<MatrixType>* >(i);
}
-template <class MATRIX>
-inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_up(size_type i) const
+template <typename MatrixType>
+inline const MGLevelObject<MatrixBlock<MatrixType> > &
+MGMatrixBlockVector<MatrixType>::block_up(size_type i) const
{
- return *flux_matrices_up.read<const MGLevelObject<MATRIX>* >(i);
+ return *flux_matrices_up.read<const MGLevelObject<MatrixType>* >(i);
}
-template <class MATRIX>
-inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_up(size_type i)
+template <typename MatrixType>
+inline MGLevelObject<MatrixBlock<MatrixType> > &
+MGMatrixBlockVector<MatrixType>::block_up(size_type i)
{
- return *flux_matrices_up.entry<MGLevelObject<MATRIX>* >(i);
+ return *flux_matrices_up.entry<MGLevelObject<MatrixType>* >(i);
}
-template <class MATRIX>
-inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_down(size_type i) const
+template <typename MatrixType>
+inline const MGLevelObject<MatrixBlock<MatrixType> > &
+MGMatrixBlockVector<MatrixType>::block_down(size_type i) const
{
- return *flux_matrices_down.read<const MGLevelObject<MATRIX>* >(i);
+ return *flux_matrices_down.read<const MGLevelObject<MatrixType>* >(i);
}
-template <class MATRIX>
-inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_down(size_type i)
+template <typename MatrixType>
+inline MGLevelObject<MatrixBlock<MatrixType> > &
+MGMatrixBlockVector<MatrixType>::block_down(size_type i)
{
- return *flux_matrices_down.entry<MGLevelObject<MATRIX>* >(i);
+ return *flux_matrices_down.entry<MGLevelObject<MatrixType>* >(i);
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-MGMatrixBlockVector<MATRIX>::reinit_matrix(const MGLevelObject<BlockSparsityPattern> &sparsity)
+MGMatrixBlockVector<MatrixType>::reinit_matrix(const MGLevelObject<BlockSparsityPattern> &sparsity)
{
for (size_type i=0; i<this->size(); ++i)
{
- MGLevelObject<MatrixBlock<MATRIX> > &o = block(i);
+ MGLevelObject<MatrixBlock<MatrixType> > &o = block(i);
const size_type row = o[o.min_level()].row;
const size_type col = o[o.min_level()].column;
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-MGMatrixBlockVector<MATRIX>::reinit_edge(const MGLevelObject<BlockSparsityPattern> &sparsity)
+MGMatrixBlockVector<MatrixType>::reinit_edge(const MGLevelObject<BlockSparsityPattern> &sparsity)
{
for (size_type i=0; i<this->size(); ++i)
{
- MGLevelObject<MatrixBlock<MATRIX> > &o = block(i);
+ MGLevelObject<MatrixBlock<MatrixType> > &o = block(i);
const size_type row = o[o.min_level()].row;
const size_type col = o[o.min_level()].column;
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-MGMatrixBlockVector<MATRIX>::reinit_edge_flux(const MGLevelObject<BlockSparsityPattern> &sparsity)
+MGMatrixBlockVector<MatrixType>::reinit_edge_flux
+(const MGLevelObject<BlockSparsityPattern> &sparsity)
{
for (size_type i=0; i<this->size(); ++i)
{
- MGLevelObject<MatrixBlock<MATRIX> > &o = block(i);
+ MGLevelObject<MatrixBlock<MatrixType> > &o = block(i);
const size_type row = o[o.min_level()].row;
const size_type col = o[o.min_level()].column;
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-MGMatrixBlockVector<MATRIX>::clear_object(AnyData &mo)
+MGMatrixBlockVector<MatrixType>::clear_object (AnyData &mo)
{
for (size_type i=0; i<mo.size(); ++i)
{
- MGLevelObject<MatrixBlock<MATRIX> > &o = mo.entry<MGLevelObject<MATRIX>* >(i);
+ MGLevelObject<MatrixBlock<MatrixType> > &o = mo.entry<MGLevelObject<MatrixType>* >(i);
for (size_type level = o.min_level(); level <= o.max_level(); ++level)
o[level].matrix.clear();
}
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-MGMatrixBlockVector<MATRIX>::clear(bool really_clean)
+MGMatrixBlockVector<MatrixType>::clear (bool really_clean)
{
if (really_clean)
{
* Constructor. Additionally to the two constituting matrices, a memory
* pool for the auxiliary vector must be provided.
*/
- template <class MATRIX1, class MATRIX2>
- ProductMatrix (const MATRIX1 &m1,
- const MATRIX2 &m2,
+ template <typename MatrixType1, typename MatrixType2>
+ ProductMatrix (const MatrixType1 &m1,
+ const MatrixType2 &m2,
VectorMemory<VectorType> &mem);
/**
/**
* Change the matrices.
*/
- template <class MATRIX1, class MATRIX2>
- void reinit(const MATRIX1 &m1, const MATRIX2 &m2);
+ template <typename MatrixType1, typename MatrixType2>
+ void reinit (const MatrixType1 &m1, const MatrixType2 &m2);
/**
* Change the matrices and memory pool.
*/
- template <class MATRIX1, class MATRIX2>
- void initialize(const MATRIX1 &m1, const MATRIX2 &m2,
- VectorMemory<VectorType> &mem);
+ template <typename MatrixType1, typename MatrixType2>
+ void initialize (const MatrixType1 &m1,
+ const MatrixType2 &m2,
+ VectorMemory<VectorType> &mem);
// Doc in PointerMatrixBase
void clear();
/**
* Constructor with initialization.
*/
- template <class MATRIX>
- ScaledMatrix (const MATRIX &M, const double factor);
+ template <typename MatrixType>
+ ScaledMatrix (const MatrixType &M, const double factor);
/**
* Destructor
/**
* Initialize for use with a new matrix and factor.
*/
- template <class MATRIX>
- void initialize (const MATRIX &M, const double factor);
+ template <typename MatrixType>
+ void initialize (const MatrixType &M, const double factor);
/**
* Reset the object to its original state.
* Initialization function. Provide a solver object, a matrix, and another
* preconditioner for this.
*/
- template <class MATRIX, class PRECONDITION>
- void initialize (const MATRIX &,
+ template <typename MatrixType, class PRECONDITION>
+ void initialize (const MatrixType &,
const PRECONDITION &);
/**
template<typename VectorType>
-template<class MATRIX>
+template<typename MatrixType>
inline
-ScaledMatrix<VectorType>::ScaledMatrix(const MATRIX &mat, const double factor)
+ScaledMatrix<VectorType>::ScaledMatrix(const MatrixType &mat, const double factor)
:
m(new_pointer_matrix_base(mat, VectorType())),
factor(factor)
template<typename VectorType>
-template<class MATRIX>
+template<typename MatrixType>
inline
void
-ScaledMatrix<VectorType>::initialize(const MATRIX &mat, const double f)
+ScaledMatrix<VectorType>::initialize(const MatrixType &mat, const double f)
{
if (m) delete m;
m = new_pointer_matrix_base(mat, VectorType());
template<typename VectorType>
-template<class MATRIX1, class MATRIX2>
-ProductMatrix<VectorType>::ProductMatrix (const MATRIX1 &mat1,
- const MATRIX2 &mat2,
+template<typename MatrixType1, typename MatrixType2>
+ProductMatrix<VectorType>::ProductMatrix (const MatrixType1 &mat1,
+ const MatrixType2 &mat2,
VectorMemory<VectorType> &m)
: mem(&m)
{
- m1 = new PointerMatrix<MATRIX1, VectorType>(&mat1, typeid(*this).name());
- m2 = new PointerMatrix<MATRIX2, VectorType>(&mat2, typeid(*this).name());
+ m1 = new PointerMatrix<MatrixType1, VectorType>(&mat1, typeid(*this).name());
+ m2 = new PointerMatrix<MatrixType2, VectorType>(&mat2, typeid(*this).name());
}
template<typename VectorType>
-template<class MATRIX1, class MATRIX2>
+template<typename MatrixType1, typename MatrixType2>
void
-ProductMatrix<VectorType>::reinit (const MATRIX1 &mat1, const MATRIX2 &mat2)
+ProductMatrix<VectorType>::reinit (const MatrixType1 &mat1, const MatrixType2 &mat2)
{
if (m1) delete m1;
if (m2) delete m2;
- m1 = new PointerMatrix<MATRIX1, VectorType>(&mat1, typeid(*this).name());
- m2 = new PointerMatrix<MATRIX2, VectorType>(&mat2, typeid(*this).name());
+ m1 = new PointerMatrix<MatrixType1, VectorType>(&mat1, typeid(*this).name());
+ m2 = new PointerMatrix<MatrixType2, VectorType>(&mat2, typeid(*this).name());
}
template<typename VectorType>
-template<class MATRIX1, class MATRIX2>
+template<typename MatrixType1, typename MatrixType2>
void
-ProductMatrix<VectorType>::initialize (const MATRIX1 &mat1,
- const MATRIX2 &mat2,
+ProductMatrix<VectorType>::initialize (const MatrixType1 &mat1,
+ const MatrixType2 &mat2,
VectorMemory<VectorType> &memory)
{
mem = &memory;
if (m1) delete m1;
if (m2) delete m2;
- m1 = new PointerMatrix<MATRIX1, VectorType>(&mat1, typeid(*this).name());
- m2 = new PointerMatrix<MATRIX2, VectorType>(&mat2, typeid(*this).name());
+ m1 = new PointerMatrix<MatrixType1, VectorType>(&mat1, typeid(*this).name());
+ m2 = new PointerMatrix<MatrixType2, VectorType>(&mat2, typeid(*this).name());
}
//-----------------------------------------------------------------------//
template <typename VectorType>
-template <class MATRIX, class PRECONDITION>
+template <typename MatrixType, class PRECONDITION>
inline void
-InverseMatrixRichardson<VectorType>::initialize (const MATRIX &m, const PRECONDITION &p)
+InverseMatrixRichardson<VectorType>::initialize (const MatrixType &m, const PRECONDITION &p)
{
if (matrix != 0)
delete matrix;
- matrix = new PointerMatrix<MATRIX, VectorType>(&m);
+ matrix = new PointerMatrix<MatrixType, VectorType>(&m);
if (precondition != 0)
delete precondition;
precondition = new PointerMatrix<PRECONDITION, VectorType>(&p);
/**
* Auxiliary class to represent <code>A-sigma*B</code> operator.
*/
- template <typename MATRIX>
+ template <typename MatrixType>
class Shift : public dealii::Subscriptor
{
public:
/**
* Constructor.
*/
- Shift (const MATRIX &A,
- const MATRIX &B,
- const double sigma)
+ Shift (const MatrixType &A,
+ const MatrixType &B,
+ const double sigma)
:
A(A),
B(B),
}
private:
- const MATRIX &A;
- const MATRIX &B;
+ const MatrixType &A;
+ const MatrixType &B;
const double sigma;
};
* calling the <code>pd(n/s)eupd</code> and <code>pd(n/s)aupd</code>
* functions of PARPACK.
*/
- template <typename MATRIX1,
- typename MATRIX2, typename INVERSE>
+ template <typename MatrixType1,
+ typename MatrixType2, typename INVERSE>
void solve
- (const MATRIX1 &A,
- const MATRIX2 &B,
+ (const MatrixType1 &A,
+ const MatrixType2 &B,
const INVERSE &inverse,
std::vector<std::complex<double> > &eigenvalues,
std::vector<VectorType> &eigenvectors,
- const unsigned int n_eigenvalues);
+ const unsigned int n_eigenvalues);
std::size_t memory_consumption() const;
}
template <typename VectorType>
-template <typename MATRIX1,typename MATRIX2, typename INVERSE>
+template <typename MatrixType1,typename MatrixType2, typename INVERSE>
void PArpackSolver<VectorType>::solve
-(const MATRIX1 &/*system_matrix*/,
- const MATRIX2 &mass_matrix,
+(const MatrixType1 &/*system_matrix*/,
+ const MatrixType2 &mass_matrix,
const INVERSE &inverse,
std::vector<std::complex<double> > &eigenvalues,
std::vector<VectorType> &eigenvectors,
- const unsigned int n_eigenvalues)
+ const unsigned int n_eigenvalues)
{
Assert (n_eigenvalues <= eigenvectors.size(),
*
* @author Guido Kanschat 2000, 2001, 2002
*/
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
class PointerMatrix : public PointerMatrixBase<VectorType>
{
public:
*
* If <tt>M</tt> is zero, no matrix is stored.
*/
- PointerMatrix (const MATRIX *M=0);
+ PointerMatrix (const MatrixType *M=0);
/**
* Constructor.
* argument to this function is used to this end, i.e., you can in essence
* assign a name to the current PointerMatrix object.
*/
- PointerMatrix(const MATRIX *M,
+ PointerMatrix(const MatrixType *M,
const char *name);
// Use doc from base class
* matrix.
* @see SmartPointer
*/
- const PointerMatrix &operator= (const MATRIX *M);
+ const PointerMatrix &operator= (const MatrixType *M);
/**
* Matrix-vector product.
/**
* The pointer to the actual matrix.
*/
- SmartPointer<const MATRIX,PointerMatrix<MATRIX,VectorType> > m;
+ SmartPointer<const MatrixType,PointerMatrix<MatrixType,VectorType> > m;
};
*
* This class differs form PointerMatrix by its additional VectorMemory object
* and by the fact that it implements the functions vmult_add() and
- * Tvmult_add() only using vmult() and Tvmult() of the MATRIX.
+ * Tvmult_add() only using vmult() and Tvmult() of the MatrixType.
*
* @author Guido Kanschat 2006
*/
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
class PointerMatrixAux : public PointerMatrixBase<VectorType>
{
public:
* If <tt>mem</tt> is zero, then GrowingVectorMemory is used.
*/
PointerMatrixAux (VectorMemory<VectorType> *mem = 0,
- const MATRIX *M=0);
+ const MatrixType *M = 0);
/**
* Constructor not using a matrix.
* assign a name to the current PointerMatrix object.
*/
PointerMatrixAux(VectorMemory<VectorType> *mem,
- const MATRIX *M,
+ const MatrixType *M,
const char *name);
// Use doc from base class
* matrix.
* @see SmartPointer
*/
- const PointerMatrixAux &operator= (const MATRIX *M);
+ const PointerMatrixAux &operator= (const MatrixType *M);
/**
* Matrix-vector product.
/**
* Object for getting the auxiliary vector.
*/
- mutable SmartPointer<VectorMemory<VectorType>,PointerMatrixAux<MATRIX,VectorType> > mem;
+ mutable SmartPointer<VectorMemory<VectorType>,PointerMatrixAux<MatrixType,VectorType> > mem;
/**
* The pointer to the actual matrix.
*/
- SmartPointer<const MATRIX,PointerMatrixAux<MATRIX,VectorType> > m;
+ SmartPointer<const MatrixType,PointerMatrixAux<MatrixType,VectorType> > m;
};
*
* @relates PointerMatrixBase @relates PointerMatrixAux
*/
-template <typename VectorType, class MATRIX>
+template <typename VectorType, typename MatrixType>
inline
PointerMatrixBase<VectorType> *
-new_pointer_matrix_base(MATRIX &matrix, const VectorType &, const char *name = "PointerMatrixAux")
+new_pointer_matrix_base(MatrixType &matrix, const VectorType &, const char *name = "PointerMatrixAux")
{
- return new PointerMatrixAux<MATRIX, VectorType>(0, &matrix, name);
+ return new PointerMatrixAux<MatrixType, VectorType>(0, &matrix, name);
}
/**
//----------------------------------------------------------------------//
-template<class MATRIX, typename VectorType>
-PointerMatrix<MATRIX, VectorType>::PointerMatrix (const MATRIX *M)
+template<typename MatrixType, typename VectorType>
+PointerMatrix<MatrixType, VectorType>::PointerMatrix (const MatrixType *M)
: m(M, typeid(*this).name())
{}
-template<class MATRIX, typename VectorType>
-PointerMatrix<MATRIX, VectorType>::PointerMatrix (const char *name)
+template<typename MatrixType, typename VectorType>
+PointerMatrix<MatrixType, VectorType>::PointerMatrix (const char *name)
: m(0, name)
{}
-template<class MATRIX, typename VectorType>
-PointerMatrix<MATRIX, VectorType>::PointerMatrix (const MATRIX *M,
- const char *name)
+template<typename MatrixType, typename VectorType>
+PointerMatrix<MatrixType, VectorType>::PointerMatrix (const MatrixType *M,
+ const char *name)
: m(M, name)
{}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-PointerMatrix<MATRIX, VectorType>::clear ()
+PointerMatrix<MatrixType, VectorType>::clear ()
{
m = 0;
}
-template<class MATRIX, typename VectorType>
-inline const PointerMatrix<MATRIX, VectorType> &
-PointerMatrix<MATRIX, VectorType>::operator= (const MATRIX *M)
+template<typename MatrixType, typename VectorType>
+inline const PointerMatrix<MatrixType, VectorType> &
+PointerMatrix<MatrixType, VectorType>::operator= (const MatrixType *M)
{
m = M;
return *this;
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline bool
-PointerMatrix<MATRIX, VectorType>::empty () const
+PointerMatrix<MatrixType, VectorType>::empty () const
{
if (m == 0)
return true;
return m->empty();
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-PointerMatrix<MATRIX, VectorType>::vmult (VectorType &dst,
- const VectorType &src) const
+PointerMatrix<MatrixType, VectorType>::vmult (VectorType &dst,
+ const VectorType &src) const
{
Assert (m != 0, ExcNotInitialized());
m->vmult (dst, src);
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-PointerMatrix<MATRIX, VectorType>::Tvmult (VectorType &dst,
- const VectorType &src) const
+PointerMatrix<MatrixType, VectorType>::Tvmult (VectorType &dst,
+ const VectorType &src) const
{
Assert (m != 0, ExcNotInitialized());
m->Tvmult (dst, src);
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-PointerMatrix<MATRIX, VectorType>::vmult_add (VectorType &dst,
- const VectorType &src) const
+PointerMatrix<MatrixType, VectorType>::vmult_add (VectorType &dst,
+ const VectorType &src) const
{
Assert (m != 0, ExcNotInitialized());
m->vmult_add (dst, src);
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-PointerMatrix<MATRIX, VectorType>::Tvmult_add (VectorType &dst,
- const VectorType &src) const
+PointerMatrix<MatrixType, VectorType>::Tvmult_add (VectorType &dst,
+ const VectorType &src) const
{
Assert (m != 0, ExcNotInitialized());
m->Tvmult_add (dst, src);
//----------------------------------------------------------------------//
-template<class MATRIX, typename VectorType>
-PointerMatrixAux<MATRIX, VectorType>::PointerMatrixAux (
- VectorMemory<VectorType> *mem,
- const MATRIX *M)
+template<typename MatrixType, typename VectorType>
+PointerMatrixAux<MatrixType, VectorType>::PointerMatrixAux (VectorMemory<VectorType> *mem,
+ const MatrixType *M)
: mem(mem, typeid(*this).name()),
m(M, typeid(*this).name())
{
}
-template<class MATRIX, typename VectorType>
-PointerMatrixAux<MATRIX, VectorType>::PointerMatrixAux (
- VectorMemory<VectorType> *mem,
- const char *name)
+template<typename MatrixType, typename VectorType>
+PointerMatrixAux<MatrixType, VectorType>::PointerMatrixAux (VectorMemory<VectorType> *mem,
+ const char *name)
: mem(mem, name),
m(0, name)
{
}
-template<class MATRIX, typename VectorType>
-PointerMatrixAux<MATRIX, VectorType>::PointerMatrixAux (
- VectorMemory<VectorType> *mem,
- const MATRIX *M,
- const char *name)
+template<typename MatrixType, typename VectorType>
+PointerMatrixAux<MatrixType, VectorType>::PointerMatrixAux (VectorMemory<VectorType> *mem,
+ const MatrixType *M,
+ const char *name)
: mem(mem, name),
m(M, name)
{
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-PointerMatrixAux<MATRIX, VectorType>::clear ()
+PointerMatrixAux<MatrixType, VectorType>::clear ()
{
m = 0;
}
-template<class MATRIX, typename VectorType>
-inline const PointerMatrixAux<MATRIX, VectorType> &
-PointerMatrixAux<MATRIX, VectorType>::operator= (const MATRIX *M)
+template<typename MatrixType, typename VectorType>
+inline const PointerMatrixAux<MatrixType, VectorType> &
+PointerMatrixAux<MatrixType, VectorType>::operator= (const MatrixType *M)
{
m = M;
return *this;
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-PointerMatrixAux<MATRIX, VectorType>::set_memory(VectorMemory<VectorType> *M)
+PointerMatrixAux<MatrixType, VectorType>::set_memory(VectorMemory<VectorType> *M)
{
mem = M;
if (mem == 0)
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline bool
-PointerMatrixAux<MATRIX, VectorType>::empty () const
+PointerMatrixAux<MatrixType, VectorType>::empty () const
{
if (m == 0)
return true;
return m->empty();
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-PointerMatrixAux<MATRIX, VectorType>::vmult (VectorType &dst,
+PointerMatrixAux<MatrixType, VectorType>::vmult (VectorType &dst,
const VectorType &src) const
{
if (mem == 0)
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-PointerMatrixAux<MATRIX, VectorType>::Tvmult (VectorType &dst,
+PointerMatrixAux<MatrixType, VectorType>::Tvmult (VectorType &dst,
const VectorType &src) const
{
if (mem == 0)
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-PointerMatrixAux<MATRIX, VectorType>::vmult_add (VectorType &dst,
+PointerMatrixAux<MatrixType, VectorType>::vmult_add (VectorType &dst,
const VectorType &src) const
{
if (mem == 0)
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-PointerMatrixAux<MATRIX, VectorType>::Tvmult_add (VectorType &dst,
+PointerMatrixAux<MatrixType, VectorType>::Tvmult_add (VectorType &dst,
const VectorType &src) const
{
if (mem == 0)
template<typename number>
-PointerMatrixVector<number>::PointerMatrixVector (
- const Vector<number> *M,
- const char *name)
+PointerMatrixVector<number>::PointerMatrixVector (const Vector<number> *M,
+ const char *name)
: m(M, name)
{}
template<typename number>
inline void
-PointerMatrixVector<number>::vmult (
- Vector<number> &dst,
- const Vector<number> &src) const
+PointerMatrixVector<number>::vmult (Vector<number> &dst,
+ const Vector<number> &src) const
{
Assert (m != 0, ExcNotInitialized());
Assert (dst.size() == 1, ExcDimensionMismatch(dst.size(), 1));
template<typename number>
inline void
-PointerMatrixVector<number>::Tvmult (
- Vector<number> &dst,
- const Vector<number> &src) const
+PointerMatrixVector<number>::Tvmult (Vector<number> &dst,
+ const Vector<number> &src) const
{
Assert (m != 0, ExcNotInitialized());
Assert(src.size() == 1, ExcDimensionMismatch(src.size(), 1));
template<typename number>
inline void
-PointerMatrixVector<number>::vmult_add (
- Vector<number> &dst,
- const Vector<number> &src) const
+PointerMatrixVector<number>::vmult_add (Vector<number> &dst,
+ const Vector<number> &src) const
{
Assert (m != 0, ExcNotInitialized());
Assert (dst.size() == 1, ExcDimensionMismatch(dst.size(), 1));
template<typename number>
inline void
-PointerMatrixVector<number>::Tvmult_add (
- Vector<number> &dst,
- const Vector<number> &src) const
+PointerMatrixVector<number>::Tvmult_add (Vector<number> &dst,
+ const Vector<number> &src) const
{
Assert (m != 0, ExcNotInitialized());
Assert(src.size() == 1, ExcDimensionMismatch(src.size(), 1));
* The matrix argument is ignored and here just for compatibility with more
* complex preconditioners.
*/
- template <class MATRIX>
- void initialize (const MATRIX &matrix,
+ template <typename MatrixType>
+ void initialize (const MatrixType &matrix,
const AdditionalData &additional_data = AdditionalData());
/**
* preconditioners. The matrix argument is ignored and here just for
* compatibility with more complex preconditioners.
*/
- template <class MATRIX>
- void initialize (const MATRIX &matrix,
+ template <typename MatrixType>
+ void initialize (const MatrixType &matrix,
const AdditionalData ¶meters);
/**
*
* @author Guido Kanschat, Wolfgang Bangerth, 1999
*/
-template<class MATRIX = SparseMatrix<double>, class VectorType = Vector<double> >
+template<typename MatrixType = SparseMatrix<double>, class VectorType = Vector<double> >
class PreconditionUseMatrix : public Subscriptor
{
public:
/**
* Type of the preconditioning function of the matrix.
*/
- typedef void ( MATRIX::* function_ptr)(VectorType &, const VectorType &) const;
+ typedef void ( MatrixType::* function_ptr)(VectorType &, const VectorType &) const;
/**
* Constructor. This constructor stores a reference to the matrix object
* for later use and selects a preconditioning method, which must be a
* member function of that matrix.
*/
- PreconditionUseMatrix(const MATRIX &M,
+ PreconditionUseMatrix(const MatrixType &M,
const function_ptr method);
/**
/**
* Pointer to the matrix in use.
*/
- const MATRIX &matrix;
+ const MatrixType &matrix;
/**
* Pointer to the preconditioning function.
* @author Guido Kanschat, 2000; extension for full compatibility with
* LinearOperator class: Jean-Paul Pelteret, 2015
*/
-template<class MATRIX = SparseMatrix<double> >
+template<typename MatrixType = SparseMatrix<double> >
class PreconditionRelaxation : public Subscriptor
{
public:
/**
* Declare type for container size.
*/
- typedef typename MATRIX::size_type size_type;
+ typedef typename MatrixType::size_type size_type;
/**
* Class for parameters.
* the preconditioner object. The relaxation parameter should be larger than
* zero and smaller than 2 for numerical reasons. It defaults to 1.
*/
- void initialize (const MATRIX &A,
+ void initialize (const MatrixType &A,
const AdditionalData ¶meters = AdditionalData());
/**
/**
* Pointer to the matrix object.
*/
- SmartPointer<const MATRIX, PreconditionRelaxation<MATRIX> > A;
+ SmartPointer<const MatrixType, PreconditionRelaxation<MatrixType> > A;
/**
* Relaxation parameter.
/**
- * Jacobi preconditioner using matrix built-in function. The <tt>MATRIX</tt>
+ * Jacobi preconditioner using matrix built-in function. The <tt>MatrixType</tt>
* class used is required to have a function <tt>precondition_Jacobi(VectorType&,
* const VectorType&, double</tt>)
*
*
* @author Guido Kanschat, 2000
*/
-template <class MATRIX = SparseMatrix<double> >
-class PreconditionJacobi : public PreconditionRelaxation<MATRIX>
+template <typename MatrixType = SparseMatrix<double> >
+class PreconditionJacobi : public PreconditionRelaxation<MatrixType>
{
public:
/**
* Using the right hand side <i>b</i> and the previous iterate <i>x</i>, this
* is the operation implemented by step().
*
- * The MATRIX class used is required to have functions
+ * The MatrixType class used is required to have functions
* <tt>precondition_SOR(VectorType&, const VectorType&, double)</tt> and
* <tt>precondition_TSOR(VectorType&, const VectorType&, double)</tt>.
*
*
* @author Guido Kanschat, 2000
*/
-template <class MATRIX = SparseMatrix<double> >
-class PreconditionSOR : public PreconditionRelaxation<MATRIX>
+template <typename MatrixType = SparseMatrix<double> >
+class PreconditionSOR : public PreconditionRelaxation<MatrixType>
{
public:
/**
/**
- * SSOR preconditioner using matrix built-in function. The <tt>MATRIX</tt>
+ * SSOR preconditioner using matrix built-in function. The <tt>MatrixType</tt>
* class used is required to have a function <tt>precondition_SSOR(VectorType&,
* const VectorType&, double)</tt>
*
*
* @author Guido Kanschat, 2000
*/
-template <class MATRIX = SparseMatrix<double> >
-class PreconditionSSOR : public PreconditionRelaxation<MATRIX>
+template <typename MatrixType = SparseMatrix<double> >
+class PreconditionSSOR : public PreconditionRelaxation<MatrixType>
{
public:
/**
* Declare type for container size.
*/
- typedef typename MATRIX::size_type size_type;
+ typedef typename MatrixType::size_type size_type;
/**
* A typedef to the base class.
*/
- typedef PreconditionRelaxation<MATRIX> BaseClass;
+ typedef PreconditionRelaxation<MatrixType> BaseClass;
/**
* the preconditioner object. The relaxation parameter should be larger than
* zero and smaller than 2 for numerical reasons. It defaults to 1.
*/
- void initialize (const MATRIX &A,
+ void initialize (const MatrixType &A,
const typename BaseClass::AdditionalData ¶meters = typename BaseClass::AdditionalData());
/**
/**
* Permuted SOR preconditioner using matrix built-in function. The
- * <tt>MATRIX</tt> class used is required to have functions <tt>PSOR(VectorType&,
+ * <tt>MatrixType</tt> class used is required to have functions <tt>PSOR(VectorType&,
* const VectorType&, double)</tt> and <tt>TPSOR(VectorType&, const VectorType&,
* double)</tt>.
*
* @author Guido Kanschat, 2003; extension for full compatibility with
* LinearOperator class: Jean-Paul Pelteret, 2015
*/
-template <class MATRIX = SparseMatrix<double> >
-class PreconditionPSOR : public PreconditionRelaxation<MATRIX>
+template <typename MatrixType = SparseMatrix<double> >
+class PreconditionPSOR : public PreconditionRelaxation<MatrixType>
{
public:
/**
* Declare type for container size.
*/
- typedef typename MATRIX::size_type size_type;
+ typedef typename MatrixType::size_type size_type;
/**
* Parameters for PreconditionPSOR.
*/
AdditionalData (const std::vector<size_type> &permutation,
const std::vector<size_type> &inverse_permutation,
- const typename PreconditionRelaxation<MATRIX>::AdditionalData
- ¶meters = typename PreconditionRelaxation<MATRIX>::AdditionalData());
+ const typename PreconditionRelaxation<MatrixType>::AdditionalData
+ ¶meters = typename PreconditionRelaxation<MatrixType>::AdditionalData());
/**
* Storage for the permutation vector.
/**
* Relaxation parameters
*/
- typename PreconditionRelaxation<MATRIX>::AdditionalData parameters;
+ typename PreconditionRelaxation<MatrixType>::AdditionalData parameters;
};
/**
* The relaxation parameter should be larger than zero and smaller than 2
* for numerical reasons. It defaults to 1.
*/
- void initialize (const MATRIX &A,
+ void initialize (const MatrixType &A,
const std::vector<size_type> &permutation,
const std::vector<size_type> &inverse_permutation,
- const typename PreconditionRelaxation<MATRIX>::AdditionalData &
- parameters = typename PreconditionRelaxation<MATRIX>::AdditionalData());
+ const typename PreconditionRelaxation<MatrixType>::AdditionalData &
+ parameters = typename PreconditionRelaxation<MatrixType>::AdditionalData());
/**
* Initialize matrix and relaxation parameter. The matrix is just stored in
* After this function is called the preconditioner is ready to be used
* (using the <code>vmult</code> function of derived classes).
*/
- void initialize (const MATRIX &A,
+ void initialize (const MatrixType &A,
const AdditionalData &additional_data);
/**
* @author Martin Kronbichler, 2009; extension for full compatibility with
* LinearOperator class: Jean-Paul Pelteret, 2015
*/
-template <class MATRIX=SparseMatrix<double>, class VectorType=Vector<double> >
+template <typename MatrixType=SparseMatrix<double>, class VectorType=Vector<double> >
class PreconditionChebyshev : public Subscriptor
{
public:
* matrix weighted by its diagonal using a modified CG iteration in case the
* given number of iterations is positive.
*/
- void initialize (const MATRIX &matrix,
+ void initialize (const MatrixType &matrix,
const AdditionalData &additional_data = AdditionalData());
/**
/**
* A pointer to the underlying matrix.
*/
- SmartPointer<const MATRIX,PreconditionChebyshev<MATRIX,VectorType> > matrix_ptr;
+ SmartPointer<const MatrixType,PreconditionChebyshev<MatrixType,VectorType> > matrix_ptr;
/**
* Internal vector used for the <tt>vmult</tt> operation.
n_columns (0)
{}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-PreconditionIdentity::initialize (
- const MATRIX &matrix,
- const PreconditionIdentity::AdditionalData &)
+PreconditionIdentity::initialize (const MatrixType &matrix,
+ const PreconditionIdentity::AdditionalData &)
{
n_rows = matrix.m();
n_columns = matrix.n();
//---------------------------------------------------------------------------
inline
-PreconditionRichardson::AdditionalData::AdditionalData (
- const double relaxation)
+PreconditionRichardson::AdditionalData::AdditionalData (const double relaxation)
:
relaxation(relaxation)
{}
inline void
-PreconditionRichardson::initialize (
- const PreconditionRichardson::AdditionalData ¶meters)
+PreconditionRichardson::initialize
+(const PreconditionRichardson::AdditionalData ¶meters)
{
relaxation = parameters.relaxation;
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-PreconditionRichardson::initialize (
- const MATRIX &matrix,
- const PreconditionRichardson::AdditionalData ¶meters)
+PreconditionRichardson::initialize
+(const MatrixType &matrix,
+ const PreconditionRichardson::AdditionalData ¶meters)
{
relaxation = parameters.relaxation;
n_rows = matrix.m();
//---------------------------------------------------------------------------
-template <class MATRIX>
+template <typename MatrixType>
inline void
-PreconditionRelaxation<MATRIX>::initialize (const MATRIX &rA,
- const AdditionalData ¶meters)
+PreconditionRelaxation<MatrixType>::initialize (const MatrixType &rA,
+ const AdditionalData ¶meters)
{
A = &rA;
relaxation = parameters.relaxation;
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-PreconditionRelaxation<MATRIX>::clear ()
+PreconditionRelaxation<MatrixType>::clear ()
{
A = 0;
}
-template <class MATRIX>
-inline typename PreconditionRelaxation<MATRIX>::size_type
-PreconditionRelaxation<MATRIX>::m () const
+template <typename MatrixType>
+inline typename PreconditionRelaxation<MatrixType>::size_type
+PreconditionRelaxation<MatrixType>::m () const
{
Assert (A!=0, ExcNotInitialized());
return A->m();
}
-template <class MATRIX>
-inline typename PreconditionRelaxation<MATRIX>::size_type
-PreconditionRelaxation<MATRIX>::n () const
+template <typename MatrixType>
+inline typename PreconditionRelaxation<MatrixType>::size_type
+PreconditionRelaxation<MatrixType>::n () const
{
Assert (A!=0, ExcNotInitialized());
return A->n();
//---------------------------------------------------------------------------
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionJacobi<MATRIX>::vmult (VectorType &dst, const VectorType &src) const
+PreconditionJacobi<MatrixType>::vmult (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionJacobi<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionJacobi<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionJacobi and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionJacobi<MATRIX>::Tvmult (VectorType &dst, const VectorType &src) const
+PreconditionJacobi<MatrixType>::Tvmult (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionJacobi<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionJacobi<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionJacobi and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionJacobi<MATRIX>::step (VectorType &dst, const VectorType &src) const
+PreconditionJacobi<MatrixType>::step (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionJacobi<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionJacobi<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionJacobi and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionJacobi<MATRIX>::Tstep (VectorType &dst, const VectorType &src) const
+PreconditionJacobi<MatrixType>::Tstep (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionJacobi<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionJacobi<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionJacobi and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
//---------------------------------------------------------------------------
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionSOR<MATRIX>::vmult (VectorType &dst, const VectorType &src) const
+PreconditionSOR<MatrixType>::vmult (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionSOR<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionSOR<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionSOR<MATRIX>::Tvmult (VectorType &dst, const VectorType &src) const
+PreconditionSOR<MatrixType>::Tvmult (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionSOR<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionSOR<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionSOR<MATRIX>::step (VectorType &dst, const VectorType &src) const
+PreconditionSOR<MatrixType>::step (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionSOR<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionSOR<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionSOR<MATRIX>::Tstep (VectorType &dst, const VectorType &src) const
+PreconditionSOR<MatrixType>::Tstep (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionSOR<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionSOR<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
//---------------------------------------------------------------------------
-template <class MATRIX>
+template <typename MatrixType>
inline void
-PreconditionSSOR<MATRIX>::initialize (const MATRIX &rA,
+PreconditionSSOR<MatrixType>::initialize (const MatrixType &rA,
const typename BaseClass::AdditionalData ¶meters)
{
- this->PreconditionRelaxation<MATRIX>::initialize (rA, parameters);
+ this->PreconditionRelaxation<MatrixType>::initialize (rA, parameters);
// in case we have a SparseMatrix class, we can extract information about
// the diagonal.
- const SparseMatrix<typename MATRIX::value_type> *mat =
- dynamic_cast<const SparseMatrix<typename MATRIX::value_type> *>(&*this->A);
+ const SparseMatrix<typename MatrixType::value_type> *mat =
+ dynamic_cast<const SparseMatrix<typename MatrixType::value_type> *>(&*this->A);
// calculate the positions first after the diagonal.
if (mat != 0)
// diagonal. we need to precondition with the elements on the left
// only. note: the first entry in each line denotes the diagonal
// element, which we need not check.
- typename SparseMatrix<typename MATRIX::value_type>::const_iterator
+ typename SparseMatrix<typename MatrixType::value_type>::const_iterator
it = mat->begin(row)+1;
for ( ; it < mat->end(row); ++it)
if (it->column() > row)
}
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionSSOR<MATRIX>::vmult (VectorType &dst, const VectorType &src) const
+PreconditionSSOR<MatrixType>::vmult (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionSSOR<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionSSOR<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionSSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionSSOR<MATRIX>::Tvmult (VectorType &dst, const VectorType &src) const
+PreconditionSSOR<MatrixType>::Tvmult (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionSSOR<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionSSOR<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionSSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionSSOR<MATRIX>::step (VectorType &dst, const VectorType &src) const
+PreconditionSSOR<MatrixType>::step (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionSSOR<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionSSOR<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionSSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionSSOR<MATRIX>::Tstep (VectorType &dst, const VectorType &src) const
+PreconditionSSOR<MatrixType>::Tstep (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionSSOR<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionSSOR<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionSSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
//---------------------------------------------------------------------------
-template <class MATRIX>
+template <typename MatrixType>
inline void
-PreconditionPSOR<MATRIX>::initialize (
- const MATRIX &rA,
- const std::vector<size_type> &p,
- const std::vector<size_type> &ip,
- const typename PreconditionRelaxation<MATRIX>::AdditionalData ¶meters)
+PreconditionPSOR<MatrixType>::initialize
+(const MatrixType &rA,
+ const std::vector<size_type> &p,
+ const std::vector<size_type> &ip,
+ const typename PreconditionRelaxation<MatrixType>::AdditionalData ¶meters)
{
permutation = &p;
inverse_permutation = &ip;
- PreconditionRelaxation<MATRIX>::initialize(rA, parameters);
+ PreconditionRelaxation<MatrixType>::initialize(rA, parameters);
}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-PreconditionPSOR<MATRIX>::initialize (
- const MATRIX &A,
- const AdditionalData &additional_data)
+PreconditionPSOR<MatrixType>::initialize (const MatrixType &A,
+ const AdditionalData &additional_data)
{
initialize(A,
additional_data.permutation,
}
-template <class MATRIX>
+template <typename MatrixType>
template <typename VectorType>
inline void
-PreconditionPSOR<MATRIX>::vmult (VectorType &dst, const VectorType &src) const
+PreconditionPSOR<MatrixType>::vmult (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionPSOR<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionPSOR<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionPSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
-template <class MATRIX>
+template <typename MatrixType>
template<class VectorType>
inline void
-PreconditionPSOR<MATRIX>::Tvmult (VectorType &dst, const VectorType &src) const
+PreconditionPSOR<MatrixType>::Tvmult (VectorType &dst, const VectorType &src) const
{
#ifdef DEAL_II_WITH_CXX11
static_assert(
- std::is_same<typename PreconditionPSOR<MATRIX>::size_type, typename VectorType::size_type>::value,
+ std::is_same<typename PreconditionPSOR<MatrixType>::size_type, typename VectorType::size_type>::value,
"PreconditionPSOR and VectorType must have the same size_type.");
#endif // DEAL_II_WITH_CXX11
this->A->TPSOR (dst, *permutation, *inverse_permutation, this->relaxation);
}
-template <class MATRIX>
-PreconditionPSOR<MATRIX>::AdditionalData::AdditionalData (
- const std::vector<size_type> &permutation,
- const std::vector<size_type> &inverse_permutation,
- const typename PreconditionRelaxation<MATRIX>::AdditionalData ¶meters)
+template <typename MatrixType>
+PreconditionPSOR<MatrixType>::AdditionalData::AdditionalData
+(const std::vector<size_type> &permutation,
+ const std::vector<size_type> &inverse_permutation,
+ const typename PreconditionRelaxation<MatrixType>::AdditionalData ¶meters)
:
permutation(permutation),
inverse_permutation(inverse_permutation),
//---------------------------------------------------------------------------
-template<class MATRIX, class VectorType>
-PreconditionUseMatrix<MATRIX,VectorType>::PreconditionUseMatrix(const MATRIX &M,
- const function_ptr method)
+template<typename MatrixType, class VectorType>
+PreconditionUseMatrix<MatrixType,VectorType>::PreconditionUseMatrix(const MatrixType &M,
+ const function_ptr method)
:
matrix(M), precondition(method)
{}
-template<class MATRIX, class VectorType>
+template<typename MatrixType, class VectorType>
void
-PreconditionUseMatrix<MATRIX,VectorType>::vmult (VectorType &dst,
- const VectorType &src) const
+PreconditionUseMatrix<MatrixType,VectorType>::vmult (VectorType &dst,
+ const VectorType &src) const
{
(matrix.*precondition)(dst, src);
}
//---------------------------------------------------------------------------
-template<class MATRIX>
+template<typename MatrixType>
inline
-PreconditionRelaxation<MATRIX>::AdditionalData::
+PreconditionRelaxation<MatrixType>::AdditionalData::
AdditionalData (const double relaxation)
:
relaxation (relaxation)
-template <class MATRIX, class VectorType>
+template <typename MatrixType, class VectorType>
inline
-PreconditionChebyshev<MATRIX,VectorType>::AdditionalData::
+PreconditionChebyshev<MatrixType,VectorType>::AdditionalData::
AdditionalData (const unsigned int degree,
const double smoothing_range,
const bool nonzero_starting,
-template <class MATRIX, class VectorType>
+template <typename MatrixType, class VectorType>
inline
-PreconditionChebyshev<MATRIX,VectorType>::PreconditionChebyshev ()
+PreconditionChebyshev<MatrixType,VectorType>::PreconditionChebyshev ()
:
is_initialized (false)
{
-template <class MATRIX, class VectorType>
+template <typename MatrixType, class VectorType>
inline
void
-PreconditionChebyshev<MATRIX,VectorType>::initialize (const MATRIX &matrix,
- const AdditionalData &additional_data)
+PreconditionChebyshev<MatrixType,VectorType>::initialize
+(const MatrixType &matrix,
+ const AdditionalData &additional_data)
{
matrix_ptr = &matrix;
data = additional_data;
-template <class MATRIX, class VectorType>
+template <typename MatrixType, class VectorType>
inline
void
-PreconditionChebyshev<MATRIX,VectorType>::vmult (VectorType &dst,
- const VectorType &src) const
+PreconditionChebyshev<MatrixType,VectorType>::vmult (VectorType &dst,
+ const VectorType &src) const
{
Assert (is_initialized, ExcMessage("Preconditioner not initialized"));
double rhok = delta / theta, sigma = theta / delta;
-template <class MATRIX, class VectorType>
+template <typename MatrixType, class VectorType>
inline
void
-PreconditionChebyshev<MATRIX,VectorType>::Tvmult (VectorType &dst,
- const VectorType &src) const
+PreconditionChebyshev<MatrixType,VectorType>::Tvmult (VectorType &dst,
+ const VectorType &src) const
{
Assert (is_initialized, ExcMessage("Preconditioner not initialized"));
double rhok = delta / theta, sigma = theta / delta;
-template <class MATRIX, typename VectorType>
+template <typename MatrixType, typename VectorType>
inline
-void PreconditionChebyshev<MATRIX,VectorType>::clear ()
+void PreconditionChebyshev<MatrixType,VectorType>::clear ()
{
is_initialized = false;
matrix_ptr = 0;
}
-template <class MATRIX, typename VectorType>
+template <typename MatrixType, typename VectorType>
inline
-typename PreconditionChebyshev<MATRIX,VectorType>::size_type
-PreconditionChebyshev<MATRIX,VectorType>::m () const
+typename PreconditionChebyshev<MatrixType,VectorType>::size_type
+PreconditionChebyshev<MatrixType,VectorType>::m () const
{
Assert (matrix_ptr!=0, ExcNotInitialized());
return matrix_ptr->m();
}
-template <class MATRIX, typename VectorType>
+template <typename MatrixType, typename VectorType>
inline
-typename PreconditionChebyshev<MATRIX,VectorType>::size_type
-PreconditionChebyshev<MATRIX,VectorType>::n () const
+typename PreconditionChebyshev<MatrixType,VectorType>::size_type
+PreconditionChebyshev<MatrixType,VectorType>::n () const
{
Assert (matrix_ptr!=0, ExcNotInitialized());
return matrix_ptr->n();
DEAL_II_NAMESPACE_OPEN
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
class PreconditionBlockJacobi;
/*! @addtogroup Preconditioners
/**
* Base class for actual block preconditioners. This class assumes the
- * <tt>MATRIX</tt> consisting of invertible blocks of @p blocksize on the
+ * <tt>MatrixType</tt> consisting of invertible blocks of @p blocksize on the
* diagonal and provides the inversion of the diagonal blocks of the matrix.
* It is not necessary for this class that the matrix be block diagonal;
* rather, it applies to matrices of arbitrary structure with the minimal
* @author Ralf Hartmann, Guido Kanschat
* @date 1999, 2000, 2010
*/
-template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
+template<typename MatrixType, typename inverse_type = typename MatrixType::value_type>
class PreconditionBlock
: public virtual Subscriptor,
protected PreconditionBlockBase<inverse_type>
/**
* Define number type of matrix.
*/
- typedef typename MATRIX::value_type number;
+ typedef typename MatrixType::value_type number;
/**
* Value type for inverse matrices.
*
* Additionally, a relaxation parameter for derived classes may be provided.
*/
- void initialize (const MATRIX &A,
+ void initialize (const MatrixType &A,
const AdditionalData parameters);
protected:
/**
*
* Additionally, a relaxation parameter for derived classes may be provided.
*/
- void initialize (const MATRIX &A,
+ void initialize (const MatrixType &A,
const std::vector<size_type> &permutation,
const std::vector<size_type> &inverse_permutation,
const AdditionalData parameters);
/**
* Replacement of invert_diagblocks() for permuted preconditioning.
*/
- void invert_permuted_diagblocks(
- const std::vector<size_type> &permutation,
- const std::vector<size_type> &inverse_permutation);
+ void invert_permuted_diagblocks(const std::vector<size_type> &permutation,
+ const std::vector<size_type> &inverse_permutation);
public:
/**
* Deletes the inverse diagonal block matrices if existent, sets the
* function.
*/
template <typename number2>
- void forward_step (
- Vector<number2> &dst,
- const Vector<number2> &prev,
- const Vector<number2> &src,
- const bool transpose_diagonal) const;
+ void forward_step (Vector<number2> &dst,
+ const Vector<number2> &prev,
+ const Vector<number2> &src,
+ const bool transpose_diagonal) const;
/**
* Perform one block relaxation step in backward numbering.
* function.
*/
template <typename number2>
- void backward_step (
- Vector<number2> &dst,
- const Vector<number2> &prev,
- const Vector<number2> &src,
- const bool transpose_diagonal) const;
+ void backward_step (Vector<number2> &dst,
+ const Vector<number2> &prev,
+ const Vector<number2> &src,
+ const bool transpose_diagonal) const;
/**
* inverse matrices should not be stored) until the last call of the
* preconditoining @p vmult function of the derived classes.
*/
- SmartPointer<const MATRIX,PreconditionBlock<MATRIX,inverse_type> > A;
+ SmartPointer<const MatrixType,PreconditionBlock<MatrixType,inverse_type> > A;
/**
* Relaxation parameter to be used by derived classes.
*/
*
* @author Ralf Hartmann, Guido Kanschat, 1999, 2000, 2003
*/
-template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
+template<typename MatrixType, typename inverse_type = typename MatrixType::value_type>
class PreconditionBlockJacobi : public virtual Subscriptor,
- private PreconditionBlock<MATRIX, inverse_type>
+ private PreconditionBlock<MatrixType, inverse_type>
{
private:
/**
* Define number type of matrix.
*/
- typedef typename MATRIX::value_type number;
+ typedef typename MatrixType::value_type number;
public:
/**
* Constructor. Since we use accessors only for read access, a const
* matrix pointer is sufficient.
*/
- Accessor (const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
+ Accessor (const PreconditionBlockJacobi<MatrixType, inverse_type> *matrix,
const size_type row);
/**
/**
* The matrix accessed.
*/
- const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix;
+ const PreconditionBlockJacobi<MatrixType, inverse_type> *matrix;
/**
* Save block size here for further reference.
/**
* Constructor.
*/
- const_iterator(const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
+ const_iterator(const PreconditionBlockJacobi<MatrixType, inverse_type> *matrix,
const size_type row);
/**
/**
* import functions from private base class
*/
- using PreconditionBlock<MATRIX, inverse_type>::initialize;
- using PreconditionBlock<MATRIX, inverse_type>::clear;
- using PreconditionBlock<MATRIX, inverse_type>::empty;
- using PreconditionBlock<MATRIX, inverse_type>::el;
- using PreconditionBlock<MATRIX, inverse_type>::set_same_diagonal;
- using PreconditionBlock<MATRIX, inverse_type>::invert_diagblocks;
- using PreconditionBlock<MATRIX, inverse_type>::block_size;
+ using PreconditionBlock<MatrixType, inverse_type>::initialize;
+ using PreconditionBlock<MatrixType, inverse_type>::clear;
+ using PreconditionBlock<MatrixType, inverse_type>::empty;
+ using PreconditionBlock<MatrixType, inverse_type>::el;
+ using PreconditionBlock<MatrixType, inverse_type>::set_same_diagonal;
+ using PreconditionBlock<MatrixType, inverse_type>::invert_diagblocks;
+ using PreconditionBlock<MatrixType, inverse_type>::block_size;
using PreconditionBlockBase<inverse_type>::size;
using PreconditionBlockBase<inverse_type>::inverse;
using PreconditionBlockBase<inverse_type>::inverse_householder;
using PreconditionBlockBase<inverse_type>::inverse_svd;
using PreconditionBlockBase<inverse_type>::log_statistics;
- using PreconditionBlock<MATRIX, inverse_type>::set_permutation;
+ using PreconditionBlock<MatrixType, inverse_type>::set_permutation;
/**
* Execute block Jacobi preconditioning.
*
* @author Ralf Hartmann, Guido Kanschat, 1999, 2000, 2001, 2002, 2003
*/
-template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
+template<typename MatrixType, typename inverse_type = typename MatrixType::value_type>
class PreconditionBlockSOR : public virtual Subscriptor,
- protected PreconditionBlock<MATRIX, inverse_type>
+ protected PreconditionBlock<MatrixType, inverse_type>
{
public:
/**
/**
* Define number type of matrix.
*/
- typedef typename MATRIX::value_type number;
+ typedef typename MatrixType::value_type number;
/**
* import types and functions from protected base class.
*/
- using typename PreconditionBlock<MATRIX,inverse_type>::AdditionalData;
- using PreconditionBlock<MATRIX, inverse_type>::initialize;
- using PreconditionBlock<MATRIX, inverse_type>::clear;
- using PreconditionBlock<MATRIX, inverse_type>::empty;
+ using typename PreconditionBlock<MatrixType,inverse_type>::AdditionalData;
+ using PreconditionBlock<MatrixType, inverse_type>::initialize;
+ using PreconditionBlock<MatrixType, inverse_type>::clear;
+ using PreconditionBlock<MatrixType, inverse_type>::empty;
using PreconditionBlockBase<inverse_type>::size;
using PreconditionBlockBase<inverse_type>::inverse;
using PreconditionBlockBase<inverse_type>::inverse_householder;
using PreconditionBlockBase<inverse_type>::inverse_svd;
- using PreconditionBlock<MATRIX, inverse_type>::el;
- using PreconditionBlock<MATRIX, inverse_type>::set_same_diagonal;
- using PreconditionBlock<MATRIX, inverse_type>::invert_diagblocks;
- using PreconditionBlock<MATRIX, inverse_type>::set_permutation;
+ using PreconditionBlock<MatrixType, inverse_type>::el;
+ using PreconditionBlock<MatrixType, inverse_type>::set_same_diagonal;
+ using PreconditionBlock<MatrixType, inverse_type>::invert_diagblocks;
+ using PreconditionBlock<MatrixType, inverse_type>::set_permutation;
using PreconditionBlockBase<inverse_type>::log_statistics;
/**
*
* @author Ralf Hartmann, Guido Kanschat, 1999, 2000
*/
-template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
+template<typename MatrixType, typename inverse_type = typename MatrixType::value_type>
class PreconditionBlockSSOR : public virtual Subscriptor,
- private PreconditionBlockSOR<MATRIX, inverse_type>
+ private PreconditionBlockSOR<MatrixType, inverse_type>
{
public:
/**
/**
* Define number type of matrix.
*/
- typedef typename MATRIX::value_type number;
+ typedef typename MatrixType::value_type number;
/**
* Constructor.
PreconditionBlockSSOR ();
// Keep AdditionalData accessible
- using typename PreconditionBlockSOR<MATRIX,inverse_type>::AdditionalData;
+ using typename PreconditionBlockSOR<MatrixType,inverse_type>::AdditionalData;
// The following are the
// functions of the base classes
/**
* Make initialization function publicly available.
*/
- using PreconditionBlockSOR<MATRIX,inverse_type>::initialize;
- using PreconditionBlockSOR<MATRIX,inverse_type>::clear;
+ using PreconditionBlockSOR<MatrixType,inverse_type>::initialize;
+ using PreconditionBlockSOR<MatrixType,inverse_type>::clear;
using PreconditionBlockBase<inverse_type>::size;
using PreconditionBlockBase<inverse_type>::inverse;
using PreconditionBlockBase<inverse_type>::inverse_householder;
using PreconditionBlockBase<inverse_type>::inverse_svd;
using PreconditionBlockBase<inverse_type>::log_statistics;
- using PreconditionBlockSOR<MATRIX,inverse_type>::set_permutation;
- using PreconditionBlockSOR<MATRIX, inverse_type>::empty;
- using PreconditionBlockSOR<MATRIX, inverse_type>::el;
- using PreconditionBlockSOR<MATRIX,inverse_type>::set_same_diagonal;
- using PreconditionBlockSOR<MATRIX,inverse_type>::invert_diagblocks;
+ using PreconditionBlockSOR<MatrixType,inverse_type>::set_permutation;
+ using PreconditionBlockSOR<MatrixType, inverse_type>::empty;
+ using PreconditionBlockSOR<MatrixType, inverse_type>::el;
+ using PreconditionBlockSOR<MatrixType,inverse_type>::set_same_diagonal;
+ using PreconditionBlockSOR<MatrixType,inverse_type>::invert_diagblocks;
/**
* Execute block SSOR preconditioning.
#ifndef DOXYGEN
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline bool
-PreconditionBlock<MATRIX, inverse_type>::empty () const
+PreconditionBlock<MatrixType, inverse_type>::empty () const
{
if (A == 0)
return true;
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline inverse_type
-PreconditionBlock<MATRIX, inverse_type>::el (
+PreconditionBlock<MatrixType, inverse_type>::el (
size_type i,
size_type j) const
{
//---------------------------------------------------------------------------
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
-PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::
-Accessor (const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
+PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::Accessor::
+Accessor (const PreconditionBlockJacobi<MatrixType, inverse_type> *matrix,
const size_type row)
:
matrix(matrix),
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
-typename PreconditionBlockJacobi<MATRIX, inverse_type>::size_type
-PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::row() const
+typename PreconditionBlockJacobi<MatrixType, inverse_type>::size_type
+PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::Accessor::row() const
{
Assert (a_block < matrix->size(),
ExcIteratorPastEnd());
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
-typename PreconditionBlockJacobi<MATRIX, inverse_type>::size_type
-PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::column() const
+typename PreconditionBlockJacobi<MatrixType, inverse_type>::size_type
+PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::Accessor::column() const
{
Assert (a_block < matrix->size(),
ExcIteratorPastEnd());
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
inverse_type
-PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::value() const
+PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::Accessor::value() const
{
Assert (a_block < matrix->size(),
ExcIteratorPastEnd());
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
-PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::
-const_iterator(const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
+PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::
+const_iterator(const PreconditionBlockJacobi<MatrixType, inverse_type> *matrix,
const size_type row)
:
accessor(matrix, row)
{}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
-typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator &
-PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::operator++ ()
+typename PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator &
+PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::operator++ ()
{
Assert (*this != accessor.matrix->end(), ExcIteratorPastEnd());
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
-const typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor &
-PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::operator* () const
+const typename PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::Accessor &
+PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::operator* () const
{
return accessor;
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
-const typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor *
-PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::operator-> () const
+const typename PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::Accessor *
+PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::operator-> () const
{
return &accessor;
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
bool
-PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::
+PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::
operator == (const const_iterator &other) const
{
if (accessor.a_block == accessor.matrix->size() &&
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
bool
-PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::
+PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::
operator != (const const_iterator &other) const
{
return ! (*this == other);
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
bool
-PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::
+PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator::
operator < (const const_iterator &other) const
{
return (accessor.row() < other.accessor.row() ||
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
-typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator
-PreconditionBlockJacobi<MATRIX, inverse_type>::begin () const
+typename PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator
+PreconditionBlockJacobi<MatrixType, inverse_type>::begin () const
{
return const_iterator(this, 0);
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
-typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator
-PreconditionBlockJacobi<MATRIX, inverse_type>::end () const
+typename PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator
+PreconditionBlockJacobi<MatrixType, inverse_type>::end () const
{
return const_iterator(this, this->size() * this->block_size());
}
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
-typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator
-PreconditionBlockJacobi<MATRIX, inverse_type>::begin (
+typename PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator
+PreconditionBlockJacobi<MatrixType, inverse_type>::begin (
const size_type r) const
{
Assert (r < this->A->m(), ExcIndexRange(r, 0, this->A->m()));
-template<class MATRIX, typename inverse_type>
+template<typename MatrixType, typename inverse_type>
inline
-typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator
-PreconditionBlockJacobi<MATRIX, inverse_type>::end (
+typename PreconditionBlockJacobi<MatrixType, inverse_type>::const_iterator
+PreconditionBlockJacobi<MatrixType, inverse_type>::end (
const size_type r) const
{
Assert (r < this->A->m(), ExcIndexRange(r, 0, this->A->m()));
DEAL_II_NAMESPACE_OPEN
-template<class MATRIX, typename inverse_type>
-PreconditionBlock<MATRIX, inverse_type>::AdditionalData::
+template<typename MatrixType, typename inverse_type>
+PreconditionBlock<MatrixType, inverse_type>::AdditionalData::
AdditionalData (const size_type block_size,
- const double relaxation,
- const bool invert_diagonal,
- const bool same_diagonal)
+ const double relaxation,
+ const bool invert_diagonal,
+ const bool same_diagonal)
:
relaxation (relaxation),
block_size(block_size),
{}
-template <class MATRIX, typename inverse_type>
-PreconditionBlock<MATRIX,inverse_type>::PreconditionBlock (bool store)
+template <typename MatrixType, typename inverse_type>
+PreconditionBlock<MatrixType,inverse_type>::PreconditionBlock (bool store)
: PreconditionBlockBase<inverse_type>(store),
blocksize(0),
A(0, typeid(*this).name())
{}
-template <class MATRIX, typename inverse_type>
-PreconditionBlock<MATRIX,inverse_type>::~PreconditionBlock ()
+template <typename MatrixType, typename inverse_type>
+PreconditionBlock<MatrixType,inverse_type>::~PreconditionBlock ()
{}
-template <class MATRIX, typename inverse_type>
-void PreconditionBlock<MATRIX,inverse_type>::clear ()
+template <typename MatrixType, typename inverse_type>
+void PreconditionBlock<MatrixType,inverse_type>::clear ()
{
PreconditionBlockBase<inverse_type>::clear();
blocksize = 0;
}
-template <class MATRIX, typename inverse_type>
-void PreconditionBlock<MATRIX,inverse_type>::initialize (
- const MATRIX &M,
- const AdditionalData parameters)
+template <typename MatrixType, typename inverse_type>
+void PreconditionBlock<MatrixType,inverse_type>::initialize
+(const MatrixType &M,
+ const AdditionalData parameters)
{
const size_type bsize = parameters.block_size;
}
-template <class MATRIX, typename inverse_type>
-void PreconditionBlock<MATRIX,inverse_type>::initialize (
- const MATRIX &M,
- const std::vector<size_type> &permutation,
- const std::vector<size_type> &inverse_permutation,
- const AdditionalData parameters)
+template <typename MatrixType, typename inverse_type>
+void PreconditionBlock<MatrixType,inverse_type>::initialize
+(const MatrixType &M,
+ const std::vector<size_type> &permutation,
+ const std::vector<size_type> &inverse_permutation,
+ const AdditionalData parameters)
{
set_permutation(permutation, inverse_permutation);
initialize(M, parameters);
}
-template <class MATRIX, typename inverse_type>
-void PreconditionBlock<MATRIX,inverse_type>::invert_permuted_diagblocks(
- const std::vector<size_type> &permutation,
- const std::vector<size_type> &inverse_permutation)
+template <typename MatrixType, typename inverse_type>
+void PreconditionBlock<MatrixType,inverse_type>::invert_permuted_diagblocks
+(const std::vector<size_type> &permutation,
+ const std::vector<size_type> &inverse_permutation)
{
Assert (A!=0, ExcNotInitialized());
Assert (blocksize!=0, ExcNotInitialized());
- const MATRIX &M=*A;
+ const MatrixType &M=*A;
Assert (this->inverses_ready()==0, ExcInverseMatricesAlreadyExist());
AssertDimension (permutation.size(), M.m());
AssertDimension (inverse_permutation.size(), M.m());
for (size_type row_cell=0; row_cell<blocksize; ++row_cell)
{
- typename MATRIX::const_iterator entry = M.begin(row_cell);
- const typename MATRIX::const_iterator row_end = M.end(row_cell);
+ typename MatrixType::const_iterator entry = M.begin(row_cell);
+ const typename MatrixType::const_iterator row_end = M.end(row_cell);
while (entry != row_end)
{
if (entry->column() < blocksize)
const size_type row = permutation[urow];
- typename MATRIX::const_iterator entry = M.begin(row);
- const typename MATRIX::const_iterator row_end = M.end(row);
+ typename MatrixType::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator row_end = M.end(row);
for (; entry != row_end; ++entry)
{
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlock<MATRIX,inverse_type>::forward_step (
- Vector<number2> &dst,
- const Vector<number2> &prev,
- const Vector<number2> &src,
- const bool transpose_diagonal) const
+void PreconditionBlock<MatrixType,inverse_type>::forward_step
+(Vector<number2> &dst,
+ const Vector<number2> &prev,
+ const Vector<number2> &src,
+ const bool transpose_diagonal) const
{
Assert (this->A!=0, ExcNotInitialized());
- const MATRIX &M=*this->A;
+ const MatrixType &M=*this->A;
if (permutation.size() != 0)
Assert (permutation.size() == M.m() || permutation.size() == this->size(),
++row_cell, ++row)
{
// deallog << ' ' << row;
- const typename MATRIX::const_iterator row_end = M.end(row);
- typename MATRIX::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator row_end = M.end(row);
+ typename MatrixType::const_iterator entry = M.begin(row);
b_cell_row=src(row);
for (; entry != row_end; ++entry)
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlock<MATRIX,inverse_type>::backward_step (
- Vector<number2> &dst,
- const Vector<number2> &prev,
- const Vector<number2> &src,
- const bool transpose_diagonal) const
+void PreconditionBlock<MatrixType,inverse_type>::backward_step
+(Vector<number2> &dst,
+ const Vector<number2> &prev,
+ const Vector<number2> &src,
+ const bool transpose_diagonal) const
{
Assert (this->A!=0, ExcNotInitialized());
- const MATRIX &M=*this->A;
+ const MatrixType &M=*this->A;
if (permutation.size() != 0)
Assert (permutation.size() == M.m() || permutation.size() == this->size(),
row_cell<this->blocksize;
++row_cell, ++row)
{
- const typename MATRIX::const_iterator row_end = M.end(row);
- typename MATRIX::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator row_end = M.end(row);
+ typename MatrixType::const_iterator entry = M.begin(row);
b_cell_row=src(row);
for (; entry != row_end; ++entry)
}
-template <class MATRIX, typename inverse_type>
-typename PreconditionBlock<MATRIX,inverse_type>::size_type
-PreconditionBlock<MATRIX,inverse_type>::block_size() const
+template <typename MatrixType, typename inverse_type>
+typename PreconditionBlock<MatrixType,inverse_type>::size_type
+PreconditionBlock<MatrixType,inverse_type>::block_size() const
{
return blocksize;
}
-template <class MATRIX, typename inverse_type>
-void PreconditionBlock<MATRIX,inverse_type>::invert_diagblocks()
+template <typename MatrixType, typename inverse_type>
+void PreconditionBlock<MatrixType,inverse_type>::invert_diagblocks()
{
Assert (A!=0, ExcNotInitialized());
Assert (blocksize!=0, ExcNotInitialized());
- const MATRIX &M=*A;
+ const MatrixType &M=*A;
Assert (this->inverses_ready()==0, ExcInverseMatricesAlreadyExist());
FullMatrix<inverse_type> M_cell(blocksize);
deallog << "PreconditionBlock uses only one diagonal block" << std::endl;
for (size_type row_cell=0; row_cell<blocksize; ++row_cell)
{
- typename MATRIX::const_iterator entry = M.begin(row_cell);
- const typename MATRIX::const_iterator row_end = M.end(row_cell);
+ typename MatrixType::const_iterator entry = M.begin(row_cell);
+ const typename MatrixType::const_iterator row_end = M.end(row_cell);
while (entry != row_end)
{
if (entry->column() < blocksize)
for (size_type row_cell=0; row_cell<blocksize; ++row_cell)
{
const size_type row = row_cell + cell_start;
- typename MATRIX::const_iterator entry = M.begin(row);
- const typename MATRIX::const_iterator row_end = M.end(row);
+ typename MatrixType::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator row_end = M.end(row);
for (; entry != row_end; ++entry)
{
-template <class MATRIX, typename inverse_type>
-void PreconditionBlock<MATRIX,inverse_type>::set_permutation (
- const std::vector<size_type> &p,
- const std::vector<size_type> &i)
+template <typename MatrixType, typename inverse_type>
+void PreconditionBlock<MatrixType,inverse_type>::set_permutation
+(const std::vector<size_type> &p,
+ const std::vector<size_type> &i)
{
Assert (p.size() == i.size(), ExcDimensionMismatch(p.size(), i.size()));
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
std::size_t
-PreconditionBlock<MATRIX,inverse_type>::memory_consumption () const
+PreconditionBlock<MatrixType,inverse_type>::memory_consumption () const
{
return (sizeof(*this)
- sizeof(PreconditionBlockBase<inverse_type>)
/*--------------------- PreconditionBlockJacobi -----------------------*/
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockJacobi<MATRIX,inverse_type>
+void PreconditionBlockJacobi<MatrixType,inverse_type>
::do_vmult (Vector<number2> &dst,
const Vector<number2> &src,
- bool adding) const
+ bool adding) const
{
Assert(this->A!=0, ExcNotInitialized());
- const MATRIX &M=*this->A;
+ const MatrixType &M=*this->A;
Vector<number2> b_cell(this->blocksize), x_cell(this->blocksize);
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockJacobi<MATRIX,inverse_type>
+void PreconditionBlockJacobi<MatrixType,inverse_type>
::vmult (Vector<number2> &dst,
const Vector<number2> &src) const
{
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockJacobi<MATRIX,inverse_type>
+void PreconditionBlockJacobi<MatrixType,inverse_type>
::Tvmult (Vector<number2> &dst,
const Vector<number2> &src) const
{
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockJacobi<MATRIX,inverse_type>
+void PreconditionBlockJacobi<MatrixType,inverse_type>
::vmult_add (Vector<number2> &dst,
const Vector<number2> &src) const
{
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockJacobi<MATRIX,inverse_type>
+void PreconditionBlockJacobi<MatrixType,inverse_type>
::Tvmult_add (Vector<number2> &dst,
const Vector<number2> &src) const
{
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockJacobi<MATRIX,inverse_type>
+void PreconditionBlockJacobi<MatrixType,inverse_type>
::step (Vector<number2> &dst,
const Vector<number2> &src) const
{
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockJacobi<MATRIX,inverse_type>
+void PreconditionBlockJacobi<MatrixType,inverse_type>
::Tstep (Vector<number2> &dst,
const Vector<number2> &src) const
{
/*--------------------- PreconditionBlockSOR -----------------------*/
-template <class MATRIX, typename inverse_type>
-PreconditionBlockSOR<MATRIX,inverse_type>::PreconditionBlockSOR ()
- : PreconditionBlock<MATRIX,inverse_type> (false)
+template <typename MatrixType, typename inverse_type>
+PreconditionBlockSOR<MatrixType,inverse_type>::PreconditionBlockSOR ()
+ : PreconditionBlock<MatrixType,inverse_type> (false)
{}
-template <class MATRIX, typename inverse_type>
-PreconditionBlockSOR<MATRIX,inverse_type>::PreconditionBlockSOR (bool store)
- : PreconditionBlock<MATRIX,inverse_type> (store)
+template <typename MatrixType, typename inverse_type>
+PreconditionBlockSOR<MatrixType,inverse_type>::PreconditionBlockSOR (bool store)
+ : PreconditionBlock<MatrixType,inverse_type> (store)
{}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSOR<MATRIX,inverse_type>::forward (
- Vector<number2> &dst,
- const Vector<number2> &src,
- const bool transpose_diagonal,
- const bool) const
+void PreconditionBlockSOR<MatrixType,inverse_type>::forward
+(Vector<number2> &dst,
+ const Vector<number2> &src,
+ const bool transpose_diagonal,
+ const bool) const
{
Assert (this->A!=0, ExcNotInitialized());
- const MATRIX &M=*this->A;
+ const MatrixType &M=*this->A;
const bool permuted = (this->permutation.size() != 0);
if (permuted)
{
row_cell < this->blocksize;
++row_cell, ++row)
{
- const typename MATRIX::const_iterator row_end = M.end(row);
- typename MATRIX::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator row_end = M.end(row);
+ typename MatrixType::const_iterator entry = M.begin(row);
b_cell_row=src(row);
for (; entry != row_end; ++entry)
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSOR<MATRIX,inverse_type>::backward (
- Vector<number2> &dst,
- const Vector<number2> &src,
- const bool transpose_diagonal,
- const bool) const
+void PreconditionBlockSOR<MatrixType,inverse_type>::backward
+(Vector<number2> &dst,
+ const Vector<number2> &src,
+ const bool transpose_diagonal,
+ const bool) const
{
Assert (this->A!=0, ExcNotInitialized());
- const MATRIX &M=*this->A;
+ const MatrixType &M=*this->A;
const bool permuted = (this->permutation.size() != 0);
if (permuted)
{
row_cell<this->blocksize;
++row_cell, ++row)
{
- const typename MATRIX::const_iterator row_end = M.end(row);
- typename MATRIX::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator row_end = M.end(row);
+ typename MatrixType::const_iterator entry = M.begin(row);
b_cell_row=src(row);
for (; entry != row_end; ++entry)
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSOR<MATRIX,inverse_type>
+void PreconditionBlockSOR<MatrixType,inverse_type>
::vmult (Vector<number2> &dst,
const Vector<number2> &src) const
{
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSOR<MATRIX,inverse_type>
+void PreconditionBlockSOR<MatrixType,inverse_type>
::vmult_add (Vector<number2> &dst,
const Vector<number2> &src) const
{
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSOR<MATRIX,inverse_type>
+void PreconditionBlockSOR<MatrixType,inverse_type>
::Tvmult (Vector<number2> &dst,
const Vector<number2> &src) const
{
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSOR<MATRIX,inverse_type>
+void PreconditionBlockSOR<MatrixType,inverse_type>
::Tvmult_add (Vector<number2> &dst,
const Vector<number2> &src) const
{
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSOR<MATRIX,inverse_type>
+void PreconditionBlockSOR<MatrixType,inverse_type>
::step (Vector<number2> &dst,
const Vector<number2> &src) const
{
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSOR<MATRIX,inverse_type>
+void PreconditionBlockSOR<MatrixType,inverse_type>
::Tstep (Vector<number2> &dst,
const Vector<number2> &src) const
{
//---------------------------------------------------------------------------
-template <class MATRIX, typename inverse_type>
-PreconditionBlockSSOR<MATRIX,inverse_type>::PreconditionBlockSSOR ()
- : PreconditionBlockSOR<MATRIX,inverse_type> (true)
+template <typename MatrixType, typename inverse_type>
+PreconditionBlockSSOR<MatrixType,inverse_type>::PreconditionBlockSSOR ()
+ : PreconditionBlockSOR<MatrixType,inverse_type> (true)
{}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSSOR<MATRIX,inverse_type>::vmult (Vector<number2> &dst,
+void PreconditionBlockSSOR<MatrixType,inverse_type>::vmult (Vector<number2> &dst,
const Vector<number2> &src) const
{
Vector<number2> help;
this->backward(dst, help, false, false);
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSSOR<MATRIX,inverse_type>::Tvmult (Vector<number2> &dst,
- const Vector<number2> &src) const
+void PreconditionBlockSSOR<MatrixType,inverse_type>::Tvmult (Vector<number2> &dst,
+ const Vector<number2> &src) const
{
Vector<number2> help;
help.reinit(dst);
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSSOR<MATRIX,inverse_type>
+void PreconditionBlockSSOR<MatrixType,inverse_type>
::step (Vector<number2> &dst,
const Vector<number2> &src) const
{
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void PreconditionBlockSSOR<MATRIX,inverse_type>
+void PreconditionBlockSSOR<MatrixType,inverse_type>
::Tstep (Vector<number2> &dst,
const Vector<number2> &src) const
{
* @author Ralf Hartmann, 1999; extension for full compatibility with
* LinearOperator class: Jean-Paul Pelteret, 2015
*/
-template <class MATRIX = SparseMatrix<double>,
+template <typename MatrixType = SparseMatrix<double>,
typename VectorType = dealii::Vector<double> >
class PreconditionSelector : public Subscriptor
{
/**
* Declare type for container size.
*/
- typedef typename MATRIX::size_type size_type;
+ typedef typename MatrixType::size_type size_type;
/**
* Constructor. @p omega denotes the damping parameter of the
* Takes the matrix that is needed for preconditionings that involves a
* matrix. e.g. for @p precondition_jacobi, <tt>~_sor</tt>, <tt>~_ssor</tt>.
*/
- void use_matrix(const MATRIX &M);
+ void use_matrix(const MatrixType &M);
/**
* Return the dimension of the codomain (or range) space. To remember: the
* Matrix that is used for the matrix-builtin preconditioning function. cf.
* also @p PreconditionUseMatrix.
*/
- SmartPointer<const MATRIX,PreconditionSelector<MATRIX,VectorType> > A;
+ SmartPointer<const MatrixType,PreconditionSelector<MatrixType,VectorType> > A;
/**
* Stores the damping parameter of the preconditioner.
/* --------------------- Inline and template functions ------------------- */
-template <class MATRIX, typename VectorType>
-PreconditionSelector<MATRIX,VectorType>
+template <typename MatrixType, typename VectorType>
+PreconditionSelector<MatrixType,VectorType>
::PreconditionSelector(const std::string &preconditioning,
const typename VectorType::value_type &omega) :
preconditioning(preconditioning),
omega(omega) {}
-template <class MATRIX, typename VectorType>
-PreconditionSelector<MATRIX,VectorType>::~PreconditionSelector()
+template <typename MatrixType, typename VectorType>
+PreconditionSelector<MatrixType,VectorType>::~PreconditionSelector()
{
// release the matrix A
A=0;
}
-template <class MATRIX, typename VectorType>
-void PreconditionSelector<MATRIX,VectorType>::use_matrix(const MATRIX &M)
+template <typename MatrixType, typename VectorType>
+void PreconditionSelector<MatrixType,VectorType>::use_matrix(const MatrixType &M)
{
A=&M;
}
<<<<<<< fc87b7c22812a5fc7751b36c66b20e6fa54df72c
-template <class MATRIX, typename VectorType>
-inline typename PreconditionSelector<MATRIX,VectorType>::size_type
-PreconditionSelector<MATRIX,VectorType>::m () const
+template <typename MatrixType, typename VectorType>
+inline typename PreconditionSelector<MatrixType,VectorType>::size_type
+PreconditionSelector<MatrixType,VectorType>::m () const
{
Assert(A!=0, ExcNoMatrixGivenToUse());
return A->m();
}
-template <class MATRIX, typename VectorType>
-inline typename PreconditionSelector<MATRIX,VectorType>::size_type
-PreconditionSelector<MATRIX,VectorType>::n () const
+template <typename MatrixType, typename VectorType>
+inline typename PreconditionSelector<MatrixType,VectorType>::size_type
+PreconditionSelector<MatrixType,VectorType>::n () const
{
Assert(A!=0, ExcNoMatrixGivenToUse());
return A->n();
-template <class MATRIX, typename VectorType>
-void PreconditionSelector<MATRIX,VectorType>::vmult (VectorType &dst,
- const VectorType &src) const
+template <typename MatrixType, typename VectorType>
+void PreconditionSelector<MatrixType,VectorType>::vmult (VectorType &dst,
+ const VectorType &src) const
{
if (preconditioning=="none")
{
}
-template <class MATRIX, typename VectorType>
-void PreconditionSelector<MATRIX,VectorType>::Tvmult (VectorType &dst,
- const VectorType &src) const
+template <typename MatrixType, typename VectorType>
+void PreconditionSelector<MatrixType,VectorType>::Tvmult (VectorType &dst,
+ const VectorType &src) const
{
if (preconditioning=="none")
{
}
-template <class MATRIX, typename VectorType>
-std::string PreconditionSelector<MATRIX,VectorType>::get_precondition_names()
+template <typename MatrixType, typename VectorType>
+std::string PreconditionSelector<MatrixType,VectorType>::get_precondition_names()
{
return "none|jacobi|sor|ssor";
}
* @author Guido Kanschat
* @date 2010
*/
-template <class MATRIX, typename inverse_type=typename MATRIX::value_type>
+template <typename MatrixType, typename inverse_type=typename MatrixType::value_type>
class RelaxationBlock :
protected PreconditionBlockBase<inverse_type>
{
/**
* Define number type of matrix.
*/
- typedef typename MATRIX::value_type number;
+ typedef typename MatrixType::value_type number;
/**
* Value type for inverse matrices.
* rather a pointer is stored. Thus, the lifetime of
* <code>additional_data</code> hast to exceed the lifetime of this object.
*/
- void initialize (const MATRIX &A,
+ void initialize (const MatrixType &A,
const AdditionalData ¶meters);
/**
* inverse matrices should not be stored) until the last call of the
* preconditioning @p vmult function of the derived classes.
*/
- SmartPointer<const MATRIX,RelaxationBlock<MATRIX,inverse_type> > A;
+ SmartPointer<const MatrixType,RelaxationBlock<MatrixType,inverse_type> > A;
/**
* Control information.
*/
- SmartPointer<const AdditionalData, RelaxationBlock<MATRIX,inverse_type> > additional_data;
+ SmartPointer<const AdditionalData, RelaxationBlock<MatrixType,inverse_type> > additional_data;
};
* @author Guido Kanschat
* @date 2010
*/
-template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
+template<typename MatrixType, typename inverse_type = typename MatrixType::value_type>
class RelaxationBlockJacobi : public virtual Subscriptor,
- protected RelaxationBlock<MATRIX, inverse_type>
+ protected RelaxationBlock<MatrixType, inverse_type>
{
public:
/**
/**
* Define number type of matrix.
*/
- typedef typename MATRIX::value_type number;
+ typedef typename MatrixType::value_type number;
/**
* Make type publicly available.
*/
- using typename RelaxationBlock<MATRIX,inverse_type>::AdditionalData;
+ using typename RelaxationBlock<MatrixType,inverse_type>::AdditionalData;
/**
* Make initialization function publicly available.
*/
- using RelaxationBlock<MATRIX, inverse_type>::initialize;
+ using RelaxationBlock<MatrixType, inverse_type>::initialize;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::clear;
+ using RelaxationBlock<MatrixType, inverse_type>::clear;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::empty;
+ using RelaxationBlock<MatrixType, inverse_type>::empty;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::size;
+ using RelaxationBlock<MatrixType, inverse_type>::size;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::inverse;
+ using RelaxationBlock<MatrixType, inverse_type>::inverse;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::inverse_householder;
+ using RelaxationBlock<MatrixType, inverse_type>::inverse_householder;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::inverse_svd;
+ using RelaxationBlock<MatrixType, inverse_type>::inverse_svd;
using PreconditionBlockBase<inverse_type>::log_statistics;
/**
* Perform one step of the Jacobi iteration.
* @author Guido Kanschat
* @date 2010
*/
-template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
+template<typename MatrixType, typename inverse_type = typename MatrixType::value_type>
class RelaxationBlockSOR : public virtual Subscriptor,
- protected RelaxationBlock<MATRIX, inverse_type>
+ protected RelaxationBlock<MatrixType, inverse_type>
{
public:
/**
/**
* Define number type of matrix.
*/
- typedef typename MATRIX::value_type number;
+ typedef typename MatrixType::value_type number;
/**
* Make type publicly available.
*/
- using typename RelaxationBlock<MATRIX,inverse_type>::AdditionalData;
+ using typename RelaxationBlock<MatrixType,inverse_type>::AdditionalData;
/**
* Make initialization function publicly available.
*/
- using RelaxationBlock<MATRIX, inverse_type>::initialize;
+ using RelaxationBlock<MatrixType, inverse_type>::initialize;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::clear;
+ using RelaxationBlock<MatrixType, inverse_type>::clear;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::empty;
+ using RelaxationBlock<MatrixType, inverse_type>::empty;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::size;
+ using RelaxationBlock<MatrixType, inverse_type>::size;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::inverse;
+ using RelaxationBlock<MatrixType, inverse_type>::inverse;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::inverse_householder;
+ using RelaxationBlock<MatrixType, inverse_type>::inverse_householder;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::inverse_svd;
+ using RelaxationBlock<MatrixType, inverse_type>::inverse_svd;
using PreconditionBlockBase<inverse_type>::log_statistics;
/**
* Perform one step of the SOR iteration.
* @author Guido Kanschat
* @date 2010
*/
-template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
+template<typename MatrixType, typename inverse_type = typename MatrixType::value_type>
class RelaxationBlockSSOR : public virtual Subscriptor,
- protected RelaxationBlock<MATRIX, inverse_type>
+ protected RelaxationBlock<MatrixType, inverse_type>
{
public:
/**
* Define number type of matrix.
*/
- typedef typename MATRIX::value_type number;
+ typedef typename MatrixType::value_type number;
/**
* Make type publicly available.
*/
- using typename RelaxationBlock<MATRIX,inverse_type>::AdditionalData;
+ using typename RelaxationBlock<MatrixType,inverse_type>::AdditionalData;
/**
* Make initialization function publicly available.
*/
- using RelaxationBlock<MATRIX, inverse_type>::initialize;
+ using RelaxationBlock<MatrixType, inverse_type>::initialize;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::clear;
+ using RelaxationBlock<MatrixType, inverse_type>::clear;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::empty;
+ using RelaxationBlock<MatrixType, inverse_type>::empty;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::size;
+ using RelaxationBlock<MatrixType, inverse_type>::size;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::inverse;
+ using RelaxationBlock<MatrixType, inverse_type>::inverse;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::inverse_householder;
+ using RelaxationBlock<MatrixType, inverse_type>::inverse_householder;
/**
* Make function of base class public again.
*/
- using RelaxationBlock<MATRIX, inverse_type>::inverse_svd;
+ using RelaxationBlock<MatrixType, inverse_type>::inverse_svd;
using PreconditionBlockBase<inverse_type>::log_statistics;
/**
* Perform one step of the SOR iteration.
DEAL_II_NAMESPACE_OPEN
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
inline
-RelaxationBlock<MATRIX,inverse_type>::AdditionalData::AdditionalData (
- const double relaxation,
- const bool invert_diagonal,
- const bool same_diagonal)
+RelaxationBlock<MatrixType,inverse_type>::AdditionalData::AdditionalData
+(const double relaxation,
+ const bool invert_diagonal,
+ const bool same_diagonal)
:
relaxation(relaxation),
invert_diagonal(invert_diagonal),
{}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
inline
std::size_t
-RelaxationBlock<MATRIX,inverse_type>::AdditionalData::memory_consumption() const
+RelaxationBlock<MatrixType,inverse_type>::AdditionalData::memory_consumption() const
{
std::size_t result = sizeof(*this)
+ - sizeof(block_list) + block_list.memory_consumption();
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
inline
void
-RelaxationBlock<MATRIX,inverse_type>::initialize (
- const MATRIX &M,
- const AdditionalData ¶meters)
+RelaxationBlock<MatrixType,inverse_type>::initialize (const MatrixType &M,
+ const AdditionalData ¶meters)
{
Assert (parameters.invert_diagonal, ExcNotImplemented());
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
inline
void
-RelaxationBlock<MATRIX,inverse_type>::clear ()
+RelaxationBlock<MatrixType,inverse_type>::clear ()
{
A = 0;
additional_data = 0;
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
inline
void
-RelaxationBlock<MATRIX,inverse_type>::invert_diagblocks ()
+RelaxationBlock<MatrixType,inverse_type>::invert_diagblocks ()
{
- const MATRIX &M=*A;
+ const MatrixType &M=*A;
FullMatrix<inverse_type> M_cell;
if (this->same_diagonal())
for (size_type row_cell=0; row_cell<bs; ++row_cell, ++row)
{
//TODO:[GK] Optimize here
- for (typename MATRIX::const_iterator entry = M.begin(row->column());
+ for (typename MatrixType::const_iterator entry = M.begin(row->column());
entry != M.end(row->column()); ++entry)
{
const size_type column = entry->column();
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
inline
void
-RelaxationBlock<MATRIX,inverse_type>::do_step (
- Vector<number2> &dst,
- const Vector<number2> &prev,
- const Vector<number2> &src,
- const bool backward) const
+RelaxationBlock<MatrixType,inverse_type>::do_step (Vector<number2> &dst,
+ const Vector<number2> &prev,
+ const Vector<number2> &src,
+ const bool backward) const
{
Assert (additional_data->invert_diagonal, ExcNotImplemented());
- const MATRIX &M=*this->A;
+ const MatrixType &M=*this->A;
Vector<number2> b_cell, x_cell;
const bool permutation_empty = additional_data->order.size() == 0;
for (size_type row_cell=0; row_cell<bs; ++row_cell, ++row)
{
b_cell(row_cell) = src(row->column());
- for (typename MATRIX::const_iterator entry = M.begin(row->column());
+ for (typename MatrixType::const_iterator entry = M.begin(row->column());
entry != M.end(row->column()); ++entry)
b_cell(row_cell) -= entry->value() * prev(entry->column());
}
//----------------------------------------------------------------------//
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void RelaxationBlockJacobi<MATRIX,inverse_type>::step (
- Vector<number2> &dst,
- const Vector<number2> &src) const
+void RelaxationBlockJacobi<MatrixType,inverse_type>::step
+(Vector<number2> &dst,
+ const Vector<number2> &src) const
{
GrowingVectorMemory<Vector<number2> > mem;
typename VectorMemory<Vector<number2> >::Pointer aux = mem;
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void RelaxationBlockJacobi<MATRIX,inverse_type>::Tstep (
- Vector<number2> &dst,
- const Vector<number2> &src) const
+void RelaxationBlockJacobi<MatrixType,inverse_type>::Tstep
+(Vector<number2> &dst,
+ const Vector<number2> &src) const
{
GrowingVectorMemory<Vector<number2> > mem;
typename VectorMemory<Vector<number2> >::Pointer aux = mem;
//----------------------------------------------------------------------//
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void RelaxationBlockSOR<MATRIX,inverse_type>::step (
- Vector<number2> &dst,
- const Vector<number2> &src) const
+void RelaxationBlockSOR<MatrixType,inverse_type>::step
+(Vector<number2> &dst,
+ const Vector<number2> &src) const
{
this->do_step(dst, dst, src, false);
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void RelaxationBlockSOR<MATRIX,inverse_type>::Tstep (
- Vector<number2> &dst,
- const Vector<number2> &src) const
+void RelaxationBlockSOR<MatrixType,inverse_type>::Tstep
+(Vector<number2> &dst,
+ const Vector<number2> &src) const
{
this->do_step(dst, dst, src, true);
}
//----------------------------------------------------------------------//
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void RelaxationBlockSSOR<MATRIX,inverse_type>::step (
- Vector<number2> &dst,
- const Vector<number2> &src) const
+void RelaxationBlockSSOR<MatrixType,inverse_type>::step
+(Vector<number2> &dst,
+ const Vector<number2> &src) const
{
this->do_step(dst, dst, src, false);
this->do_step(dst, dst, src, true);
}
-template <class MATRIX, typename inverse_type>
+template <typename MatrixType, typename inverse_type>
template <typename number2>
-void RelaxationBlockSSOR<MATRIX,inverse_type>::Tstep (
- Vector<number2> &dst,
- const Vector<number2> &src) const
+void RelaxationBlockSSOR<MatrixType,inverse_type>::Tstep
+(Vector<number2> &dst,
+ const Vector<number2> &src) const
{
this->do_step(dst, dst, src, true);
this->do_step(dst, dst, src, false);
*
* @author Guido Kanschat, 2000, 2001
*/
-template<class MATRIX>
+template<typename MatrixType>
class ShiftedMatrix
{
public:
/**
* Constructor. Provide the base matrix and a shift parameter.
*/
- ShiftedMatrix (const MATRIX &A, const double sigma);
+ ShiftedMatrix (const MatrixType &A, const double sigma);
/**
* Set the shift parameter.
/**
* Storage for base matrix.
*/
- SmartPointer<const MATRIX,ShiftedMatrix<MATRIX> > A;
+ SmartPointer<const MatrixType,ShiftedMatrix<MatrixType> > A;
/**
* Auxiliary vector.
*
* @author Guido Kanschat, 2001
*/
-template<class MATRIX, class MASSMATRIX, class VectorType>
+template<typename MatrixType, class MASSMatrixType, class VectorType>
class ShiftedMatrixGeneralized
{
public:
/**
* Constructor. Provide the base matrix and a shift parameter.
*/
- ShiftedMatrixGeneralized (const MATRIX &A,
- const MASSMATRIX &M,
- const double sigma);
+ ShiftedMatrixGeneralized (const MatrixType &A,
+ const MASSMatrixType &M,
+ const double sigma);
/**
* Set the shift parameter.
/**
* Storage for base matrix.
*/
- SmartPointer<const MATRIX,ShiftedMatrixGeneralized<MATRIX,MASSMATRIX,VectorType> > A;
+ SmartPointer<const MatrixType,ShiftedMatrixGeneralized<MatrixType,MASSMatrixType,VectorType> > A;
/**
* Storage for mass matrix.
*/
- SmartPointer<const MASSMATRIX,ShiftedMatrixGeneralized<MATRIX,MASSMATRIX,VectorType> > M;
+ SmartPointer<const MASSMatrixType,ShiftedMatrixGeneralized<MatrixType,MASSMatrixType,VectorType> > M;
/**
* Auxiliary vector.
/*@}*/
//---------------------------------------------------------------------------
-template <class MATRIX>
+template <typename MatrixType>
inline
-ShiftedMatrix<MATRIX>::ShiftedMatrix (const MATRIX &A, const double sigma)
+ShiftedMatrix<MatrixType>::ShiftedMatrix (const MatrixType &A,
+ const double sigma)
:
A(&A), sigma(sigma)
{}
-template <class MATRIX>
+template <typename MatrixType>
inline void
-ShiftedMatrix<MATRIX>::shift (const double s)
+ShiftedMatrix<MatrixType>::shift (const double s)
{
sigma = s;
}
-template <class MATRIX>
+template <typename MatrixType>
inline double
-ShiftedMatrix<MATRIX>::shift () const
+ShiftedMatrix<MatrixType>::shift () const
{
return sigma;
}
-template <class MATRIX>
+template <typename MatrixType>
template <class VectorType>
inline void
-ShiftedMatrix<MATRIX>::vmult (VectorType &dst, const VectorType &src) const
+ShiftedMatrix<MatrixType>::vmult (VectorType &dst, const VectorType &src) const
{
A->vmult(dst, src);
if (sigma != 0.)
}
-template <class MATRIX>
+template <typename MatrixType>
template <class VectorType>
inline double
-ShiftedMatrix<MATRIX>::residual (VectorType &dst,
- const VectorType &src,
- const VectorType &rhs) const
+ShiftedMatrix<MatrixType>::residual (VectorType &dst,
+ const VectorType &src,
+ const VectorType &rhs) const
{
A->vmult(dst, src);
if (sigma != 0.)
//---------------------------------------------------------------------------
-template <class MATRIX, class MASSMATRIX, class VectorType>
+template <typename MatrixType, class MASSMatrixType, class VectorType>
inline
-ShiftedMatrixGeneralized<MATRIX, MASSMATRIX, VectorType>
-::ShiftedMatrixGeneralized (const MATRIX &A,
- const MASSMATRIX &M,
- const double sigma)
+ShiftedMatrixGeneralized<MatrixType, MASSMatrixType, VectorType>
+::ShiftedMatrixGeneralized (const MatrixType &A,
+ const MASSMatrixType &M,
+ const double sigma)
:
A(&A), M(&M), sigma(sigma)
{}
-template <class MATRIX, class MASSMATRIX, class VectorType>
+template <typename MatrixType, class MASSMatrixType, class VectorType>
inline void
-ShiftedMatrixGeneralized<MATRIX, MASSMATRIX, VectorType>::shift (const double s)
+ShiftedMatrixGeneralized<MatrixType, MASSMatrixType, VectorType>::shift (const double s)
{
sigma = s;
}
-template <class MATRIX, class MASSMATRIX, class VectorType>
+template <typename MatrixType, class MASSMatrixType, class VectorType>
inline double
-ShiftedMatrixGeneralized<MATRIX, MASSMATRIX, VectorType>::shift () const
+ShiftedMatrixGeneralized<MatrixType, MASSMatrixType, VectorType>::shift () const
{
return sigma;
}
-template <class MATRIX, class MASSMATRIX, class VectorType>
+template <typename MatrixType, class MASSMatrixType, class VectorType>
inline void
-ShiftedMatrixGeneralized<MATRIX, MASSMATRIX, VectorType>::vmult (VectorType &dst,
- const VectorType &src) const
+ShiftedMatrixGeneralized<MatrixType, MASSMatrixType, VectorType>::vmult
+(VectorType &dst,
+ const VectorType &src) const
{
A->vmult(dst, src);
if (sigma != 0.)
}
-template <class MATRIX, class MASSMATRIX, class VectorType>
+template <typename MatrixType, class MASSMatrixType, class VectorType>
inline double
-ShiftedMatrixGeneralized<MATRIX, MASSMATRIX, VectorType>::residual (VectorType &dst,
- const VectorType &src,
- const VectorType &rhs) const
+ShiftedMatrixGeneralized<MatrixType, MASSMatrixType, VectorType>::residual
+(VectorType &dst,
+ const VectorType &src,
+ const VectorType &rhs) const
{
A->vmult(dst, src);
if (sigma != 0.)
/**
* Solve primal problem only.
*/
- template<class MATRIX, class PRECONDITIONER>
+ template<typename MatrixType, class PRECONDITIONER>
void
- solve (const MATRIX &A,
+ solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition);
/**
* Computation of the stopping criterion.
*/
- template <class MATRIX>
- double criterion (const MATRIX &A, const VectorType &x, const VectorType &b);
+ template <typename MatrixType>
+ double criterion (const MatrixType &A, const VectorType &x, const VectorType &b);
/**
* Interface for derived class. This function gets the current iteration
/**
* Everything before the iteration loop.
*/
- template <class MATRIX>
- SolverControl::State start(const MATRIX &A);
+ template <typename MatrixType>
+ SolverControl::State start(const MatrixType &A);
/**
* A structure returned by the iterate() function representing what it found
* The iteration loop itself. The function returns a structure indicating
* what happened in this function.
*/
- template<class MATRIX, class PRECONDITIONER>
+ template<typename MatrixType, class PRECONDITIONER>
IterationResult
- iterate(const MATRIX &A,
+ iterate(const MatrixType &A,
const PRECONDITIONER &precondition);
};
template <typename VectorType>
-template <class MATRIX>
+template <typename MatrixType>
double
-SolverBicgstab<VectorType>::criterion (const MATRIX &A, const VectorType &x, const VectorType &b)
+SolverBicgstab<VectorType>::criterion (const MatrixType &A,
+ const VectorType &x,
+ const VectorType &b)
{
A.vmult(*Vt, x);
Vt->add(-1.,b);
template <typename VectorType >
-template <class MATRIX>
+template <typename MatrixType>
SolverControl::State
-SolverBicgstab<VectorType>::start(const MATRIX &A)
+SolverBicgstab<VectorType>::start (const MatrixType &A)
{
A.vmult(*Vr, *Vx);
Vr->sadd(-1.,1.,*Vb);
template<typename VectorType>
-template<class MATRIX, class PRECONDITIONER>
+template<typename MatrixType, class PRECONDITIONER>
typename SolverBicgstab<VectorType>::IterationResult
-SolverBicgstab<VectorType>::iterate(const MATRIX &A,
+SolverBicgstab<VectorType>::iterate(const MatrixType &A,
const PRECONDITIONER &precondition)
{
//TODO:[GK] Implement "use the length of the computed orthogonal residual" in the BiCGStab method.
template<typename VectorType>
-template<class MATRIX, class PRECONDITIONER>
+template<typename MatrixType, class PRECONDITIONER>
void
-SolverBicgstab<VectorType>::solve(const MATRIX &A,
+SolverBicgstab<VectorType>::solve(const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition)
/**
* Solve the linear system $Ax=b$ for x.
*/
- template <class MATRIX, class PRECONDITIONER>
+ template <typename MatrixType, class PRECONDITIONER>
void
- solve (const MATRIX &A,
+ solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition);
template <typename VectorType>
-template <class MATRIX, class PRECONDITIONER>
+template <typename MatrixType, class PRECONDITIONER>
void
-SolverCG<VectorType>::solve (const MATRIX &A,
+SolverCG<VectorType>::solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition)
/**
* Solve the linear system $Ax=b$ for x.
*/
- template<class MATRIX, class PRECONDITIONER>
+ template<typename MatrixType, class PRECONDITIONER>
void
- solve (const MATRIX &A,
+ solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition);
/**
* Solve the linear system $Ax=b$ for x.
*/
- template<class MATRIX, class PRECONDITIONER>
+ template<typename MatrixType, class PRECONDITIONER>
void
- solve (const MATRIX &A,
+ solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition);
template<class VectorType>
-template<class MATRIX, class PRECONDITIONER>
+template<typename MatrixType, class PRECONDITIONER>
void
-SolverGMRES<VectorType>::solve (const MATRIX &A,
+SolverGMRES<VectorType>::solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition)
template<class VectorType>
-template<class MATRIX, class PRECONDITIONER>
+template<typename MatrixType, class PRECONDITIONER>
void
-SolverFGMRES<VectorType>::solve (const MATRIX &A,
+SolverFGMRES<VectorType>::solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition)
/**
* Solve the linear system $Ax=b$ for x.
*/
- template<class MATRIX, class PRECONDITIONER>
+ template<typename MatrixType, class PRECONDITIONER>
void
- solve (const MATRIX &A,
+ solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition);
template<class VectorType>
-template<class MATRIX, class PRECONDITIONER>
+template<typename MatrixType, class PRECONDITIONER>
void
-SolverMinRes<VectorType>::solve (const MATRIX &A,
+SolverMinRes<VectorType>::solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition)
/**
* Solve the linear system $Ax=b$ for x.
*/
- template<class MATRIX, class PRECONDITIONER>
+ template<typename MatrixType, class PRECONDITIONER>
void
- solve (const MATRIX &A,
+ solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition);
* The iteration loop itself. The function returns a structure indicating
* what happened in this function.
*/
- template<class MATRIX, class PRECONDITIONER>
+ template<typename MatrixType, class PRECONDITIONER>
IterationResult
- iterate (const MATRIX &A,
+ iterate (const MatrixType &A,
const PRECONDITIONER &precondition);
/**
template<class VectorType>
-template<class MATRIX, class PRECONDITIONER>
+template<typename MatrixType, class PRECONDITIONER>
void
-SolverQMRS<VectorType>::solve (const MATRIX &A,
+SolverQMRS<VectorType>::solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition)
template<class VectorType>
-template<class MATRIX, class PRECONDITIONER>
+template<typename MatrixType, class PRECONDITIONER>
typename SolverQMRS<VectorType>::IterationResult
-SolverQMRS<VectorType>::iterate(const MATRIX &A,
+SolverQMRS<VectorType>::iterate(const MatrixType &A,
const PRECONDITIONER &precondition)
{
/* Remark: the matrix A in the article is the preconditioned matrix.
* R(x_k,b)$. The matrix <i>A</i> itself is only used to compute the
* residual.
*/
- template<class MATRIX, class RELAXATION>
+ template<typename MatrixType, class RELAXATION>
void
- solve (const MATRIX &A,
+ solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const RELAXATION &R);
template <class VectorType>
-template <class MATRIX, class RELAXATION>
+template <typename MatrixType, class RELAXATION>
void
-SolverRelaxation<VectorType>::solve (const MATRIX &A,
+SolverRelaxation<VectorType>::solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const RELAXATION &R)
/**
* Solve the linear system $Ax=b$ for x.
*/
- template<class MATRIX, class PRECONDITIONER>
+ template<typename MatrixType, class PRECONDITIONER>
void
- solve (const MATRIX &A,
+ solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition);
/**
* Solve $A^Tx=b$ for $x$.
*/
- template<class MATRIX, class PRECONDITIONER>
+ template<typename MatrixType, class PRECONDITIONER>
void
- Tsolve (const MATRIX &A,
+ Tsolve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition);
template <class VectorType>
-template <class MATRIX, class PRECONDITIONER>
+template <typename MatrixType, class PRECONDITIONER>
void
-SolverRichardson<VectorType>::solve (const MATRIX &A,
+SolverRichardson<VectorType>::solve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition)
template <class VectorType>
-template <class MATRIX, class PRECONDITIONER>
+template <typename MatrixType, class PRECONDITIONER>
void
-SolverRichardson<VectorType>::Tsolve (const MATRIX &A,
+SolverRichardson<VectorType>::Tsolve (const MatrixType &A,
VectorType &x,
const VectorType &b,
const PRECONDITIONER &precondition)
*
* The function returns a reference to @p this.
*/
- template <class MATRIX>
+ template <typename MatrixType>
SparseMatrixEZ<number> &
- copy_from (const MATRIX &source, const bool elide_zero_values = true);
+ copy_from (const MatrixType &source, const bool elide_zero_values = true);
/**
* Add @p matrix scaled by @p factor to this matrix.
* type is convertible to the data type of this matrix and it has the
* standard @p const_iterator.
*/
- template <class MATRIX>
- void add (const number factor,
- const MATRIX &matrix);
+ template <typename MatrixType>
+ void add (const number factor,
+ const MatrixType &matrix);
//@}
/**
* @name Entry Access
* matrix entries and that @p A has a function <tt>el(i,j)</tt> for access
* to a specific entry.
*/
- template <class MATRIXA, class MATRIXB>
- void conjugate_add (const MATRIXA &A,
- const MATRIXB &B,
- const bool transpose = false);
+ template <typename MatrixTypeA, typename MatrixTypeB>
+ void conjugate_add (const MatrixTypeA &A,
+ const MatrixTypeB &B,
+ const bool transpose = false);
//@}
/**
* @name Iterators
}
template<typename number>
-template <class MATRIX>
+template <typename MatrixType>
inline
SparseMatrixEZ<number> &
-SparseMatrixEZ<number>::copy_from (const MATRIX &M, const bool elide_zero_values)
+SparseMatrixEZ<number>::copy_from (const MatrixType &M, const bool elide_zero_values)
{
reinit(M.m(),
M.n(),
// copy them into the current object
for (size_type row = 0; row < M.m(); ++row)
{
- const typename MATRIX::const_iterator end_row = M.end(row);
- for (typename MATRIX::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator end_row = M.end(row);
+ for (typename MatrixType::const_iterator entry = M.begin(row);
entry != end_row; ++entry)
set(row, entry->column(), entry->value(), elide_zero_values);
}
}
template<typename number>
-template <class MATRIX>
+template <typename MatrixType>
inline
void
-SparseMatrixEZ<number>::add (const number factor,
- const MATRIX &M)
+SparseMatrixEZ<number>::add (const number factor,
+ const MatrixType &M)
{
Assert (M.m() == m(), ExcDimensionMismatch(M.m(), m()));
Assert (M.n() == n(), ExcDimensionMismatch(M.n(), n()));
// add them into the current object
for (size_type row = 0; row < M.m(); ++row)
{
- const typename MATRIX::const_iterator end_row = M.end(row);
- for (typename MATRIX::const_iterator entry = M.begin(row);
+ const typename MatrixType::const_iterator end_row = M.end(row);
+ for (typename MatrixType::const_iterator entry = M.begin(row);
entry != end_row; ++entry)
if (entry->value() != 0)
add(row, entry->column(), factor * entry->value());
template<typename number>
-template <class MATRIXA, class MATRIXB>
+template <typename MatrixTypeA, typename MatrixTypeB>
inline void
-SparseMatrixEZ<number>::conjugate_add (const MATRIXA &A,
- const MATRIXB &B,
- const bool transpose)
+SparseMatrixEZ<number>::conjugate_add (const MatrixTypeA &A,
+ const MatrixTypeB &B,
+ const bool transpose)
{
// Compute the result
// r_ij = \sum_kl b_ik b_jl a_kl
// corresponding rows of B only.
// For the non-transpose case, we
// must find a trick.
- typename MATRIXB::const_iterator b1 = B.begin();
- const typename MATRIXB::const_iterator b_final = B.end();
+ typename MatrixTypeB::const_iterator b1 = B.begin();
+ const typename MatrixTypeB::const_iterator b_final = B.end();
if (transpose)
while (b1 != b_final)
{
const size_type i = b1->column();
const size_type k = b1->row();
- typename MATRIXB::const_iterator b2 = B.begin();
+ typename MatrixTypeB::const_iterator b2 = B.begin();
while (b2 != b_final)
{
const size_type j = b2->column();
const size_type l = b2->row();
- const typename MATRIXA::value_type a = A.el(k,l);
+ const typename MatrixTypeA::value_type a = A.el(k,l);
if (a != 0.)
add (i, j, a * b1->value() * b2->value());
++b1;
}
- typename MATRIXA::const_iterator ai = A.begin();
- const typename MATRIXA::const_iterator ae = A.end();
+ typename MatrixTypeA::const_iterator ai = A.begin();
+ const typename MatrixTypeA::const_iterator ae = A.end();
while (ai != ae)
{
- const typename MATRIXA::value_type a = ai->value();
+ const typename MatrixTypeA::value_type a = ai->value();
// Don't do anything if
// this entry is zero.
if (a == 0.) continue;
// nonzero entry in column
// ai->row()
b1 = B.begin(minrow[ai->row()]);
- const typename MATRIXB::const_iterator
+ const typename MatrixTypeB::const_iterator
be1 = B.end(maxrow[ai->row()]);
- const typename MATRIXB::const_iterator
+ const typename MatrixTypeB::const_iterator
be2 = B.end(maxrow[ai->column()]);
while (b1 != be1)
{
const size_type i = b1->row();
- typename MATRIXB::const_iterator
+ typename MatrixTypeB::const_iterator
b2 = B.begin(minrow[ai->column()]);
while (b2 != be2)
{
* @ingroup Matrix2
* @author Guido Kanschat, 2006
*/
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
class
TransposeMatrix : public PointerMatrixBase<VectorType>
{
*
* If <tt>M</tt> is zero, no matrix is stored.
*/
- TransposeMatrix (const MATRIX *M=0);
+ TransposeMatrix (const MatrixType *M=0);
/**
* Constructor. The name argument is used to identify the SmartPointer for
* the TransposeMatrix. The name argument is used to identify the
* SmartPointer for this object.
*/
- TransposeMatrix(const MATRIX *M,
- const char *name);
+ TransposeMatrix(const MatrixType *M,
+ const char *name);
// Use doc from base class
virtual void clear();
* matrix.
* @see SmartPointer
*/
- const TransposeMatrix &operator= (const MATRIX *M);
+ const TransposeMatrix &operator= (const MatrixType *M);
/**
* Matrix-vector product.
/**
* The pointer to the actual matrix.
*/
- SmartPointer<const MATRIX,TransposeMatrix<MATRIX,VectorType> > m;
+ SmartPointer<const MatrixType,TransposeMatrix<MatrixType,VectorType> > m;
};
//----------------------------------------------------------------------//
-template<class MATRIX, typename VectorType>
-TransposeMatrix<MATRIX, VectorType>::TransposeMatrix (const MATRIX *M)
+template<typename MatrixType, typename VectorType>
+TransposeMatrix<MatrixType, VectorType>::TransposeMatrix (const MatrixType *M)
: m(M)
{}
-template<class MATRIX, typename VectorType>
-TransposeMatrix<MATRIX, VectorType>::TransposeMatrix (const char *name)
+template<typename MatrixType, typename VectorType>
+TransposeMatrix<MatrixType, VectorType>::TransposeMatrix (const char *name)
: m(0, name)
{}
-template<class MATRIX, typename VectorType>
-TransposeMatrix<MATRIX, VectorType>::TransposeMatrix (
- const MATRIX *M,
- const char *name)
+template<typename MatrixType, typename VectorType>
+TransposeMatrix<MatrixType, VectorType>::TransposeMatrix (const MatrixType *M,
+ const char *name)
: m(M, name)
{}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-TransposeMatrix<MATRIX, VectorType>::clear ()
+TransposeMatrix<MatrixType, VectorType>::clear ()
{
m = 0;
}
-template<class MATRIX, typename VectorType>
-inline const TransposeMatrix<MATRIX, VectorType> &
-TransposeMatrix<MATRIX, VectorType>::operator= (const MATRIX *M)
+template<typename MatrixType, typename VectorType>
+inline const TransposeMatrix<MatrixType, VectorType> &
+TransposeMatrix<MatrixType, VectorType>::operator= (const MatrixType *M)
{
m = M;
return *this;
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline bool
-TransposeMatrix<MATRIX, VectorType>::empty () const
+TransposeMatrix<MatrixType, VectorType>::empty () const
{
if (m == 0)
return true;
return m->empty();
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-TransposeMatrix<MATRIX, VectorType>::vmult (VectorType &dst,
- const VectorType &src) const
+TransposeMatrix<MatrixType, VectorType>::vmult (VectorType &dst,
+ const VectorType &src) const
{
Assert (m != 0, ExcNotInitialized());
m->Tvmult (dst, src);
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-TransposeMatrix<MATRIX, VectorType>::Tvmult (VectorType &dst,
- const VectorType &src) const
+TransposeMatrix<MatrixType, VectorType>::Tvmult (VectorType &dst,
+ const VectorType &src) const
{
Assert (m != 0, ExcNotInitialized());
m->vmult (dst, src);
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-TransposeMatrix<MATRIX, VectorType>::vmult_add (VectorType &dst,
- const VectorType &src) const
+TransposeMatrix<MatrixType, VectorType>::vmult_add (VectorType &dst,
+ const VectorType &src) const
{
Assert (m != 0, ExcNotInitialized());
m->Tvmult_add (dst, src);
}
-template<class MATRIX, typename VectorType>
+template<typename MatrixType, typename VectorType>
inline void
-TransposeMatrix<MATRIX, VectorType>::Tvmult_add (VectorType &dst,
- const VectorType &src) const
+TransposeMatrix<MatrixType, VectorType>::Tvmult_add (VectorType &dst,
+ const VectorType &src) const
{
Assert (m != 0, ExcNotInitialized());
m->vmult_add (dst, src);
* used locally.
*
* In the block model, each of the blocks of the local vectors corresponds
- * to the restriction of a single block of the system to this cell (
- * @ref GlossBlock).
+ * to the restriction of a single block of the system to this cell
+ (* @ref GlossBlock).
* Thus, the size of this local block is the number of degrees of freedom
* of the corresponding base element of the FESystem.
*
* @ingroup MeshWorker
* @author Guido Kanschat, 2009
*/
- template <class MATRIX, typename number = double>
+ template <typename MatrixType, typename number = double>
class MatrixLocalBlocksToGlobalBlocks
{
public:
* initialize cell matrix vectors.
*/
void initialize(const BlockInfo *block_info,
- MatrixBlockVector<MATRIX> &matrices);
+ MatrixBlockVector<MatrixType> &matrices);
/**
* Initialize the constraints.
/**
* Assemble a single local matrix into a global one.
*/
- void assemble(
- MatrixBlock<MATRIX> &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2);
+ void assemble(MatrixBlock<MatrixType> &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2);
/**
* The global matrices, stored as a vector of pointers.
*/
- SmartPointer<MatrixBlockVector<MATRIX>,
- MatrixLocalBlocksToGlobalBlocks<MATRIX, number> > matrices;
+ SmartPointer<MatrixBlockVector<MatrixType>,
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number> > matrices;
/**
* A pointer to the object containing the block structure.
*/
SmartPointer<const BlockInfo,
- MatrixLocalBlocksToGlobalBlocks<MATRIX, number> > block_info;
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number> > block_info;
/**
* A pointer to the object containing constraints.
*/
SmartPointer<const ConstraintMatrix,
- MatrixLocalBlocksToGlobalBlocks<MATRIX,number> > constraints;
+ MatrixLocalBlocksToGlobalBlocks<MatrixType,number> > constraints;
/**
* The smallest positive number that will be entered into the global
* @ingroup MeshWorker
* @author Guido Kanschat, 2009
*/
- template <class MATRIX, typename number = double>
+ template <typename MatrixType, typename number = double>
class MGMatrixLocalBlocksToGlobalBlocks
{
public:
- typedef MGMatrixBlockVector<MATRIX> MatrixPtrVector;
- typedef SmartPointer<MatrixPtrVector, MGMatrixLocalBlocksToGlobalBlocks<MATRIX,number> >
+ typedef MGMatrixBlockVector<MatrixType> MatrixPtrVector;
+ typedef SmartPointer<MatrixPtrVector, MGMatrixLocalBlocksToGlobalBlocks<MatrixType,number> >
MatrixPtrVectorPtr;
/**
/**
* Assemble a single local matrix into a global one.
*/
- void assemble(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2,
- bool transpose = false);
+ void assemble(MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2,
+ bool transpose = false);
/**
* Assemble a single local matrix into a global one.
*/
- void assemble_fluxes(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2);
+ void assemble_fluxes(MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2);
/**
* Assemble a single local matrix into a global one.
*/
- void assemble_up(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2);
+ void assemble_up(MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2);
/**
* Assemble a single local matrix into a global one.
*/
- void assemble_down(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2);
+ void assemble_down(MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2);
/**
* Assemble a single local matrix into a global one.
*/
- void assemble_in(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2);
+ void assemble_in(MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2);
/**
* Assemble a single local matrix into a global one.
*/
- void assemble_out(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2);
+ void assemble_out(MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2);
/**
* The level matrices, stored as a vector of pointers.
/**
* A pointer to the object containing the block structure.
*/
- SmartPointer<const BlockInfo, MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number> > block_info;
+ SmartPointer<const BlockInfo, MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number> > block_info;
/**
* A pointer to the object containing constraints.
*/
- SmartPointer<const MGConstrainedDoFs,MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number> > mg_constrained_dofs;
+ SmartPointer<const MGConstrainedDoFs,MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number> > mg_constrained_dofs;
/**
//----------------------------------------------------------------------//
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline
- MatrixLocalBlocksToGlobalBlocks<MATRIX, number>::MatrixLocalBlocksToGlobalBlocks(
- double threshold)
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number>::MatrixLocalBlocksToGlobalBlocks
+ (double threshold)
:
threshold(threshold)
{}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MatrixLocalBlocksToGlobalBlocks<MATRIX, number>::initialize(
- const BlockInfo *b,
- MatrixBlockVector<MATRIX> &m)
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number>::initialize
+ (const BlockInfo *b,
+ MatrixBlockVector<MatrixType> &m)
{
block_info = b;
matrices = &m;
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MatrixLocalBlocksToGlobalBlocks<MATRIX, number>::initialize(
- const ConstraintMatrix &c)
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number>::initialize
+ (const ConstraintMatrix &c)
{
constraints = &c;
}
- template <class MATRIX ,typename number>
+ template <typename MatrixType ,typename number>
template <class DOFINFO>
inline void
- MatrixLocalBlocksToGlobalBlocks<MATRIX, number>::initialize_info(
- DOFINFO &info,
- bool face) const
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number>::initialize_info
+ (DOFINFO &info,
+ bool face) const
{
info.initialize_matrices(*matrices, face);
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble(
- MatrixBlock<MATRIX> &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2)
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number>::assemble
+ (MatrixBlock<MatrixType> &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2)
{
if (constraints == 0)
{
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
template <class DOFINFO>
inline void
- MatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble(
- const DOFINFO &info)
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number>::assemble (const DOFINFO &info)
{
for (unsigned int i=0; i<matrices->size(); ++i)
{
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
template <class DOFINFO>
inline void
- MatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble(
- const DOFINFO &info1,
- const DOFINFO &info2)
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number>::assemble (const DOFINFO &info1,
+ const DOFINFO &info2)
{
for (unsigned int i=0; i<matrices->size(); ++i)
{
// ----------------------------------------------------------------------//
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::MGMatrixLocalBlocksToGlobalBlocks(
- double threshold)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::MGMatrixLocalBlocksToGlobalBlocks
+ (double threshold)
:
threshold(threshold)
{}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::initialize(
- const BlockInfo *b,
- MatrixPtrVector &m)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::initialize
+ (const BlockInfo *b,
+ MatrixPtrVector &m)
{
block_info = b;
AssertDimension(block_info->local().size(), block_info->global().size());
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::initialize(
- const MGConstrainedDoFs &mg_c)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::initialize
+ (const MGConstrainedDoFs &mg_c)
{
mg_constrained_dofs = &mg_c;
}
- template <class MATRIX ,typename number>
+ template <typename MatrixType ,typename number>
template <class DOFINFO>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::initialize_info(
- DOFINFO &info,
- bool face) const
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::initialize_info
+ (DOFINFO &info,
+ bool face) const
{
info.initialize_matrices(*matrices, face);
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::initialize_edge_flux(
- MatrixPtrVector &up,
- MatrixPtrVector &down)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::initialize_edge_flux
+ (MatrixPtrVector &up,
+ MatrixPtrVector &down)
{
flux_up = up;
flux_down = down;
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::initialize_interfaces(
- MatrixPtrVector &in,
- MatrixPtrVector &out)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::initialize_interfaces
+ (MatrixPtrVector &in,
+ MatrixPtrVector &out)
{
interface_in = in;
interface_out = out;
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2,
- bool transpose)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::assemble
+ (MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2,
+ bool transpose)
{
for (unsigned int j=0; j<local.n_rows(); ++j)
for (unsigned int k=0; k<local.n_cols(); ++k)
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble_fluxes(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::assemble_fluxes
+ (MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2)
{
for (unsigned int j=0; j<local.n_rows(); ++j)
for (unsigned int k=0; k<local.n_cols(); ++k)
}
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble_up(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::assemble_up
+ (MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2)
{
for (unsigned int j=0; j<local.n_rows(); ++j)
for (unsigned int k=0; k<local.n_cols(); ++k)
}
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble_down(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::assemble_down
+ (MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2)
{
for (unsigned int j=0; j<local.n_rows(); ++j)
for (unsigned int k=0; k<local.n_cols(); ++k)
}
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble_in(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::assemble_in
+ (MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2)
{
// AssertDimension(local.n(), dof1.size());
// AssertDimension(local.m(), dof2.size());
}
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble_out(
- MATRIX &global,
- const FullMatrix<number> &local,
- const unsigned int block_row,
- const unsigned int block_col,
- const std::vector<types::global_dof_index> &dof1,
- const std::vector<types::global_dof_index> &dof2,
- const unsigned int level1,
- const unsigned int level2)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::assemble_out
+ (MatrixType &global,
+ const FullMatrix<number> &local,
+ const unsigned int block_row,
+ const unsigned int block_col,
+ const std::vector<types::global_dof_index> &dof1,
+ const std::vector<types::global_dof_index> &dof2,
+ const unsigned int level1,
+ const unsigned int level2)
{
// AssertDimension(local.n(), dof1.size());
// AssertDimension(local.m(), dof2.size());
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
template <class DOFINFO>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble(const DOFINFO &info)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::assemble(const DOFINFO &info)
{
const unsigned int level = info.cell->level();
}
- template <class MATRIX, typename number>
+ template <typename MatrixType, typename number>
template <class DOFINFO>
inline void
- MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble(
- const DOFINFO &info1,
- const DOFINFO &info2)
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>::assemble
+ (const DOFINFO &info1,
+ const DOFINFO &info2)
{
const unsigned int level1 = info1.cell->level();
const unsigned int level2 = info2.cell->level();
for (unsigned int i=0; i<matrices->size(); ++i)
{
- MGLevelObject<MatrixBlock<MATRIX> > &o = matrices->block(i);
+ MGLevelObject<MatrixBlock<MatrixType> > &o = matrices->block(i);
// Row and column index of
// the block we are dealing with
*
* @note This function is usually only called by the assembler.
*/
- template <class MATRIX>
- void initialize_matrices(const MatrixBlockVector<MATRIX> &matrices,
+ template <typename MatrixType>
+ void initialize_matrices(const MatrixBlockVector<MatrixType> &matrices,
bool both);
/**
*
* @note This function is usually only called by the assembler.
*/
- template <class MATRIX>
- void initialize_matrices(const MGMatrixBlockVector<MATRIX> &matrices,
+ template <typename MatrixType>
+ void initialize_matrices(const MGMatrixBlockVector<MatrixType> &matrices,
bool both);
/**
template <typename number>
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- LocalResults<number>::initialize_matrices(
- const MatrixBlockVector<MATRIX> &matrices,
- bool both)
+ LocalResults<number>::initialize_matrices
+ (const MatrixBlockVector<MatrixType> &matrices,
+ bool both)
{
M1.resize(matrices.size());
if (both)
template <typename number>
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- LocalResults<number>::initialize_matrices(
- const MGMatrixBlockVector<MATRIX> &matrices,
- bool both)
+ LocalResults<number>::initialize_matrices
+ (const MGMatrixBlockVector<MatrixType> &matrices,
+ bool both)
{
M1.resize(matrices.size());
if (both)
M2.resize(matrices.size());
for (unsigned int i=0; i<matrices.size(); ++i)
{
- const MGLevelObject<MatrixBlock<MATRIX> > &o = matrices.block(i);
+ const MGLevelObject<MatrixBlock<MatrixType> > &o = matrices.block(i);
const unsigned int row = o[o.min_level()].row;
const unsigned int col = o[o.min_level()].column;
* @ingroup MeshWorker
* @author Guido Kanschat, 2009
*/
- template <class MATRIX>
+ template <typename MatrixType>
class MatrixSimple
{
public:
/**
* Store the result matrix for later assembling.
*/
- void initialize(MATRIX &m);
+ void initialize(MatrixType &m);
/**
* Store several result matrices for later assembling.
*/
- void initialize(std::vector<MATRIX> &m);
+ void initialize(std::vector<MatrixType> &m);
/**
* Initialize the constraints. After this function has been called with
/**
* The vector of global matrices being assembled.
*/
- std::vector<SmartPointer<MATRIX,MatrixSimple<MATRIX> > > matrix;
+ std::vector<SmartPointer<MatrixType,MatrixSimple<MatrixType> > > matrix;
/**
* A pointer to the object containing constraints.
*/
- SmartPointer<const ConstraintMatrix,MatrixSimple<MATRIX> > constraints;
+ SmartPointer<const ConstraintMatrix,MatrixSimple<MatrixType> > constraints;
/**
* The smallest positive number that will be entered into the global
* @ingroup MeshWorker
* @author Guido Kanschat, 2009
*/
- template <class MATRIX>
+ template <typename MatrixType>
class MGMatrixSimple
{
public:
/**
* Store the result matrix for later assembling.
*/
- void initialize(MGLevelObject<MATRIX> &m);
+ void initialize(MGLevelObject<MatrixType> &m);
/**
* Initialize the multilevel constraints.
* Initialize the matrices #flux_up and #flux_down used for local
* refinement with discontinuous Galerkin methods.
*/
- void initialize_fluxes(MGLevelObject<MATRIX> &flux_up,
- MGLevelObject<MATRIX> &flux_down);
+ void initialize_fluxes(MGLevelObject<MatrixType> &flux_up,
+ MGLevelObject<MatrixType> &flux_down);
/**
* Initialize the matrices #interface_in and #interface_out used for
* local refinement with continuous Galerkin methods.
*/
- void initialize_interfaces(MGLevelObject<MATRIX> &interface_in,
- MGLevelObject<MATRIX> &interface_out);
+ void initialize_interfaces(MGLevelObject<MatrixType> &interface_in,
+ MGLevelObject<MatrixType> &interface_out);
/**
* Initialize the local data in the DoFInfo object used later for
* assembling.
/**
* Assemble a single matrix into a global matrix.
*/
- void assemble(MATRIX &G,
+ void assemble(MatrixType &G,
const FullMatrix<double> &M,
const std::vector<types::global_dof_index> &i1,
const std::vector<types::global_dof_index> &i2);
/**
* Assemble a single matrix into a global matrix.
*/
- void assemble(MATRIX &G,
+ void assemble(MatrixType &G,
const FullMatrix<double> &M,
const std::vector<types::global_dof_index> &i1,
const std::vector<types::global_dof_index> &i2,
* Assemble a single matrix into a global matrix.
*/
- void assemble_up(MATRIX &G,
+ void assemble_up(MatrixType &G,
const FullMatrix<double> &M,
const std::vector<types::global_dof_index> &i1,
const std::vector<types::global_dof_index> &i2,
* Assemble a single matrix into a global matrix.
*/
- void assemble_down(MATRIX &G,
+ void assemble_down(MatrixType &G,
const FullMatrix<double> &M,
const std::vector<types::global_dof_index> &i1,
const std::vector<types::global_dof_index> &i2,
* Assemble a single matrix into a global matrix.
*/
- void assemble_in(MATRIX &G,
+ void assemble_in(MatrixType &G,
const FullMatrix<double> &M,
const std::vector<types::global_dof_index> &i1,
const std::vector<types::global_dof_index> &i2,
* Assemble a single matrix into a global matrix.
*/
- void assemble_out(MATRIX &G,
+ void assemble_out(MatrixType &G,
const FullMatrix<double> &M,
const std::vector<types::global_dof_index> &i1,
const std::vector<types::global_dof_index> &i2,
/**
* The global matrix being assembled.
*/
- SmartPointer<MGLevelObject<MATRIX>,MGMatrixSimple<MATRIX> > matrix;
+ SmartPointer<MGLevelObject<MatrixType>,MGMatrixSimple<MatrixType> > matrix;
/**
* The matrix used for face flux terms across the refinement edge,
* coupling coarse to fine.
*/
- SmartPointer<MGLevelObject<MATRIX>,MGMatrixSimple<MATRIX> > flux_up;
+ SmartPointer<MGLevelObject<MatrixType>,MGMatrixSimple<MatrixType> > flux_up;
/**
* The matrix used for face flux terms across the refinement edge,
* coupling fine to coarse.
*/
- SmartPointer<MGLevelObject<MATRIX>,MGMatrixSimple<MATRIX> > flux_down;
+ SmartPointer<MGLevelObject<MatrixType>,MGMatrixSimple<MatrixType> > flux_down;
/**
* The matrix used for face contributions for continuous elements across
* the refinement edge, coupling coarse to fine.
*/
- SmartPointer<MGLevelObject<MATRIX>,MGMatrixSimple<MATRIX> > interface_in;
+ SmartPointer<MGLevelObject<MatrixType>,MGMatrixSimple<MatrixType> > interface_in;
/**
* The matrix used for face contributions for continuous elements across
* the refinement edge, coupling fine to coarse.
*/
- SmartPointer<MGLevelObject<MATRIX>,MGMatrixSimple<MATRIX> > interface_out;
+ SmartPointer<MGLevelObject<MatrixType>,MGMatrixSimple<MatrixType> > interface_out;
/**
* A pointer to the object containing constraints.
*/
- SmartPointer<const MGConstrainedDoFs,MGMatrixSimple<MATRIX> > mg_constrained_dofs;
+ SmartPointer<const MGConstrainedDoFs,MGMatrixSimple<MatrixType> > mg_constrained_dofs;
/**
* The smallest positive number that will be entered into the global
* @ingroup MeshWorker
* @author Guido Kanschat, 2009
*/
- template <class MATRIX, typename VectorType>
+ template <typename MatrixType, typename VectorType>
class SystemSimple :
- private MatrixSimple<MATRIX>,
+ private MatrixSimple<MatrixType>,
private ResidualSimple<VectorType>
{
public:
/**
* Store the two objects data is assembled into.
*/
- void initialize(MATRIX &m, VectorType &rhs);
+ void initialize(MatrixType &m, VectorType &rhs);
/**
* Initialize the constraints. After this function has been called with
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- ResidualSimple<MATRIX>::initialize_local_blocks(const BlockIndices &)
+ ResidualSimple<MatrixType>::initialize_local_blocks(const BlockIndices &)
{}
//----------------------------------------------------------------------//
- template <class MATRIX>
+ template <typename MatrixType>
inline
- MatrixSimple<MATRIX>::MatrixSimple(double threshold)
+ MatrixSimple<MatrixType>::MatrixSimple(double threshold)
:
threshold(threshold)
{}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MatrixSimple<MATRIX>::initialize(MATRIX &m)
+ MatrixSimple<MatrixType>::initialize(MatrixType &m)
{
matrix.resize(1);
matrix[0] = &m;
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MatrixSimple<MATRIX>::initialize(std::vector<MATRIX> &m)
+ MatrixSimple<MatrixType>::initialize(std::vector<MatrixType> &m)
{
matrix.resize(m.size());
for (unsigned int i=0; i<m.size(); ++i)
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MatrixSimple<MATRIX>::initialize(const ConstraintMatrix &c)
+ MatrixSimple<MatrixType>::initialize(const ConstraintMatrix &c)
{
constraints = &c;
}
- template <class MATRIX >
+ template <typename MatrixType >
template <class DOFINFO>
inline void
- MatrixSimple<MATRIX>::initialize_info(DOFINFO &info, bool face) const
+ MatrixSimple<MatrixType>::initialize_info(DOFINFO &info, bool face) const
{
Assert(matrix.size() != 0, ExcNotInitialized());
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MatrixSimple<MATRIX>::assemble(const FullMatrix<double> &M,
+ MatrixSimple<MatrixType>::assemble(const FullMatrix<double> &M,
const unsigned int index,
const std::vector<types::global_dof_index> &i1,
const std::vector<types::global_dof_index> &i2)
}
- template <class MATRIX>
+ template <typename MatrixType>
template <class DOFINFO>
inline void
- MatrixSimple<MATRIX>::assemble(const DOFINFO &info)
+ MatrixSimple<MatrixType>::assemble(const DOFINFO &info)
{
Assert(!info.level_cell, ExcMessage("Cell may not access level dofs"));
const unsigned int n = info.indices_by_block.size();
}
- template <class MATRIX>
+ template <typename MatrixType>
template <class DOFINFO>
inline void
- MatrixSimple<MATRIX>::assemble(const DOFINFO &info1, const DOFINFO &info2)
+ MatrixSimple<MatrixType>::assemble(const DOFINFO &info1, const DOFINFO &info2)
{
Assert(!info1.level_cell, ExcMessage("Cell may not access level dofs"));
Assert(!info2.level_cell, ExcMessage("Cell may not access level dofs"));
//----------------------------------------------------------------------//
- template <class MATRIX>
+ template <typename MatrixType>
inline
- MGMatrixSimple<MATRIX>::MGMatrixSimple(double threshold)
+ MGMatrixSimple<MatrixType>::MGMatrixSimple(double threshold)
:
threshold(threshold)
{}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MGMatrixSimple<MATRIX>::initialize(MGLevelObject<MATRIX> &m)
+ MGMatrixSimple<MatrixType>::initialize(MGLevelObject<MatrixType> &m)
{
matrix = &m;
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MGMatrixSimple<MATRIX>::initialize(const MGConstrainedDoFs &c)
+ MGMatrixSimple<MatrixType>::initialize(const MGConstrainedDoFs &c)
{
mg_constrained_dofs = &c;
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MGMatrixSimple<MATRIX>::initialize_fluxes(
- MGLevelObject<MATRIX> &up, MGLevelObject<MATRIX> &down)
+ MGMatrixSimple<MatrixType>::initialize_fluxes(MGLevelObject<MatrixType> &up,
+ MGLevelObject<MatrixType> &down)
{
flux_up = &up;
flux_down = &down;
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MGMatrixSimple<MATRIX>::initialize_interfaces(
- MGLevelObject<MATRIX> &in, MGLevelObject<MATRIX> &out)
+ MGMatrixSimple<MatrixType>::initialize_interfaces
+ (MGLevelObject<MatrixType> &in, MGLevelObject<MatrixType> &out)
{
interface_in = ∈
interface_out = &out;
}
- template <class MATRIX >
+ template <typename MatrixType >
template <class DOFINFO>
inline void
- MGMatrixSimple<MATRIX>::initialize_info(DOFINFO &info, bool face) const
+ MGMatrixSimple<MatrixType>::initialize_info(DOFINFO &info, bool face) const
{
const unsigned int n = info.indices_by_block.size();
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MGMatrixSimple<MATRIX>::assemble(
- MATRIX &G,
- const FullMatrix<double> &M,
- const std::vector<types::global_dof_index> &i1,
- const std::vector<types::global_dof_index> &i2)
+ MGMatrixSimple<MatrixType>::assemble
+ (MatrixType &G,
+ const FullMatrix<double> &M,
+ const std::vector<types::global_dof_index> &i1,
+ const std::vector<types::global_dof_index> &i2)
{
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MGMatrixSimple<MATRIX>::assemble(
- MATRIX &G,
- const FullMatrix<double> &M,
- const std::vector<types::global_dof_index> &i1,
- const std::vector<types::global_dof_index> &i2,
- const unsigned int level)
+ MGMatrixSimple<MatrixType>::assemble
+ (MatrixType &G,
+ const FullMatrix<double> &M,
+ const std::vector<types::global_dof_index> &i1,
+ const std::vector<types::global_dof_index> &i2,
+ const unsigned int level)
{
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MGMatrixSimple<MATRIX>::assemble_up(
- MATRIX &G,
- const FullMatrix<double> &M,
- const std::vector<types::global_dof_index> &i1,
- const std::vector<types::global_dof_index> &i2,
- const unsigned int level)
+ MGMatrixSimple<MatrixType>::assemble_up
+ (MatrixType &G,
+ const FullMatrix<double> &M,
+ const std::vector<types::global_dof_index> &i1,
+ const std::vector<types::global_dof_index> &i2,
+ const unsigned int level)
{
AssertDimension(M.n(), i1.size());
AssertDimension(M.m(), i2.size());
}
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MGMatrixSimple<MATRIX>::assemble_down(
- MATRIX &G,
- const FullMatrix<double> &M,
- const std::vector<types::global_dof_index> &i1,
- const std::vector<types::global_dof_index> &i2,
- const unsigned int level)
+ MGMatrixSimple<MatrixType>::assemble_down
+ (MatrixType &G,
+ const FullMatrix<double> &M,
+ const std::vector<types::global_dof_index> &i1,
+ const std::vector<types::global_dof_index> &i2,
+ const unsigned int level)
{
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
}
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MGMatrixSimple<MATRIX>::assemble_in(
- MATRIX &G,
- const FullMatrix<double> &M,
- const std::vector<types::global_dof_index> &i1,
- const std::vector<types::global_dof_index> &i2,
- const unsigned int level)
+ MGMatrixSimple<MatrixType>::assemble_in
+ (MatrixType &G,
+ const FullMatrix<double> &M,
+ const std::vector<types::global_dof_index> &i1,
+ const std::vector<types::global_dof_index> &i2,
+ const unsigned int level)
{
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
}
- template <class MATRIX>
+ template <typename MatrixType>
inline void
- MGMatrixSimple<MATRIX>::assemble_out(
- MATRIX &G,
- const FullMatrix<double> &M,
- const std::vector<types::global_dof_index> &i1,
- const std::vector<types::global_dof_index> &i2,
- const unsigned int level)
+ MGMatrixSimple<MatrixType>::assemble_out
+ (MatrixType &G,
+ const FullMatrix<double> &M,
+ const std::vector<types::global_dof_index> &i1,
+ const std::vector<types::global_dof_index> &i2,
+ const unsigned int level)
{
AssertDimension(M.n(), i1.size());
AssertDimension(M.m(), i2.size());
}
- template <class MATRIX>
+ template <typename MatrixType>
template <class DOFINFO>
inline void
- MGMatrixSimple<MATRIX>::assemble(const DOFINFO &info)
+ MGMatrixSimple<MatrixType>::assemble(const DOFINFO &info)
{
Assert(info.level_cell, ExcMessage("Cell must access level dofs"));
const unsigned int level = info.cell->level();
}
- template <class MATRIX>
+ template <typename MatrixType>
template <class DOFINFO>
inline void
- MGMatrixSimple<MATRIX>::assemble(const DOFINFO &info1,
+ MGMatrixSimple<MatrixType>::assemble(const DOFINFO &info1,
const DOFINFO &info2)
{
Assert(info1.level_cell, ExcMessage("Cell must access level dofs"));
//----------------------------------------------------------------------//
- template <class MATRIX, typename VectorType>
- SystemSimple<MATRIX,VectorType>::SystemSimple(double t)
+ template <typename MatrixType, typename VectorType>
+ SystemSimple<MatrixType,VectorType>::SystemSimple(double t)
:
- MatrixSimple<MATRIX>(t)
+ MatrixSimple<MatrixType>(t)
{}
- template <class MATRIX, typename VectorType>
+ template <typename MatrixType, typename VectorType>
inline void
- SystemSimple<MATRIX,VectorType>::initialize(MATRIX &m, VectorType &rhs)
+ SystemSimple<MatrixType,VectorType>::initialize(MatrixType &m, VectorType &rhs)
{
AnyData data;
VectorType *p = &rhs;
data.add(p, "right hand side");
- MatrixSimple<MATRIX>::initialize(m);
+ MatrixSimple<MatrixType>::initialize(m);
ResidualSimple<VectorType>::initialize(data);
}
- template <class MATRIX, typename VectorType>
+ template <typename MatrixType, typename VectorType>
inline void
- SystemSimple<MATRIX,VectorType>::initialize(const ConstraintMatrix &c)
+ SystemSimple<MatrixType,VectorType>::initialize(const ConstraintMatrix &c)
{
- MatrixSimple<MATRIX>::initialize(c);
+ MatrixSimple<MatrixType>::initialize(c);
ResidualSimple<VectorType>::initialize(c);
}
- template <class MATRIX, typename VectorType>
+ template <typename MatrixType, typename VectorType>
template <class DOFINFO>
inline void
- SystemSimple<MATRIX,VectorType>::initialize_info(DOFINFO &info,
+ SystemSimple<MatrixType,VectorType>::initialize_info(DOFINFO &info,
bool face) const
{
- MatrixSimple<MATRIX>::initialize_info(info, face);
+ MatrixSimple<MatrixType>::initialize_info(info, face);
ResidualSimple<VectorType>::initialize_info(info, face);
}
- template <class MATRIX, typename VectorType>
+ template <typename MatrixType, typename VectorType>
template <class DOFINFO>
inline void
- SystemSimple<MATRIX,VectorType>::assemble(const DOFINFO &info)
+ SystemSimple<MatrixType,VectorType>::assemble(const DOFINFO &info)
{
- MatrixSimple<MATRIX>::assemble(info);
+ MatrixSimple<MatrixType>::assemble(info);
ResidualSimple<VectorType>::assemble(info);
}
- template <class MATRIX, typename VectorType>
+ template <typename MatrixType, typename VectorType>
template <class DOFINFO>
inline void
- SystemSimple<MATRIX,VectorType>::assemble(const DOFINFO &info1,
+ SystemSimple<MatrixType,VectorType>::assemble(const DOFINFO &info1,
const DOFINFO &info2)
{
- MatrixSimple<MATRIX>::assemble(info1, info2);
+ MatrixSimple<MatrixType>::assemble(info1, info2);
ResidualSimple<VectorType>::assemble(info1, info2);
}
}
*
* @author Guido Kanschat, 2005
*/
-template <class MATRIX, class RELAX, typename number>
+template <typename MatrixType, class RELAX, typename number>
class MGSmootherBlock
: public MGSmootherBase<BlockVector<number> >
{
/**
* Constructor. Sets memory and smoothing parameters.
*/
- MGSmootherBlock(VectorMemory<BlockVector<number> > &mem,
- const unsigned int steps = 1,
- const bool variable = false,
- const bool symmetric = false,
- const bool transpose = false,
- const bool reverse = false);
+ MGSmootherBlock (VectorMemory<BlockVector<number> > &mem,
+ const unsigned int steps = 1,
+ const bool variable = false,
+ const bool symmetric = false,
+ const bool transpose = false,
+ const bool reverse = false);
/**
* Initialize for matrices. The parameter <tt>matrices</tt> can be any
* object having functions <tt>get_minlevel()</tt> and
* <tt>get_maxlevel()</tt> as well as an <tt>operator[]</tt> returning a
- * reference to @p MATRIX.
+ * reference to @p MatrixType.
*
* The same convention is used for the parameter <tt>smoothers</tt>, such
* that <tt>operator[]</tt> returns the object doing the block-smoothing on
* This function stores pointers to the level matrices and smoothing
* operator for each level.
*/
- template <class MGMATRIX, class MGRELAX>
- void initialize (const MGMATRIX &matrices,
- const MGRELAX &smoothers);
+ template <class MGMatrixType, class MGRELAX>
+ void initialize (const MGMatrixType &matrices,
+ const MGRELAX &smoothers);
/**
* Empty all vectors.
/**
* Pointer to the matrices.
*/
- MGLevelObject<PointerMatrix<MATRIX, BlockVector<number> > > matrices;
+ MGLevelObject<PointerMatrix<MatrixType, BlockVector<number> > > matrices;
/**
* Pointer to the matrices.
#ifndef DOXYGEN
-template <class MATRIX, class RELAX, typename number>
+template <typename MatrixType, class RELAX, typename number>
inline
-MGSmootherBlock<MATRIX, RELAX, number>::MGSmootherBlock(
- VectorMemory<BlockVector<number> > &mem,
- const unsigned int steps,
- const bool variable,
- const bool symmetric,
- const bool transpose,
- const bool reverse)
+MGSmootherBlock<MatrixType, RELAX, number>::MGSmootherBlock
+(VectorMemory<BlockVector<number> > &mem,
+ const unsigned int steps,
+ const bool variable,
+ const bool symmetric,
+ const bool transpose,
+ const bool reverse)
:
steps(steps),
variable(variable),
{}
-template <class MATRIX, class RELAX, typename number>
+template <typename MatrixType, class RELAX, typename number>
inline void
-MGSmootherBlock<MATRIX, RELAX, number>::clear ()
+MGSmootherBlock<MatrixType, RELAX, number>::clear ()
{
unsigned int i=matrices.min_level(),
max_level=matrices.max_level();
}
-template <class MATRIX, class RELAX, typename number>
-template <class MGMATRIX, class MGRELAX>
+template <typename MatrixType, class RELAX, typename number>
+template <class MGMatrixType, class MGRELAX>
inline void
-MGSmootherBlock<MATRIX, RELAX, number>::initialize (
- const MGMATRIX &m,
- const MGRELAX &s)
+MGSmootherBlock<MatrixType, RELAX, number>::initialize (const MGMatrixType &m,
+ const MGRELAX &s)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
}
}
-template <class MATRIX, class RELAX, typename number>
+template <typename MatrixType, class RELAX, typename number>
inline void
-MGSmootherBlock<MATRIX, RELAX, number>::
+MGSmootherBlock<MatrixType, RELAX, number>::
set_steps (const unsigned int s)
{
steps = s;
}
-template <class MATRIX, class RELAX, typename number>
+template <typename MatrixType, class RELAX, typename number>
inline void
-MGSmootherBlock<MATRIX, RELAX, number>::
+MGSmootherBlock<MatrixType, RELAX, number>::
set_variable (const bool flag)
{
variable = flag;
}
-template <class MATRIX, class RELAX, typename number>
+template <typename MatrixType, class RELAX, typename number>
inline void
-MGSmootherBlock<MATRIX, RELAX, number>::
+MGSmootherBlock<MatrixType, RELAX, number>::
set_symmetric (const bool flag)
{
symmetric = flag;
}
-template <class MATRIX, class RELAX, typename number>
+template <typename MatrixType, class RELAX, typename number>
inline void
-MGSmootherBlock<MATRIX, RELAX, number>::
+MGSmootherBlock<MatrixType, RELAX, number>::
set_transpose (const bool flag)
{
transpose = flag;
}
-template <class MATRIX, class RELAX, typename number>
+template <typename MatrixType, class RELAX, typename number>
inline void
-MGSmootherBlock<MATRIX, RELAX, number>::
+MGSmootherBlock<MatrixType, RELAX, number>::
set_reverse (const bool flag)
{
reverse = flag;
}
-template <class MATRIX, class RELAX, typename number>
+template <typename MatrixType, class RELAX, typename number>
inline void
-MGSmootherBlock<MATRIX, RELAX, number>::smooth(
- const unsigned int level,
- BlockVector<number> &u,
+MGSmootherBlock<MatrixType, RELAX, number>::smooth(const unsigned int level,
+ BlockVector<number> &u,
const BlockVector<number> &rhs) const
{
deallog.push("Smooth");
* transforming a triplet of iterative solver, matrix and preconditioner into
* a coarse grid solver.
*
- * The type of the matrix (i.e. the template parameter @p MATRIX) should be
+ * The type of the matrix (i.e. the template parameter @p MatrixType) should be
* derived from @p Subscriptor to allow for the use of a smart pointer to it.
*
* @author Guido Kanschat, 1999, Ralf Hartmann, 2002.
* Constructor. Store solver, matrix and preconditioning method for later
* use.
*/
- template<class MATRIX, class PRECOND>
+ template<typename MatrixType, class PRECOND>
MGCoarseGridLACIteration (SOLVER &,
- const MATRIX &,
+ const MatrixType &,
const PRECOND &);
/**
/**
* Initialize new data.
*/
- template<class MATRIX, class PRECOND>
+ template<typename MatrixType, class PRECOND>
void initialize (SOLVER &,
- const MATRIX &,
+ const MatrixType &,
const PRECOND &);
/**
* Sets the matrix. This gives the possibility to replace the matrix that
* was given to the constructor by a new matrix.
*/
- template <class MATRIX>
- void set_matrix (const MATRIX &);
+ template <typename MatrixType>
+ void set_matrix (const MatrixType &);
private:
/**
template<class SOLVER, class VectorType>
-template<class MATRIX, class PRECOND>
+template<typename MatrixType, class PRECOND>
MGCoarseGridLACIteration<SOLVER, VectorType>
-::MGCoarseGridLACIteration(SOLVER &s,
- const MATRIX &m,
- const PRECOND &p)
+::MGCoarseGridLACIteration (SOLVER &s,
+ const MatrixType &m,
+ const PRECOND &p)
:
solver(&s, typeid(*this).name())
{
- matrix = new PointerMatrix<MATRIX, VectorType>(&m);
+ matrix = new PointerMatrix<MatrixType, VectorType>(&m);
precondition = new PointerMatrix<PRECOND, VectorType>(&p);
}
template<class SOLVER, class VectorType>
-template<class MATRIX, class PRECOND>
+template<typename MatrixType, class PRECOND>
void
MGCoarseGridLACIteration<SOLVER, VectorType>
-::initialize(SOLVER &s,
- const MATRIX &m,
- const PRECOND &p)
+::initialize (SOLVER &s,
+ const MatrixType &m,
+ const PRECOND &p)
{
solver = &s;
if (matrix)
delete matrix;
- matrix = new PointerMatrix<MATRIX, VectorType>(&m);
+ matrix = new PointerMatrix<MatrixType, VectorType>(&m);
if (precondition)
delete precondition;
precondition = new PointerMatrix<PRECOND, VectorType>(&p);
template<class SOLVER, class VectorType>
-template<class MATRIX>
+template<typename MatrixType>
void
MGCoarseGridLACIteration<SOLVER, VectorType>
-::set_matrix(const MATRIX &m)
+::set_matrix(const MatrixType &m)
{
if (matrix)
delete matrix;
- matrix = new PointerMatrix<MATRIX, VectorType>(&m);
+ matrix = new PointerMatrix<MatrixType, VectorType>(&m);
}
//---------------------------------------------------------------------------
template<typename number, class VectorType>
-MGCoarseGridHouseholder<number, VectorType>::MGCoarseGridHouseholder(
- const FullMatrix<number> *A)
+MGCoarseGridHouseholder<number, VectorType>::MGCoarseGridHouseholder
+(const FullMatrix<number> *A)
{
if (A != 0) householder.initialize(*A);
}
template<typename number, class VectorType>
void
-MGCoarseGridHouseholder<number, VectorType>::initialize(
- const FullMatrix<number> &A)
+MGCoarseGridHouseholder<number, VectorType>::initialize(const FullMatrix<number> &A)
{
householder.initialize(A);
}
template<typename number, class VectorType>
void
-MGCoarseGridHouseholder<number, VectorType>::operator() (
- const unsigned int /*level*/,
- VectorType &dst,
- const VectorType &src) const
+MGCoarseGridHouseholder<number, VectorType>::operator() (const unsigned int /*level*/,
+ VectorType &dst,
+ const VectorType &src) const
{
householder.least_squares(dst, src);
}
template<typename number, class VectorType>
void
-MGCoarseGridSVD<number, VectorType>::initialize(
- const FullMatrix<number> &A,
- double threshold)
+MGCoarseGridSVD<number, VectorType>::initialize (const FullMatrix<number> &A,
+ double threshold)
{
matrix.reinit(A.n_rows(), A.n_cols());
matrix = A;
* Constructor setting up pointers to the matrices in <tt>M</tt> by
* calling initialize().
*/
- template <class MATRIX>
- Matrix(const MGLevelObject<MATRIX> &M);
+ template <typename MatrixType>
+ Matrix(const MGLevelObject<MatrixType> &M);
/**
* Initialize the object such that the level multiplication uses the
* matrices in <tt>M</tt>
*/
- template <class MATRIX>
+ template <typename MatrixType>
void
- initialize(const MGLevelObject<MATRIX> &M);
+ initialize(const MGLevelObject<MatrixType> &M);
/**
* Access matrix on a level.
/**
* Multilevel matrix selecting from block matrices. This class implements the
- * interface defined by MGMatrixBase. The template parameter @p MATRIX should
+ * interface defined by MGMatrixBase. The template parameter @p MatrixType should
* be a block matrix class like BlockSparseMatrix or @p BlockSparseMatrixEZ.
* Then, this class stores a pointer to a MGLevelObject of this matrix class.
* In each @p vmult, the block selected on initialization will be multiplied
*
* @author Guido Kanschat, 2002
*/
-template <class MATRIX, typename number>
+template <typename MatrixType, typename number>
class MGMatrixSelect : public MGMatrixBase<Vector<number> >
{
public:
* Constructor. @p row and @p col are the coordinate of the selected block.
* The other argument is handed over to the @p SmartPointer constructor.
*/
- MGMatrixSelect (const unsigned int row = 0,
- const unsigned int col = 0,
- MGLevelObject<MATRIX> *matrix = 0);
+ MGMatrixSelect (const unsigned int row = 0,
+ const unsigned int col = 0,
+ MGLevelObject<MatrixType> *matrix = 0);
/**
* Set the matrix object to be used. The matrix object must exist longer as
* the @p MGMatrix object, since only a pointer is stored.
*/
- void set_matrix (MGLevelObject<MATRIX> *M);
+ void set_matrix (MGLevelObject<MatrixType> *M);
/**
* Select the block for multiplication.
/**
* Pointer to the matrix objects on each level.
*/
- SmartPointer<MGLevelObject<MATRIX>,MGMatrixSelect<MATRIX,number> > matrix;
+ SmartPointer<MGLevelObject<MatrixType>,MGMatrixSelect<MatrixType,number> > matrix;
/**
* Row coordinate of selected block.
*/
namespace mg
{
template <typename VectorType>
- template <class MATRIX>
+ template <typename MatrixType>
inline
void
- Matrix<VectorType>::initialize (const MGLevelObject<MATRIX> &p)
+ Matrix<VectorType>::initialize (const MGLevelObject<MatrixType> &p)
{
matrices.resize(p.min_level(), p.max_level());
for (unsigned int level=p.min_level(); level <= p.max_level(); ++level)
template <typename VectorType>
- template <class MATRIX>
+ template <typename MatrixType>
inline
- Matrix<VectorType>::Matrix (const MGLevelObject<MATRIX> &p)
+ Matrix<VectorType>::Matrix (const MGLevelObject<MatrixType> &p)
{
initialize(p);
}
/*----------------------------------------------------------------------*/
-template <class MATRIX, typename number>
-MGMatrixSelect<MATRIX, number>::
-MGMatrixSelect (const unsigned int row,
- const unsigned int col,
- MGLevelObject<MATRIX> *p)
+template <typename MatrixType, typename number>
+MGMatrixSelect<MatrixType, number>::
+MGMatrixSelect (const unsigned int row,
+ const unsigned int col,
+ MGLevelObject<MatrixType> *p)
:
matrix (p, typeid(*this).name()),
row(row),
-template <class MATRIX, typename number>
+template <typename MatrixType, typename number>
void
-MGMatrixSelect<MATRIX, number>::set_matrix (MGLevelObject<MATRIX> *p)
+MGMatrixSelect<MatrixType, number>::set_matrix (MGLevelObject<MatrixType> *p)
{
matrix = p;
}
-template <class MATRIX, typename number>
+template <typename MatrixType, typename number>
void
-MGMatrixSelect<MATRIX, number>::
+MGMatrixSelect<MatrixType, number>::
select_block (const unsigned int brow,
const unsigned int bcol)
{
}
-template <class MATRIX, typename number>
+template <typename MatrixType, typename number>
void
-MGMatrixSelect<MATRIX, number>::
-vmult (const unsigned int level,
- Vector<number> &dst,
+MGMatrixSelect<MatrixType, number>::
+vmult (const unsigned int level,
+ Vector<number> &dst,
const Vector<number> &src) const
{
Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX> &m = *matrix;
+ const MGLevelObject<MatrixType> &m = *matrix;
m[level].block(row, col).vmult(dst, src);
}
-template <class MATRIX, typename number>
+template <typename MatrixType, typename number>
void
-MGMatrixSelect<MATRIX, number>::
-vmult_add (const unsigned int level,
- Vector<number> &dst,
+MGMatrixSelect<MatrixType, number>::
+vmult_add (const unsigned int level,
+ Vector<number> &dst,
const Vector<number> &src) const
{
Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX> &m = *matrix;
+ const MGLevelObject<MatrixType> &m = *matrix;
m[level].block(row, col).vmult_add(dst, src);
}
-template <class MATRIX, typename number>
+template <typename MatrixType, typename number>
void
-MGMatrixSelect<MATRIX, number>::
-Tvmult (const unsigned int level,
- Vector<number> &dst,
+MGMatrixSelect<MatrixType, number>::
+Tvmult (const unsigned int level,
+ Vector<number> &dst,
const Vector<number> &src) const
{
Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX> &m = *matrix;
+ const MGLevelObject<MatrixType> &m = *matrix;
m[level].block(row, col).Tvmult(dst, src);
}
-template <class MATRIX, typename number>
+template <typename MatrixType, typename number>
void
-MGMatrixSelect<MATRIX, number>::
-Tvmult_add (const unsigned int level,
- Vector<number> &dst,
+MGMatrixSelect<MatrixType, number>::
+Tvmult_add (const unsigned int level,
+ Vector<number> &dst,
const Vector<number> &src) const
{
Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX> &m = *matrix;
+ const MGLevelObject<MatrixType> &m = *matrix;
m[level].block(row, col).Tvmult_add(dst, src);
}
* @p additional_data is an object of type @p RELAX::AdditionalData and is
* handed to the initialization function of the relaxation method.
*/
- template <class MATRIX2>
- void initialize (const MGLevelObject<MATRIX2> &matrices,
+ template <typename MatrixType2>
+ void initialize (const MGLevelObject<MatrixType2> &matrices,
const typename RELAX::AdditionalData &additional_data = typename RELAX::AdditionalData());
/**
* common range is utilized. This way, smoothing can be restricted to
* certain levels even if the matrix was generated for all levels.
*/
- template <class MATRIX2, class DATA>
- void initialize (const MGLevelObject<MATRIX2> &matrices,
- const MGLevelObject<DATA> &additional_data);
+ template <typename MatrixType2, class DATA>
+ void initialize (const MGLevelObject<MatrixType2> &matrices,
+ const MGLevelObject<DATA> &additional_data);
/**
* Empty all vectors.
*
* @author Guido Kanschat, 2003
*/
-template<class MATRIX, class RELAX, typename VectorType>
+template<typename MatrixType, class RELAX, typename VectorType>
class MGSmootherRelaxation : public MGSmoother<VectorType>
{
public:
* @p additional_data is an object of type @p RELAX::AdditionalData and is
* handed to the initialization function of the relaxation method.
*/
- template <class MATRIX2>
- void initialize (const MGLevelObject<MATRIX2> &matrices,
+ template <typename MatrixType2>
+ void initialize (const MGLevelObject<MatrixType2> &matrices,
const typename RELAX::AdditionalData &additional_data = typename RELAX::AdditionalData());
/**
* @p additional_data is an object of type @p RELAX::AdditionalData and is
* handed to the initialization function of the relaxation method.
*/
- template <class MATRIX2, class DATA>
- void initialize (const MGLevelObject<MATRIX2> &matrices,
- const MGLevelObject<DATA> &additional_data);
+ template <typename MatrixType2, class DATA>
+ void initialize (const MGLevelObject<MatrixType2> &matrices,
+ const MGLevelObject<DATA> &additional_data);
/**
* Initialize for single blocks of matrices. Of this block matrix, the block
* @p additional_data is an object of type @p RELAX::AdditionalData and is
* handed to the initialization function of the relaxation method.
*/
- template <class MATRIX2, class DATA>
- void initialize (const MGLevelObject<MATRIX2> &matrices,
- const DATA &additional_data,
- const unsigned int block_row,
- const unsigned int block_col);
+ template <typename MatrixType2, class DATA>
+ void initialize (const MGLevelObject<MatrixType2> &matrices,
+ const DATA &additional_data,
+ const unsigned int block_row,
+ const unsigned int block_col);
/**
* Initialize for single blocks of matrices. Of this block matrix, the block
* @p additional_data is an object of type @p RELAX::AdditionalData and is
* handed to the initialization function of the relaxation method.
*/
- template <class MATRIX2, class DATA>
- void initialize (const MGLevelObject<MATRIX2> &matrices,
- const MGLevelObject<DATA> &additional_data,
- const unsigned int block_row,
- const unsigned int block_col);
+ template <typename MatrixType2, class DATA>
+ void initialize (const MGLevelObject<MatrixType2> &matrices,
+ const MGLevelObject<DATA> &additional_data,
+ const unsigned int block_row,
+ const unsigned int block_col);
/**
* Empty all vectors.
/**
* Pointer to the matrices.
*/
- MGLevelObject<PointerMatrix<MATRIX, VectorType> > matrices;
+ MGLevelObject<PointerMatrix<MatrixType, VectorType> > matrices;
};
*
* @author Guido Kanschat, 2009
*/
-template<class MATRIX, class PRECONDITIONER, typename VectorType>
+template<typename MatrixType, class PRECONDITIONER, typename VectorType>
class MGSmootherPrecondition : public MGSmoother<VectorType>
{
public:
* @p additional_data is an object of type @p PRECONDITIONER::AdditionalData
* and is handed to the initialization function of the relaxation method.
*/
- template <class MATRIX2>
- void initialize (const MGLevelObject<MATRIX2> &matrices,
+ template <typename MatrixType2>
+ void initialize (const MGLevelObject<MatrixType2> &matrices,
const typename PRECONDITIONER::AdditionalData &additional_data = typename PRECONDITIONER::AdditionalData());
/**
* @p additional_data is an object of type @p PRECONDITIONER::AdditionalData
* and is handed to the initialization function of the relaxation method.
*/
- template <class MATRIX2, class DATA>
- void initialize (const MGLevelObject<MATRIX2> &matrices,
- const MGLevelObject<DATA> &additional_data);
+ template <typename MatrixType2, class DATA>
+ void initialize (const MGLevelObject<MatrixType2> &matrices,
+ const MGLevelObject<DATA> &additional_data);
/**
* Initialize for single blocks of matrices. Of this block matrix, the block
* @p additional_data is an object of type @p PRECONDITIONER::AdditionalData
* and is handed to the initialization function of the relaxation method.
*/
- template <class MATRIX2, class DATA>
- void initialize (const MGLevelObject<MATRIX2> &matrices,
- const DATA &additional_data,
- const unsigned int block_row,
- const unsigned int block_col);
+ template <typename MatrixType2, class DATA>
+ void initialize (const MGLevelObject<MatrixType2> &matrices,
+ const DATA &additional_data,
+ const unsigned int block_row,
+ const unsigned int block_col);
/**
* Initialize for single blocks of matrices. Of this block matrix, the block
* @p additional_data is an object of type @p PRECONDITIONER::AdditionalData
* and is handed to the initialization function of the relaxation method.
*/
- template <class MATRIX2, class DATA>
- void initialize (const MGLevelObject<MATRIX2> &matrices,
- const MGLevelObject<DATA> &additional_data,
- const unsigned int block_row,
- const unsigned int block_col);
+ template <typename MatrixType2, class DATA>
+ void initialize (const MGLevelObject<MatrixType2> &matrices,
+ const MGLevelObject<DATA> &additional_data,
+ const unsigned int block_row,
+ const unsigned int block_col);
/**
* Empty all vectors.
/**
* Pointer to the matrices.
*/
- MGLevelObject<PointerMatrix<MATRIX, VectorType> > matrices;
+ MGLevelObject<PointerMatrix<MatrixType, VectorType> > matrices;
};
template <typename VectorType>
inline
-MGSmoother<VectorType>::MGSmoother(
- const unsigned int steps,
- const bool variable,
- const bool symmetric,
- const bool transpose)
+MGSmoother<VectorType>::MGSmoother (const unsigned int steps,
+ const bool variable,
+ const bool symmetric,
+ const bool transpose)
:
steps(steps),
variable(variable),
{
template <class RELAX, typename VectorType>
inline
- SmootherRelaxation<RELAX, VectorType>::SmootherRelaxation(
- const unsigned int steps,
- const bool variable,
- const bool symmetric,
- const bool transpose)
+ SmootherRelaxation<RELAX, VectorType>::SmootherRelaxation
+ (const unsigned int steps,
+ const bool variable,
+ const bool symmetric,
+ const bool transpose)
: MGSmoother<VectorType>(steps, variable, symmetric, transpose)
{}
template <class RELAX, typename VectorType>
- template <class MATRIX2>
+ template <typename MatrixType2>
inline void
- SmootherRelaxation<RELAX, VectorType>::initialize (
- const MGLevelObject<MATRIX2> &m,
- const typename RELAX::AdditionalData &data)
+ SmootherRelaxation<RELAX, VectorType>::initialize
+ (const MGLevelObject<MatrixType2> &m,
+ const typename RELAX::AdditionalData &data)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
template <class RELAX, typename VectorType>
- template <class MATRIX2, class DATA>
+ template <typename MatrixType2, class DATA>
inline void
- SmootherRelaxation<RELAX, VectorType>::initialize (
- const MGLevelObject<MATRIX2> &m,
- const MGLevelObject<DATA> &data)
+ SmootherRelaxation<RELAX, VectorType>::initialize
+ (const MGLevelObject<MatrixType2> &m,
+ const MGLevelObject<DATA> &data)
{
const unsigned int min = std::max(m.min_level(), data.min_level());
const unsigned int max = std::min(m.max_level(), data.max_level());
//----------------------------------------------------------------------//
-template <class MATRIX, class RELAX, typename VectorType>
+template <typename MatrixType, class RELAX, typename VectorType>
inline
-MGSmootherRelaxation<MATRIX, RELAX, VectorType>::MGSmootherRelaxation(
- const unsigned int steps,
- const bool variable,
- const bool symmetric,
- const bool transpose)
+MGSmootherRelaxation<MatrixType, RELAX, VectorType>::MGSmootherRelaxation
+(const unsigned int steps,
+ const bool variable,
+ const bool symmetric,
+ const bool transpose)
:
MGSmoother<VectorType>(steps, variable, symmetric, transpose)
{}
-template <class MATRIX, class RELAX, typename VectorType>
+template <typename MatrixType, class RELAX, typename VectorType>
inline void
-MGSmootherRelaxation<MATRIX, RELAX, VectorType>::clear ()
+MGSmootherRelaxation<MatrixType, RELAX, VectorType>::clear ()
{
smoothers.clear();
}
-template <class MATRIX, class RELAX, typename VectorType>
-template <class MATRIX2>
+template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType2>
inline void
-MGSmootherRelaxation<MATRIX, RELAX, VectorType>::initialize (
- const MGLevelObject<MATRIX2> &m,
- const typename RELAX::AdditionalData &data)
+MGSmootherRelaxation<MatrixType, RELAX, VectorType>::initialize
+(const MGLevelObject<MatrixType2> &m,
+ const typename RELAX::AdditionalData &data)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
}
}
-template <class MATRIX, class RELAX, typename VectorType>
-template <class MATRIX2, class DATA>
+template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType2, class DATA>
inline void
-MGSmootherRelaxation<MATRIX, RELAX, VectorType>::initialize (
- const MGLevelObject<MATRIX2> &m,
- const MGLevelObject<DATA> &data)
+MGSmootherRelaxation<MatrixType, RELAX, VectorType>::initialize
+(const MGLevelObject<MatrixType2> &m,
+ const MGLevelObject<DATA> &data)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
}
}
-template <class MATRIX, class RELAX, typename VectorType>
-template <class MATRIX2, class DATA>
+template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType2, class DATA>
inline void
-MGSmootherRelaxation<MATRIX, RELAX, VectorType>::initialize (
- const MGLevelObject<MATRIX2> &m,
- const DATA &data,
- const unsigned int row,
- const unsigned int col)
+MGSmootherRelaxation<MatrixType, RELAX, VectorType>::initialize
+(const MGLevelObject<MatrixType2> &m,
+ const DATA &data,
+ const unsigned int row,
+ const unsigned int col)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
}
}
-template <class MATRIX, class RELAX, typename VectorType>
-template <class MATRIX2, class DATA>
+template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType2, class DATA>
inline void
-MGSmootherRelaxation<MATRIX, RELAX, VectorType>::initialize (
- const MGLevelObject<MATRIX2> &m,
- const MGLevelObject<DATA> &data,
- const unsigned int row,
- const unsigned int col)
+MGSmootherRelaxation<MatrixType, RELAX, VectorType>::initialize
+(const MGLevelObject<MatrixType2> &m,
+ const MGLevelObject<DATA> &data,
+ const unsigned int row,
+ const unsigned int col)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
}
-template <class MATRIX, class RELAX, typename VectorType>
+template <typename MatrixType, class RELAX, typename VectorType>
inline void
-MGSmootherRelaxation<MATRIX, RELAX, VectorType>::smooth (const unsigned int level,
- VectorType &u,
- const VectorType &rhs) const
+MGSmootherRelaxation<MatrixType, RELAX, VectorType>::smooth (const unsigned int level,
+ VectorType &u,
+ const VectorType &rhs) const
{
unsigned int maxlevel = smoothers.max_level();
unsigned int steps2 = this->steps;
-template <class MATRIX, class RELAX, typename VectorType>
+template <typename MatrixType, class RELAX, typename VectorType>
inline
std::size_t
-MGSmootherRelaxation<MATRIX, RELAX, VectorType>::
+MGSmootherRelaxation<MatrixType, RELAX, VectorType>::
memory_consumption () const
{
return sizeof(*this)
//----------------------------------------------------------------------//
-template <class MATRIX, class PRECONDITIONER, typename VectorType>
+template <typename MatrixType, class PRECONDITIONER, typename VectorType>
inline
-MGSmootherPrecondition<MATRIX, PRECONDITIONER, VectorType>::MGSmootherPrecondition(
- const unsigned int steps,
- const bool variable,
- const bool symmetric,
- const bool transpose)
+MGSmootherPrecondition<MatrixType, PRECONDITIONER, VectorType>::MGSmootherPrecondition
+(const unsigned int steps,
+ const bool variable,
+ const bool symmetric,
+ const bool transpose)
:
MGSmoother<VectorType>(steps, variable, symmetric, transpose)
{}
-template <class MATRIX, class PRECONDITIONER, typename VectorType>
+template <typename MatrixType, class PRECONDITIONER, typename VectorType>
inline void
-MGSmootherPrecondition<MATRIX, PRECONDITIONER, VectorType>::clear ()
+MGSmootherPrecondition<MatrixType, PRECONDITIONER, VectorType>::clear ()
{
smoothers.clear();
-template <class MATRIX, class PRECONDITIONER, typename VectorType>
-template <class MATRIX2>
+template <typename MatrixType, class PRECONDITIONER, typename VectorType>
+template <typename MatrixType2>
inline void
-MGSmootherPrecondition<MATRIX, PRECONDITIONER, VectorType>::initialize (
- const MGLevelObject<MATRIX2> &m,
- const typename PRECONDITIONER::AdditionalData &data)
+MGSmootherPrecondition<MatrixType, PRECONDITIONER, VectorType>::initialize
+(const MGLevelObject<MatrixType2> &m,
+ const typename PRECONDITIONER::AdditionalData &data)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
-template <class MATRIX, class PRECONDITIONER, typename VectorType>
-template <class MATRIX2, class DATA>
+template <typename MatrixType, class PRECONDITIONER, typename VectorType>
+template <typename MatrixType2, class DATA>
inline void
-MGSmootherPrecondition<MATRIX, PRECONDITIONER, VectorType>::initialize (
- const MGLevelObject<MATRIX2> &m,
- const MGLevelObject<DATA> &data)
+MGSmootherPrecondition<MatrixType, PRECONDITIONER, VectorType>::initialize
+(const MGLevelObject<MatrixType2> &m,
+ const MGLevelObject<DATA> &data)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
-template <class MATRIX, class PRECONDITIONER, typename VectorType>
-template <class MATRIX2, class DATA>
+template <typename MatrixType, class PRECONDITIONER, typename VectorType>
+template <typename MatrixType2, class DATA>
inline void
-MGSmootherPrecondition<MATRIX, PRECONDITIONER, VectorType>::initialize (
- const MGLevelObject<MATRIX2> &m,
- const DATA &data,
- const unsigned int row,
- const unsigned int col)
+MGSmootherPrecondition<MatrixType, PRECONDITIONER, VectorType>::initialize
+(const MGLevelObject<MatrixType2> &m,
+ const DATA &data,
+ const unsigned int row,
+ const unsigned int col)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
-template <class MATRIX, class PRECONDITIONER, typename VectorType>
-template <class MATRIX2, class DATA>
+template <typename MatrixType, class PRECONDITIONER, typename VectorType>
+template <typename MatrixType2, class DATA>
inline void
-MGSmootherPrecondition<MATRIX, PRECONDITIONER, VectorType>::initialize (
- const MGLevelObject<MATRIX2> &m,
- const MGLevelObject<DATA> &data,
- const unsigned int row,
- const unsigned int col)
+MGSmootherPrecondition<MatrixType, PRECONDITIONER, VectorType>::initialize
+(const MGLevelObject<MatrixType2> &m,
+ const MGLevelObject<DATA> &data,
+ const unsigned int row,
+ const unsigned int col)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
-template <class MATRIX, class PRECONDITIONER, typename VectorType>
+template <typename MatrixType, class PRECONDITIONER, typename VectorType>
inline void
-MGSmootherPrecondition<MATRIX, PRECONDITIONER, VectorType>::smooth
+MGSmootherPrecondition<MatrixType, PRECONDITIONER, VectorType>::smooth
(const unsigned int level,
VectorType &u,
const VectorType &rhs) const
-template <class MATRIX, class PRECONDITIONER, typename VectorType>
+template <typename MatrixType, class PRECONDITIONER, typename VectorType>
inline
std::size_t
-MGSmootherPrecondition<MATRIX, PRECONDITIONER, VectorType>::
+MGSmootherPrecondition<MatrixType, PRECONDITIONER, VectorType>::
memory_consumption () const
{
return sizeof(*this)