]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Introduce a variable that denotes the finite difference step length in
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 10 Sep 2001 09:05:31 +0000 (09:05 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 10 Sep 2001 09:05:31 +0000 (09:05 +0000)
the computation of the second derivatives.

git-svn-id: https://svn.dealii.org/trunk@4952 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_base.h
deal.II/deal.II/source/fe/fe.cc

index f84c4f20641ff8887eac9a13837321c7afcbeda9..f3935c6aa857e9e79d00fb654c02750a84ae9a66 100644 (file)
@@ -960,6 +960,21 @@ class FiniteElementBase : public Subscriptor,
                      typename Mapping<dim>::InternalDataBase &mapping_internal,
                      InternalDataBase                        &fe_internal,
                      FEValuesData<dim>                       &data) const;
+
+  private:
+                                    /**
+                                     * Second derivatives of shapes
+                                     * functions are not computed
+                                     * analytically, but by finite
+                                     * differences of the
+                                     * gradients. This static
+                                     * variable denotes the step
+                                     * length to be used for
+                                     * that. It's value is set to
+                                     * 1e-6.
+                                     */
+    static const double fd_step_length;
+    
     
                                     /**
                                      * Allow the FESystem class to
index 8b16e29b7a8d39f6ea08c13313d4d7f82ed93814..d77a428651883d646cdcf11162a5a484c665225b 100644 (file)
@@ -31,6 +31,10 @@ using namespace std;
 /*------------------------------- FiniteElementBase ----------------------*/
 
 
+template <int dim>
+const double FiniteElementBase<dim>::fd_step_length = 1.0e-6;
+
+
 template <int dim>
 void
 FiniteElementBase<dim>::
@@ -58,8 +62,7 @@ InternalDataBase::initialize_2nd (const FiniteElement<dim> *element,
   for (unsigned int d=0; d<dim; ++d)
     {
       Point<dim> shift;
-//TODO:[GK] unify the places where the finite differencing step length is used      
-      shift (d) = 1.e-6;
+      shift (d) = fd_step_length;
 
                                       // generate points and FEValues
                                       // objects shifted in
@@ -374,13 +377,12 @@ compute_2nd (const Mapping<dim>                   &mapping,
            const Tensor<1,dim>& left
              = fe_internal.differences[d1+dim]->shape_grad(shape, q);
 
-//TODO:[GK] unify the places where the finite differencing step length is used      
                                             // compute the second
                                             // derivative from a
                                             // symmetric difference
                                             // approximation
            for (unsigned int d=0; d<dim; ++d)
-             diff_quot[d][q][d1] = 1./(2*1.e-6) * (right[d]-left[d]);
+             diff_quot[d][q][d1] = 1./(2*fd_step_length) * (right[d]-left[d]);
          }
 
                                       // up to now we still have

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.