From: hartmann Date: Wed, 14 Jul 1999 12:39:17 +0000 (+0000) Subject: fix a bug that occured while using the vectorial interpolate function with continuous FEs X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=862d920916d18449f189cb545188c4f45fa3f101;p=dealii-svn.git fix a bug that occured while using the vectorial interpolate function with continuous FEs git-svn-id: https://svn.dealii.org/trunk@1574 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/numerics/vectors.cc b/deal.II/deal.II/source/numerics/vectors.cc index a196449e76..b9e379829e 100644 --- a/deal.II/deal.II/source/numerics/vectors.cc +++ b/deal.II/deal.II/source/numerics/vectors.cc @@ -194,12 +194,14 @@ void VectorTools::interpolate (const DoFHandler &dof, // the following vector collects all dofs i, // 0<=i dofs_of_rep_points; // the following table converts a dof i - // to the dof of the representative - // point. - vector dof_to_rep_dof_table; + // to the rep index. + vector dof_to_rep_index_table; unsigned int n_rep_points=0; for (unsigned int i=0; i::interpolate (const DoFHandler &dof, if (unit_support_points[i] == unit_support_points[dofs_of_rep_points[j-1]]) { - dof_to_rep_dof_table.push_back(j-1); + dof_to_rep_index_table.push_back(j-1); representative=false; break; } if (representative) { + // rep_index=dofs_of_rep_points.size() + dof_to_rep_index_table.push_back(dofs_of_rep_points.size()); + // dofs_of_rep_points[rep_index]=i dofs_of_rep_points.push_back(i); - dof_to_rep_dof_table.push_back(i); ++n_rep_points; } } Assert(dofs_of_rep_points.size()==n_rep_points, ExcInternalError()); - Assert(dof_to_rep_dof_table.size()==fe.total_dofs, ExcInternalError()); + Assert(dof_to_rep_index_table.size()==fe.total_dofs, ExcInternalError()); cout << "n_rep_points=" << n_rep_points << endl; @@ -262,7 +266,7 @@ void VectorTools::interpolate (const DoFHandler &dof, { const unsigned int component = fe.system_to_component_index(i).first; - const unsigned int rep_dof=dof_to_rep_dof_table[i]; + const unsigned int rep_dof=dof_to_rep_index_table[i]; vec(dofs_on_cell[i]) = function_values_at_rep_points[rep_dof](component); } @@ -941,7 +945,7 @@ VectorTools::integrate_difference (const DoFHandler &dof, case H1_norm: { const unsigned int n_q_points = q.n_quadrature_points; - vector > psi (n_q_points); + vector > psi (n_q_points, Vector(fe.n_components)); // first compute the exact solution // (vectors) at the quadrature points