]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add access functions for base elements
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 28 Sep 2009 17:47:20 +0000 (17:47 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 28 Sep 2009 17:47:20 +0000 (17:47 +0000)
git-svn-id: https://svn.dealii.org/trunk@19582 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/block_info.h
deal.II/deal.II/source/dofs/block_info.cc

index 93e1a3c861ee249a9d0fbb553c9301d9a4b49429..d8bb24f53314025cca250897a25f12c444fb7697 100644 (file)
@@ -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<unsigned int> base_element;
+    std::vector<unsigned int> 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
index 212de36faee4f253bcf4134f17acfcdd8af2a76b..60cb4ab05f6f6724778b8a4e877a1a0a06e936d3 100644 (file)
@@ -41,10 +41,10 @@ BlockInfo::initialize_local(const DoFHandler<dim, spacedim>& dof)
   const FiniteElement<dim, spacedim>& fe = dof.get_fe();
   std::vector<unsigned int> sizes(fe.n_blocks());
 
-  base_element.resize(fe.n_blocks());
+  base_elements.resize(fe.n_blocks());
   
-  for (unsigned int i=0;i<base_element.size();++i)
-    base_element[i] = fe.block_to_base_index(i).first;
+  for (unsigned int i=0;i<base_elements.size();++i)
+    base_elements[i] = fe.block_to_base_index(i).first;
   
   local_renumbering.resize(fe.n_dofs_per_cell());
   FETools::compute_block_renumbering(fe,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.