Reference documentation for deal.II version 9.1.1
\(\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/tensor.h>
22 #include <deal.II/base/thread_local_storage.h>
23 
24 #include <deal.II/dofs/dof_accessor.h>
25 #include <deal.II/dofs/dof_handler.h>
26 
27 #include <deal.II/fe/mapping_q1.h>
28 
29 #include <deal.II/grid/grid_tools_cache.h>
30 
31 #include <deal.II/lac/vector.h>
32 
33 #include <boost/optional.hpp>
34 
35 
36 DEAL_II_NAMESPACE_OPEN
37 
38 namespace VectorTools
39 {
41 }
42 
43 namespace Functions
44 {
159  template <int dim,
160  typename DoFHandlerType = DoFHandler<dim>,
161  typename VectorType = Vector<double>>
162  class FEFieldFunction : public Function<dim, typename VectorType::value_type>
163  {
164  public:
174  const DoFHandlerType &dh,
175  const VectorType & data_vector,
177 
183  void
185  const typename DoFHandlerType::active_cell_iterator &newcell);
186 
202  virtual void
203  vector_value(
204  const Point<dim> & p,
205  Vector<typename VectorType::value_type> &values) const override;
206 
224  virtual typename VectorType::value_type
225  value(const Point<dim> &p, const unsigned int component = 0) const override;
226 
242  virtual void
243  value_list(const std::vector<Point<dim>> & points,
244  std::vector<typename VectorType::value_type> &values,
245  const unsigned int component = 0) const override;
246 
247 
263  virtual void
264  vector_value_list(const std::vector<Point<dim>> &points,
266  &values) const override;
267 
283  virtual void
284  vector_gradient(const Point<dim> &p,
286  &gradients) const override;
287 
304  gradient(const Point<dim> & p,
305  const unsigned int component = 0) const override;
306 
320  virtual void
322  const std::vector<Point<dim>> &p,
323  std::vector<std::vector<Tensor<1, dim, typename VectorType::value_type>>>
324  &gradients) const override;
325 
339  virtual void
341  const std::vector<Point<dim>> & p,
342  std::vector<Tensor<1, dim, typename VectorType::value_type>> &gradients,
343  const unsigned int component = 0) const override;
344 
345 
357  virtual typename VectorType::value_type
358  laplacian(const Point<dim> & p,
359  const unsigned int component = 0) const override;
360 
373  virtual void
375  const Point<dim> & p,
376  Vector<typename VectorType::value_type> &values) const override;
377 
389  virtual void
390  laplacian_list(const std::vector<Point<dim>> & points,
391  std::vector<typename VectorType::value_type> &values,
392  const unsigned int component = 0) const override;
393 
405  virtual void
406  vector_laplacian_list(const std::vector<Point<dim>> &points,
408  &values) const override;
409 
432  unsigned int
434  const std::vector<Point<dim>> & points,
435  std::vector<typename DoFHandlerType::active_cell_iterator> &cells,
436  std::vector<std::vector<Point<dim>>> & qpoints,
437  std::vector<std::vector<unsigned int>> & maps) const;
438 
439  private:
444  typename DoFHandlerType::active_cell_iterator>;
445 
449  SmartPointer<const DoFHandlerType,
451  dh;
452 
456  const VectorType &data_vector;
457 
462 
467 
472 
478  boost::optional<Point<dim>>
480  const typename DoFHandlerType::active_cell_iterator &cell,
481  const Point<dim> & point) const;
482  };
483 } // namespace Functions
484 
485 DEAL_II_NAMESPACE_CLOSE
486 
487 #endif
FEFieldFunction(const DoFHandlerType &dh, const VectorType &data_vector, const Mapping< dim > &mapping=StaticMappingQ1< dim >::mapping)
SmartPointer< const DoFHandlerType, FEFieldFunction< dim, DoFHandlerType, VectorType > > dh
virtual void value_list(const std::vector< Point< dim >> &points, std::vector< typename VectorType::value_type > &values, const unsigned int component=0) const override
virtual void vector_gradient(const Point< dim > &p, std::vector< Tensor< 1, dim, typename VectorType::value_type >> &gradients) const override
const Mapping< dim > & mapping
void set_active_cell(const typename DoFHandlerType::active_cell_iterator &newcell)
boost::optional< Point< dim > > get_reference_coordinates(const typename DoFHandlerType::active_cell_iterator &cell, const Point< dim > &point) const
virtual void vector_value(const Point< dim > &p, Vector< typename VectorType::value_type > &values) const override
static ::ExceptionBase & ExcPointNotAvailableHere()
virtual void vector_value_list(const std::vector< Point< dim >> &points, std::vector< Vector< typename VectorType::value_type >> &values) const override
virtual void vector_laplacian(const Point< dim > &p, Vector< typename VectorType::value_type > &values) const override
virtual void vector_laplacian_list(const std::vector< Point< dim >> &points, std::vector< Vector< typename VectorType::value_type >> &values) const override
virtual VectorType::value_type value(const Point< dim > &p, const unsigned int component=0) const override
const VectorType & data_vector
GridTools::Cache< dim, DoFHandlerType::space_dimension > cache
Definition: mpi.h:90
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 Tensor< 1, dim, typename VectorType::value_type > gradient(const Point< dim > &p, const unsigned int component=0) 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
virtual VectorType::value_type laplacian(const Point< dim > &p, const unsigned int component=0) const override