From: Guido Kanschat Date: Mon, 29 Jan 2001 11:32:51 +0000 (+0000) Subject: interpolation matrices in FE_Q, starting FE_DGQ X-Git-Tag: v8.0.0~19768 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bb55f33f8abaffb15f6974dafca8cd431e39769;p=dealii.git interpolation matrices in FE_Q, starting FE_DGQ git-svn-id: https://svn.dealii.org/trunk@3818 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/full_matrix.h b/deal.II/lac/include/lac/full_matrix.h index 19c9b94fd6..ed0150ecba 100644 --- a/deal.II/lac/include/lac/full_matrix.h +++ b/deal.II/lac/include/lac/full_matrix.h @@ -19,6 +19,7 @@ #include #include +#include // forward declarations template class Vector; @@ -157,6 +158,29 @@ class FullMatrix : public Subscriptor const unsigned int j=0); + /** + * Fill with permutation of another matrix. + * + * The matrix @p{src} is copied + * into the target. The two + * permutation @p{p_r} and + * @p{p_c} operate in a way, such + * that @{result(i,j) = + * src(p_r[i], p_c[j])}. + * + * The vectors may also be a + * selection from a larger set of + * integers, if the matrix + * @p{src} is bigger. It is also + * possible to duplicate rows or + * columns by this method. + */ + template + void fill_permutation (const FullMatrix &src, + const std::vector& p_rows, + const std::vector& p_cols); + + /** * Fill matrix with an array of numbers. * The array is arranged line by line. No diff --git a/deal.II/lac/include/lac/full_matrix.templates.h b/deal.II/lac/include/lac/full_matrix.templates.h index 53aea79ee2..58bf9e8eca 100644 --- a/deal.II/lac/include/lac/full_matrix.templates.h +++ b/deal.II/lac/include/lac/full_matrix.templates.h @@ -457,6 +457,24 @@ void FullMatrix::fill (const FullMatrix& src, } +template +template +void FullMatrix::fill_permutation (const FullMatrix &src, + const std::vector& p_rows, + const std::vector& p_cols) +{ + Assert (p_rows.size() == dim_image, + ExcDimensionMismatch (p_rows.size(), dim_image)); + Assert (p_cols.size() == dim_range, + ExcDimensionMismatch (p_cols.size(), dim_range)); + + for (unsigned int i=0;i template void FullMatrix::fill (const number2* entries)