From: kanschat Date: Mon, 28 Sep 2009 17:47:20 +0000 (+0000) Subject: add access functions for base elements X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2fec7470e7fef0dfecb920496a7050e394bf11a;p=dealii-svn.git add access functions for base elements git-svn-id: https://svn.dealii.org/trunk@19582 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/dofs/block_info.h b/deal.II/deal.II/include/dofs/block_info.h index 93e1a3c861..d8bb24f533 100644 --- a/deal.II/deal.II/include/dofs/block_info.h +++ b/deal.II/deal.II/include/dofs/block_info.h @@ -112,6 +112,18 @@ class BlockInfo : public Subscriptor * numbering of DoFAccessor. */ unsigned int renumber (unsigned int i) const; + + /** + * The number of base elements. + */ + unsigned int n_base_elements() const; + + /** + * Return the base element of + * this index. + */ + unsigned int base_element(unsigned int i) const; + private: /** * @brief The block structure @@ -133,7 +145,7 @@ class BlockInfo : public Subscriptor * The base element associated * with each block. */ - std::vector base_element; + std::vector base_elements; /** * A vector containing the @@ -184,6 +196,25 @@ unsigned int BlockInfo::renumber(unsigned int i) const } +inline +unsigned int +BlockInfo::base_element(unsigned int i) const +{ + AssertIndexRange(i, base_elements.size()); + + return base_elements[i]; +} + + +inline +unsigned int +BlockInfo::n_base_elements() const +{ + return base_elements.size(); +} + + + DEAL_II_NAMESPACE_CLOSE #endif diff --git a/deal.II/deal.II/source/dofs/block_info.cc b/deal.II/deal.II/source/dofs/block_info.cc index 212de36fae..60cb4ab05f 100644 --- a/deal.II/deal.II/source/dofs/block_info.cc +++ b/deal.II/deal.II/source/dofs/block_info.cc @@ -41,10 +41,10 @@ BlockInfo::initialize_local(const DoFHandler& dof) const FiniteElement& fe = dof.get_fe(); std::vector sizes(fe.n_blocks()); - base_element.resize(fe.n_blocks()); + base_elements.resize(fe.n_blocks()); - for (unsigned int i=0;i