Reference documentation for deal.II version 9.1.0-pre
function_spherical.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2016 - 2017 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_function_spherical_h
17 #define dealii_function_spherical_h
18 
19 #include <deal.II/base/config.h>
20 
21 #include <deal.II/base/function.h>
22 #include <deal.II/base/point.h>
23 
24 #include <array>
25 
26 DEAL_II_NAMESPACE_OPEN
27 
28 namespace Functions
29 {
43  template <int dim>
44  class Spherical : public Function<dim>
45  {
46  public:
55  Spherical(const Point<dim> & center = Point<dim>(),
56  const unsigned int n_components = 1);
57 
64  virtual double
65  value(const Point<dim> & point,
66  const unsigned int component = 0) const override;
67 
75  virtual Tensor<1, dim>
76  gradient(const Point<dim> & p,
77  const unsigned int component = 0) const override;
78 
87  hessian(const Point<dim> & p,
88  const unsigned int component = 0) const override;
89 
90  std::size_t
91  memory_consumption() const;
92 
93  private:
98  virtual double
99  svalue(const std::array<double, dim> &sp,
100  const unsigned int component) const;
101 
108  virtual std::array<double, dim>
109  sgradient(const std::array<double, dim> &sp,
110  const unsigned int component) const;
111 
119  virtual std::array<double, 6>
120  shessian(const std::array<double, dim> &sp,
121  const unsigned int component) const;
122 
127  };
128 } // namespace Functions
129 
130 DEAL_II_NAMESPACE_CLOSE
131 
132 #endif
const unsigned int n_components
Definition: function.h:160
virtual double value(const Point< dim > &point, const unsigned int component=0) const override
Spherical(const Point< dim > &center=Point< dim >(), const unsigned int n_components=1)
virtual SymmetricTensor< 2, dim > hessian(const Point< dim > &p, const unsigned int component=0) const override
virtual Tensor< 1, dim > gradient(const Point< dim > &p, const unsigned int component=0) const override
const Tensor< 1, dim > coordinate_system_offset
virtual std::array< double, dim > sgradient(const std::array< double, dim > &sp, const unsigned int component) const
virtual double svalue(const std::array< double, dim > &sp, const unsigned int component) const
virtual std::array< double, 6 > shessian(const std::array< double, dim > &sp, const unsigned int component) const