]> https://gitweb.dealii.org/ - dealii.git/commitdiff
copy function unchanged from header
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 30 Mar 2006 15:02:59 +0000 (15:02 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 30 Mar 2006 15:02:59 +0000 (15:02 +0000)
git-svn-id: https://svn.dealii.org/trunk@12774 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe.cc

index 6e217055eb2e88a25e1f81b0f1a330ee510fff13..f07aab84be1573494f2842d953ee5e23c8d4c391 100644 (file)
@@ -319,6 +319,23 @@ FiniteElement<dim>::get_prolongation_matrix (const unsigned int child) const
 }
 
 
+template <int dim>  
+unsigned int
+FiniteElement<dim>::component_to_block_index (const unsigned int index) const
+{
+  Assert (index < this->n_components(),
+         ExcIndexRange(index, 0, this->n_components()));
+                                  // The block is computed simply as
+                                  // first block of this base plus
+                                  // the index within the base blocks
+  const std::pair<unsigned int, unsigned int>
+    base = component_to_base_index(index);
+                                  // Integer division used on purpose!
+  const unsigned int block_in_base = base.second / base_element(base.first).n_components();
+  return first_block_of_base(base.first) + block_in_base;
+}
+
+
 template <int dim>
 bool
 FiniteElement<dim>::prolongation_is_implemented () const

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.