const Point<spacedim> &position,
const Mapping<dim, spacedim> &mapping)
{
- const auto vertices = mapping.get_vertices(cell);
- double minimum_distance = position.distance_square(vertices[0]);
- unsigned int closest_vertex = 0;
+ const auto vertices = mapping.get_vertices(cell);
+ double minimum_distance = position.distance_square(vertices[0]);
+ unsigned int closest_vertex = 0;
+ const unsigned int n_vertices = cell->n_vertices();
- for (unsigned int v = 1; v < cell->n_vertices(); ++v)
+ for (unsigned int v = 1; v < n_vertices; ++v)
{
const double vertex_distance = position.distance_square(vertices[v]);
if (vertex_distance < minimum_distance)
std::pair<Point<spacedim>, Point<spacedim>> boundary_points =
std::make_pair(this->vertex(0), this->vertex(0));
- for (unsigned int v = 1; v < this->n_vertices(); ++v)
+ const unsigned int n_vertices = this->n_vertices();
+ for (unsigned int v = 1; v < n_vertices; ++v)
{
- const Point<spacedim> &x = this->vertex(v);
+ const Point<spacedim> x = this->vertex(v);
for (unsigned int k = 0; k < spacedim; ++k)
{
boundary_points.first[k] = std::min(boundary_points.first[k], x[k]);