]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use GeometryInfo<dim>::child_to_cell_coordinates function instead of implementing...
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 17 May 2005 17:39:00 +0000 (17:39 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 17 May 2005 17:39:00 +0000 (17:39 +0000)
git-svn-id: https://svn.dealii.org/trunk@10688 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/quadrature.cc

index d2dc06cc1b948d789ccfdec519ebf4f8a8f4bebc..e54823a257a861da6d2c38497eea393f5727e0dd 100644 (file)
@@ -832,39 +832,12 @@ QProjector<dim>::project_to_child (const Quadrature<dim>    &quadrature,
   Assert (child_no < GeometryInfo<dim>::children_per_cell,
          ExcIndexRange (child_no, 0, GeometryInfo<dim>::children_per_cell));
   
-  const unsigned int n_q_points = quadrature.n_quadrature_points;  
-    
-                                  // projection is simple: copy over
-                                  // old points, scale them, and if
-                                  // necessary shift them
-  std::vector<Point<dim> > q_points = quadrature.get_points ();
-  for (unsigned int i=0; i<n_q_points; ++i)
-    q_points[i] /= 2;
-
-  switch (dim)
-    {
-      case 1:
-      {
-       if (child_no == 1)
-         for (unsigned int i=0; i<n_q_points; ++i)
-           q_points[i][0] += 0.5;
-       break;
-      };
+  const unsigned int n_q_points = quadrature.n_quadrature_points;
 
-      case 2:
-      {
-       if ((child_no == 1) || (child_no == 2))
-         for (unsigned int i=0; i<n_q_points; ++i)
-           q_points[i][0] += 0.5;
-       if ((child_no == 2) || (child_no == 3))
-         for (unsigned int i=0; i<n_q_points; ++i)
-           q_points[i][1] += 0.5;
-       break;
-      };
-
-      default:
-           Assert (false, ExcNotImplemented());
-    };
+  std::vector<Point<dim> > q_points(n_q_points);
+  for (unsigned int i=0; i<n_q_points; ++i)
+    q_points[i]=GeometryInfo<dim>::child_to_cell_coordinates(
+      quadrature.point(i), child_no);
 
                                   // for the weights, things are
                                   // equally simple: copy them and

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.