Reference documentation for deal.II version 9.2.0
\(\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 
56 template <int rank, int dim, typename Number = double>
58  : public FunctionTime<typename numbers::NumberTraits<Number>::real_type>,
59  public Subscriptor
60 {
61 public:
66 
71 
75  using time_type = typename FunctionTime<
77 
82  TensorFunction(const time_type initial_time = time_type(0.0));
83 
89  virtual ~TensorFunction() override = default;
90 
94  virtual value_type
95  value(const Point<dim> &p) const;
96 
102  virtual void
103  value_list(const std::vector<Point<dim>> &points,
104  std::vector<value_type> & values) const;
105 
109  virtual gradient_type
110  gradient(const Point<dim> &p) const;
111 
117  virtual void
118  gradient_list(const std::vector<Point<dim>> &points,
119  std::vector<gradient_type> & gradients) const;
120 };
121 
122 
123 
131 template <int rank, int dim, typename Number = double>
132 class ConstantTensorFunction : public TensorFunction<rank, dim, Number>
133 {
134 public:
139 
147  ConstantTensorFunction(const ::Tensor<rank, dim, Number> &value,
148  const time_type initial_time = 0.0);
149 
150  virtual ~ConstantTensorFunction() override = default;
151 
152  virtual typename ::TensorFunction<rank, dim, Number>::value_type
153  value(const Point<dim> &p) const override;
154 
155  virtual void
156  value_list(
157  const std::vector<Point<dim>> &points,
158  std::vector<typename ::TensorFunction<rank, dim, Number>::value_type>
159  &values) const override;
160 
161  virtual typename ::TensorFunction<rank, dim, Number>::gradient_type
162  gradient(const Point<dim> &p) const override;
163 
164  virtual void
166  const std::vector<Point<dim>> &points,
167  std::vector<
168  typename ::TensorFunction<rank, dim, Number>::gradient_type>
169  &gradients) const override;
170 
171 private:
172  const ::Tensor<rank, dim, Number> _value;
173 };
174 
175 
176 
184 template <int rank, int dim, typename Number = double>
185 class ZeroTensorFunction : public ConstantTensorFunction<rank, dim, Number>
186 {
187 public:
191  using time_type =
193 
200  ZeroTensorFunction(const time_type initial_time = 0.0);
201 };
202 
203 
205 
206 #endif
function_time.h
ConstantTensorFunction::_value
const ::Tensor< rank, dim, Number > _value
Definition: tensor_function.h:172
TensorFunction::gradient_list
virtual void gradient_list(const std::vector< Point< dim >> &points, std::vector< gradient_type > &gradients) const
Subscriptor
Definition: subscriptor.h:62
FunctionTime
Definition: function_time.h:73
ConstantTensorFunction::time_type
typename TensorFunction< rank, dim, Number >::time_type time_type
Definition: tensor_function.h:138
ZeroTensorFunction::time_type
typename ConstantTensorFunction< rank, dim, Number >::time_type time_type
Definition: tensor_function.h:192
TensorFunction::value_list
virtual void value_list(const std::vector< Point< dim >> &points, std::vector< value_type > &values) const
TensorFunction::~TensorFunction
virtual ~TensorFunction() override=default
subscriptor.h
Tensor< rank, dim, double >
ZeroTensorFunction::ZeroTensorFunction
ZeroTensorFunction(const time_type initial_time=0.0)
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
ConstantTensorFunction::ConstantTensorFunction
ConstantTensorFunction(const ::Tensor< rank, dim, Number > &value, const time_type initial_time=0.0)
TensorFunction::time_type
typename FunctionTime< typename numbers::NumberTraits< Number >::real_type >::time_type time_type
Definition: tensor_function.h:76
numbers::NumberTraits::real_type
number real_type
Definition: numbers.h:437
smartpointer.h
exceptions.h
ZeroTensorFunction
Definition: tensor_function.h:185
TensorFunction
Definition: tensor_function.h:57
ConstantTensorFunction::gradient
virtual typename ::TensorFunction< rank, dim, Number >::gradient_type gradient(const Point< dim > &p) const override
ConstantTensorFunction::value
virtual typename ::TensorFunction< rank, dim, Number >::value_type value(const Point< dim > &p) const override
function.h
ConstantTensorFunction::value_list
virtual void value_list(const std::vector< Point< dim >> &points, std::vector< typename ::TensorFunction< rank, dim, Number >::value_type > &values) const override
TensorFunction::value
virtual value_type value(const Point< dim > &p) const
ConstantTensorFunction::~ConstantTensorFunction
virtual ~ConstantTensorFunction() override=default
TensorFunction::gradient
virtual gradient_type gradient(const Point< dim > &p) const
ConstantTensorFunction::gradient_list
virtual void gradient_list(const std::vector< Point< dim >> &points, std::vector< typename ::TensorFunction< rank, dim, Number >::gradient_type > &gradients) const override
Point< dim >
config.h
TensorFunction::TensorFunction
TensorFunction(const time_type initial_time=time_type(0.0))
ConstantTensorFunction
Definition: tensor_function.h:132
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
FunctionTime< numbers::NumberTraits< double >::real_type >::time_type
numbers::NumberTraits< double >::real_type time_type
Definition: function_time.h:108
point.h