From: Guido Kanschat Date: Wed, 11 Jun 2014 16:53:43 +0000 (+0000) Subject: add access to system element X-Git-Tag: v8.2.0-rc1~406 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da004cf985944105ac732a9779db295cca6eba7f;p=dealii.git add access to system element git-svn-id: https://svn.dealii.org/trunk@33032 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/meshworker/integration_info.h b/deal.II/include/deal.II/meshworker/integration_info.h index a120eced0f..0350e5deb4 100644 --- a/deal.II/include/deal.II/meshworker/integration_info.h +++ b/deal.II/include/deal.II/meshworker/integration_info.h @@ -132,22 +132,26 @@ namespace MeshWorker */ void clear(); + /** + * Return a reference to the FiniteElement that was used to + * initialize this object. + */ + const FiniteElement& finite_element() const; + /// This is true if we are assembling for multigrid bool multigrid; /// Access to finite element /** - * This is the access function being used, if the constructor for - * a single element was used. It throws an exception, if applied - * to a vector of elements. + * This is the access function being used, if initialize() for a + * single element was used (without the BlockInfo argument). It + * throws an exception, if applied to a vector of elements. */ const FEValuesBase &fe_values () const; /// Access to finite elements /** - * This access function must be used if the constructor for a - * group of elements was used. - * - * @see DGBlockSplitApplication + * This access function must be used if the initalize() for a + * group of elements was used (with a valid BlockInfo object). */ const FEValuesBase &fe_values (const unsigned int i) const; @@ -206,6 +210,11 @@ namespace MeshWorker std::size_t memory_consumption () const; private: + /** + * The pointer to the (system) element used for initialization. + */ + SmartPointer, IntegrationInfo > fe_pointer; + /** * Use the finite element functions in #global_data and fill the * vectors #values, #gradients and #hessians with values according @@ -579,6 +588,7 @@ namespace MeshWorker gradients(other.gradients), hessians(other.hessians), global_data(other.global_data), + fe_pointer(other.fe_pointer), n_components(other.n_components) { fevalv.resize(other.fevalv.size()); @@ -616,6 +626,7 @@ namespace MeshWorker const UpdateFlags flags, const BlockInfo *block_info) { + fe_pointer = ⪙ if (block_info == 0 || block_info->local().size() == 0) { fevalv.resize(1); @@ -635,6 +646,14 @@ namespace MeshWorker } + template + inline const FiniteElement & + IntegrationInfo::finite_element() const + { + Assert (fe_pointer !=0, ExcNotInitialized()); + return *fe_pointer; + } + template inline const FEValuesBase & IntegrationInfo::fe_values() const