Reference documentation for deal.II version 9.5.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\}}\)
Loading...
Searching...
No Matches
tensor_function.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 1999 - 2020 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
25#include <deal.II/base/point.h>
28
29#include <vector>
30
32
55template <int rank, int dim, typename Number = double>
57 : public FunctionTime<typename numbers::NumberTraits<Number>::real_type>,
58 public Subscriptor
59{
60public:
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
129template <int rank, int dim, typename Number = double>
130class ConstantTensorFunction : public TensorFunction<rank, dim, Number>
131{
132public:
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
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
169private:
170 const ::Tensor<rank, dim, Number> _value;
171};
172
173
174
181template <int rank, int dim, typename Number = double>
182class ZeroTensorFunction : public ConstantTensorFunction<rank, dim, Number>
183{
184public:
188 using time_type =
190
197 ZeroTensorFunction(const time_type initial_time = 0.0);
198};
199
200
202
203#endif
virtual void value_list(const std::vector< Point< dim > > &points, std::vector< typename ::TensorFunction< rank, dim, Number >::value_type > &values) const override
virtual ~ConstantTensorFunction() override=default
typename TensorFunction< rank, dim, Number >::time_type time_type
ConstantTensorFunction(const ::Tensor< rank, dim, Number > &value, const time_type initial_time=0.0)
virtual typename::TensorFunction< rank, dim, Number >::value_type value(const Point< dim > &p) const override
const ::Tensor< rank, dim, Number > _value
virtual typename::TensorFunction< rank, dim, Number >::gradient_type gradient(const Point< dim > &p) const override
virtual void gradient_list(const std::vector< Point< dim > > &points, std::vector< typename ::TensorFunction< rank, dim, Number >::gradient_type > &gradients) const override
Definition point.h:112
virtual void value_list(const std::vector< Point< dim > > &points, std::vector< value_type > &values) const
virtual gradient_type gradient(const Point< dim > &p) const
virtual value_type value(const Point< dim > &p) const
TensorFunction(const time_type initial_time=time_type(0.0))
virtual ~TensorFunction() override=default
virtual void gradient_list(const std::vector< Point< dim > > &points, std::vector< gradient_type > &gradients) const
typename FunctionTime< typename numbers::NumberTraits< Number >::real_type >::time_type time_type
typename ConstantTensorFunction< rank, dim, Number >::time_type time_type
ZeroTensorFunction(const time_type initial_time=0.0)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473