]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Do compute the locations of vertices of patches also if no data is attached.
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 16 Nov 2016 01:06:50 +0000 (18:06 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 16 Nov 2016 01:06:50 +0000 (18:06 -0700)
Previously, higher order or Eulerian mappings were ignores if no data was attached to a DataOut object.
This seems wrong. Fix this by moving a piece of code before the check whether there is data.

source/numerics/data_out.cc

index a8d71d9f67108704ab5a340b9bf0693f3dcd3274..516b096519bd437a7a63f1a15f1d9717706ac81d 100644 (file)
@@ -83,54 +83,54 @@ build_one_patch
                                (cell_and_index->first,
                                 GeometryInfo<DoFHandlerType::dimension>::unit_cell_vertex (vertex));
 
-  if (scratch_data.n_datasets > 0)
+  // create DoFHandlerType::active_cell_iterator and initialize FEValues
+  scratch_data.reinit_all_fe_values(this->dof_data, cell_and_index->first);
+
+  const FEValuesBase<DoFHandlerType::dimension,DoFHandlerType::space_dimension> &fe_patch_values
+    = scratch_data.get_present_fe_values (0);
+
+  const unsigned int n_q_points = fe_patch_values.n_quadrature_points;
+
+  // depending on the requested output of curved cells, if necessary
+  // append the quadrature points to the last rows of the patch.data
+  // member. This is the case if we want to produce curved cells at the
+  // boundary and this cell actually is at the boundary, or else if we
+  // want to produce curved cells everywhere
+  //
+  // note: a cell is *always* at the boundary if dim<spacedim
+  if (curved_cell_region==curved_inner_cells
+      ||
+      (curved_cell_region==curved_boundary
+       &&
+       (cell_and_index->first->at_boundary()
+        ||
+        (DoFHandlerType::dimension != DoFHandlerType::space_dimension))))
     {
-      // create DoFHandlerType::active_cell_iterator and initialize FEValues
-      scratch_data.reinit_all_fe_values(this->dof_data, cell_and_index->first);
-
-      const FEValuesBase<DoFHandlerType::dimension,DoFHandlerType::space_dimension> &fe_patch_values
-        = scratch_data.get_present_fe_values (0);
-
-      const unsigned int n_q_points = fe_patch_values.n_quadrature_points;
-
-      // depending on the requested output of curved cells, if necessary
-      // append the quadrature points to the last rows of the patch.data
-      // member. This is the case if we want to produce curved cells at the
-      // boundary and this cell actually is at the boundary, or else if we
-      // want to produce curved cells everywhere
-      //
-      // note: a cell is *always* at the boundary if dim<spacedim
-      if (curved_cell_region==curved_inner_cells
-          ||
-          (curved_cell_region==curved_boundary
-           &&
-           (cell_and_index->first->at_boundary()
-            ||
-            (DoFHandlerType::dimension != DoFHandlerType::space_dimension))))
-        {
-          Assert(patch.space_dim==DoFHandlerType::space_dimension, ExcInternalError());
+      Assert(patch.space_dim==DoFHandlerType::space_dimension, ExcInternalError());
 
-          // set the flag indicating that for this cell the points are
-          // explicitly given
-          patch.points_are_available = true;
+      // set the flag indicating that for this cell the points are
+      // explicitly given
+      patch.points_are_available = true;
 
-          // then resize the patch.data member in order to have enough memory for
-          // the quadrature points as well, and copy the quadrature points there
-          const std::vector<Point<DoFHandlerType::space_dimension> > &q_points
-            = fe_patch_values.get_quadrature_points();
+      // then resize the patch.data member in order to have enough memory for
+      // the quadrature points as well, and copy the quadrature points there
+      const std::vector<Point<DoFHandlerType::space_dimension> > &q_points
+        = fe_patch_values.get_quadrature_points();
 
-          patch.data.reinit (scratch_data.n_datasets+DoFHandlerType::space_dimension, n_q_points);
-          for (unsigned int i=0; i<DoFHandlerType::space_dimension; ++i)
-            for (unsigned int q=0; q<n_q_points; ++q)
-              patch.data(patch.data.size(0)-DoFHandlerType::space_dimension+i,q) = q_points[q][i];
-        }
-      else
-        {
-          patch.data.reinit(scratch_data.n_datasets, n_q_points);
-          patch.points_are_available = false;
-        }
+      patch.data.reinit (scratch_data.n_datasets+DoFHandlerType::space_dimension, n_q_points);
+      for (unsigned int i=0; i<DoFHandlerType::space_dimension; ++i)
+        for (unsigned int q=0; q<n_q_points; ++q)
+          patch.data(patch.data.size(0)-DoFHandlerType::space_dimension+i,q) = q_points[q][i];
+    }
+  else
+    {
+      patch.data.reinit(scratch_data.n_datasets, n_q_points);
+      patch.points_are_available = false;
+    }
 
 
+  if (scratch_data.n_datasets > 0)
+    {
       // counter for data records
       unsigned int offset=0;
 

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.