Reference documentation for deal.II version Git 2276b94619 2020-02-28 10:11:55 +0100
\(\newcommand{\vcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\vcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
fe_field_function.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2007 - 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_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>
23 #include <deal.II/base/std_cxx17/optional.h>
24 #include <deal.II/base/tensor.h>
25 #include <deal.II/base/thread_local_storage.h>
26 
27 #include <deal.II/dofs/dof_accessor.h>
28 #include <deal.II/dofs/dof_handler.h>
29 
30 #include <deal.II/fe/mapping_q1.h>
31 
32 #include <deal.II/grid/grid_tools_cache.h>
33 
34 #include <deal.II/lac/vector.h>
35 
36 
37 DEAL_II_NAMESPACE_OPEN
38 
39 // Forward declaration
40 #ifndef DOXYGEN
41 namespace VectorTools
42 {
44 }
45 #endif
46 
47 namespace Functions
48 {
163  template <int dim,
164  typename DoFHandlerType = DoFHandler<dim>,
165  typename VectorType = Vector<double>>
166  class FEFieldFunction : public Function<dim, typename VectorType::value_type>
167  {
168  public:
178  const DoFHandlerType &dh,
179  const VectorType & data_vector,
180  const Mapping<dim> & mapping = StaticMappingQ1<dim>::mapping);
181 
187  void
188  set_active_cell(
189  const typename DoFHandlerType::active_cell_iterator &newcell);
190 
206  virtual void
207  vector_value(
208  const Point<dim> & p,
209  Vector<typename VectorType::value_type> &values) const override;
210 
228  virtual typename VectorType::value_type
229  value(const Point<dim> &p, const unsigned int component = 0) const override;
230 
246  virtual void
247  value_list(const std::vector<Point<dim>> & points,
248  std::vector<typename VectorType::value_type> &values,
249  const unsigned int component = 0) const override;
250 
251 
267  virtual void
268  vector_value_list(const std::vector<Point<dim>> &points,
270  &values) const override;
271 
287  virtual void
288  vector_gradient(const Point<dim> &p,
290  &gradients) const override;
291 
308  gradient(const Point<dim> & p,
309  const unsigned int component = 0) const override;
310 
324  virtual void
325  vector_gradient_list(
326  const std::vector<Point<dim>> &p,
327  std::vector<std::vector<Tensor<1, dim, typename VectorType::value_type>>>
328  &gradients) const override;
329 
343  virtual void
344  gradient_list(
345  const std::vector<Point<dim>> & p,
346  std::vector<Tensor<1, dim, typename VectorType::value_type>> &gradients,
347  const unsigned int component = 0) const override;
348 
349 
361  virtual typename VectorType::value_type
362  laplacian(const Point<dim> & p,
363  const unsigned int component = 0) const override;
364 
377  virtual void
378  vector_laplacian(
379  const Point<dim> & p,
380  Vector<typename VectorType::value_type> &values) const override;
381 
393  virtual void
394  laplacian_list(const std::vector<Point<dim>> & points,
395  std::vector<typename VectorType::value_type> &values,
396  const unsigned int component = 0) const override;
397 
409  virtual void
410  vector_laplacian_list(const std::vector<Point<dim>> &points,
412  &values) const override;
413 
436  unsigned int
437  compute_point_locations(
438  const std::vector<Point<dim>> & points,
439  std::vector<typename DoFHandlerType::active_cell_iterator> &cells,
440  std::vector<std::vector<Point<dim>>> & qpoints,
441  std::vector<std::vector<unsigned int>> & maps) const;
442 
443  private:
448  typename DoFHandlerType::active_cell_iterator>;
449 
453  SmartPointer<const DoFHandlerType,
455  dh;
456 
460  const VectorType &data_vector;
461 
466 
471 
476 
482  std_cxx17::optional<Point<dim>>
483  get_reference_coordinates(
484  const typename DoFHandlerType::active_cell_iterator &cell,
485  const Point<dim> & point) const;
486  };
487 } // namespace Functions
488 
489 DEAL_II_NAMESPACE_CLOSE
490 
491 #endif
SmartPointer< const DoFHandlerType, FEFieldFunction< dim, DoFHandlerType, VectorType > > dh
const Mapping< dim > & mapping
static ::ExceptionBase & ExcPointNotAvailableHere()
const VectorType & data_vector
GridTools::Cache< dim, DoFHandlerType::space_dimension > cache
Definition: tensor.h:422