]> https://gitweb.dealii.org/ - dealii.git/commitdiff
new function for projection prepared
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 28 Nov 2003 11:51:13 +0000 (11:51 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 28 Nov 2003 11:51:13 +0000 (11:51 +0000)
git-svn-id: https://svn.dealii.org/trunk@8205 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_tools.h
deal.II/deal.II/source/fe/fe_tools.cc

index fac0190c82c6d812af8940ec722d8e44d829fba0..5e87a72e21b8611616e652dffddc28623ee68b28 100644 (file)
@@ -112,6 +112,12 @@ class FETools
                                        const FiniteElement<dim> &fe2,
                                        FullMatrix<number> &difference_matrix);
 
+    template <int dim, typename number>
+    static void get_projection_matrix(const FiniteElement<dim> &fe1,
+                                     const FiniteElement<dim> &fe2,
+                                     FullMatrix<number> &matrix);
+
+    
                                     /**
                                      * Gives the interpolation of a the
                                      * @p{dof1}-function @p{u1} to a
index 3214ad68c97c3c5562c8da326c053ccf863caed0..23b76f20e04423d8caf83603e62b507df724192e 100644 (file)
@@ -18,6 +18,7 @@
 #include <lac/block_vector.h>
 #include <grid/tria.h>
 #include <grid/tria_iterator.h>
+#include <grid/grid_generator.h>
 #include <fe/fe_tools.h>
 #include <fe/fe.h>
 #include <fe/fe_q.h>
@@ -310,6 +311,38 @@ void FETools::get_interpolation_difference_matrix (const FiniteElement<dim> &fe1
 }
 
 
+template <int dim, typename number>
+void FETools::get_projection_matrix (const FiniteElement<dim> &fe1,
+                                    const FiniteElement<dim> &fe2,
+                                    FullMatrix<number> &interpolation_matrix)
+{
+  Assert (fe1.n_components() == fe2.n_components(),
+         ExcDimensionMismatch(fe1.n_components(), fe2.n_components()));
+  Assert(interpolation_matrix.m()==fe2.dofs_per_cell &&
+        interpolation_matrix.n()==fe1.dofs_per_cell,
+        ExcMatrixDimensionMismatch(interpolation_matrix.m(),
+                                   interpolation_matrix.n(),
+                                   fe2.dofs_per_cell,
+                                   fe1.dofs_per_cell));
+  
+  unsigned int m = fe1.dofs_per_cell;
+  unsigned int n = fe2.dofs_per_cell;
+                                  // First, create a mass matrix. We
+                                  // cannot use MatrixTools, since we
+                                  // want to have a FullMatrix.
+                                  //
+                                  // This happens in the target space
+  FullMatrix<double> mass (n, n);
+  Triangulation<dim> tr;
+  GridGenerator::hyper_cube(tr);
+  DoFHandler<dim> dof;
+  dof.distribute_dofs(tr, fe2);
+  typename DoFHandler<dim>::active_cell_iterator cell = dof.begin();
+
+                                  // Set up FEValues. Here, we 
+}
+
+
 template <int dim, class InVector, class OutVector>
 void FETools::interpolate(const DoFHandler<dim> &dof1,
                          const InVector &u1,

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.