]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Relegate getting an initial guess to StaticMappingQ1.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 6 Sep 2015 23:26:09 +0000 (18:26 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 10 Sep 2015 19:36:44 +0000 (14:36 -0500)
source/fe/mapping_q.cc

index d1aeb6b850d89b7820cb4fc09234eba39fc9d32f..4447272c2b64d4e01733f181f2c6016e40c20b2a 100644 (file)
@@ -63,8 +63,17 @@ MappingQ<dim,spacedim>::MappingQ (const unsigned int degree,
           ((dim==2) ?
            4+4*(degree-1) :
            8+12*(degree-1)+6*(degree-1)*(degree-1))),
-  use_mapping_q_on_all_cells (use_mapping_q_on_all_cells
-                              || (dim != spacedim)),
+
+  // see whether we want to use *this* mapping objects on *all* cells,
+  // or defer to an explicit Q1 mapping on interior cells. if
+  // degree==1, then we are already that Q1 mapping, so we don't need
+  // it; if dim!=spacedim, there is also no need for anything because
+  // we're most likely on a curved manifold
+  use_mapping_q_on_all_cells (degree==1
+                              ||
+                              use_mapping_q_on_all_cells
+                              ||
+                              (dim != spacedim)),
   feq(degree),
   q1_mapping (this->use_mapping_q_on_all_cells
               ?
@@ -1028,7 +1037,7 @@ transform_real_to_unit_cell (const typename Triangulation<dim,spacedim>::cell_it
   try
     {
       initial_p_unit
-        = MappingQ1<dim,spacedim>::transform_real_to_unit_cell(cell, p);
+        = StaticMappingQ1<dim,spacedim>::mapping.transform_real_to_unit_cell(cell, p);
     }
   catch (const typename Mapping<dim,spacedim>::ExcTransformationFailed &)
     {

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.