]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fixed problem with 2nd derivatives on faces
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 28 Apr 2006 18:56:16 +0000 (18:56 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 28 Apr 2006 18:56:16 +0000 (18:56 +0000)
git-svn-id: https://svn.dealii.org/trunk@12935 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe.cc
deal.II/doc/news/changes.html

index 29f656b918d4808342b0842e70c919de40f2e561..59081535efb3eabe68137c249e70f1a54230a658 100644 (file)
@@ -684,15 +684,14 @@ FiniteElement<dim>::memory_consumption () const
 
 template <int dim>
 void
-FiniteElement<dim>::
-compute_2nd (const Mapping<dim>                   &mapping,
-            const typename Triangulation<dim>::cell_iterator &cell,
-            const unsigned int,
-            typename Mapping<dim>::InternalDataBase &mapping_internal,
-            InternalDataBase                     &fe_internal,
-            FEValuesData<dim>                    &data) const
-{
-//TODO[GK]: This function presently has a flaw: it ignores the offset parameter. This means that if it is called for faces or subfaces, it computes the data for _all_ faces or subfaces, even though we only need to have this for one of them. given that computing second derivatives is expensive, this is significant. What should be done is to honor the offset parameter and of course only compute what we actually need
+FiniteElement<dim>::compute_2nd (
+  const Mapping<dim>                   &mapping,
+  const typename Triangulation<dim>::cell_iterator &cell,
+  const unsigned int offset,
+  typename Mapping<dim>::InternalDataBase &mapping_internal,
+  InternalDataBase                     &fe_internal,
+  FEValuesData<dim>                    &data) const
+{
   Assert ((fe_internal.update_each | fe_internal.update_once)
          & update_second_derivatives,
          ExcInternalError());
@@ -713,6 +712,9 @@ compute_2nd (const Mapping<dim>                   &mapping,
     {
       fe_internal.differences[d]->reinit(cell);
       fe_internal.differences[d+dim]->reinit(cell);
+      Assert(offset <= fe_internal.differences[d]->n_quadrature_points - n_q_points,
+            ExcIndexRange(offset, 0, fe_internal.differences[d]->n_quadrature_points
+                          - n_q_points));
     }
 
                                   // collection of difference
@@ -752,8 +754,8 @@ compute_2nd (const Mapping<dim>                   &mapping,
               Tensor<1,dim> right, left;
               if (is_primitive(shape_index))
                 {
-                  right = fe_internal.differences[d1]->shape_grad(shape_index, q);
-                  left  = fe_internal.differences[d1+dim]->shape_grad(shape_index, q);
+                  right = fe_internal.differences[d1]->shape_grad(shape_index, q+offset);
+                  left  = fe_internal.differences[d1+dim]->shape_grad(shape_index, q+offset);
                 }
               else
                 {
@@ -789,9 +791,9 @@ compute_2nd (const Mapping<dim>                   &mapping,
                           ExcInternalError());
 
                   right = fe_internal.differences[d1]
-                          ->shape_grad_component(shape_index, q, component);
+                          ->shape_grad_component(shape_index, q+offset, component);
                   left  = fe_internal.differences[d1+dim]
-                          ->shape_grad_component(shape_index, q, component);
+                          ->shape_grad_component(shape_index, q+offset, component);
                 };
               
                                                // compute the second
index 6fc545e3ac2c13fea1aa7dd9658d0e1c7c579eb0..9c4dc4d6626575b3baa67b173dfb0e30d38cdad2 100644 (file)
@@ -635,6 +635,13 @@ inconvenience this causes.
 <h3>deal.II</h3>
 
 <ol>
+  
+  <li> <p> Fixed: second derivatives where not computed correctly in <code
+  class="class">FEFaceValuesBase</code>.
+  <br>
+  (GK 2006/04/28)
+  </p>
+
   <li> <p>
        New: The functions <code>Triangulation::clear_user_flags_line</code>,
        <code>Triangulation::clear_user_flags_quad</code>, and

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.