From c9a5a9e0d942d80dc9a2d3444e9901df9d167d06 Mon Sep 17 00:00:00 2001 From: David Wells Date: Wed, 18 Aug 2021 16:07:59 -0400 Subject: [PATCH] Use Mapping::get_vertices(). This is much faster for MappingFEField and about the same for other mapping classes. --- source/numerics/data_out.cc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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; -- 2.39.5