]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
interpolation matrices in FE_Q, starting FE_DGQ
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 29 Jan 2001 11:32:51 +0000 (11:32 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 29 Jan 2001 11:32:51 +0000 (11:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@3818 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/full_matrix.h
deal.II/lac/include/lac/full_matrix.templates.h

index 19c9b94fd65f039b9f34d79e496bb97eed115a0b..ed0150ecbaff509145762bc8f4d1cebce9a525c9 100644 (file)
@@ -19,6 +19,7 @@
 #include <base/exceptions.h>
 #include <base/subscriptor.h>
 
+#include <vector>
 
 // forward declarations
 template<typename number> 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<typename number2>
+    void fill_permutation (const FullMatrix<number2> &src,
+              const std::vector<unsigned int>& p_rows,
+              const std::vector<unsigned int>& p_cols);
+    
+
                                      /**
                                      * Fill matrix with an array of numbers.
                                      * The array is arranged line by line. No
index 53aea79ee2860a15d7d5b1d0fecccea17b69d929..58bf9e8eca0cd6ea87841749f0f81ff6922df7b1 100644 (file)
@@ -457,6 +457,24 @@ void FullMatrix<number>::fill (const FullMatrix<number2>& src,
 }
 
 
+template <typename number>
+template <typename number2>
+void FullMatrix<number>::fill_permutation (const FullMatrix<number2> &src,
+                                          const std::vector<unsigned int>& p_rows,
+                                          const std::vector<unsigned int>& 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<dim_image;++i)
+    for (unsigned int j=0;j<dim_range;++j)
+      el(i,j) = src(p_rows[i], p_cols[j]);
+}
+
+
+
 template <typename number>
 template <typename number2>
 void FullMatrix<number>::fill (const number2* entries)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.