Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
function_spherical.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2016 - 2019 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 {
44  template <int dim>
45  class Spherical : public Function<dim>
46  {
47  public:
56  Spherical(const Point<dim> & center = Point<dim>(),
57  const unsigned int n_components = 1);
58 
65  virtual double
66  value(const Point<dim> & point,
67  const unsigned int component = 0) const override;
68 
76  virtual Tensor<1, dim>
77  gradient(const Point<dim> & p,
78  const unsigned int component = 0) const override;
79 
88  hessian(const Point<dim> & p,
89  const unsigned int component = 0) const override;
90 
91  std::size_t
92  memory_consumption() const;
93 
94  private:
99  virtual double
100  svalue(const std::array<double, dim> &sp,
101  const unsigned int component) const;
102 
109  virtual std::array<double, dim>
110  sgradient(const std::array<double, dim> &sp,
111  const unsigned int component) const;
112 
120  virtual std::array<double, 6>
121  shessian(const std::array<double, dim> &sp,
122  const unsigned int component) const;
123 
128  };
129 } // namespace Functions
130 
131 DEAL_II_NAMESPACE_CLOSE
132 
133 #endif
const unsigned int n_components
Definition: function.h:162
virtual double value(const Point< dim > &point, const unsigned int component=0) const override
virtual std::array< double, 6 > shessian(const std::array< double, dim > &sp, const unsigned int component) const
Spherical(const Point< dim > &center=Point< dim >(), const unsigned int n_components=1)
virtual std::array< double, dim > sgradient(const std::array< double, dim > &sp, const unsigned int component) const
virtual SymmetricTensor< 2, dim > hessian(const Point< dim > &p, const unsigned int component=0) const override
virtual double svalue(const std::array< double, dim > &sp, const unsigned int component) const
virtual Tensor< 1, dim > gradient(const Point< dim > &p, const unsigned int component=0) const override
const Tensor< 1, dim > coordinate_system_offset