]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Merge from mainline.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 25 Sep 2012 12:52:56 +0000 (12:52 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 25 Sep 2012 12:52:56 +0000 (12:52 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_higher_derivatives@26720 0785d39b-7218-0410-832d-ea1e28bc413d

14 files changed:
1  2 
deal.II/doc/news/changes.h
deal.II/include/deal.II/fe/fe.h
deal.II/include/deal.II/fe/fe_poly.h
deal.II/include/deal.II/fe/fe_poly.templates.h
deal.II/include/deal.II/fe/fe_poly_face.h
deal.II/include/deal.II/fe/fe_poly_face.templates.h
deal.II/include/deal.II/fe/fe_poly_tensor.h
deal.II/include/deal.II/fe/fe_system.h
deal.II/include/deal.II/fe/fe_values.h
deal.II/source/fe/fe.cc
deal.II/source/fe/fe_dgp_nonparametric.cc
deal.II/source/fe/fe_poly_tensor.cc
deal.II/source/fe/fe_system.cc
deal.II/source/fe/fe_values.cc

Simple merge
index de47dcf476dc8d453f2e0dbcad2d7d4bab06b8af,62bf4a2db65cc9267796d79ade0fe66441fca07c..1ab2d2e649b422d1750fcc6662b1b93f55c27bb7
  #include <deal.II/base/config.h>
  #include <deal.II/base/geometry_info.h>
  #include <deal.II/fe/fe_base.h>
+ #include <deal.II/fe/fe_values_extractors.h>
+ #include <deal.II/fe/component_mask.h>
+ #include <deal.II/fe/block_mask.h>
  
 +#include <boost/any.hpp>
 +
  
  DEAL_II_NAMESPACE_OPEN
  
Simple merge
index 69e9bde9d67fe0c8f2433b9e3faa6e8129a247a0,1f43711b02eebafde82c0b880ab26ba534e28bbd..e0c51ce64ac91f8d5a8e9083b19676b2977a98a4
@@@ -5023,112 -4719,6 +4811,81 @@@ FEValuesBase<dim,spacedim>::shape_2nd_d
  
  
  
-                                      // otherwise, use the mapping
-                                      // between shape function numbers
-                                      // and rows. note that by the
-                                      // assertions above, we know that
-                                      // this particular shape function
-                                      // is primitive, so there is no
-                                      // question to which vector
-                                      // component the call of this
-                                      // function refers
-     return this->shape_nth_derivatives[nth_derivative][this->shape_function_to_row_table[i]][j];
 +template <int dim, int spacedim>
 +inline
 +const boost::any &
 +FEValuesBase<dim,spacedim>::shape_nth_derivative (const unsigned int i,
 +                                           const unsigned int j,
 +                                           const unsigned int nth_derivative) const
 +{
 +  Assert (i < fe->dofs_per_cell,
 +          ExcIndexRange (i, 0, fe->dofs_per_cell));
 +  Assert (this->update_flags & update_nth_derivatives(nth_derivative),
 +          ExcAccessToUninitializedField());
 +  Assert (fe->is_primitive (i),
 +          ExcShapeFunctionNotPrimitive(i));
 +  Assert (nth_derivative<this->shape_nth_derivatives.size(),
 +          ExcIndexRange (nth_derivative, 0, this->shape_nth_derivatives.size()));
 +  Assert (i<this->shape_nth_derivatives[nth_derivative].size(),
 +          ExcIndexRange (i, 0, this->shape_nth_derivatives[nth_derivative].size()));
 +  Assert (j<this->shape_nth_derivatives[nth_derivative][0].size(),
 +          ExcIndexRange (j, 0, this->shape_nth_derivatives[nth_derivative][0].size()));
 +
 +                                   // if the entire FE is primitive,
 +                                   // then we can take a short-cut:
 +  if (fe->is_primitive())
 +    return this->shape_nth_derivatives[nth_derivative][i][j];
 +  else
-                                    // if this particular shape
-                                    // function is primitive, then we
-                                    // can take a short-cut by checking
-                                    // whether the requested component
-                                    // is the only non-zero one (note
-                                    // that calling
-                                    // system_to_component_table only
-                                    // works if the shape function is
-                                    // primitive):
-   if (fe->is_primitive(i))
-     {
-       if (component == fe->system_to_component_index(i).first)
-         return this->shape_nth_derivatives[nth_derivative][this->shape_function_to_row_table[i]][j];
-       else
-         return boost::any ();
-     }
-   else
-     {
-                                        // no, this shape function is
-                                        // not primitive. then we have
-                                        // to loop over its components
-                                        // to find the corresponding
-                                        // row in the arrays of this
-                                        // object. before that check
-                                        // whether the shape function
-                                        // is non-zero at all within
-                                        // this component:
-       if (fe->get_nonzero_components(i)[component] == false)
-         return boost::any ();
-                                        // count how many non-zero
-                                        // component the shape function
-                                        // has before the one we are
-                                        // looking for, and add this to
-                                        // the offset of the first
-                                        // non-zero component of this
-                                        // shape function in the arrays
-                                        // we index presently:
-       const unsigned int
-         row = (this->shape_function_to_row_table[i]
-                +
-                std::count (fe->get_nonzero_components(i).begin(),
-                            fe->get_nonzero_components(i).begin()+component,
-                            true));
-       return this->shape_nth_derivatives[nth_derivative][row][j];
-     }
++    {
++                                     // otherwise, use the mapping
++                                     // between shape function
++                                     // numbers and rows. note that
++                                     // by the assertions above, we
++                                     // know that this particular
++                                     // shape function is primitive,
++                                     // so we can call
++                                     // system_to_component_index
++      const unsigned int
++      row = this->shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first];
++      return this->shape_nth_derivatives[nth_derivative][row][j];
++    }
 +}
 +
 +
 +
 +
 +template <int dim, int spacedim>
 +inline
 +boost::any
 +FEValuesBase<dim,spacedim>::shape_nth_derivative_component (const unsigned int i,
 +                                                     const unsigned int j,
 +                                                     const unsigned int component,
 +                                                     const unsigned int nth_derivative) const
 +{
 +  Assert (i < fe->dofs_per_cell,
 +          ExcIndexRange (i, 0, fe->dofs_per_cell));
 +  Assert (this->update_flags & update_nth_derivatives(nth_derivative),
 +          ExcAccessToUninitializedField());
 +  Assert (component < fe->n_components(),
 +          ExcIndexRange(component, 0, fe->n_components()));
 +
++                                 // check whether the shape function
++                                 // is non-zero at all within
++                                 // this component:
++  if (fe->get_nonzero_components(i)[component] == false)
++    return boost::any();
++
++                                 // look up the right row in the
++                                 // table and take the data from
++                                 // there
++  const unsigned int
++    row = this->shape_function_to_row_table[i * fe->n_components() + component];
++  return this->shape_nth_derivatives[nth_derivative][row][j];
 +}
 +
 +
 +
 +
  template <int dim, int spacedim>
  inline
  const FiniteElement<dim,spacedim> &
Simple merge
index 0d428a0b77be1b03ab053294b190c7c3d8a6ffed,9e717442a3a945f62bd035ddcdb386dcae96567e..79b1bfae893002777de31bbd59a998c81ff3f761
@@@ -545,7 -395,9 +545,8 @@@ FE_PolyTensor<POLY,dim,spacedim>::fill_
  
    for (unsigned int i=0; i<this->dofs_per_cell; ++i)
      {
-       const unsigned int first = data.shape_function_to_row_table[i];
+       const unsigned int first = data.shape_function_to_row_table[i * this->n_components() +
+                                                                               this->get_nonzero_components(i).first_selected_component()];
 -
        if (flags & update_values && cell_similarity != CellSimilarity::translation)
          switch (mapping_type)
            {
Simple merge
Simple merge

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.