From: Wolfgang Bangerth Date: Fri, 18 Oct 2019 05:49:27 +0000 (-0600) Subject: More minor updates. X-Git-Tag: v9.2.0-rc1~973^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8923%2Fhead;p=dealii.git More minor updates. --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index b824ba3192..efad61ecbd 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -438,14 +438,9 @@ namespace GridTools // loop over quadrature points for (unsigned int q = 0; q < quadrature.size(); ++q) { - Tensor<2, dim, double> jacobian = + const Tensor<2, dim, double> jacobian = Tensor<2, dim, double>(fe_values.jacobian(q)); - LAPACKFullMatrix J = LAPACKFullMatrix(dim); - for (unsigned int i = 0; i < dim; i++) - for (unsigned int j = 0; j < dim; j++) - J(i, j) = jacobian[i][j]; - // We intentionally do not want to throw an exception in case of // inverted elements since this is not the task of this // function. Instead, inf is written into the vector in case of @@ -456,12 +451,22 @@ namespace GridTools } else { + LAPACKFullMatrix J = LAPACKFullMatrix(dim); + for (unsigned int i = 0; i < dim; i++) + for (unsigned int j = 0; j < dim; j++) + J(i, j) = jacobian[i][j]; + J.compute_svd(); double const max_sv = J.singular_value(0); double const min_sv = J.singular_value(dim - 1); double const ar = max_sv / min_sv; + // Take the max between the previous and the current + // aspect ratio value; if we had previously encountered + // an inverted cell, we will have placed an infinity + // in the aspect_ratio_cell variable, and that value + // will survive this max operation. aspect_ratio_cell = std::max(aspect_ratio_cell, ar); } } @@ -474,6 +479,8 @@ namespace GridTools return aspect_ratio_vector; } + + template double compute_maximum_aspect_ratio(const Triangulation &triangulation, @@ -489,6 +496,7 @@ namespace GridTools } + template BoundingBox compute_bounding_box(const Triangulation &tria)