From fa1e84c2c031579487efade046cedf73b61ca17f Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 10 May 2000 09:11:11 +0000 Subject: [PATCH] Getting support points from system elements resulted in an exception. git-svn-id: https://svn.dealii.org/branches/Branch-3-0@2829 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/fe/fe_system.cc | 36 ++++++++++++++++++-------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/deal.II/deal.II/source/fe/fe_system.cc b/deal.II/deal.II/source/fe/fe_system.cc index 2bac4eaa73..e20955631c 100644 --- a/deal.II/deal.II/source/fe/fe_system.cc +++ b/deal.II/deal.II/source/fe/fe_system.cc @@ -489,7 +489,7 @@ void FESystem::initialize () }; -// now set up the interface constraints. + // now set up the interface constraints. // this is kind'o hairy, so don't try // to do it dimension independent build_interface_constraints (); @@ -755,7 +755,7 @@ FESystem::shape_grad_grad (const unsigned int i, Assert((i comp = system_to_component_index(i); + pair comp = system_to_component_index(i); return base_element(component_to_base_table[comp.first]) .shape_grad_grad(comp.second, p); @@ -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; } -- 2.39.5