17 #ifndef __deal2__fe_values_h 18 #define __deal2__fe_values_h 21 #include <deal.II/base/config.h> 23 #include <deal.II/base/subscriptor.h> 24 #include <deal.II/base/point.h> 25 #include <deal.II/base/derivative_form.h> 26 #include <deal.II/base/symmetric_tensor.h> 27 #include <deal.II/base/vector_slice.h> 28 #include <deal.II/base/quadrature.h> 29 #include <deal.II/base/table.h> 30 #include <deal.II/grid/tria.h> 31 #include <deal.II/grid/tria_iterator.h> 32 #include <deal.II/dofs/dof_handler.h> 33 #include <deal.II/dofs/dof_accessor.h> 34 #include <deal.II/hp/dof_handler.h> 35 #include <deal.II/fe/fe.h> 36 #include <deal.II/fe/fe_update_flags.h> 37 #include <deal.II/fe/fe_values_extractors.h> 38 #include <deal.II/fe/mapping.h> 39 #include <deal.II/multigrid/mg_dof_handler.h> 47 #ifdef DEAL_II_WITH_PETSC 56 template <
typename Number>
class Vector;
141 template <
int dim,
int spacedim=dim>
204 const unsigned int component);
224 value (
const unsigned int shape_function,
225 const unsigned int q_point)
const;
236 gradient (
const unsigned int shape_function,
237 const unsigned int q_point)
const;
248 hessian (
const unsigned int shape_function,
249 const unsigned int q_point)
const;
261 template <
class InputVector>
262 void get_function_values (
const InputVector &fe_function,
263 std::vector<value_type> &values)
const;
275 template <
class InputVector>
276 void get_function_gradients (
const InputVector &fe_function,
277 std::vector<gradient_type> &gradients)
const;
289 template <
class InputVector>
290 void get_function_hessians (
const InputVector &fe_function,
291 std::vector<hessian_type> &hessians)
const;
304 template <
class InputVector>
305 void get_function_laplacians (
const InputVector &fe_function,
306 std::vector<value_type> &laplacians)
const;
355 template <
int dim,
int spacedim=dim>
401 typedef typename ::internal::CurlType<spacedim>::type
curl_type;
424 bool is_nonzero_shape_function_component[spacedim];
435 unsigned int row_index[spacedim];
446 unsigned int single_nonzero_component_index;
463 const unsigned int first_vector_component);
486 value (
const unsigned int shape_function,
487 const unsigned int q_point)
const;
501 gradient (
const unsigned int shape_function,
502 const unsigned int q_point)
const;
517 symmetric_gradient_type
518 symmetric_gradient (
const unsigned int shape_function,
519 const unsigned int q_point)
const;
530 divergence (
const unsigned int shape_function,
531 const unsigned int q_point)
const;
548 curl (
const unsigned int shape_function,
549 const unsigned int q_point)
const;
560 hessian (
const unsigned int shape_function,
561 const unsigned int q_point)
const;
573 template <
class InputVector>
574 void get_function_values (
const InputVector &fe_function,
575 std::vector<value_type> &values)
const;
587 template <
class InputVector>
588 void get_function_gradients (
const InputVector &fe_function,
589 std::vector<gradient_type> &gradients)
const;
606 template <
class InputVector>
608 get_function_symmetric_gradients (
const InputVector &fe_function,
609 std::vector<symmetric_gradient_type> &symmetric_gradients)
const;
622 template <
class InputVector>
623 void get_function_divergences (
const InputVector &fe_function,
624 std::vector<divergence_type> &divergences)
const;
637 template <
class InputVector>
638 void get_function_curls (
const InputVector &fe_function,
639 std::vector<curl_type> &curls)
const;
651 template <
class InputVector>
652 void get_function_hessians (
const InputVector &fe_function,
653 std::vector<hessian_type> &hessians)
const;
666 template <
class InputVector>
667 void get_function_laplacians (
const InputVector &fe_function,
668 std::vector<value_type> &laplacians)
const;
689 template <
int rank,
int dim,
int spacedim = dim>
714 template <
int dim,
int spacedim>
741 struct ShapeFunctionData
751 bool is_nonzero_shape_function_component[value_type::n_independent_components];
762 unsigned int row_index[value_type::n_independent_components];
773 unsigned int single_nonzero_component_index;
791 const unsigned int first_tensor_component);
815 value (
const unsigned int shape_function,
816 const unsigned int q_point)
const;
831 divergence (
const unsigned int shape_function,
832 const unsigned int q_point)
const;
844 template <
class InputVector>
845 void get_function_values (
const InputVector &fe_function,
846 std::vector<value_type> &values)
const;
862 template <
class InputVector>
863 void get_function_divergences (
const InputVector &fe_function,
864 std::vector<divergence_type> &divergences)
const;
885 template <
int rank,
int dim,
int spacedim = dim>
905 template <
int dim,
int spacedim>
925 struct ShapeFunctionData
935 bool is_nonzero_shape_function_component[value_type::n_independent_components];
946 unsigned int row_index[value_type::n_independent_components];
957 unsigned int single_nonzero_component_index;
976 const unsigned int first_tensor_component);
1001 value (
const unsigned int shape_function,
1002 const unsigned int q_point)
const;
1016 divergence (
const unsigned int shape_function,
1017 const unsigned int q_point)
const;
1029 template <
class InputVector>
1030 void get_function_values (
const InputVector &fe_function,
1031 std::vector<value_type> &values)
const;
1048 template <
class InputVector>
1049 void get_function_divergences (
const InputVector &fe_function,
1050 std::vector<divergence_type> &divergences)
const;
1084 template <
int dim,
int spacedim>
1091 std::vector<::FEValuesViews::Scalar<dim,spacedim> >
scalars;
1092 std::vector<::FEValuesViews::Vector<dim,spacedim> > vectors;
1093 std::vector<::FEValuesViews::SymmetricTensor<2,dim,spacedim> >
1094 symmetric_second_order_tensors;
1095 std::vector<::FEValuesViews::Tensor<2,dim,spacedim> >
1096 second_order_tensors;
1126 template <
int dim,
int spacedim=dim>
1133 void initialize (
const unsigned int n_quadrature_points,
1393 template <
int dim,
int spacedim>
1401 static const unsigned int dimension = dim;
1406 static const unsigned int space_dimension = spacedim;
1429 const unsigned int dofs_per_cell,
1460 const double &shape_value (
const unsigned int function_no,
1461 const unsigned int point_no)
const;
1481 double shape_value_component (
const unsigned int function_no,
1482 const unsigned int point_no,
1483 const unsigned int component)
const;
1504 shape_grad (
const unsigned int function_no,
1505 const unsigned int quadrature_point)
const;
1522 shape_grad_component (
const unsigned int function_no,
1523 const unsigned int point_no,
1524 const unsigned int component)
const;
1544 shape_hessian (
const unsigned int function_no,
1545 const unsigned int point_no)
const;
1551 shape_2nd_derivative (
const unsigned int function_no,
1570 shape_hessian_component (
const unsigned int function_no,
1571 const unsigned int point_no,
1572 const unsigned int component)
const;
1578 shape_2nd_derivative_component (
const unsigned int function_no,
1579 const unsigned int point_no,
1619 template <
class InputVector,
typename number>
1620 void get_function_values (
const InputVector &fe_function,
1621 std::vector<number> &values)
const;
1634 template <
class InputVector,
typename number>
1635 void get_function_values (
const InputVector &fe_function,
1654 template <
class InputVector,
typename number>
1655 void get_function_values (
const InputVector &fe_function,
1656 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
1657 std::vector<number> &values)
const;
1678 template <
class InputVector,
typename number>
1679 void get_function_values (
const InputVector &fe_function,
1680 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
1712 template <
class InputVector>
1713 void get_function_values (
const InputVector &fe_function,
1714 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
1715 VectorSlice<std::vector<std::vector<double> > > values,
1716 const bool quadrature_points_fastest)
const;
1754 template <
class InputVector>
1755 void get_function_gradients (
const InputVector &fe_function,
1772 template <
class InputVector>
1773 void get_function_gradients (
const InputVector &fe_function,
1780 template <
class InputVector>
1781 void get_function_gradients (
const InputVector &fe_function,
1782 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
1789 template <
class InputVector>
1790 void get_function_gradients (
const InputVector &fe_function,
1791 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
1793 bool quadrature_points_fastest =
false)
const;
1798 template <
class InputVector>
1799 void get_function_grads (
const InputVector &fe_function,
1805 template <class InputVector>
1806 void get_function_grads (const InputVector &fe_function,
1807 std::vector<
std::vector<
Tensor<1,spacedim> > > &gradients) const DEAL_II_DEPRECATED;
1812 template <class InputVector>
1813 void get_function_grads (const InputVector &fe_function,
1815 std::vector<Tensor<1,spacedim> > &gradients) const DEAL_II_DEPRECATED;
1820 template <class InputVector>
1821 void get_function_grads (const InputVector &fe_function,
1823 std::vector<
std::vector<Tensor<1,spacedim> > > &gradients,
1824 bool quadrature_points_fastest = false) const DEAL_II_DEPRECATED;
1863 template <class InputVector>
1865 get_function_hessians (const InputVector &fe_function,
1866 std::vector<Tensor<2,spacedim> > &hessians) const;
1883 template <class InputVector>
1885 get_function_hessians (const InputVector &fe_function,
1886 std::vector<
std::vector<Tensor<2,spacedim> > > &hessians,
1887 bool quadrature_points_fastest = false) const;
1893 template <class InputVector>
1894 void get_function_hessians (
1895 const InputVector &fe_function,
1897 std::vector<Tensor<2,spacedim> > &hessians) const;
1903 template <class InputVector>
1904 void get_function_hessians (
1905 const InputVector &fe_function,
1908 bool quadrature_points_fastest = false) const;
1913 template <class InputVector>
1915 get_function_2nd_derivatives (const InputVector &,
1916 std::vector<Tensor<2,spacedim> > &) const DEAL_II_DEPRECATED;
1921 template <class InputVector>
1923 get_function_2nd_derivatives (const InputVector &,
1924 std::vector<
std::vector<Tensor<2,spacedim> > > &,
1925 bool = false) const DEAL_II_DEPRECATED;
1964 template <class InputVector, typename number>
1966 get_function_laplacians (const InputVector &fe_function,
1967 std::vector<number> &laplacians) const;
1986 template <class InputVector, typename number>
1988 get_function_laplacians (const InputVector &fe_function,
1989 std::vector<
Vector<number> > &laplacians) const;
1995 template <class InputVector, typename number>
1996 void get_function_laplacians (
1997 const InputVector &fe_function,
1999 std::vector<number> &laplacians) const;
2005 template <class InputVector, typename number>
2006 void get_function_laplacians (
2007 const InputVector &fe_function,
2009 std::vector<
Vector<number> > &laplacians) const;
2015 template <class InputVector, typename number>
2016 void get_function_laplacians (
2017 const InputVector &fe_function,
2019 std::vector<
std::vector<number> > &laplacians,
2020 bool quadrature_points_fastest = false) const;
2029 const
Point<spacedim> &quadrature_point (const
unsigned int i) const;
2034 const
std::vector<
Point<spacedim> > &get_quadrature_points () const;
2049 double JxW (const
unsigned int quadrature_point) const;
2054 const
std::vector<
double> &get_JxW_values () const;
2060 const
DerivativeForm<1,dim,spacedim> &jacobian (const
unsigned int quadrature_point) const;
2072 const DerivativeForm<2,dim,spacedim> &jacobian_grad (const
unsigned int quadrature_point) const;
2077 const
std::vector<DerivativeForm<2,dim,spacedim> > &get_jacobian_grads () const;
2083 const DerivativeForm<1,spacedim,dim> &inverse_jacobian (const
unsigned int quadrature_point) const;
2088 const
std::vector<DerivativeForm<1,spacedim,dim> > &get_inverse_jacobians () const;
2098 const
Point<spacedim> &normal_vector (const
unsigned int i) const;
2105 const
std::vector<
Point<spacedim> > &get_normal_vectors () const;
2111 void transform (
std::vector<Tensor<1,spacedim> > &transformed,
2112 const
std::vector<Tensor<1,dim> > &original,
2121 const
Point<spacedim> &cell_normal_vector (const
unsigned int i) const DEAL_II_DEPRECATED;
2128 const
std::vector<
Point<spacedim> > &get_cell_normal_vectors () const DEAL_II_DEPRECATED;
2183 const
Mapping<dim,spacedim> &get_mapping () const;
2198 const typename
Triangulation<dim,spacedim>::cell_iterator get_cell () const;
2211 std::
size_t memory_consumption () const;
2224 "
object for which this kind of information has not been computed. What "
2225 "information these objects compute is determined by the update_* flags you "
2226 "pass to the constructor. Here, the operation you are attempting requires "
2229 << "> flag to be set, but it was apparently not specified upon construction.");
2235 DeclException0 (ExcCannotInitializeField);
2241 DeclException0 (ExcInvalidUpdateFlag);
2247 DeclException0 (ExcFEDontMatch);
2255 << "The shape function with index " << arg1
2256 << " is not primitive, i.e. it is vector-valued and "
2257 << "has more than one non-zero vector component. This "
2258 << "function cannot be called for these shape functions. "
2259 << "Maybe you want to use the same function with the "
2260 << "_component suffix?");
2266 DeclException0 (ExcFENotPrimitive);
2297 class CellIteratorBase;
2304 class TriaCellIterator;
2311 std::auto_ptr<const CellIteratorBase> present_cell;
2327 void invalidate_present_cell ();
2339 maybe_invalidate_previous_present_cell (const typename
Triangulation<dim,spacedim>::cell_iterator &cell);
2385 check_cell_similarity (const typename
Triangulation<dim,spacedim>::cell_iterator &cell);
2398 FEValuesBase &operator= (const FEValuesBase &);
2411 template <
int,
int,
int> friend class
FEValuesViews::SymmetricTensor;
2412 template <
int,
int,
int> friend class
FEValuesViews::Tensor;
2427 template <
int dim,
int spacedim=dim>
2428 class
FEValues : public FEValuesBase<dim,spacedim>
2435 static const unsigned int integral_dimension = dim;
2459 template <
class DH,
bool level_dof_access>
2486 std::size_t memory_consumption ()
const;
2534 template <
int dim,
int spacedim=dim>
2542 static const unsigned int integral_dimension = dim-1;
2556 const unsigned int dofs_per_cell,
2572 const std::vector<Tensor<1,spacedim> > &get_boundary_forms ()
const;
2578 unsigned int get_face_index()
const;
2584 const Quadrature<dim-1> & get_quadrature ()
const;
2590 std::size_t memory_consumption ()
const;
2622 template <
int dim,
int spacedim=dim>
2630 static const unsigned int dimension = dim;
2632 static const unsigned int space_dimension = spacedim;
2638 static const unsigned int integral_dimension = dim-1;
2660 template <
class DH,
bool level_dof_access>
2662 const unsigned int face_no);
2677 const unsigned int face_no);
2706 void do_reinit (
const unsigned int face_no);
2727 template <
int dim,
int spacedim=dim>
2734 static const unsigned int dimension = dim;
2739 static const unsigned int space_dimension = spacedim;
2745 static const unsigned int integral_dimension = dim-1;
2769 template <
class DH,
bool level_dof_access>
2771 const unsigned int face_no,
2772 const unsigned int subface_no);
2787 const unsigned int face_no,
2788 const unsigned int subface_no);
2832 void do_reinit (
const unsigned int face_no,
2833 const unsigned int subface_no);
2844 template <
int dim,
int spacedim>
2846 typename Scalar<dim,spacedim>::value_type
2847 Scalar<dim,spacedim>::value (
const unsigned int shape_function,
2848 const unsigned int q_point)
const 2851 Assert (shape_function < fe_values.fe->dofs_per_cell,
2852 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
2854 typename FVB::ExcAccessToUninitializedField(
"update_values"));
2859 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
2860 return fe_values.shape_values(shape_function_data[shape_function]
2870 template <
int dim,
int spacedim>
2872 typename Scalar<dim,spacedim>::gradient_type
2873 Scalar<dim,spacedim>::gradient (
const unsigned int shape_function,
2874 const unsigned int q_point)
const 2877 Assert (shape_function < fe_values.fe->dofs_per_cell,
2878 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
2880 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
2888 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
2889 return fe_values.shape_gradients[shape_function_data[shape_function]
2890 .row_index][q_point];
2892 return gradient_type();
2897 template <
int dim,
int spacedim>
2899 typename Scalar<dim,spacedim>::hessian_type
2900 Scalar<dim,spacedim>::hessian (
const unsigned int shape_function,
2901 const unsigned int q_point)
const 2904 Assert (shape_function < fe_values.fe->dofs_per_cell,
2905 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
2907 typename FVB::ExcAccessToUninitializedField(
"update_hessians"));
2915 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
2916 return fe_values.shape_hessians[shape_function_data[shape_function].row_index][q_point];
2918 return hessian_type();
2923 template <
int dim,
int spacedim>
2927 const unsigned int q_point)
const 2930 Assert (shape_function < fe_values.fe->dofs_per_cell,
2931 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
2933 typename FVB::ExcAccessToUninitializedField(
"update_values"));
2937 const int snc = shape_function_data[shape_function].single_nonzero_component;
2939 return value_type();
2942 value_type return_value;
2943 return_value[shape_function_data[shape_function].single_nonzero_component_index]
2944 = fe_values.shape_values(snc,q_point);
2945 return return_value;
2949 value_type return_value;
2950 for (
unsigned int d=0; d<dim; ++d)
2951 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
2953 = fe_values.shape_values(shape_function_data[shape_function].row_index[d],q_point);
2955 return return_value;
2961 template <
int dim,
int spacedim>
2965 const unsigned int q_point)
const 2968 Assert (shape_function < fe_values.fe->dofs_per_cell,
2969 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
2971 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
2975 const int snc = shape_function_data[shape_function].single_nonzero_component;
2977 return gradient_type();
2980 gradient_type return_value;
2981 return_value[shape_function_data[shape_function].single_nonzero_component_index]
2982 = fe_values.shape_gradients[snc][q_point];
2983 return return_value;
2987 gradient_type return_value;
2988 for (
unsigned int d=0; d<dim; ++d)
2989 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
2991 = fe_values.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point];
2993 return return_value;
2999 template <
int dim,
int spacedim>
3003 const unsigned int q_point)
const 3008 Assert (shape_function < fe_values.fe->dofs_per_cell,
3009 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
3011 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
3015 const int snc = shape_function_data[shape_function].single_nonzero_component;
3017 return divergence_type();
3020 fe_values.shape_gradients[snc][q_point][shape_function_data[shape_function].single_nonzero_component_index];
3023 divergence_type return_value = 0;
3024 for (
unsigned int d=0; d<dim; ++d)
3025 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
3027 += fe_values.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point][d];
3029 return return_value;
3035 template <
int dim,
int spacedim>
3043 Assert (shape_function < fe_values.fe->dofs_per_cell,
3044 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
3046 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
3048 const int snc = shape_function_data[shape_function].single_nonzero_component;
3051 return curl_type ();
3058 Assert (
false,
ExcMessage(
"Computing the curl in 1d is not a useful operation"));
3059 return curl_type ();
3066 curl_type return_value;
3072 if (shape_function_data[shape_function].single_nonzero_component_index == 0)
3073 return_value[0] = -1.0 * fe_values.shape_gradients[snc][q_point][1];
3075 return_value[0] = fe_values.shape_gradients[snc][q_point][0];
3077 return return_value;
3082 curl_type return_value;
3084 return_value[0] = 0.0;
3086 if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
3088 -= fe_values.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][1];
3090 if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
3092 += fe_values.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][0];
3094 return return_value;
3102 curl_type return_value;
3104 switch (shape_function_data[shape_function].single_nonzero_component_index)
3108 return_value[0] = 0;
3109 return_value[1] = fe_values.shape_gradients[snc][q_point][2];
3110 return_value[2] = -1.0 * fe_values.shape_gradients[snc][q_point][1];
3111 return return_value;
3116 return_value[0] = -1.0 * fe_values.shape_gradients[snc][q_point][2];
3117 return_value[1] = 0;
3118 return_value[2] = fe_values.shape_gradients[snc][q_point][0];
3119 return return_value;
3124 return_value[0] = fe_values.shape_gradients[snc][q_point][1];
3125 return_value[1] = -1.0 * fe_values.shape_gradients[snc][q_point][0];
3126 return_value[2] = 0;
3127 return return_value;
3134 curl_type return_value;
3136 for (
unsigned int i = 0; i < dim; ++i)
3137 return_value[i] = 0.0;
3139 if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
3142 += fe_values.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][2];
3144 -= fe_values.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][1];
3147 if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
3150 -= fe_values.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][2];
3152 += fe_values.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][0];
3155 if (shape_function_data[shape_function].is_nonzero_shape_function_component[2])
3158 += fe_values.shape_gradients[shape_function_data[shape_function].row_index[2]][q_point][1];
3160 -= fe_values.shape_gradients[shape_function_data[shape_function].row_index[2]][q_point][0];
3163 return return_value;
3172 template <
int dim,
int spacedim>
3176 const unsigned int q_point)
const 3181 Assert (shape_function < fe_values.fe->dofs_per_cell,
3182 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
3184 typename FVB::ExcAccessToUninitializedField(
"update_hessians"));
3188 const int snc = shape_function_data[shape_function].single_nonzero_component;
3190 return hessian_type();
3193 hessian_type return_value;
3194 return_value[shape_function_data[shape_function].single_nonzero_component_index]
3195 = fe_values.shape_hessians[snc][q_point];
3196 return return_value;
3200 hessian_type return_value;
3201 for (
unsigned int d=0; d<dim; ++d)
3202 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
3204 = fe_values.shape_hessians[shape_function_data[shape_function].row_index[d]][q_point];
3206 return return_value;
3220 ::SymmetricTensor<2,1>
3221 symmetrize_single_row (
const unsigned int n,
3222 const ::Tensor<1,1> &t)
3227 const double array[1] = { t[0] };
3228 return ::SymmetricTensor<2,1>(array);
3233 ::SymmetricTensor<2,2>
3234 symmetrize_single_row (
const unsigned int n,
3235 const ::Tensor<1,2> &t)
3241 const double array[3] = { t[0], 0, t[1]/2 };
3242 return ::SymmetricTensor<2,2>(array);
3246 const double array[3] = { 0, t[1], t[0]/2 };
3247 return ::SymmetricTensor<2,2>(array);
3252 return ::SymmetricTensor<2,2>();
3259 ::SymmetricTensor<2,3>
3260 symmetrize_single_row (
const unsigned int n,
3261 const ::Tensor<1,3> &t)
3267 const double array[6] = { t[0], 0, 0, t[1]/2, t[2]/2, 0 };
3268 return ::SymmetricTensor<2,3>(array);
3272 const double array[6] = { 0, t[1], 0, t[0]/2, 0, t[2]/2 };
3273 return ::SymmetricTensor<2,3>(array);
3277 const double array[6] = { 0, 0, t[2], 0, t[0]/2, t[1]/2 };
3278 return ::SymmetricTensor<2,3>(array);
3283 return ::SymmetricTensor<2,3>();
3290 template <
int dim,
int spacedim>
3294 const unsigned int q_point)
const 3297 Assert (shape_function < fe_values.fe->dofs_per_cell,
3298 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
3300 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
3304 const int snc = shape_function_data[shape_function].single_nonzero_component;
3306 return symmetric_gradient_type();
3308 return symmetrize_single_row (shape_function_data[shape_function].single_nonzero_component_index,
3309 fe_values.shape_gradients[snc][q_point]);
3312 gradient_type return_value;
3313 for (
unsigned int d=0; d<dim; ++d)
3314 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
3316 = fe_values.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point];
3318 return symmetrize(return_value);
3324 template <
int dim,
int spacedim>
3328 const unsigned int q_point)
const 3331 Assert (shape_function < fe_values.fe->dofs_per_cell,
3332 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
3334 typename FVB::ExcAccessToUninitializedField(
"update_values"));
3341 = shape_function_data[shape_function].single_nonzero_component;
3347 return value_type();
3352 value_type return_value;
3353 const unsigned int comp =
3354 shape_function_data[shape_function].single_nonzero_component_index;
3355 return_value[value_type::unrolled_to_component_indices(comp)]
3356 = fe_values.shape_values(snc,q_point);
3357 return return_value;
3361 value_type return_value;
3362 for (
unsigned int d = 0; d < value_type::n_independent_components; ++d)
3363 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
3364 return_value[value_type::unrolled_to_component_indices(d)]
3365 = fe_values.shape_values(shape_function_data[shape_function].row_index[d],q_point);
3366 return return_value;
3371 template <
int dim,
int spacedim>
3375 const unsigned int q_point)
const 3378 Assert (shape_function < fe_values.fe->dofs_per_cell,
3379 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
3381 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
3383 const int snc = shape_function_data[shape_function].single_nonzero_component;
3389 return divergence_type();
3422 const unsigned int comp =
3423 shape_function_data[shape_function].single_nonzero_component_index;
3424 const unsigned int ii = value_type::unrolled_to_component_indices(comp)[0];
3425 const unsigned int jj = value_type::unrolled_to_component_indices(comp)[1];
3442 const ::Tensor<1, spacedim> phi_grad = fe_values.shape_gradients[snc][q_point];
3444 divergence_type return_value;
3445 return_value[ii] = phi_grad[jj];
3448 return_value[jj] = phi_grad[ii];
3450 return return_value;
3456 divergence_type return_value;
3457 return return_value;
3461 template <
int dim,
int spacedim>
3465 const unsigned int q_point)
const 3468 Assert (shape_function < fe_values.fe->dofs_per_cell,
3469 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
3471 typename FVB::ExcAccessToUninitializedField(
"update_values"));
3478 = shape_function_data[shape_function].single_nonzero_component;
3484 return value_type();
3489 value_type return_value;
3490 const unsigned int comp =
3491 shape_function_data[shape_function].single_nonzero_component_index;
3493 return_value[indices] = fe_values.shape_values(snc,q_point);
3494 return return_value;
3498 value_type return_value;
3499 for (
unsigned int d = 0; d < dim*dim; ++d)
3500 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
3503 return_value[indices]
3504 = fe_values.shape_values(shape_function_data[shape_function].row_index[d],q_point);
3506 return return_value;
3511 template <
int dim,
int spacedim>
3515 const unsigned int q_point)
const 3518 Assert (shape_function < fe_values.fe->dofs_per_cell,
3519 ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
3521 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
3523 const int snc = shape_function_data[shape_function].single_nonzero_component;
3529 return divergence_type();
3549 const unsigned int comp =
3550 shape_function_data[shape_function].single_nonzero_component_index;
3552 const unsigned int ii = indices[0];
3553 const unsigned int jj = indices[1];
3555 const ::Tensor<1, spacedim> phi_grad = fe_values.shape_gradients[snc][q_point];
3557 divergence_type return_value;
3558 return_value[jj] = phi_grad[ii];
3560 return return_value;
3566 divergence_type return_value;
3567 return return_value;
3578 template <
int dim,
int spacedim>
3586 0, fe_values_views_cache.scalars.size()));
3588 return fe_values_views_cache.scalars[scalar.
component];
3593 template <
int dim,
int spacedim>
3600 fe_values_views_cache.vectors.size(),
3602 0, fe_values_views_cache.vectors.size()));
3607 template <
int dim,
int spacedim>
3614 fe_values_views_cache.symmetric_second_order_tensors.size(),
3616 0, fe_values_views_cache.symmetric_second_order_tensors.size()));
3621 template <
int dim,
int spacedim>
3628 fe_values_views_cache.second_order_tensors.size(),
3630 0, fe_values_views_cache.second_order_tensors.size()));
3638 template <
int dim,
int spacedim>
3642 const unsigned int j)
const 3644 Assert (i < fe->dofs_per_cell,
3647 ExcAccessToUninitializedField(
"update_values"));
3648 Assert (fe->is_primitive (i),
3649 ExcShapeFunctionNotPrimitive(i));
3653 if (fe->is_primitive())
3654 return this->shape_values(i,j);
3666 row = this->shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first];
3667 return this->shape_values(row, j);
3673 template <
int dim,
int spacedim>
3677 const unsigned int j,
3678 const unsigned int component)
const 3680 Assert (i < fe->dofs_per_cell,
3682 Assert (this->update_flags & update_values,
3683 ExcAccessToUninitializedField(
"update_values"));
3684 Assert (component < fe->n_components(),
3690 if (fe->get_nonzero_components(i)[component] ==
false)
3697 row = this->shape_function_to_row_table[i * fe->n_components() + component];
3698 return this->shape_values(row, j);
3703 template <
int dim,
int spacedim>
3707 const unsigned int j)
const 3709 Assert (i < fe->dofs_per_cell,
3712 ExcAccessToUninitializedField(
"update_gradients"));
3713 Assert (fe->is_primitive (i),
3714 ExcShapeFunctionNotPrimitive(i));
3715 Assert (i<this->shape_gradients.size(),
3717 Assert (j<this->shape_gradients[0].size(),
3722 if (fe->is_primitive())
3723 return this->shape_gradients[i][j];
3735 row = this->shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first];
3736 return this->shape_gradients[row][j];
3742 template <
int dim,
int spacedim>
3746 const unsigned int j,
3747 const unsigned int component)
const 3749 Assert (i < fe->dofs_per_cell,
3751 Assert (this->update_flags & update_gradients,
3752 ExcAccessToUninitializedField(
"update_gradients"));
3753 Assert (component < fe->n_components(),
3759 if (fe->get_nonzero_components(i)[component] ==
false)
3766 row = this->shape_function_to_row_table[i * fe->n_components() + component];
3767 return this->shape_gradients[row][j];
3772 template <
int dim,
int spacedim>
3776 const unsigned int j)
const 3778 Assert (i < fe->dofs_per_cell,
3781 ExcAccessToUninitializedField(
"update_hessians"));
3782 Assert (fe->is_primitive (i),
3783 ExcShapeFunctionNotPrimitive(i));
3784 Assert (i<this->shape_hessians.size(),
3786 Assert (j<this->shape_hessians[0].size(),
3791 if (fe->is_primitive())
3792 return this->shape_hessians[i][j];
3804 row = this->shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first];
3805 return this->shape_hessians[row][j];
3811 template <
int dim,
int spacedim>
3815 const unsigned int j)
const 3817 return shape_hessian(i,j);
3822 template <
int dim,
int spacedim>
3826 const unsigned int j,
3827 const unsigned int component)
const 3829 Assert (i < fe->dofs_per_cell,
3831 Assert (this->update_flags & update_hessians,
3832 ExcAccessToUninitializedField(
"update_hessians"));
3833 Assert (component < fe->n_components(),
3839 if (fe->get_nonzero_components(i)[component] ==
false)
3846 row = this->shape_function_to_row_table[i * fe->n_components() + component];
3847 return this->shape_hessians[row][j];
3852 template <
int dim,
int spacedim>
3856 const unsigned int j,
3857 const unsigned int component)
const 3859 return shape_hessian_component(i,j,component);
3864 template <
int dim,
int spacedim>
3873 template <
int dim,
int spacedim>
3883 template <
int dim,
int spacedim>
3888 return this->update_flags;
3893 template <
int dim,
int spacedim>
3895 const std::vector<Point<spacedim> > &
3899 ExcAccessToUninitializedField(
"update_quadrature_points"));
3900 return this->quadrature_points;
3905 template <
int dim,
int spacedim>
3907 const std::vector<double> &
3911 ExcAccessToUninitializedField(
"update_JxW_values"));
3912 return this->JxW_values;
3917 template <
int dim,
int spacedim>
3919 const std::vector<DerivativeForm<1,dim,spacedim> > &
3923 ExcAccessToUninitializedField(
"update_jacobians"));
3924 return this->jacobians;
3929 template <
int dim,
int spacedim>
3931 const std::vector<DerivativeForm<2,dim,spacedim> > &
3935 ExcAccessToUninitializedField(
"update_jacobians_grads"));
3936 return this->jacobian_grads;
3941 template <
int dim,
int spacedim>
3943 const std::vector<DerivativeForm<1,spacedim,dim> > &
3947 ExcAccessToUninitializedField(
"update_inverse_jacobians"));
3948 return this->inverse_jacobians;
3953 template <
int dim,
int spacedim>
3959 ExcAccessToUninitializedField(
"update_quadrature_points"));
3960 Assert (i<this->quadrature_points.size(),
ExcIndexRange(i, 0, this->quadrature_points.size()));
3962 return this->quadrature_points[i];
3968 template <
int dim,
int spacedim>
3974 ExcAccessToUninitializedField(
"update_JxW_values"));
3977 return this->JxW_values[i];
3982 template <
int dim,
int spacedim>
3988 ExcAccessToUninitializedField(
"update_jacobians"));
3991 return this->jacobians[i];
3996 template <
int dim,
int spacedim>
4002 ExcAccessToUninitializedField(
"update_jacobians_grads"));
4005 return this->jacobian_grads[i];
4010 template <
int dim,
int spacedim>
4016 ExcAccessToUninitializedField(
"update_inverse_jacobians"));
4017 Assert (i<this->inverse_jacobians.size(),
ExcIndexRange(i, 0, this->inverse_jacobians.size()));
4019 return this->inverse_jacobians[i];
4023 template <
int dim,
int spacedim>
4024 template <
class InputVector>
4030 get_function_gradients(fe_function, gradients);
4035 template <
int dim,
int spacedim>
4036 template <
class InputVector>
4040 const InputVector &fe_function,
4041 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
4044 get_function_gradients(fe_function, indices, values);
4049 template <
int dim,
int spacedim>
4050 template <
class InputVector>
4057 get_function_gradients(fe_function, gradients);
4062 template <
int dim,
int spacedim>
4063 template <
class InputVector>
4067 const InputVector &fe_function,
4068 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
4070 bool q_points_fastest)
const 4072 get_function_gradients(fe_function, indices, values, q_points_fastest);
4077 template <
int dim,
int spacedim>
4078 template <
class InputVector>
4085 get_function_hessians(fe_function, hessians);
4090 template <
int dim,
int spacedim>
4091 template <
class InputVector>
4097 bool quadrature_points_fastest)
const 4099 get_function_hessians(fe_function, hessians, quadrature_points_fastest);
4104 template <
int dim,
int spacedim>
4111 typename FVB::ExcAccessToUninitializedField(
"update_normal_vectors"));
4112 Assert (i<this->normal_vectors.size(),
4115 return this->normal_vectors[i];
4120 template <
int dim,
int spacedim>
4125 return this->normal_vector(i);
4134 template <
int dim,
int spacedim>
4144 template <
int dim,
int spacedim>
4156 template <
int dim,
int spacedim>
4161 return present_face_index;
4167 template <
int dim,
int spacedim>
4177 template <
int dim,
int spacedim>
4187 template <
int dim,
int spacedim>
4197 template <
int dim,
int spacedim>
4203 Assert (i<this->boundary_forms.size(),
4206 typename FVB::ExcAccessToUninitializedField(
"update_boundary_forms"));
4208 return this->boundary_forms[i];
4213 DEAL_II_NAMESPACE_CLOSE
Transformed quadrature weights.
const std::vector< DerivativeForm< 2, dim, spacedim > > & get_jacobian_grads() const
HessianVector shape_hessians
double shape_value_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
const Tensor< 1, spacedim > & shape_grad(const unsigned int function_no, const unsigned int quadrature_point) const
const FEValuesViews::Scalar< dim, spacedim > & operator[](const FEValuesExtractors::Scalar &scalar) const
::Tensor< 1, spacedim > divergence_type
void get_function_grads(const InputVector &fe_function, std::vector< Tensor< 1, spacedim > > &gradients) const DEAL_II_DEPRECATED
const FEValuesBase< dim, spacedim > & fe_values
Tensor< 1, spacedim > shape_grad_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
unsigned int present_face_index
const Quadrature< dim-1 > & get_quadrature() const
const Tensor< 2, spacedim > & shape_2nd_derivative(const unsigned int function_no, const unsigned int point_no) const DEAL_II_DEPRECATED
std::vector< std::vector< Tensor< 2, spacedim > > > HessianVector
const Tensor< 2, spacedim > & shape_hessian(const unsigned int function_no, const unsigned int point_no) const
std::vector< ShapeFunctionData > shape_function_data
std::vector<::FEValuesViews::Scalar< dim, spacedim > > scalars
static TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
const unsigned int dofs_per_cell
GradientVector shape_gradients
const Point< spacedim > & normal_vector(const unsigned int i) const
const DerivativeForm< 1, dim, spacedim > & jacobian(const unsigned int quadrature_point) const
const unsigned int component
::Tensor< 3, spacedim > hessian_type
const Quadrature< dim-1 > quadrature
::ExceptionBase & ExcMessage(std::string arg1)
unsigned int get_face_index() const
const FESubfaceValues< dim, spacedim > & get_present_fe_values() const
int single_nonzero_component
const std::vector< DerivativeForm< 1, spacedim, dim > > & get_inverse_jacobians() const
::internal::CurlType< spacedim >::type curl_type
Outer normal vector, not normalized.
const FEFaceValues< dim, spacedim > & get_present_fe_values() const
const unsigned int first_tensor_component
Transformed quadrature points.
const Tensor< 1, spacedim > & boundary_form(const unsigned int i) const
::Tensor< 1, spacedim > gradient_type
::SymmetricTensor< 2, spacedim > value_type
std::vector< Point< spacedim > > normal_vectors
std::vector< DerivativeForm< 1, dim, spacedim > > jacobians
const std::vector< double > & get_JxW_values() const
const Point< spacedim > & quadrature_point(const unsigned int i) const
UpdateFlags get_update_flags() const
std::vector< double > JxW_values
const Quadrature< dim > & get_quadrature() const
const std::vector< DerivativeForm< 1, dim, spacedim > > & get_jacobians() const
const std::vector< Point< spacedim > > & get_quadrature_points() const
std::vector< Tensor< 1, spacedim > > boundary_forms
const unsigned int first_tensor_component
::Tensor< 1, spacedim > value_type
#define DeclException1(Exception1, type1, outsequence)
std::vector< ShapeFunctionData > shape_function_data
std::vector< DerivativeForm< 1, spacedim, dim > > inverse_jacobians
#define Assert(cond, exc)
::Tensor< 2, spacedim > value_type
std::vector< ShapeFunctionData > shape_function_data
const Quadrature< dim > quadrature
const unsigned int first_vector_component
#define DeclException0(Exception0)
std::vector< unsigned int > shape_function_to_row_table
::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
::Tensor< 1, spacedim > divergence_type
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
Tensor< 2, spacedim > shape_hessian_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
Second derivatives of shape functions.
Gradient of volume element.
const Mapping< dim, spacedim > & get_mapping() const
std::vector< DerivativeForm< 2, dim, spacedim > > jacobian_grads
std::vector< std::vector< Tensor< 1, spacedim > > > GradientVector
const DerivativeForm< 1, spacedim, dim > & inverse_jacobian(const unsigned int quadrature_point) const
const unsigned int n_quadrature_points
const Point< spacedim > & cell_normal_vector(const unsigned int i) const DEAL_II_DEPRECATED
const double & shape_value(const unsigned int function_no, const unsigned int point_no) const
::Tensor< 2, spacedim > hessian_type
const FEValuesBase< dim, spacedim > & fe_values
int single_nonzero_component
::SymmetricTensor< 2, spacedim > symmetric_gradient_type
std::vector< Point< spacedim > > quadrature_points
Shape function gradients.
Table< 2, double > ShapeVector
::Tensor< 2, spacedim > gradient_type
const FEValuesBase< dim, spacedim > & fe_values
const DerivativeForm< 2, dim, spacedim > & jacobian_grad(const unsigned int quadrature_point) const
::ExceptionBase & ExcNotImplemented()
const FiniteElement< dim, spacedim > & get_fe() const
Tensor< 2, spacedim > shape_2nd_derivative_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const DEAL_II_DEPRECATED
bool is_nonzero_shape_function_component
::ExceptionBase & ExcInternalError()
void get_function_2nd_derivatives(const InputVector &, std::vector< Tensor< 2, spacedim > > &) const DEAL_II_DEPRECATED
int single_nonzero_component
double JxW(const unsigned int quadrature_point) const
const FEValues< dim, spacedim > & get_present_fe_values() const
std::vector< ShapeFunctionData > shape_function_data
const FEValuesBase< dim, spacedim > & fe_values