From: David Wells Date: Wed, 18 Aug 2021 20:07:59 +0000 (-0400) Subject: Use Mapping::get_vertices(). X-Git-Tag: v9.4.0-rc1~1062^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9a5a9e0d942d80dc9a2d3444e9901df9d167d06;p=dealii.git Use Mapping::get_vertices(). This is much faster for MappingFEField and about the same for other mapping classes. --- diff --git a/source/numerics/data_out.cc b/source/numerics/data_out.cc index 11bb33f408..b874167f07 100644 --- a/source/numerics/data_out.cc +++ b/source/numerics/data_out.cc @@ -112,16 +112,9 @@ DataOut::build_one_patch( const FEValuesBase &fe_patch_values = scratch_data.get_present_fe_values(0); - // set the vertices of the patch. if the mapping does not preserve locations - // (e.g. MappingQEulerian), we need to compute the offset of the vertex for - // the graphical output. Otherwise, we can just use the vertex info. - for (const unsigned int vertex : cell_and_index->first->vertex_indices()) - if (scratch_data.mapping_collection[0].preserves_vertex_locations()) - patch.vertices[vertex] = cell_and_index->first->vertex(vertex); - else - patch.vertices[vertex] = - fe_patch_values.get_mapping().transform_unit_to_real_cell( - cell_and_index->first, GeometryInfo::unit_cell_vertex(vertex)); + const auto vertices = + fe_patch_values.get_mapping().get_vertices(cell_and_index->first); + std::copy(vertices.begin(), vertices.end(), std::begin(patch.vertices)); const unsigned int n_q_points = fe_patch_values.n_quadrature_points;