446 .solution_hessians[i]
450 .solution_hessians[i][1] =
452 .solution_hessians[i];
487 std::vector<Vector<double>> tmp(
493 dataset->get_function_values(
494 this_fe_patch_values,
501 for (
unsigned int i = 0;
503 .solution_values.size();
511 for (
unsigned int j = 0; j < n_components;
514 .solution_values[i][j] = tmp[i][j];
520 dataset->get_function_values(
521 this_fe_patch_values,
526 for (
unsigned int i = 0;
528 .solution_values.size();
531 for (
unsigned int j = 0; j < n_components;
534 .solution_values[i][j + n_components] =
542 std::vector<std::vector<Tensor<1, spacedim>>> tmp(
544 .solution_gradients.size(),
548 dataset->get_function_gradients(
549 this_fe_patch_values,
554 for (
unsigned int i = 0;
556 .solution_gradients.size();
561 .solution_gradients[i]
564 for (
unsigned int j = 0; j < n_components;
567 .solution_gradients[i][j] = tmp[i][j];
571 dataset->get_function_gradients(
572 this_fe_patch_values,
577 for (
unsigned int i = 0;
579 .solution_gradients.size();
582 for (
unsigned int j = 0; j < n_components;
585 .solution_gradients[i][j + n_components] =
593 std::vector<std::vector<Tensor<2, spacedim>>> tmp(
595 .solution_gradients.size(),
599 dataset->get_function_hessians(
600 this_fe_patch_values,
605 for (
unsigned int i = 0;
607 .solution_hessians.size();
612 .solution_hessians[i]
615 for (
unsigned int j = 0; j < n_components;
618 .solution_hessians[i][j] = tmp[i][j];
622 dataset->get_function_hessians(
623 this_fe_patch_values,
628 for (
unsigned int i = 0;
630 .solution_hessians.size();
633 for (
unsigned int j = 0; j < n_components;
636 .solution_hessians[i][j + n_components] =
649 dh_cell(&cell_and_index->first->get_triangulation(),
650 cell_and_index->first->level(),
651 cell_and_index->first->index(),
652 dataset->dof_handler);
668 for (
unsigned int q = 0; q < n_q_points; ++q)
669 for (
unsigned int component = 0;
670 component < dataset->n_output_variables;
672 patch.
data(offset + component, q) =
678 offset += dataset->n_output_variables;
685 if (n_components == 1)
690 dataset->get_function_values(
691 this_fe_patch_values,
694 scratch_data.patch_values_scalar.solution_values);
695 for (
unsigned int q = 0; q < n_q_points; ++q)
696 patch.
data(offset, q) =
705 if (dataset->is_complex_valued() ==
true)
707 dataset->get_function_values(
708 this_fe_patch_values,
711 scratch_data.patch_values_scalar.solution_values);
712 for (
unsigned int q = 0; q < n_q_points; ++q)
713 patch.
data(offset, q) =
727 if (dataset->is_complex_valued() ==
false)
729 dataset->get_function_values(
730 this_fe_patch_values,
733 scratch_data.patch_values_system.solution_values);
734 for (
unsigned int component = 0; component < n_components;
736 for (
unsigned int q = 0; q < n_q_points; ++q)
737 patch.
data(offset + component, q) =
742 offset += dataset->n_output_variables;
774 dataset->get_function_values(
775 this_fe_patch_values,
778 scratch_data.patch_values_system.solution_values);
784 Assert(dataset->data_component_interpretation.size() ==
788 unsigned int destination = offset;
789 for (
unsigned int component = 0;
790 component < n_components;
794 dataset->data_component_interpretation[component])
807 for (
unsigned int q = 0; q < n_q_points;
809 patch.
data(destination, q) =
811 .solution_values[q](component);
833 const unsigned int size = spacedim;
834 for (
unsigned int c = 0; c <
size; ++c)
835 for (
unsigned int q = 0; q < n_q_points;
837 patch.
data(destination + c, q) =
839 .solution_values[q](component + c);
842 destination += 2 *
size;
851 const unsigned int size =
853 for (
unsigned int c = 0; c <
size; ++c)
854 for (
unsigned int q = 0; q < n_q_points;
856 patch.
data(destination + c, q) =
858 .solution_values[q](component + c);
861 destination += 2 *
size;
875 dataset->get_function_values(
876 this_fe_patch_values,
879 scratch_data.patch_values_system.solution_values);
881 unsigned int destination = offset;
882 for (
unsigned int component = 0;
883 component < n_components;
887 dataset->data_component_interpretation[component])
896 for (
unsigned int q = 0; q < n_q_points;
898 patch.
data(destination + 1, q) =
900 .solution_values[q](component);
916 const unsigned int size = spacedim;
917 for (
unsigned int c = 0; c <
size; ++c)
918 for (
unsigned int q = 0; q < n_q_points;
920 patch.
data(destination +
size + c, q) =
922 .solution_values[q](component + c);
925 destination += 2 *
size;
934 const unsigned int size =
936 for (
unsigned int c = 0; c <
size; ++c)
937 for (
unsigned int q = 0; q < n_q_points;
939 patch.
data(destination +
size + c, q) =
941 .solution_values[q](component + c);
944 destination += 2 *
size;
959 offset += dataset->n_output_variables * 2;
971 if (this->cell_data.size() != 0)
975 for (
const auto &dataset : this->cell_data)
980 dataset->get_cell_data_value(cell_and_index->second,
983 for (
unsigned int q = 0; q < n_q_points; ++q)
988 if (dataset->is_complex_valued() ==
true)
990 const double value = dataset->get_cell_data_value(
991 cell_and_index->second,
994 for (
unsigned int q = 0; q < n_q_points; ++q)
998 offset += (dataset->is_complex_valued() ? 2 : 1);
1004 for (
const unsigned int f : cell_and_index->
first->face_indices())
1016 if (cell_and_index->first->at_boundary(f) ||
1017 (cell_and_index->first->neighbor(f)->level() !=
1018 cell_and_index->first->level()))
1024 const cell_iterator neighbor = cell_and_index->first->neighbor(f);
1025 Assert(
static_cast<unsigned int>(neighbor->level()) <
1028 if ((
static_cast<unsigned int>(neighbor->index()) >=
1031 [neighbor->index()] ==
1045 const unsigned int patch_idx =
1047 [cell_and_index->first->index()];
1055 this->patches[patch_idx].swap(patch);
1091 const unsigned int n_subdivisions_,
1100 const unsigned int n_subdivisions =
1101 (n_subdivisions_ != 0) ? n_subdivisions_ : this->default_subdivisions;
1102 Assert(n_subdivisions >= 1,
1106 this->validate_dataset_names();
1124 std::vector<std::vector<unsigned int>> cell_to_patch_index_map;
1125 cell_to_patch_index_map.resize(this->
triangulation->n_levels());
1126 for (
unsigned int l = 0; l < this->
triangulation->n_levels(); ++l)
1129 unsigned int max_index = 0;
1133 if (
static_cast<unsigned int>(cell->level()) == l)
1135 std::max(max_index,
static_cast<unsigned int>(cell->index()));
1137 cell_to_patch_index_map[l].resize(
1142 std::vector<std::pair<cell_iterator, unsigned int>> all_cells;
1150 unsigned int active_index = 0;
1157 while (active_cell != this->
triangulation->end() && cell->is_active() &&
1158 decltype(active_cell)(cell) != active_cell)
1164 Assert(
static_cast<unsigned int>(cell->level()) <
1165 cell_to_patch_index_map.size(),
1167 Assert(
static_cast<unsigned int>(cell->index()) <
1168 cell_to_patch_index_map[cell->level()].size(),
1172 cell_to_patch_index_map[cell->level()][cell->index()] =
1175 all_cells.emplace_back(cell, active_index);
1179 this->patches.clear();
1180 this->patches.resize(all_cells.size());
1188 unsigned int n_datasets = 0;
1189 for (
unsigned int i = 0; i < this->cell_data.size(); ++i)
1190 n_datasets += (this->cell_data[i]->is_complex_valued() &&
1191 (this->cell_data[i]->postprocessor ==
nullptr) ?
1194 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
1195 n_datasets += (this->dof_data[i]->n_output_variables *
1196 (this->dof_data[i]->is_complex_valued() &&
1197 (this->dof_data[i]->postprocessor ==
nullptr) ?
1201 std::vector<unsigned int> n_postprocessor_outputs(this->dof_data.size());
1202 for (
unsigned int dataset = 0; dataset < this->dof_data.size(); ++dataset)
1203 if (this->dof_data[dataset]->postprocessor)
1204 n_postprocessor_outputs[dataset] =
1205 this->dof_data[dataset]->n_output_variables;
1207 n_postprocessor_outputs[dataset] = 0;
1210 (n_subdivisions < 2 ? no_curved_cells : curved_region);
1213 if (curved_cell_region != no_curved_cells)
1216 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
1217 if (this->dof_data[i]->postprocessor)
1219 this->dof_data[i]->postprocessor->get_needed_update_flags();
1225 "The update of normal vectors may not be requested for evaluation of "
1226 "data on cells via DataPostprocessor."));
1231 n_postprocessor_outputs,
1235 cell_to_patch_index_map);
1237 auto worker = [
this, n_subdivisions, curved_cell_region](
1238 const std::pair<cell_iterator, unsigned int> *cell_and_index,
1244 this->build_one_patch(cell_and_index,
1247 curved_cell_region);
1251 if (all_cells.size() > 0)
1253 all_cells.data() + all_cells.size(),
1256 std::function<
void(
const int)>(),