From: wolf Date: Mon, 10 Sep 2001 09:05:31 +0000 (+0000) Subject: Introduce a variable that denotes the finite difference step length in X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f117f429caff987314d8ce8f0fc9c1b670b97364;p=dealii-svn.git Introduce a variable that denotes the finite difference step length in the computation of the second derivatives. git-svn-id: https://svn.dealii.org/trunk@4952 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_base.h b/deal.II/deal.II/include/fe/fe_base.h index f84c4f2064..f3935c6aa8 100644 --- a/deal.II/deal.II/include/fe/fe_base.h +++ b/deal.II/deal.II/include/fe/fe_base.h @@ -960,6 +960,21 @@ class FiniteElementBase : public Subscriptor, typename Mapping::InternalDataBase &mapping_internal, InternalDataBase &fe_internal, FEValuesData &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 diff --git a/deal.II/deal.II/source/fe/fe.cc b/deal.II/deal.II/source/fe/fe.cc index 8b16e29b7a..d77a428651 100644 --- a/deal.II/deal.II/source/fe/fe.cc +++ b/deal.II/deal.II/source/fe/fe.cc @@ -31,6 +31,10 @@ using namespace std; /*------------------------------- FiniteElementBase ----------------------*/ +template +const double FiniteElementBase::fd_step_length = 1.0e-6; + + template void FiniteElementBase:: @@ -58,8 +62,7 @@ InternalDataBase::initialize_2nd (const FiniteElement *element, for (unsigned int d=0; d 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 &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