From 42f346d0dc39187935b7fc2e49abfc158de1dc9b Mon Sep 17 00:00:00 2001 From: Simon Sticko Date: Tue, 28 Apr 2020 16:33:43 +0200 Subject: [PATCH] Implement hessian and laplacian on ConstantFunction. --- include/deal.II/base/function.h | 8 ++++++++ include/deal.II/base/function.templates.h | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) 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 //--------------------------------------------------------------------------- -- 2.39.5