]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fixed bug in mapping q eulerian
authorheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 18 May 2011 12:46:00 +0000 (12:46 +0000)
committerheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 18 May 2011 12:46:00 +0000 (12:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@23720 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/fe/mapping_q.cc
deal.II/source/fe/mapping_q1.cc

index 2c275637bc41f3f81f6761f7a11a7b5ceab5249a..526bd86f83c0ed9d9f6f6a928ecae6850390ba04 100644 (file)
@@ -1355,7 +1355,13 @@ transform_unit_to_real_cell (const typename Triangulation<dim,spacedim>::cell_it
                &*mdata);
 
   compute_mapping_support_points(cell, p_data->mapping_support_points);
-
+                                  // If this should be Q1, ignore all
+                                  // other support points.
+  if(p_data->shape_values.size()<p_data->mapping_support_points.size())
+    p_data->mapping_support_points.resize
+      (GeometryInfo<dim>::vertices_per_cell);
+  
+  
   return this->transform_unit_to_real_cell_internal(*p_data);
 }
 
@@ -1389,6 +1395,12 @@ transform_real_to_unit_cell (const typename Triangulation<dim,spacedim>::cell_it
 
       std::vector<Point<spacedim> > &points = mdata->mapping_support_points;
       compute_mapping_support_points (cell, points);
+                                      // If this is a q1 mapping,
+                                      // then only use the support
+                                      // points on the vertices.
+      if(mdata->shape_values.size()<points.size())
+       points.resize(GeometryInfo<dim>::vertices_per_cell);
+      
 
       this->transform_real_to_unit_cell_internal(cell, p, *mdata, p_unit);
     }
index bacf60448eca7723a6ff6e71a23aa578887c7e3c..bd7010fbc6823c0f33d2ea84bd30e721372a57f4 100644 (file)
@@ -1459,6 +1459,15 @@ MappingQ1<dim,spacedim>::transform_unit_to_real_cell (
                                   // points
   compute_mapping_support_points(cell, mdata->mapping_support_points);
 
+                                  // Mapping support points can be
+                                  // bigger than necessary. If this
+                                  // is the case, force them to be
+                                  // Q1.
+  if(mdata->mapping_support_points.size() > mdata->shape_values.size())
+    mdata->mapping_support_points.resize
+      (GeometryInfo<dim>::vertices_per_cell);
+  
+
   return transform_unit_to_real_cell_internal(*mdata);
 }
 
@@ -1509,14 +1518,15 @@ transform_real_to_unit_cell (const typename Triangulation<dim,spacedim>::cell_it
                                              | update_transformation_gradients,
                                              point_quadrature)));
 
-  MappingQ1<dim,spacedim>::compute_mapping_support_points (cell,
-                                                          mdata->mapping_support_points);
-
-// compute_mapping_support_points (cell, mdata->mapping_support_points);
-  
-  Assert(mdata->mapping_support_points.size() ==
-         GeometryInfo<dim>::vertices_per_cell,
+  compute_mapping_support_points (cell, mdata->mapping_support_points);
+                                  // The support points have to be at
+                                  // least as many as there are
+                                  // vertices.
+  Assert(mdata->mapping_support_points.size() >=
+        GeometryInfo<dim>::vertices_per_cell,
         ExcInternalError());
+                                  // Ignore non vertex support points.
+  mdata->mapping_support_points.resize(GeometryInfo<dim>::vertices_per_cell);
 
                                   // perform the newton iteration.
   transform_real_to_unit_cell_internal(cell, p, *mdata, p_unit);

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.