From aa909894217b0a3d6e9397f1d4cb6c3465f23760 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 15 Nov 2016 18:06:50 -0700 Subject: [PATCH] Do compute the locations of vertices of patches also if no data is attached. 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 | 84 ++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/source/numerics/data_out.cc b/source/numerics/data_out.cc index a8d71d9f67..516b096519 100644 --- a/source/numerics/data_out.cc +++ b/source/numerics/data_out.cc @@ -83,54 +83,54 @@ build_one_patch (cell_and_index->first, GeometryInfo::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 &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 dimfirst->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 &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 dimfirst->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 > &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 > &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 0) + { // counter for data records unsigned int offset=0; -- 2.39.5