From 8dfd01dbbc6afd3306b11f86e89a9a3a62ba8ae0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 18 Sep 2015 11:13:10 -0500 Subject: [PATCH] Simplify code. --- source/fe/mapping_q1.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/source/fe/mapping_q1.cc b/source/fe/mapping_q1.cc index cf3bd3935c..7e7edcd9ef 100644 --- a/source/fe/mapping_q1.cc +++ b/source/fe/mapping_q1.cc @@ -407,15 +407,18 @@ transform_real_to_unit_cell (const typename Triangulation::cell_it // of the cell std::vector > a; this->compute_mapping_support_points (cell,a); - Point initial_p_unit = - transform_real_to_unit_cell_initial_guess(a,p); + Assert(a.size() == GeometryInfo::vertices_per_cell, + ExcInternalError()); // if dim==1 there is nothing else to do to the initial value, and // it is the answer if (dim == 1) - return initial_p_unit; + return transform_real_to_unit_cell_initial_guess(a,p); else { + const Point initial_p_unit = + transform_real_to_unit_cell_initial_guess(a,p); + // use the full mapping. in case the function above should have // given us something back that lies outside the unit cell (that // might happen because either the function computing an initial @@ -436,11 +439,7 @@ transform_real_to_unit_cell (const typename Triangulation::cell_it std_cxx11::unique_ptr::InternalData> mdata (this->get_data(update_flags, point_quadrature)); - - this->compute_mapping_support_points (cell, mdata->mapping_support_points); - Assert(mdata->mapping_support_points.size() == - GeometryInfo::vertices_per_cell, - ExcInternalError()); + mdata->mapping_support_points = a; // perform the Newton iteration and // return the result. note that this -- 2.39.5