]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
create_interpolation_matrix ok
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 10 Sep 1998 16:12:13 +0000 (16:12 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 10 Sep 1998 16:12:13 +0000 (16:12 +0000)
interpolation for vectors

git-svn-id: https://svn.dealii.org/trunk@604 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/matrices.cc
deal.II/deal.II/source/numerics/vectors.cc

index 425f34dae94f239cdd13e24a1a506f70a4c91c26..dd8c5c0177bc00efffb122edae7605432c7ba052 100644 (file)
@@ -804,14 +804,14 @@ MatrixCreator<dim>::create_interpolation_matrix(const FiniteElement<dim> &high,
                                                const FiniteElement<dim> &low,
                                                dFMatrix& result)
 {
-  result.reinit (high.total_dofs, low.total_dofs);
+  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);
   
-  for (unsigned int i=0; i<high.total_dofs; ++i)
-    for (unsigned int j=0; j<low.total_dofs; ++j)
-      result(i,j) = low.shape_value (j, unit_support_points[i]);
+  for (unsigned int i=0; i<low.total_dofs; ++i)
+    for (unsigned int j=0; j<high.total_dofs; ++j)
+      result(i,j) = high.shape_value (j, unit_support_points[i]);
 }
 
 
index d59d097e2add773902be7813b460d15c84018060..76f09c5c7f36a6c5f854ec7c892523c750bf0d62 100644 (file)
@@ -77,7 +77,18 @@ VectorTools<dim>::interpolate(const DoFHandler<dim>    &high_dof,
                         const dVector            &high,
                         dVector                  &low)
 {
+  dVector cell_high(high_dof.get_fe().total_dofs);
+  dVector cell_low(low_dof.get_fe().total_dofs);
   
+  DoFHandler<dim>::active_cell_iterator h = high_dof.begin_active();
+  DoFHandler<dim>::active_cell_iterator l = low_dof.begin_active();
+  
+  for(; h != high_dof.end(); ++h, ++l)
+  {
+    h->get_dof_values(high, cell_high);
+    transfer.vmult(cell_low, cell_high);
+    l->distribute_local_to_global(cell_low, low);
+  }
 }
 
 #if deal_II_dimension == 1

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.