]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement hessian and laplacian on ConstantFunction. 9979/head
authorSimon Sticko <simon@sticko.se>
Tue, 28 Apr 2020 14:33:43 +0000 (16:33 +0200)
committerSimon Sticko <simon@sticko.se>
Tue, 28 Apr 2020 16:50:45 +0000 (18:50 +0200)
include/deal.II/base/function.h
include/deal.II/base/function.templates.h

index 0bdf1c10276b80c6f12b4c5d6037708ec97aa4f5..b16d95a4943eff0732d0b221ca432083d12d5b1e 100644 (file)
@@ -477,6 +477,14 @@ namespace Functions
       std::vector<std::vector<Tensor<1, dim, RangeNumberType>>> &gradients)
       const override;
 
+    virtual SymmetricTensor<2, dim, RangeNumberType>
+    hessian(const Point<dim> & point,
+            const unsigned int component = 0) const override;
+
+    virtual RangeNumberType
+    laplacian(const Point<dim> & point,
+              const unsigned int component = 0) const override;
+
     std::size_t
     memory_consumption() const;
 
index 747ba3fe41236e7c28e2398277272e9ebea0749e..56cd3469b295085ec7071b2b4a253df2f887cc14 100644 (file)
@@ -512,6 +512,24 @@ namespace Functions
   }
 
 
+
+  template <int dim, typename RangeNumberType>
+  SymmetricTensor<2, dim, RangeNumberType>
+  ConstantFunction<dim, RangeNumberType>::hessian(const Point<dim> &,
+                                                  const unsigned int) const
+  {
+    return SymmetricTensor<2, dim, RangeNumberType>();
+  }
+
+
+
+  template <int dim, typename RangeNumberType>
+  RangeNumberType
+  ConstantFunction<dim, RangeNumberType>::laplacian(const Point<dim> &,
+                                                    const unsigned int) const
+  {
+    return 0;
+  }
 } // namespace Functions
 
 //---------------------------------------------------------------------------

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.