]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
create_interpolation_matrix repaired
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 3 Nov 1999 23:58:46 +0000 (23:58 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 3 Nov 1999 23:58:46 +0000 (23:58 +0000)
git-svn-id: https://svn.dealii.org/trunk@1823 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/matrices.h
deal.II/deal.II/source/numerics/matrices.cc

index 0b84b55ab613e48a2bc32578f368953e372bbd1f..695163e894ac7818d773baad3b370a0d60d13859 100644 (file)
@@ -312,9 +312,17 @@ class MatrixCreator
                                       const Function<dim>      *a = 0);
 
                                     /**
-                                     * Build Lagrange interpolation
-                                     * matrix of different finite
+                                     * Lagrange interpolation
+                                     * matrix for different
                                      * elements.
+                                     *
+                                     * This function builds a matrix
+                                     * $A$ such that a function
+                                     * $u_{high}$ is interpolated to
+                                     * a function of lower order
+                                     * $u_{low}$ by cell-wise
+                                     * multiplication
+                                     * $u_{low} = A u_{high}$.
                                      */
     static void create_interpolation_matrix(const FiniteElement<dim> &high,
                                            const FiniteElement<dim> &low,
index c409fc3dfcf902fd8f485b0bdb751b0a1f471aaf..c1fd12114753231d2bb2e0c84544abeca5597776 100644 (file)
@@ -993,9 +993,10 @@ void LaplaceMatrix<dim>::assemble (Vector<double>      &rhs,
                weights[point];
 };
 
+//TODO: check correctness of this function and use FEValues
 
-
-template<int dim> void
+template<int dim>
+void
 MatrixCreator<dim>::create_interpolation_matrix(const FiniteElement<dim> &high,
                                                const FiniteElement<dim> &low,
                                                FullMatrix<double>& result)
@@ -1005,16 +1006,27 @@ MatrixCreator<dim>::create_interpolation_matrix(const FiniteElement<dim> &high,
   
   result.reinit (low.total_dofs, high.total_dofs);
 
-  vector<Point<dim> > unit_support_points (high.total_dofs);
-  high.get_unit_support_points (unit_support_points);
+                                  // Initialize FEValues at the support points
+                                  // of the low element.
+  vector<double> phantom_weights(low.total_dofs,1.);
+  vector<Point<dim> > support_points(low.total_dofs);
+  low.get_unit_support_points(support_points);
+  Quadrature<dim> low_points(support_points,
+                            phantom_weights);
+
+  FEValues<dim> fe(high, low_points, UpdateFlags(0));
   
+//TODO: This could be less inefficient by going component by component
+//TODO: Does it work for multi-component?
+
   for (unsigned int i=0; i<low.total_dofs; ++i)
     for (unsigned int j=0; j<high.total_dofs; ++j)
                                       // shape functions need to belong
                                       // to the same component
       if (low.system_to_component_index(i).first ==
          high.system_to_component_index(j).first)
-       result(i,j) = high.shape_value (j, unit_support_points[i]);
+// This is Id at the moment
+       result(i,j) = fe.shape_value(j,i);
 }
 
 

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.