From e34ccd3558c343603eabf432a0b9ade9aa145716 Mon Sep 17 00:00:00 2001 From: bangerth Date: Tue, 22 Aug 2006 19:59:26 +0000 Subject: [PATCH] Iterate until we have found the correct set of flags git-svn-id: https://svn.dealii.org/trunk@13721 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/fe/mapping_q1.cc | 66 +++++++++++++++---------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/deal.II/deal.II/source/fe/mapping_q1.cc b/deal.II/deal.II/source/fe/mapping_q1.cc index b5bafeccbf..83f6a877c1 100644 --- a/deal.II/deal.II/source/fe/mapping_q1.cc +++ b/deal.II/deal.II/source/fe/mapping_q1.cc @@ -253,34 +253,46 @@ MappingQ1::update_each (const UpdateFlags in) const | update_boundary_forms | update_normal_vectors)); - // The following is a little incorrect: - // If not applied on a face, - // update_boundary_forms does not - // make sense. On the other hand, - // it is necessary on a - // face. Currently, - // update_boundary_forms is simply - // ignored for the interior of a - // cell. - if (out & (update_JxW_values - |update_normal_vectors)) - out |= update_boundary_forms; + // add a few flags. note that some + // flags appear in both conditions + // and in subsequents set + // operations. this leads to some + // circular logic. the only way to + // treat this is to iterate. since + // there are 3 if-clauses in the + // loop, it will take at most 3 + // iterations to converge. do them: + for (unsigned int i=0; i<3; ++i) + { + // The following is a little incorrect: + // If not applied on a face, + // update_boundary_forms does not + // make sense. On the other hand, + // it is necessary on a + // face. Currently, + // update_boundary_forms is simply + // ignored for the interior of a + // cell. + if (out & (update_JxW_values + | update_normal_vectors)) + out |= update_boundary_forms; + + if (out & (update_covariant_transformation + | update_JxW_values + | update_boundary_forms + | update_normal_vectors)) + out |= update_contravariant_transformation; + + // The contravariant transformation + // is a Piola transformation, which + // requires the determinant of the + // Jacobi matrix of the transformation. + // Therefore these values have to + // updated for each cell. + if (out & update_contravariant_transformation) + out |= update_JxW_values | update_cell_JxW_values; + } - if (out & (update_covariant_transformation - | update_JxW_values - | update_boundary_forms - | update_normal_vectors)) - out |= update_contravariant_transformation; - - // The contravariant transformation - // is a Piola transformation, which - // requires the determinant of the - // Jacobi matrix of the transformation. - // Therefore these values have to - // updated for each cell. - if (out & update_contravariant_transformation) - out |= update_JxW_values | update_cell_JxW_values; - return out; } -- 2.39.5