From 4f53a2f629b542c62a7e38f27614c5af155c7127 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 9 Mar 2001 14:20:41 +0000 Subject: [PATCH] Update flags in get_data ok git-svn-id: https://svn.dealii.org/trunk@4181 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/fe/fe_system.cc | 30 +++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/deal.II/deal.II/source/fe/fe_system.cc b/deal.II/deal.II/source/fe/fe_system.cc index f9a2e3f9ec..26289a5af6 100644 --- a/deal.II/deal.II/source/fe/fe_system.cc +++ b/deal.II/deal.II/source/fe/fe_system.cc @@ -27,6 +27,7 @@ using namespace std; #endif +//TODO: Remove obsolete data->compute_second_derivatives /* ----------------------- FESystem::InternalData ------------------- */ @@ -229,6 +230,7 @@ FESystem::clone() const } +//TODO: remove update_second_derivatives from base elements template UpdateFlags @@ -272,12 +274,18 @@ FESystem::update_each (const UpdateFlags flags) const template Mapping::InternalDataBase* -FESystem::get_data (UpdateFlags flags, +FESystem::get_data (UpdateFlags flags, const Mapping &mapping, const Quadrature &quadrature) const { InternalData* data = new InternalData(n_base_elements()); + data->update_once = update_once (flags); + data->update_each = update_each (flags); + flags = data->update_once | data->update_each; + + UpdateFlags sub_flags = flags; + // if second derivatives through // finite differencing is required, // then initialize some objects for @@ -288,7 +296,7 @@ FESystem::get_data (UpdateFlags flags, // delete // update_second_derivatives // from flags list - flags = UpdateFlags (flags ^ update_second_derivatives); + sub_flags = UpdateFlags (sub_flags ^ update_second_derivatives); data->initialize_2nd (this, mapping, quadrature); } @@ -298,7 +306,7 @@ FESystem::get_data (UpdateFlags flags, for (unsigned int base_no=0; base_no::InternalDataBase *base_fe_data_base = - base_element(base_no).get_data(flags, mapping, quadrature); + base_element(base_no).get_data(sub_flags, mapping, quadrature); FiniteElementBase::InternalDataBase *base_fe_data = dynamic_cast::InternalDataBase *> @@ -306,10 +314,13 @@ FESystem::get_data (UpdateFlags flags, data->set_fe_data(base_no, base_fe_data); - // collect requirements of base - // elements - data->update_once |= base_fe_data->update_once; - data->update_each |= base_fe_data->update_each; + // make sure that *we* compute + // second derivatives, base + // elements should not do it + Assert (!(base_fe_data->update_each & update_second_derivatives), + ExcInternalError()); + Assert (!(base_fe_data->update_once & update_second_derivatives), + ExcInternalError()); // The FEValuesData @p{data} // given to the @@ -339,12 +350,7 @@ FESystem::get_data (UpdateFlags flags, FEValuesData *base_data = new FEValuesData(); data->set_fe_values_data(base_no, base_data); } - if (data->compute_second_derivatives) - data->update_each |= update_each (update_second_derivatives); data->update_flags=data->update_once | data->update_each; - Assert(data->update_once==update_once(flags), ExcInternalError()); - Assert(data->update_each==update_each(flags), ExcInternalError()); - return data; } -- 2.39.5