Reference documentation for deal.II version 9.0.0
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 at
12 // the top level of the deal.II distribution.
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 
25 #include <array>
26 
27 DEAL_II_NAMESPACE_OPEN
28 
29 namespace Functions
30 {
31 
46  template <int dim>
47  class Spherical : public Function<dim>
48  {
49  public:
58  Spherical(const Point<dim> &center = Point<dim>(),
59  const unsigned int n_components=1);
60 
67  virtual double value (const Point<dim> &point,
68  const unsigned int component = 0) const;
69 
77  virtual Tensor<1,dim> gradient (const Point<dim> &p,
78  const unsigned int component = 0) const;
79 
87  virtual SymmetricTensor<2,dim> hessian (const Point<dim> &p,
88  const unsigned int component=0) const;
89 
90  std::size_t memory_consumption () const;
91 
92  private:
97  virtual double svalue(const std::array<double, dim> &sp,
98  const unsigned int component) const;
99 
106  virtual std::array<double, dim> sgradient(const std::array<double, dim> &sp,
107  const unsigned int component) const;
108 
115  virtual std::array<double, 6> shessian (const std::array<double, dim> &sp,
116  const unsigned int component) const;
117 
122  };
123 }
124 
125 DEAL_II_NAMESPACE_CLOSE
126 
127 #endif
128 
const Tensor< 1, dim > coordinate_system_offset
const unsigned int n_components
Definition: function.h:154
virtual SymmetricTensor< 2, dim > hessian(const Point< dim > &p, const unsigned int component=0) const
virtual std::array< double, 6 > shessian(const std::array< double, dim > &sp, const unsigned int component) const
virtual double value(const Point< dim > &point, const unsigned int component=0) const
Spherical(const Point< dim > &center=Point< dim >(), const unsigned int n_components=1)
virtual Tensor< 1, dim > gradient(const Point< dim > &p, const unsigned int component=0) const
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