From: wolf Date: Wed, 10 May 2000 09:09:29 +0000 (+0000) Subject: Getting support points from system elements resulted in an exception. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=496418538b2b1822ce7e11ce7f708ffa3db9592b;p=dealii-svn.git Getting support points from system elements resulted in an exception. git-svn-id: https://svn.dealii.org/trunk@2828 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/fe/fe_system.cc b/deal.II/deal.II/source/fe/fe_system.cc index 7ea6db0b15..e20955631c 100644 --- a/deal.II/deal.II/source/fe/fe_system.cc +++ b/deal.II/deal.II/source/fe/fe_system.cc @@ -986,25 +986,39 @@ FESystem::fill_fe_values (const DoFHandler::cell_iterator &cell, const FullMatrix &shape_values_transform, const vector > > &shape_grad_transform) const { - vector > supp(base_elements[0].first->dofs_per_cell); + // if we are to compute the support + // points, then we need to get them + // from each base element. the + // following variable is used as + // temporary + vector > supp(compute_support_points ? + base_elements[0].first->dofs_per_cell : + 0); base_elements[0].first->fill_fe_values (cell, unit_points, jacobians, compute_jacobians, jacobians_grad, compute_jacobians_grad, - support_points, compute_support_points, + supp, compute_support_points, q_points, compute_q_points, shape_values_transform, shape_grad_transform); if (compute_support_points) { - unsigned component = 0; - - for (unsigned m=0 ; m < element_multiplicity(0) ; ++ m) + // for the first base element, we + // have obtained the support + // points above already + unsigned int component = 0; + for (unsigned int m=0 ; m < element_multiplicity(0) ; ++ m) { - for (unsigned i=0 ; i < base_element(0).dofs_per_cell ; ++i) + for (unsigned int i=0 ; i < base_element(0).dofs_per_cell ; ++i) support_points[component_to_system_index(component,i)] = supp[i]; ++component; } - for (unsigned base=1 ; base < n_base_elements() ; ++base) + + // if there are more base + // elements, we still have to + // get the support points from + // them + for (unsigned int base=1 ; base < n_base_elements() ; ++base) { supp.resize(base_elements[base].first->dofs_per_cell); base_elements[base].first->fill_fe_values (cell, unit_points, jacobians, false, @@ -1013,9 +1027,9 @@ FESystem::fill_fe_values (const DoFHandler::cell_iterator &cell, q_points, false, shape_values_transform, shape_grad_transform); - for (unsigned m=0 ; m < element_multiplicity(base) ; ++ m) + for (unsigned int m=0 ; m < element_multiplicity(base) ; ++ m) { - for (unsigned i=0 ; i < base_element(base).dofs_per_cell ; ++i) + for (unsigned int i=0 ; i < base_element(base).dofs_per_cell ; ++i) support_points[component_to_system_index(component,i)] = supp[i]; ++component; }