Reference documentation for deal.II version Git cb0bd54b52 2019-09-21 16:31:22 -0400
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
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/function.h>
20 #include <deal.II/base/point.h>
21 #include <deal.II/base/std_cxx17/optional.h>
22 #include <deal.II/base/tensor.h>
23 #include <deal.II/base/thread_local_storage.h>
24 
25 #include <deal.II/dofs/dof_accessor.h>
26 #include <deal.II/dofs/dof_handler.h>
27 
28 #include <deal.II/fe/mapping_q1.h>
29 
30 #include <deal.II/grid/grid_tools_cache.h>
31 
32 #include <deal.II/lac/vector.h>
33 
34 
35 DEAL_II_NAMESPACE_OPEN
36 
37 // Forward declaration
38 #ifndef DOXYGEN
39 namespace VectorTools
40 {
42 }
43 #endif
44 
45 namespace Functions
46 {
161  template <int dim,
162  typename DoFHandlerType = DoFHandler<dim>,
163  typename VectorType = Vector<double>>
164  class FEFieldFunction : public Function<dim, typename VectorType::value_type>
165  {
166  public:
176  const DoFHandlerType &dh,
177  const VectorType & data_vector,
178  const Mapping<dim> & mapping = StaticMappingQ1<dim>::mapping);
179 
185  void
186  set_active_cell(
187  const typename DoFHandlerType::active_cell_iterator &newcell);
188 
204  virtual void
205  vector_value(
206  const Point<dim> & p,
207  Vector<typename VectorType::value_type> &values) const override;
208 
226  virtual typename VectorType::value_type
227  value(const Point<dim> &p, const unsigned int component = 0) const override;
228 
244  virtual void
245  value_list(const std::vector<Point<dim>> & points,
246  std::vector<typename VectorType::value_type> &values,
247  const unsigned int component = 0) const override;
248 
249 
265  virtual void
266  vector_value_list(const std::vector<Point<dim>> &points,
268  &values) const override;
269 
285  virtual void
286  vector_gradient(const Point<dim> &p,
288  &gradients) const override;
289 
306  gradient(const Point<dim> & p,
307  const unsigned int component = 0) const override;
308 
322  virtual void
323  vector_gradient_list(
324  const std::vector<Point<dim>> &p,
325  std::vector<std::vector<Tensor<1, dim, typename VectorType::value_type>>>
326  &gradients) const override;
327 
341  virtual void
342  gradient_list(
343  const std::vector<Point<dim>> & p,
344  std::vector<Tensor<1, dim, typename VectorType::value_type>> &gradients,
345  const unsigned int component = 0) const override;
346 
347 
359  virtual typename VectorType::value_type
360  laplacian(const Point<dim> & p,
361  const unsigned int component = 0) const override;
362 
375  virtual void
376  vector_laplacian(
377  const Point<dim> & p,
378  Vector<typename VectorType::value_type> &values) const override;
379 
391  virtual void
392  laplacian_list(const std::vector<Point<dim>> & points,
393  std::vector<typename VectorType::value_type> &values,
394  const unsigned int component = 0) const override;
395 
407  virtual void
408  vector_laplacian_list(const std::vector<Point<dim>> &points,
410  &values) const override;
411 
434  unsigned int
435  compute_point_locations(
436  const std::vector<Point<dim>> & points,
437  std::vector<typename DoFHandlerType::active_cell_iterator> &cells,
438  std::vector<std::vector<Point<dim>>> & qpoints,
439  std::vector<std::vector<unsigned int>> & maps) const;
440 
441  private:
446  typename DoFHandlerType::active_cell_iterator>;
447 
451  SmartPointer<const DoFHandlerType,
453  dh;
454 
458  const VectorType &data_vector;
459 
464 
469 
474 
480  std_cxx17::optional<Point<dim>>
481  get_reference_coordinates(
482  const typename DoFHandlerType::active_cell_iterator &cell,
483  const Point<dim> & point) const;
484  };
485 } // namespace Functions
486 
487 DEAL_II_NAMESPACE_CLOSE
488 
489 #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