From: Simon Sticko Date: Tue, 28 Apr 2020 14:33:43 +0000 (+0200) Subject: Implement hessian and laplacian on ConstantFunction. X-Git-Tag: v9.2.0-rc1~164^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42f346d0dc39187935b7fc2e49abfc158de1dc9b;p=dealii.git Implement hessian and laplacian on ConstantFunction. --- diff --git a/include/deal.II/base/function.h b/include/deal.II/base/function.h index 0bdf1c1027..b16d95a494 100644 --- a/include/deal.II/base/function.h +++ b/include/deal.II/base/function.h @@ -477,6 +477,14 @@ namespace Functions std::vector>> &gradients) const override; + virtual SymmetricTensor<2, dim, RangeNumberType> + hessian(const Point & point, + const unsigned int component = 0) const override; + + virtual RangeNumberType + laplacian(const Point & point, + const unsigned int component = 0) const override; + std::size_t memory_consumption() const; diff --git a/include/deal.II/base/function.templates.h b/include/deal.II/base/function.templates.h index 747ba3fe41..56cd3469b2 100644 --- a/include/deal.II/base/function.templates.h +++ b/include/deal.II/base/function.templates.h @@ -512,6 +512,24 @@ namespace Functions } + + template + SymmetricTensor<2, dim, RangeNumberType> + ConstantFunction::hessian(const Point &, + const unsigned int) const + { + return SymmetricTensor<2, dim, RangeNumberType>(); + } + + + + template + RangeNumberType + ConstantFunction::laplacian(const Point &, + const unsigned int) const + { + return 0; + } } // namespace Functions //---------------------------------------------------------------------------