Reference documentation for deal.II version Git b8d130ac44 2020-08-12 22:11:34 +0200
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
tensor_function.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2018 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_tensor_function_h
17 #define dealii_tensor_function_h
18 
19 
20 #include <deal.II/base/config.h>
21 
23 #include <deal.II/base/function.h>
25 #include <deal.II/base/point.h>
28 
29 #include <vector>
30 
32 
55 template <int rank, int dim, typename Number = double>
57  : public FunctionTime<typename numbers::NumberTraits<Number>::real_type>,
58  public Subscriptor
59 {
60 public:
65 
70 
74  using time_type = typename FunctionTime<
76 
81  TensorFunction(const time_type initial_time = time_type(0.0));
82 
88  virtual ~TensorFunction() override = default;
89 
93  virtual value_type
94  value(const Point<dim> &p) const;
95 
101  virtual void
102  value_list(const std::vector<Point<dim>> &points,
103  std::vector<value_type> & values) const;
104 
108  virtual gradient_type
109  gradient(const Point<dim> &p) const;
110 
116  virtual void
117  gradient_list(const std::vector<Point<dim>> &points,
118  std::vector<gradient_type> & gradients) const;
119 };
120 
121 
122 
129 template <int rank, int dim, typename Number = double>
130 class ConstantTensorFunction : public TensorFunction<rank, dim, Number>
131 {
132 public:
137 
145  ConstantTensorFunction(const ::Tensor<rank, dim, Number> &value,
146  const time_type initial_time = 0.0);
147 
148  virtual ~ConstantTensorFunction() override = default;
149 
150  virtual typename ::TensorFunction<rank, dim, Number>::value_type
151  value(const Point<dim> &p) const override;
152 
153  virtual void
154  value_list(
155  const std::vector<Point<dim>> &points,
156  std::vector<typename ::TensorFunction<rank, dim, Number>::value_type>
157  &values) const override;
158 
159  virtual typename ::TensorFunction<rank, dim, Number>::gradient_type
160  gradient(const Point<dim> &p) const override;
161 
162  virtual void
164  const std::vector<Point<dim>> &points,
165  std::vector<
166  typename ::TensorFunction<rank, dim, Number>::gradient_type>
167  &gradients) const override;
168 
169 private:
170  const ::Tensor<rank, dim, Number> _value;
171 };
172 
173 
174 
181 template <int rank, int dim, typename Number = double>
182 class ZeroTensorFunction : public ConstantTensorFunction<rank, dim, Number>
183 {
184 public:
188  using time_type =
190 
197  ZeroTensorFunction(const time_type initial_time = 0.0);
198 };
199 
200 
202 
203 #endif
virtual void gradient_list(const std::vector< Point< dim >> &points, std::vector< gradient_type > &gradients) const
virtual value_type value(const Point< dim > &p) const
typename FunctionTime< typename numbers::NumberTraits< Number >::real_type >::time_type time_type
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:363
typename TensorFunction< rank, dim, Number >::time_type time_type
TensorFunction(const time_type initial_time=time_type(0.0))
virtual ~TensorFunction() override=default
virtual gradient_type gradient(const Point< dim > &p) const
numbers::NumberTraits< RangeNumberType >::real_type time_type
Definition: tensor.h:448
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:362
virtual void value_list(const std::vector< Point< dim >> &points, std::vector< value_type > &values) const
const ::Tensor< rank, dim, Number > _value