Reference documentation for deal.II version 8.4.2
derivative_approximation.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2000 - 2015 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 at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__derivative_approximation_h
17 #define dealii__derivative_approximation_h
18 
19 #include <deal.II/base/config.h>
20 #include <deal.II/base/exceptions.h>
21 #include <deal.II/base/std_cxx11/tuple.h>
22 #include <deal.II/base/synchronous_iterator.h>
23 #include <deal.II/fe/fe_update_flags.h>
24 #include <deal.II/fe/mapping.h>
25 #include <deal.II/lac/vector.h>
26 #include <deal.II/grid/filtered_iterator.h>
27 #ifdef _MSC_VER
28 # include <deal.II/dofs/dof_accessor.h>
29 #endif
30 #include <utility>
31 
32 DEAL_II_NAMESPACE_OPEN
33 
34 template <int dim, int spacedim> class DoFHandler;
35 namespace hp
36 {
37  template <int dim, int spacedim> class DoFHandler;
38 }
39 
40 
41 
165 {
181  template <int dim, template <int, int> class DoFHandlerType, class InputVector, int spacedim>
182  void
184  const DoFHandlerType<dim,spacedim> &dof,
185  const InputVector &solution,
187  const unsigned int component = 0);
188 
193  template <int dim, template <int, int> class DoFHandlerType, class InputVector, int spacedim>
194  void
195  approximate_gradient (const DoFHandlerType<dim,spacedim> &dof,
196  const InputVector &solution,
197  Vector<float> &derivative_norm,
198  const unsigned int component = 0);
199 
217  template <int dim, template <int, int> class DoFHandlerType, class InputVector, int spacedim>
218  void
220  const DoFHandlerType<dim,spacedim> &dof,
221  const InputVector &solution,
222  Vector<float> &derivative_norm,
223  const unsigned int component = 0);
224 
229  template <int dim, template <int, int> class DoFHandlerType, class InputVector, int spacedim>
230  void
231  approximate_second_derivative (const DoFHandlerType<dim,spacedim> &dof,
232  const InputVector &solution,
233  Vector<float> &derivative_norm,
234  const unsigned int component = 0);
235 
249  template <typename DoFHandlerType, int dim, int spacedim, class InputVector, int order>
250  void
252  (const Mapping<dim, spacedim> &mapping,
253  const DoFHandlerType &dof,
254  const InputVector &solution,
255 #ifndef _MSC_VER
256  const typename DoFHandlerType::active_cell_iterator &cell,
257 #else
259 #endif
260  Tensor<order, dim> &derivative,
261  const unsigned int component = 0);
262 
266  template <typename DoFHandlerType, int dim, int spacedim, class InputVector, int order>
267  void
268  approximate_derivative_tensor
269  (const DoFHandlerType &dof,
270  const InputVector &solution,
271 #ifndef _MSC_VER
272  const typename DoFHandlerType::active_cell_iterator &cell,
273 #else
275 #endif
276  Tensor<order, dim> &derivative,
277  const unsigned int component = 0);
278 
282  template <int dim, int order>
283  double
284  derivative_norm (const Tensor<order,dim> &derivative);
285 
289  DeclException2 (ExcVectorLengthVsNActiveCells,
290  int, int,
291  << "The output vector needs to have a size equal "
292  "to the number of active cells of your triangulation "
293  "but has length " << arg1 << "There are "
294  << arg2 << " active cells in your triangulation.");
298  DeclExceptionMsg (ExcInsufficientDirections,
299  "We have encountered a cell on which the number of linearly "
300  "independent directions that span the matrix Y (discussed "
301  "in the documentation of the DerivativeApproximation "
302  "class) is not equal to dim. The matrix Y then is "
303  "rank deficient and can not be inverted.");
304 }
305 
306 
307 
308 DEAL_II_NAMESPACE_CLOSE
309 
310 #endif
void approximate_derivative_tensor(const Mapping< dim, spacedim > &mapping, const DoFHandlerType &dof, const InputVector &solution, const typename DoFHandlerType::active_cell_iterator &cell, Tensor< order, dim > &derivative, const unsigned int component=0)
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:552
Abstract base class for mapping classes.
Definition: dof_tools.h:52
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:533
Definition: hp.h:102
double derivative_norm(const Tensor< order, dim > &derivative)
Definition: mpi.h:48
void approximate_second_derivative(const Mapping< dim, spacedim > &mapping, const DoFHandlerType< dim, spacedim > &dof, const InputVector &solution, Vector< float > &derivative_norm, const unsigned int component=0)
void approximate_gradient(const Mapping< dim, spacedim > &mapping, const DoFHandlerType< dim, spacedim > &dof, const InputVector &solution, Vector< float > &derivative_norm, const unsigned int component=0)