From: Martin Kronbichler Date: Tue, 7 Nov 2017 08:24:52 +0000 (+0100) Subject: Use get_intermediate_point after merging directions. X-Git-Tag: v9.0.0-rc1~793^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5408%2Fhead;p=dealii.git Use get_intermediate_point after merging directions. --- diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index 7c7325e231..44a0a1c503 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -461,6 +461,22 @@ get_new_point (const ArrayView> &vertices, const unsigned int n_merged_points = directions.size(); + // check if we only have two points now, in which case we can use the + // get_intermediate_point function + if (n_merged_points == 2) + { + SphericalManifold<3,3> unit_manifold; + Assert(std::abs(merged_weights[0] + merged_weights[1] - 1.0) < 1e-13, + ExcMessage("Weights do not sum up to 1")); + Point<3> intermediate = unit_manifold.get_intermediate_point + (Point<3>(directions[0]), Point<3>(directions[1]), merged_weights[1]); + // copy back to spacedim-point + Point p; + for (unsigned int d=0; d vPerp; Tensor<2,2> Hessian; Tensor<1,2> gradient;