Reference documentation for deal.II version 9.3.2
\(\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\}}\)
fe_field_function.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2007 - 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_fe_function_h
17 #define dealii_fe_function_h
18 
19 #include <deal.II/base/config.h>
20 
21 #include <deal.II/base/function.h>
22 #include <deal.II/base/point.h>
24 #include <deal.II/base/tensor.h>
26 
29 
30 #include <deal.II/fe/mapping_q1.h>
31 
33 
34 #include <deal.II/lac/vector.h>
35 
36 
38 
39 // Forward declaration
40 #ifndef DOXYGEN
41 namespace VectorTools
42 {
44 }
45 #endif
46 
47 namespace Functions
48 {
166  template <int dim,
167  typename DoFHandlerType = DoFHandler<dim>,
168  typename VectorType = Vector<double>>
169  class FEFieldFunction : public Function<dim, typename VectorType::value_type>
170  {
171  public:
181  const DoFHandlerType &dh,
182  const VectorType & data_vector,
184 
190  void
192  const typename DoFHandlerType::active_cell_iterator &newcell);
193 
209  virtual void
211  const Point<dim> & p,
213 
231  virtual typename VectorType::value_type
232  value(const Point<dim> &p, const unsigned int component = 0) const override;
233 
249  virtual void
250  value_list(const std::vector<Point<dim>> & points,
251  std::vector<typename VectorType::value_type> &values,
252  const unsigned int component = 0) const override;
253 
254 
270  virtual void
271  vector_value_list(const std::vector<Point<dim>> &points,
273  &values) const override;
274 
290  virtual void
293  &gradients) const override;
294 
311  gradient(const Point<dim> & p,
312  const unsigned int component = 0) const override;
313 
327  virtual void
329  const std::vector<Point<dim>> &p,
330  std::vector<std::vector<Tensor<1, dim, typename VectorType::value_type>>>
331  &gradients) const override;
332 
346  virtual void
348  const std::vector<Point<dim>> & p,
350  const unsigned int component = 0) const override;
351 
352 
364  virtual typename VectorType::value_type
366  const unsigned int component = 0) const override;
367 
380  virtual void
382  const Point<dim> & p,
384 
396  virtual void
397  laplacian_list(const std::vector<Point<dim>> & points,
398  std::vector<typename VectorType::value_type> &values,
399  const unsigned int component = 0) const override;
400 
412  virtual void
413  vector_laplacian_list(const std::vector<Point<dim>> &points,
415  &values) const override;
416 
439  unsigned int
441  const std::vector<Point<dim>> & points,
442  std::vector<typename DoFHandlerType::active_cell_iterator> &cells,
443  std::vector<std::vector<Point<dim>>> & qpoints,
444  std::vector<std::vector<unsigned int>> & maps) const;
445 
446  private:
451  typename DoFHandlerType::active_cell_iterator>;
452 
456  SmartPointer<const DoFHandlerType,
458  dh;
459 
463  const VectorType &data_vector;
464 
469 
474 
479 
485  std_cxx17::optional<Point<dim>>
487  const typename DoFHandlerType::active_cell_iterator &cell,
488  const Point<dim> & point) const;
489  };
490 } // namespace Functions
491 
492 namespace Legacy
493 {
494  namespace Functions
495  {
502  template <int dim,
503  typename DoFHandlerType = DoFHandler<dim>,
504  typename VectorType = Vector<double>>
507  } // namespace Functions
508 } // namespace Legacy
509 
510 
512 
513 #endif
void set_active_cell(const typename DoFHandlerType::active_cell_iterator &newcell)
virtual VectorType::value_type laplacian(const Point< dim > &p, const unsigned int component=0) const override
virtual void vector_value(const Point< dim > &p, Vector< typename VectorType::value_type > &values) const override
virtual void vector_gradient(const Point< dim > &p, std::vector< Tensor< 1, dim, typename VectorType::value_type >> &gradients) const override
FEFieldFunction(const DoFHandlerType &dh, const VectorType &data_vector, const Mapping< dim > &mapping=StaticMappingQ1< dim >::mapping)
virtual void vector_laplacian(const Point< dim > &p, Vector< typename VectorType::value_type > &values) const override
virtual Tensor< 1, dim, typename VectorType::value_type > gradient(const Point< dim > &p, const unsigned int component=0) const override
virtual void vector_laplacian_list(const std::vector< Point< dim >> &points, std::vector< Vector< typename VectorType::value_type >> &values) const override
virtual void vector_gradient_list(const std::vector< Point< dim >> &p, std::vector< std::vector< Tensor< 1, dim, typename VectorType::value_type >>> &gradients) const override
virtual void gradient_list(const std::vector< Point< dim >> &p, std::vector< Tensor< 1, dim, typename VectorType::value_type >> &gradients, const unsigned int component=0) const override
virtual void laplacian_list(const std::vector< Point< dim >> &points, std::vector< typename VectorType::value_type > &values, const unsigned int component=0) const override
std_cxx17::optional< Point< dim > > get_reference_coordinates(const typename DoFHandlerType::active_cell_iterator &cell, const Point< dim > &point) const
const VectorType & data_vector
GridTools::Cache< dim, DoFHandlerType::space_dimension > cache
unsigned int compute_point_locations(const std::vector< Point< dim >> &points, std::vector< typename DoFHandlerType::active_cell_iterator > &cells, std::vector< std::vector< Point< dim >>> &qpoints, std::vector< std::vector< unsigned int >> &maps) const
virtual VectorType::value_type value(const Point< dim > &p, const unsigned int component=0) const override
virtual void value_list(const std::vector< Point< dim >> &points, std::vector< typename VectorType::value_type > &values, const unsigned int component=0) const override
const Mapping< dim > & mapping
virtual void vector_value_list(const std::vector< Point< dim >> &points, std::vector< Vector< typename VectorType::value_type >> &values) const override
SmartPointer< const DoFHandlerType, FEFieldFunction< dim, DoFHandlerType, VectorType > > dh
Abstract base class for mapping classes.
Definition: mapping.h:304
Definition: point.h:111
Definition: tensor.h:472
Definition: vector.h:110
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:396
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:397
static ::ExceptionBase & ExcPointNotAvailableHere()
::Functions::FEFieldFunction< dim, DoFHandlerType, VectorType > FEFieldFunction
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
Definition: utilities.cc:188