447 .solution_hessians[i]
451 .solution_hessians[i][1] =
453 .solution_hessians[i];
488 std::vector<Vector<double>> tmp(
494 dataset->get_function_values(
495 this_fe_patch_values,
502 for (
unsigned int i = 0;
504 .solution_values.size();
512 for (
unsigned int j = 0; j < n_components;
515 .solution_values[i][j] = tmp[i][j];
521 dataset->get_function_values(
522 this_fe_patch_values,
527 for (
unsigned int i = 0;
529 .solution_values.size();
532 for (
unsigned int j = 0; j < n_components;
535 .solution_values[i][j + n_components] =
543 std::vector<std::vector<Tensor<1, spacedim>>> tmp(
545 .solution_gradients.size(),
549 dataset->get_function_gradients(
550 this_fe_patch_values,
555 for (
unsigned int i = 0;
557 .solution_gradients.size();
562 .solution_gradients[i]
565 for (
unsigned int j = 0; j < n_components;
568 .solution_gradients[i][j] = tmp[i][j];
572 dataset->get_function_gradients(
573 this_fe_patch_values,
578 for (
unsigned int i = 0;
580 .solution_gradients.size();
583 for (
unsigned int j = 0; j < n_components;
586 .solution_gradients[i][j + n_components] =
594 std::vector<std::vector<Tensor<2, spacedim>>> tmp(
596 .solution_gradients.size(),
600 dataset->get_function_hessians(
601 this_fe_patch_values,
606 for (
unsigned int i = 0;
608 .solution_hessians.size();
613 .solution_hessians[i]
616 for (
unsigned int j = 0; j < n_components;
619 .solution_hessians[i][j] = tmp[i][j];
623 dataset->get_function_hessians(
624 this_fe_patch_values,
629 for (
unsigned int i = 0;
631 .solution_hessians.size();
634 for (
unsigned int j = 0; j < n_components;
637 .solution_hessians[i][j + n_components] =
650 dh_cell(&cell_and_index->first->get_triangulation(),
651 cell_and_index->first->level(),
652 cell_and_index->first->index(),
653 dataset->dof_handler);
669 for (
unsigned int q = 0; q < n_q_points; ++q)
670 for (
unsigned int component = 0;
671 component < dataset->n_output_variables;
673 patch.
data(offset + component, q) =
679 offset += dataset->n_output_variables;
686 if (n_components == 1)
691 dataset->get_function_values(
692 this_fe_patch_values,
695 scratch_data.patch_values_scalar.solution_values);
696 for (
unsigned int q = 0; q < n_q_points; ++q)
697 patch.
data(offset, q) =
706 if (dataset->is_complex_valued() ==
true)
708 dataset->get_function_values(
709 this_fe_patch_values,
712 scratch_data.patch_values_scalar.solution_values);
713 for (
unsigned int q = 0; q < n_q_points; ++q)
714 patch.
data(offset, q) =
728 if (dataset->is_complex_valued() ==
false)
730 dataset->get_function_values(
731 this_fe_patch_values,
734 scratch_data.patch_values_system.solution_values);
735 for (
unsigned int component = 0; component < n_components;
737 for (
unsigned int q = 0; q < n_q_points; ++q)
738 patch.
data(offset + component, q) =
743 offset += dataset->n_output_variables;
775 dataset->get_function_values(
776 this_fe_patch_values,
779 scratch_data.patch_values_system.solution_values);
785 Assert(dataset->data_component_interpretation.size() ==
789 unsigned int destination = offset;
790 for (
unsigned int component = 0;
791 component < n_components;
795 dataset->data_component_interpretation[component])
808 for (
unsigned int q = 0; q < n_q_points;
810 patch.
data(destination, q) =
812 .solution_values[q](component);
834 const unsigned int size = spacedim;
835 for (
unsigned int c = 0; c < size; ++c)
836 for (
unsigned int q = 0; q < n_q_points;
838 patch.
data(destination + c, q) =
840 .solution_values[q](component + c);
843 destination += 2 * size;
852 const unsigned int size =
854 for (
unsigned int c = 0; c < size; ++c)
855 for (
unsigned int q = 0; q < n_q_points;
857 patch.
data(destination + c, q) =
859 .solution_values[q](component + c);
862 destination += 2 * size;
876 dataset->get_function_values(
877 this_fe_patch_values,
880 scratch_data.patch_values_system.solution_values);
882 unsigned int destination = offset;
883 for (
unsigned int component = 0;
884 component < n_components;
888 dataset->data_component_interpretation[component])
897 for (
unsigned int q = 0; q < n_q_points;
899 patch.
data(destination + 1, q) =
901 .solution_values[q](component);
917 const unsigned int size = spacedim;
918 for (
unsigned int c = 0; c < size; ++c)
919 for (
unsigned int q = 0; q < n_q_points;
921 patch.
data(destination + size + c, q) =
923 .solution_values[q](component + c);
926 destination += 2 * size;
935 const unsigned int size =
937 for (
unsigned int c = 0; c < size; ++c)
938 for (
unsigned int q = 0; q < n_q_points;
940 patch.
data(destination + size + c, q) =
942 .solution_values[q](component + c);
945 destination += 2 * size;
960 offset += dataset->n_output_variables * 2;
972 if (this->cell_data.size() != 0)
976 for (
const auto &dataset : this->cell_data)
981 dataset->get_cell_data_value(cell_and_index->second,
984 for (
unsigned int q = 0; q < n_q_points; ++q)
989 if (dataset->is_complex_valued() ==
true)
991 const double value = dataset->get_cell_data_value(
992 cell_and_index->second,
995 for (
unsigned int q = 0; q < n_q_points; ++q)
999 offset += (dataset->is_complex_valued() ? 2 : 1);
1005 for (
const unsigned int f : cell_and_index->
first->face_indices())
1017 if (cell_and_index->first->at_boundary(f) ||
1018 (cell_and_index->first->neighbor(f)->level() !=
1019 cell_and_index->first->level()))
1025 const cell_iterator neighbor = cell_and_index->first->neighbor(f);
1026 Assert(
static_cast<unsigned int>(neighbor->level()) <
1029 if ((
static_cast<unsigned int>(neighbor->index()) >=
1032 [neighbor->index()] ==
1046 const unsigned int patch_idx =
1048 [cell_and_index->first->index()];
1056 this->patches[patch_idx].swap(patch);
1092 const unsigned int n_subdivisions_,
1101 const unsigned int n_subdivisions =
1102 (n_subdivisions_ != 0) ? n_subdivisions_ : this->default_subdivisions;
1103 Assert(n_subdivisions >= 1,
1107 this->validate_dataset_names();
1125 std::vector<std::vector<unsigned int>> cell_to_patch_index_map;
1126 cell_to_patch_index_map.resize(this->
triangulation->n_levels());
1127 for (
unsigned int l = 0; l < this->
triangulation->n_levels(); ++l)
1130 unsigned int max_index = 0;
1134 if (
static_cast<unsigned int>(cell->level()) == l)
1136 std::max(max_index,
static_cast<unsigned int>(cell->index()));
1138 cell_to_patch_index_map[l].resize(
1143 std::vector<std::pair<cell_iterator, unsigned int>> all_cells;
1151 unsigned int active_index = 0;
1158 while (active_cell != this->
triangulation->end() && cell->is_active() &&
1159 decltype(active_cell)(cell) != active_cell)
1165 Assert(
static_cast<unsigned int>(cell->level()) <
1166 cell_to_patch_index_map.size(),
1168 Assert(
static_cast<unsigned int>(cell->index()) <
1169 cell_to_patch_index_map[cell->level()].size(),
1173 cell_to_patch_index_map[cell->level()][cell->index()] =
1176 all_cells.emplace_back(cell, active_index);
1180 this->patches.clear();
1181 this->patches.resize(all_cells.size());
1189 unsigned int n_datasets = 0;
1190 for (
unsigned int i = 0; i < this->cell_data.size(); ++i)
1191 n_datasets += (this->cell_data[i]->is_complex_valued() &&
1192 (this->cell_data[i]->postprocessor ==
nullptr) ?
1195 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
1196 n_datasets += (this->dof_data[i]->n_output_variables *
1197 (this->dof_data[i]->is_complex_valued() &&
1198 (this->dof_data[i]->postprocessor ==
nullptr) ?
1202 std::vector<unsigned int> n_postprocessor_outputs(this->dof_data.size());
1203 for (
unsigned int dataset = 0; dataset < this->dof_data.size(); ++dataset)
1204 if (this->dof_data[dataset]->postprocessor)
1205 n_postprocessor_outputs[dataset] =
1206 this->dof_data[dataset]->n_output_variables;
1208 n_postprocessor_outputs[dataset] = 0;
1211 (n_subdivisions < 2 ? no_curved_cells : curved_region);
1214 if (curved_cell_region != no_curved_cells)
1217 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
1218 if (this->dof_data[i]->postprocessor)
1220 this->dof_data[i]->postprocessor->get_needed_update_flags();
1226 "The update of normal vectors may not be requested for evaluation of "
1227 "data on cells via DataPostprocessor."));
1232 n_postprocessor_outputs,
1236 cell_to_patch_index_map);
1238 auto worker = [
this, n_subdivisions, curved_cell_region](
1239 const std::pair<cell_iterator, unsigned int> *cell_and_index,
1245 this->build_one_patch(cell_and_index,
1248 curved_cell_region);
1252 if (all_cells.size() > 0)
1254 all_cells.data() + all_cells.size(),
1257 std::function<
void(
const int)>(),