]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move an internal function to the only class that now still uses it. 1568/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 10 Sep 2015 19:35:38 +0000 (14:35 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 10 Sep 2015 20:42:12 +0000 (15:42 -0500)
include/deal.II/fe/mapping_q_generic.h
source/fe/mapping_q1.cc
source/fe/mapping_q_generic.cc

index 5eae7b0f9e726e8d8756401bf2ad26672ffffb6f..f7b4ae5afdc726a0c9fdca6bcfc65d80d435fb62 100644 (file)
@@ -468,24 +468,6 @@ protected:
   compute_mapping_support_points (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
                                   std::vector<Point<spacedim> > &a) const = 0;
 
-  /**
-   * Transforms a point @p p on the unit cell to the point @p p_real on the
-   * real cell @p cell and returns @p p_real.
-   *
-   * This function is called by @p transform_unit_to_real_cell and multiple
-   * times (through the Newton iteration) by @p
-   * transform_real_to_unit_cell_internal.
-   *
-   * Takes a reference to an @p InternalData that must already include the
-   * shape values at point @p p and the mapping support points of the cell.
-   *
-   * This @p InternalData argument avoids multiple computations of the shape
-   * values at point @p p and especially multiple computations of the mapping
-   * support points.
-   */
-  Point<spacedim>
-  transform_unit_to_real_cell_internal (const InternalData &mdata) const;
-
   /**
    * Make MappingQ a friend since it needs to call the
    * fill_fe_values() functions on its MappingQ1 sub-object.
index f52b098027191c2b56280a05ae65a7b354ab1df4..e3671b7a6889d00c8fe7083b2d91fc6e2d6f0d59 100644 (file)
@@ -475,6 +475,40 @@ transform_real_to_unit_cell (const typename Triangulation<dim,spacedim>::cell_it
 }
 
 
+namespace
+{
+  /**
+   * Transforms a point @p p on the unit cell to the point @p p_real on the
+   * real cell @p cell and returns @p p_real.
+   *
+   * This function is called by @p transform_unit_to_real_cell and multiple
+   * times (through the Newton iteration) by @p
+   * transform_real_to_unit_cell_internal.
+   *
+   * Takes a reference to an @p InternalData that must already include the
+   * shape values at point @p p and the mapping support points of the cell.
+   *
+   * This @p InternalData argument avoids multiple computations of the shape
+   * values at point @p p and especially multiple computations of the mapping
+   * support points.
+   */
+  template<int dim, int spacedim>
+  Point<spacedim>
+  transform_unit_to_real_cell_internal (const typename MappingQ1<dim,spacedim>::InternalData &data)
+  {
+    AssertDimension (data.shape_values.size(),
+                     data.mapping_support_points.size());
+
+    // use now the InternalData to
+    // compute the point in real space.
+    Point<spacedim> p_real;
+    for (unsigned int i=0; i<data.mapping_support_points.size(); ++i)
+      p_real += data.mapping_support_points[i] * data.shape(0,i);
+
+    return p_real;
+  }
+}
+
 
 template<int dim, int spacedim>
 Point<dim>
@@ -508,7 +542,7 @@ transform_real_to_unit_cell_internal
 
   mdata.compute_shape_function_values(std::vector<Point<dim> > (1, p_unit));
 
-  Point<spacedim> p_real = transform_unit_to_real_cell_internal(mdata);
+  Point<spacedim> p_real = transform_unit_to_real_cell_internal<dim,spacedim>(mdata);
   Tensor<1,spacedim> f = p_real-p;
 
   // early out if we already have our point
@@ -597,7 +631,7 @@ transform_real_to_unit_cell_internal
           mdata.compute_shape_function_values(std::vector<Point<dim> > (1, p_unit_trial));
 
           // f(x)
-          Point<spacedim> p_real_trial = transform_unit_to_real_cell_internal(mdata);
+          Point<spacedim> p_real_trial = transform_unit_to_real_cell_internal<dim,spacedim>(mdata);
           const Tensor<1,spacedim> f_trial = p_real_trial-p;
 
 #ifdef DEBUG_TRANSFORM_REAL_TO_UNIT_CELL
@@ -753,7 +787,7 @@ transform_real_to_unit_cell_internal_codim1
     }
 
   p_minus_F = p;
-  p_minus_F -= transform_unit_to_real_cell_internal(mdata);
+  p_minus_F -= transform_unit_to_real_cell_internal<dim,spacedim>(mdata);
 
 
   for (unsigned int j=0; j<dim1; ++j)
@@ -808,7 +842,7 @@ transform_real_to_unit_cell_internal_codim1
 //TODO: implement a line search here in much the same way as for
 // the corresponding function above that does so for codim==0.
       p_minus_F = p;
-      p_minus_F -= transform_unit_to_real_cell_internal(mdata);
+      p_minus_F -= transform_unit_to_real_cell_internal<dim,spacedim>(mdata);
 
       for (unsigned int j=0; j<dim1; ++j)
         {
index 7b3cd001ed241af2ec3bfa52265744d31807d426..d37b6d71a53a6b60dbbc66d1e9e9feeafc82532a 100644 (file)
@@ -817,25 +817,6 @@ transform_unit_to_real_cell (const typename Triangulation<dim,spacedim>::cell_it
 
 
 
-template<int dim, int spacedim>
-Point<spacedim>
-MappingQGeneric<dim,spacedim>::
-transform_unit_to_real_cell_internal (const InternalData &data) const
-{
-  AssertDimension (data.shape_values.size(),
-                   data.mapping_support_points.size());
-
-  // use now the InternalData to
-  // compute the point in real space.
-  Point<spacedim> p_real;
-  for (unsigned int i=0; i<data.mapping_support_points.size(); ++i)
-    p_real += data.mapping_support_points[i] * data.shape(0,i);
-
-  return p_real;
-}
-
-
-
 template<int dim, int spacedim>
 UpdateFlags
 MappingQGeneric<dim,spacedim>::requires_update_flags (const UpdateFlags in) const

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.