From 641ba061e108ecb0a679c3e4a41a0c9a72bb412b Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 7 Mar 2017 18:24:50 +0100 Subject: [PATCH] Fix a bug in cell similarity detection with FESystem --- source/fe/fe_system.cc | 107 ++++++++++++------------ tests/numerics/create_mass_matrix_05.cc | 6 ++ 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index 652470e7e0..53b4a930ed 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -1206,61 +1206,62 @@ compute_fill (const Mapping &mapping, //TODO: Introduce the needed table and loop only over base element shape functions. This here is not efficient at all AND very bad style const UpdateFlags base_flags = base_fe_data.update_each; - // if the current cell is just a translation of the previous one, - // the underlying data has not changed, and we don't even need to - // enter this section - if (cell_similarity != CellSimilarity::translation) - for (unsigned int system_index=0; system_indexdofs_per_cell; - ++system_index) - if (this->system_to_base_table[system_index].first.first == base_no) - { - const unsigned int - base_index = this->system_to_base_table[system_index].second; - Assert (base_indexn_nonzero_components(i); - unsigned int in_index = 0; - for (unsigned int i=0; in_nonzero_components(system_index) == - base_fe.n_nonzero_components(base_index), - ExcInternalError()); + // some base element might involve values that depend on the shape + // of the geometry, so we always need to copy the shape values around + // also in case we detected a cell similarity (but no heavy work will + // be done inside the individual elements in case we have a + // translation and simple elements). + for (unsigned int system_index=0; system_indexdofs_per_cell; + ++system_index) + if (this->system_to_base_table[system_index].first.first == base_no) + { + const unsigned int + base_index = this->system_to_base_table[system_index].second; + Assert (base_indexn_nonzero_components(i); + unsigned int in_index = 0; + for (unsigned int i=0; in_nonzero_components(system_index) == + base_fe.n_nonzero_components(base_index), + ExcInternalError()); - if (base_flags & update_values) - for (unsigned int s=0; sn_nonzero_components(system_index); ++s) - for (unsigned int q=0; qn_nonzero_components(system_index); ++s) - for (unsigned int q=0; qn_nonzero_components(system_index); ++s) - for (unsigned int q=0; qn_nonzero_components(system_index); ++s) - for (unsigned int q=0; qn_nonzero_components(system_index); ++s) + for (unsigned int q=0; qn_nonzero_components(system_index); ++s) + for (unsigned int q=0; qn_nonzero_components(system_index); ++s) + for (unsigned int q=0; qn_nonzero_components(system_index); ++s) + for (unsigned int q=0; q (); deallog.pop (); -- 2.39.5