From: heltai Date: Wed, 18 May 2011 12:46:00 +0000 (+0000) Subject: Fixed bug in mapping q eulerian X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=027293c4309f90ce3253024197108e700c0f77ca;p=dealii-svn.git Fixed bug in mapping q eulerian git-svn-id: https://svn.dealii.org/trunk@23720 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/fe/mapping_q.cc b/deal.II/source/fe/mapping_q.cc index 2c275637bc..526bd86f83 100644 --- a/deal.II/source/fe/mapping_q.cc +++ b/deal.II/source/fe/mapping_q.cc @@ -1355,7 +1355,13 @@ transform_unit_to_real_cell (const typename Triangulation::cell_it &*mdata); compute_mapping_support_points(cell, p_data->mapping_support_points); - + // If this should be Q1, ignore all + // other support points. + if(p_data->shape_values.size()mapping_support_points.size()) + p_data->mapping_support_points.resize + (GeometryInfo::vertices_per_cell); + + return this->transform_unit_to_real_cell_internal(*p_data); } @@ -1389,6 +1395,12 @@ transform_real_to_unit_cell (const typename Triangulation::cell_it std::vector > &points = mdata->mapping_support_points; compute_mapping_support_points (cell, points); + // If this is a q1 mapping, + // then only use the support + // points on the vertices. + if(mdata->shape_values.size()::vertices_per_cell); + this->transform_real_to_unit_cell_internal(cell, p, *mdata, p_unit); } diff --git a/deal.II/source/fe/mapping_q1.cc b/deal.II/source/fe/mapping_q1.cc index bacf60448e..bd7010fbc6 100644 --- a/deal.II/source/fe/mapping_q1.cc +++ b/deal.II/source/fe/mapping_q1.cc @@ -1459,6 +1459,15 @@ MappingQ1::transform_unit_to_real_cell ( // points compute_mapping_support_points(cell, mdata->mapping_support_points); + // Mapping support points can be + // bigger than necessary. If this + // is the case, force them to be + // Q1. + if(mdata->mapping_support_points.size() > mdata->shape_values.size()) + mdata->mapping_support_points.resize + (GeometryInfo::vertices_per_cell); + + return transform_unit_to_real_cell_internal(*mdata); } @@ -1509,14 +1518,15 @@ transform_real_to_unit_cell (const typename Triangulation::cell_it | update_transformation_gradients, point_quadrature))); - MappingQ1::compute_mapping_support_points (cell, - mdata->mapping_support_points); - -// compute_mapping_support_points (cell, mdata->mapping_support_points); - - Assert(mdata->mapping_support_points.size() == - GeometryInfo::vertices_per_cell, + compute_mapping_support_points (cell, mdata->mapping_support_points); + // The support points have to be at + // least as many as there are + // vertices. + Assert(mdata->mapping_support_points.size() >= + GeometryInfo::vertices_per_cell, ExcInternalError()); + // Ignore non vertex support points. + mdata->mapping_support_points.resize(GeometryInfo::vertices_per_cell); // perform the newton iteration. transform_real_to_unit_cell_internal(cell, p, *mdata, p_unit);