16 #ifndef dealii_meshworker_scratch_data_h
17 #define dealii_meshworker_scratch_data_h
28 #include <boost/any.hpp>
44 template <
int dim,
int spacedim,
typename NumberType,
typename Extractor>
231 template <
int dim,
int spacedim = dim>
360 const unsigned int face_no);
374 const unsigned int face_no,
375 const unsigned int subface_no);
393 const std::vector<Point<spacedim>> &
399 const std::vector<double> &
405 const std::vector<Tensor<1, spacedim>> &
412 const std::vector<types::global_dof_index> &
443 const unsigned int face_no);
458 const unsigned int face_no,
459 const unsigned int subface_no);
478 const std::vector<double> &
484 const std::vector<Tensor<1, spacedim>> &
491 const std::vector<types::global_dof_index> &
538 template <
typename VectorType,
typename Number =
double>
542 const Number
dummy = Number(0));
552 template <
typename Number =
double>
553 const std::vector<Number> &
555 Number
dummy = Number(0))
const;
578 template <
typename Extractor,
typename Number =
double>
582 get_values(
const std::string &global_vector_name,
583 const Extractor & variable,
584 const Number
dummy = Number(0));
607 template <
typename Extractor,
typename Number =
double>
612 const Extractor & variable,
613 const Number
dummy = Number(0));
637 template <
typename Extractor,
typename Number =
double>
640 symmetric_gradient_type> &
642 const Extractor & variable,
643 const Number
dummy = Number(0));
666 template <
typename Extractor,
typename Number =
double>
671 const Extractor & variable,
672 const Number
dummy = Number(0));
695 template <
typename Extractor,
typename Number =
double>
696 const std::vector<
typename internal::
697 OutputType<dim, spacedim, Number, Extractor>::curl_type>
699 get_curls(
const std::string &global_vector_name,
700 const Extractor & variable,
701 const Number
dummy = Number(0));
724 template <
typename Extractor,
typename Number =
double>
729 const Extractor & variable,
730 const Number
dummy = Number(0));
753 template <
typename Extractor,
typename Number =
double>
756 third_derivative_type> &
758 const Extractor & variable,
759 const Number
dummy = Number(0));
774 template <
typename Extractor,
typename Number =
double>
777 const Extractor & variable,
778 const std::string &object_type,
779 const unsigned int size,
780 const Number & exemplar_number)
const;
785 template <
typename Number =
double>
788 const unsigned int size,
789 const Number & exemplar_number)
const;
901 template <
int dim,
int spacedim>
902 template <
typename Extractor,
typename Number>
905 const std::string &global_vector_name,
906 const Extractor & variable,
907 const std::string &object_type,
908 const unsigned int size,
909 const Number & exemplar_number)
const
911 return global_vector_name +
"_" + variable.get_name() +
"_" + object_type +
918 template <
int dim,
int spacedim>
919 template <
typename Number>
922 const std::string &global_vector_name,
923 const unsigned int size,
924 const Number & exemplar_number)
const
926 return global_vector_name +
"_independent_local_dofs_" +
933 template <
int dim,
int spacedim>
934 template <
typename VectorType,
typename Number>
937 const std::string &global_vector_name,
941 const unsigned int n_dofs = get_current_fe_values().get_fe().dofs_per_cell;
943 const std::string name =
944 get_unique_dofs_name(global_vector_name, n_dofs,
dummy);
946 auto &independent_local_dofs =
947 internal_data_storage
948 .template get_or_add_object_with_name<std::vector<Number>>(name,
954 for (
unsigned int i = 0; i < n_dofs; ++i)
956 input_vector(local_dof_indices[i]),
959 independent_local_dofs[i]);
961 for (
unsigned int i = 0; i < n_dofs; ++i)
962 independent_local_dofs[i] = input_vector(local_dof_indices[i]);
967 template <
int dim,
int spacedim>
968 template <
typename Number>
969 const std::vector<Number> &
971 const std::string &global_vector_name,
974 const unsigned int n_dofs = get_current_fe_values().get_fe().dofs_per_cell;
976 const std::string dofs_name =
977 get_unique_dofs_name(global_vector_name, n_dofs,
dummy);
980 internal_data_storage.stores_object_with_name(dofs_name),
982 "You did not call yet extract_local_dof_values with the right types!"));
984 return internal_data_storage
985 .template get_object_with_name<std::vector<Number>>(dofs_name);
990 template <
int dim,
int spacedim>
991 template <
typename Extractor,
typename Number>
993 typename internal::OutputType<dim, spacedim, Number, Extractor>::value_type>
996 const std::string &global_vector_name,
997 const Extractor & variable,
1000 const std::vector<Number> &independent_local_dofs =
1001 get_local_dof_values(global_vector_name,
dummy);
1007 const std::string name = get_unique_name(
1008 global_vector_name, variable,
"_values_q", n_q_points,
dummy);
1012 std::vector<
typename internal::
1013 OutputType<dim, spacedim, Number, Extractor>::value_type>;
1016 internal_data_storage.template get_or_add_object_with_name<RetType>(
1021 fev[variable].get_function_values_from_local_dof_values(
1022 independent_local_dofs, ret);
1028 template <
int dim,
int spacedim>
1029 template <
typename Extractor,
typename Number>
1031 typename internal::OutputType<dim, spacedim, Number, Extractor>::
1034 const std::string &global_vector_name,
1035 const Extractor & variable,
1038 const std::vector<Number> &independent_local_dofs =
1039 get_local_dof_values(global_vector_name,
dummy);
1045 const std::string name = get_unique_name(
1046 global_vector_name, variable,
"_gradients_q", n_q_points,
dummy);
1049 using RetType = std::vector<
1050 typename internal::OutputType<dim, spacedim, Number, Extractor>::
1054 internal_data_storage.template get_or_add_object_with_name<RetType>(
1059 fev[variable].get_function_gradients_from_local_dof_values(
1060 independent_local_dofs, ret);
1066 template <
int dim,
int spacedim>
1067 template <
typename Extractor,
typename Number>
1069 typename internal::OutputType<dim, spacedim, Number, Extractor>::
1072 const std::string &global_vector_name,
1073 const Extractor & variable,
1076 const std::vector<Number> &independent_local_dofs =
1077 get_local_dof_values(global_vector_name,
dummy);
1083 const std::string name = get_unique_name(
1084 global_vector_name, variable,
"_hessians_q", n_q_points,
dummy);
1088 std::vector<
typename internal::
1089 OutputType<dim, spacedim, Number, Extractor>::hessian_type>;
1092 internal_data_storage.template get_or_add_object_with_name<RetType>(
1098 fev[variable].get_function_hessians_from_local_dof_values(
1099 independent_local_dofs, ret);
1105 template <
int dim,
int spacedim>
1106 template <
typename Extractor,
typename Number>
1108 typename internal::OutputType<dim, spacedim, Number, Extractor>::
1109 third_derivative_type> &
1111 const std::string &global_vector_name,
1112 const Extractor & variable,
1115 const std::vector<Number> &independent_local_dofs =
1116 get_local_dof_values(global_vector_name,
dummy);
1122 const std::string name = get_unique_name(
1123 global_vector_name, variable,
"_third_derivatives_q", n_q_points,
dummy);
1126 using RetType = std::vector<
1127 typename internal::OutputType<dim, spacedim, Number, Extractor>::
1128 third_derivative_type>;
1131 internal_data_storage.template get_or_add_object_with_name<RetType>(
1137 fev[variable].get_function_third_derivatives_from_local_dof_values(
1138 independent_local_dofs, ret);
1144 template <
int dim,
int spacedim>
1145 template <
typename Extractor,
typename Number>
1147 typename internal::OutputType<dim, spacedim, Number, Extractor>::
1148 symmetric_gradient_type> &
1150 const std::string &global_vector_name,
1151 const Extractor & variable,
1154 const std::vector<Number> &independent_local_dofs =
1155 get_local_dof_values(global_vector_name,
dummy);
1161 const std::string name = get_unique_name(
1162 global_vector_name, variable,
"_symmetric_gradient_q", n_q_points,
dummy);
1166 using RetType = std::vector<
1167 typename internal::OutputType<dim, spacedim, Number, Extractor>::
1168 symmetric_gradient_type>;
1171 internal_data_storage.template get_or_add_object_with_name<RetType>(
1177 fev[variable].get_function_symmetric_gradients_from_local_dof_values(
1178 independent_local_dofs, ret);
1183 template <
int dim,
int spacedim>
1184 template <
typename Extractor,
typename Number>
1186 typename internal::OutputType<dim, spacedim, Number, Extractor>::
1189 const std::string &global_vector_name,
1190 const Extractor & variable,
1193 const std::vector<Number> &independent_local_dofs =
1194 get_local_dof_values(global_vector_name,
dummy);
1200 const std::string name = get_unique_name(
1201 global_vector_name, variable,
"_divergence_q", n_q_points,
dummy);
1204 using RetType = std::vector<
1205 typename internal::OutputType<dim, spacedim, Number, Extractor>::
1209 internal_data_storage.template get_or_add_object_with_name<RetType>(
1215 fev[variable].get_function_divergences_from_local_dof_values(
1216 independent_local_dofs, ret);
1222 template <
int dim,
int spacedim>
1223 template <
typename Extractor,
typename Number>
1225 typename internal::OutputType<dim, spacedim, Number, Extractor>::curl_type>
1228 const Extractor & variable,
1231 const std::vector<Number> &independent_local_dofs =
1232 get_local_dof_values(global_vector_name,
dummy);
1238 const std::string name = get_unique_name(
1239 global_vector_name, variable,
"_curl_q", n_q_points,
dummy);
1243 std::vector<
typename internal::
1244 OutputType<dim, spacedim, Number, Extractor>::curl_type>;
1247 internal_data_storage.template get_or_add_object_with_name<RetType>(
1252 fev[variable].get_function_curls_from_local_dof_values(
1253 independent_local_dofs, ret);