16#ifndef dealii_meshworker_scratch_data_h
17#define dealii_meshworker_scratch_data_h
29#include <boost/any.hpp>
219 template <
int dim,
int spacedim = dim>
348 const unsigned int face_no);
362 const unsigned int face_no,
363 const unsigned int subface_no);
381 const unsigned int face_no,
382 const unsigned int sub_face_no,
385 const unsigned int face_no_neighbor,
386 const unsigned int sub_face_no_neighbor);
404 const std::vector<Point<spacedim>> &
410 const std::vector<double> &
416 const std::vector<Tensor<1, spacedim>> &
423 const std::vector<types::global_dof_index> &
454 const unsigned int face_no);
469 const unsigned int face_no,
470 const unsigned int subface_no);
489 const std::vector<double> &
495 const std::vector<Tensor<1, spacedim>> &
502 const std::vector<types::global_dof_index> &
557 template <
typename VectorType,
typename Number =
double>
560 const VectorType & input_vector,
561 const Number dummy = Number(0));
571 template <
typename Number =
double>
572 const std::vector<Number> &
574 Number dummy = Number(0))
const;
597 template <
typename Extractor,
typename Number =
double>
598 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
599 template solution_value_type<Number>> &
601 const Extractor & variable,
602 const Number dummy = Number(0));
625 template <
typename Extractor,
typename Number =
double>
626 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
627 template solution_gradient_type<Number>> &
629 const Extractor & variable,
630 const Number dummy = Number(0));
654 template <
typename Extractor,
typename Number =
double>
655 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
656 template solution_symmetric_gradient_type<Number>> &
658 const Extractor & variable,
659 const Number dummy = Number(0));
682 template <
typename Extractor,
typename Number =
double>
683 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
684 template solution_divergence_type<Number>> &
686 const Extractor & variable,
687 const Number dummy = Number(0));
710 template <
typename Extractor,
typename Number =
double>
711 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
712 template solution_curl_type<Number>> &
714 const Extractor & variable,
715 const Number dummy = Number(0));
738 template <
typename Extractor,
typename Number =
double>
739 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
740 template solution_hessian_type<Number>> &
742 const Extractor & variable,
743 const Number dummy = Number(0));
766 template <
typename Extractor,
typename Number =
double>
767 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
768 template solution_laplacian_type<Number>> &
770 const Extractor & variable,
771 const Number dummy = Number(0));
794 template <
typename Extractor,
typename Number =
double>
795 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
796 template solution_third_derivative_type<Number>> &
798 const Extractor & variable,
799 const Number dummy = Number(0));
814 template <
typename Extractor,
typename Number =
double>
817 const Extractor & variable,
818 const std::string &object_type,
819 const unsigned int size,
820 const Number & exemplar_number)
const;
825 template <
typename Number =
double>
828 const unsigned int size,
829 const Number & exemplar_number)
const;
946 template <
int dim,
int spacedim>
947 template <
typename Extractor,
typename Number>
950 const std::string &global_vector_name,
951 const Extractor & variable,
952 const std::string &object_type,
953 const unsigned int size,
954 const Number & exemplar_number)
const
956 return global_vector_name +
"_" + variable.get_name() +
"_" + object_type +
963 template <
int dim,
int spacedim>
964 template <
typename Number>
967 const std::string &global_vector_name,
968 const unsigned int size,
969 const Number & exemplar_number)
const
971 return global_vector_name +
"_independent_local_dofs_" +
978 template <
int dim,
int spacedim>
979 template <
typename VectorType,
typename Number>
982 const std::string &global_vector_name,
983 const VectorType & input_vector,
986 const unsigned int n_dofs = local_dof_indices.size();
988 const std::string name =
989 get_unique_dofs_name(global_vector_name, n_dofs, dummy);
991 auto &independent_local_dofs =
992 internal_data_storage
993 .template get_or_add_object_with_name<std::vector<Number>>(name,
999 for (
unsigned int i = 0; i < n_dofs; ++i)
1001 input_vector(local_dof_indices[i]),
1004 independent_local_dofs[i]);
1006 for (
unsigned int i = 0; i < n_dofs; ++i)
1007 independent_local_dofs[i] = input_vector(local_dof_indices[i]);
1012 template <
int dim,
int spacedim>
1013 template <
typename Number>
1014 const std::vector<Number> &
1016 const std::string &global_vector_name,
1019 const unsigned int n_dofs =
1022 const std::string dofs_name =
1023 get_unique_dofs_name(global_vector_name, n_dofs, dummy);
1026 internal_data_storage.stores_object_with_name(dofs_name),
1028 "You did not call yet extract_local_dof_values with the right types!"));
1030 return internal_data_storage
1031 .template get_object_with_name<std::vector<Number>>(dofs_name);
1036 template <
int dim,
int spacedim>
1037 template <
typename Extractor,
typename Number>
1038 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1039 template solution_value_type<Number>> &
1041 const Extractor & variable,
1044 const std::vector<Number> &independent_local_dofs =
1045 get_local_dof_values(global_vector_name, dummy);
1051 const std::string name = get_unique_name(
1052 global_vector_name, variable,
"_values_q", n_q_points, dummy);
1056 std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1057 template solution_value_type<Number>>;
1060 internal_data_storage.template get_or_add_object_with_name<RetType>(
1065 fev[variable].get_function_values_from_local_dof_values(
1066 independent_local_dofs, ret);
1072 template <
int dim,
int spacedim>
1073 template <
typename Extractor,
typename Number>
1074 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1075 template solution_gradient_type<Number>> &
1077 const std::string &global_vector_name,
1078 const Extractor & variable,
1081 const std::vector<Number> &independent_local_dofs =
1082 get_local_dof_values(global_vector_name, dummy);
1088 const std::string name = get_unique_name(
1089 global_vector_name, variable,
"_gradients_q", n_q_points, dummy);
1093 std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1094 template solution_gradient_type<Number>>;
1097 internal_data_storage.template get_or_add_object_with_name<RetType>(
1102 fev[variable].get_function_gradients_from_local_dof_values(
1103 independent_local_dofs, ret);
1109 template <
int dim,
int spacedim>
1110 template <
typename Extractor,
typename Number>
1111 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1112 template solution_hessian_type<Number>> &
1114 const std::string &global_vector_name,
1115 const Extractor & variable,
1118 const std::vector<Number> &independent_local_dofs =
1119 get_local_dof_values(global_vector_name, dummy);
1125 const std::string name = get_unique_name(
1126 global_vector_name, variable,
"_hessians_q", n_q_points, dummy);
1130 std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1131 template solution_hessian_type<Number>>;
1134 internal_data_storage.template get_or_add_object_with_name<RetType>(
1140 fev[variable].get_function_hessians_from_local_dof_values(
1141 independent_local_dofs, ret);
1147 template <
int dim,
int spacedim>
1148 template <
typename Extractor,
typename Number>
1149 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1150 template solution_laplacian_type<Number>> &
1152 const std::string &global_vector_name,
1153 const Extractor & variable,
1156 const std::vector<Number> &independent_local_dofs =
1157 get_local_dof_values(global_vector_name, dummy);
1163 const std::string name = get_unique_name(
1164 global_vector_name, variable,
"_laplacians_q", n_q_points, dummy);
1168 std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1169 template solution_laplacian_type<Number>>;
1172 internal_data_storage.template get_or_add_object_with_name<RetType>(
1178 fev[variable].get_function_laplacians_from_local_dof_values(
1179 independent_local_dofs, ret);
1185 template <
int dim,
int spacedim>
1186 template <
typename Extractor,
typename Number>
1187 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1188 template solution_third_derivative_type<Number>> &
1190 const std::string &global_vector_name,
1191 const Extractor & variable,
1194 const std::vector<Number> &independent_local_dofs =
1195 get_local_dof_values(global_vector_name, dummy);
1201 const std::string name = get_unique_name(
1202 global_vector_name, variable,
"_third_derivatives_q", n_q_points, dummy);
1206 std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1207 template solution_third_derivative_type<Number>>;
1210 internal_data_storage.template get_or_add_object_with_name<RetType>(
1216 fev[variable].get_function_third_derivatives_from_local_dof_values(
1217 independent_local_dofs, ret);
1223 template <
int dim,
int spacedim>
1224 template <
typename Extractor,
typename Number>
1225 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1226 template solution_symmetric_gradient_type<Number>> &
1228 const std::string &global_vector_name,
1229 const Extractor & variable,
1232 const std::vector<Number> &independent_local_dofs =
1233 get_local_dof_values(global_vector_name, dummy);
1239 const std::string name = get_unique_name(
1240 global_vector_name, variable,
"_symmetric_gradient_q", n_q_points, dummy);
1245 std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1246 template solution_symmetric_gradient_type<Number>>;
1249 internal_data_storage.template get_or_add_object_with_name<RetType>(
1255 fev[variable].get_function_symmetric_gradients_from_local_dof_values(
1256 independent_local_dofs, ret);
1261 template <
int dim,
int spacedim>
1262 template <
typename Extractor,
typename Number>
1263 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1264 template solution_divergence_type<Number>> &
1266 const std::string &global_vector_name,
1267 const Extractor & variable,
1270 const std::vector<Number> &independent_local_dofs =
1271 get_local_dof_values(global_vector_name, dummy);
1277 const std::string name = get_unique_name(
1278 global_vector_name, variable,
"_divergence_q", n_q_points, dummy);
1282 std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1283 template solution_divergence_type<Number>>;
1286 internal_data_storage.template get_or_add_object_with_name<RetType>(
1292 fev[variable].get_function_divergences_from_local_dof_values(
1293 independent_local_dofs, ret);
1299 template <
int dim,
int spacedim>
1300 template <
typename Extractor,
typename Number>
1301 const std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1302 template solution_curl_type<Number>> &
1304 const Extractor & variable,
1307 const std::vector<Number> &independent_local_dofs =
1308 get_local_dof_values(global_vector_name, dummy);
1314 const std::string name = get_unique_name(
1315 global_vector_name, variable,
"_curl_q", n_q_points, dummy);
1319 std::vector<typename FEValuesViews::View<dim, spacedim, Extractor>::
1320 template solution_curl_type<Number>>;
1323 internal_data_storage.template get_or_add_object_with_name<RetType>(
1328 fev[variable].get_function_curls_from_local_dof_values(
1329 independent_local_dofs, ret);
const unsigned int n_quadrature_points
const FiniteElement< dim, spacedim > & get_fe() const
unsigned int n_dofs_per_cell() const
GeneralDataStorage user_data_storage
const std::vector< typename FEValuesViews::View< dim, spacedim, Extractor >::template solution_value_type< Number > > & get_values(const std::string &global_vector_name, const Extractor &variable, const Number dummy=Number(0))
const FEValuesBase< dim, spacedim > & get_current_fe_values() const
GeneralDataStorage & get_general_data_storage()
std::string get_unique_name(const std::string &global_vector_name, const Extractor &variable, const std::string &object_type, const unsigned int size, const Number &exemplar_number) const
const std::vector< typename FEValuesViews::View< dim, spacedim, Extractor >::template solution_divergence_type< Number > > & get_divergences(const std::string &global_vector_name, const Extractor &variable, const Number dummy=Number(0))
const std::vector< Tensor< 1, spacedim > > & get_neighbor_normal_vectors()
std::unique_ptr< FEValues< dim, spacedim > > neighbor_fe_values
std::unique_ptr< FEFaceValues< dim, spacedim > > fe_face_values
std::string get_unique_dofs_name(const std::string &global_vector_name, const unsigned int size, const Number &exemplar_number) const
void extract_local_dof_values(const std::string &global_vector_name, const VectorType &input_vector, const Number dummy=Number(0))
std::unique_ptr< FEValues< dim, spacedim > > fe_values
UpdateFlags cell_update_flags
const std::vector< double > & get_JxW_values() const
const Mapping< dim, spacedim > & get_mapping() const
std::unique_ptr< FEInterfaceValues< dim, spacedim > > interface_fe_values
const std::vector< double > & get_neighbor_JxW_values() const
Quadrature< dim > cell_quadrature
std::unique_ptr< FEFaceValues< dim, spacedim > > neighbor_fe_face_values
std::vector< types::global_dof_index > neighbor_dof_indices
SmartPointer< const FiniteElement< dim, spacedim > > fe
UpdateFlags face_update_flags
const std::vector< types::global_dof_index > & get_neighbor_dof_indices() const
const std::vector< typename FEValuesViews::View< dim, spacedim, Extractor >::template solution_laplacian_type< Number > > & get_laplacians(const std::string &global_vector_name, const Extractor &variable, const Number dummy=Number(0))
UpdateFlags neighbor_cell_update_flags
const std::vector< typename FEValuesViews::View< dim, spacedim, Extractor >::template solution_third_derivative_type< Number > > & get_third_derivatives(const std::string &global_vector_name, const Extractor &variable, const Number dummy=Number(0))
const std::vector< Tensor< 1, spacedim > > & get_normal_vectors() const
const std::vector< typename FEValuesViews::View< dim, spacedim, Extractor >::template solution_curl_type< Number > > & get_curls(const std::string &global_vector_name, const Extractor &variable, const Number dummy=Number(0))
const FEValues< dim, spacedim > & reinit_neighbor(const typename DoFHandler< dim, spacedim >::active_cell_iterator &cell)
const std::vector< typename FEValuesViews::View< dim, spacedim, Extractor >::template solution_hessian_type< Number > > & get_hessians(const std::string &global_vector_name, const Extractor &variable, const Number dummy=Number(0))
std::vector< types::global_dof_index > local_dof_indices
SmartPointer< const Mapping< dim, spacedim > > mapping
SmartPointer< const FEValuesBase< dim, spacedim > > current_fe_values
const std::vector< Number > & get_local_dof_values(const std::string &global_vector_name, Number dummy=Number(0)) const
const std::vector< Point< spacedim > > & get_quadrature_points() const
const FEValuesBase< dim, spacedim > & get_current_neighbor_fe_values() const
const std::vector< types::global_dof_index > & get_local_dof_indices() const
SmartPointer< const FEValuesBase< dim, spacedim > > current_neighbor_fe_values
const std::vector< typename FEValuesViews::View< dim, spacedim, Extractor >::template solution_symmetric_gradient_type< Number > > & get_symmetric_gradients(const std::string &global_vector_name, const Extractor &variable, const Number dummy=Number(0))
Quadrature< dim - 1 > face_quadrature
const std::vector< typename FEValuesViews::View< dim, spacedim, Extractor >::template solution_gradient_type< Number > > & get_gradients(const std::string &global_vector_name, const Extractor &variable, const Number dummy=Number(0))
UpdateFlags neighbor_face_update_flags
ScratchData(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim > &quadrature, const UpdateFlags &update_flags, const Quadrature< dim - 1 > &face_quadrature=Quadrature< dim - 1 >(), const UpdateFlags &face_update_flags=update_default)
std::unique_ptr< FESubfaceValues< dim, spacedim > > neighbor_fe_subface_values
const FEValues< dim, spacedim > & reinit(const typename DoFHandler< dim, spacedim >::active_cell_iterator &cell)
std::unique_ptr< FESubfaceValues< dim, spacedim > > fe_subface_values
GeneralDataStorage internal_data_storage
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
@ update_default
No update.
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcMessage(std::string arg1)
std::string type_to_string(const T &t)
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)