121 const unsigned int n_patches_per_circle =
data.n_patches_per_circle;
124 const unsigned int n_points =
data.n_subdivisions + 1;
130 std::vector<Point<dim + 1>> angle_directions(n_patches_per_circle + 1);
131 for (
unsigned int i = 0; i <= n_patches_per_circle; ++i)
133 angle_directions[i][dim - 1] =
135 angle_directions[i][dim] =
139 for (
unsigned int angle = 0; angle < n_patches_per_circle; ++angle)
148 const double r1 = (*cell)->vertex(0)[0],
149 r2 = (*cell)->vertex(1)[0];
150 Assert(r1 >= 0, ExcRadialVariableHasNegativeValues(r1));
151 Assert(r2 >= 0, ExcRadialVariableHasNegativeValues(r2));
153 my_patches[angle].vertices[0] = r1 * angle_directions[angle];
154 my_patches[angle].vertices[1] = r2 * angle_directions[angle];
155 my_patches[angle].vertices[2] = r1 * angle_directions[angle + 1];
156 my_patches[angle].vertices[3] = r2 * angle_directions[angle + 1];
163 for (
const unsigned int vertex :
169 Assert(v[0] >= 0, ExcRadialVariableHasNegativeValues(v[0]));
172 my_patches[angle].vertices[vertex] =
173 v[0] * angle_directions[angle];
174 my_patches[angle].vertices[vertex][0] = v[1];
178 v[0] * angle_directions[angle + 1];
192 if (
data.n_datasets > 0)
194 unsigned int offset = 0;
196 data.reinit_all_fe_values(this->dof_data, *cell);
198 for (
unsigned int dataset = 0; dataset < this->dof_data.size();
202 data.get_present_fe_values(dataset);
203 const unsigned int n_components =
206 this->dof_data[dataset]->postprocessor;
207 if (postprocessor !=
nullptr)
215 if (n_components == 1)
221 this->dof_data[dataset]->get_function_values(
225 data.patch_values_scalar.solution_values);
227 this->dof_data[dataset]->get_function_gradients(
231 data.patch_values_scalar.solution_gradients);
233 this->dof_data[dataset]->get_function_hessians(
237 data.patch_values_scalar.solution_hessians);
240 data.patch_values_scalar.evaluation_points =
244 spacedim>::active_cell_iterator
245 dh_cell(&(*cell)->get_triangulation(),
248 this->dof_data[dataset]->dof_handler);
249 data.patch_values_scalar.template set_cell<dim>(dh_cell);
252 data.patch_values_scalar,
253 data.postprocessed_values[dataset]);
257 data.resize_system_vectors(n_components);
262 this->dof_data[dataset]->get_function_values(
266 data.patch_values_system.solution_values);
268 this->dof_data[dataset]->get_function_gradients(
272 data.patch_values_system.solution_gradients);
274 this->dof_data[dataset]->get_function_hessians(
278 data.patch_values_system.solution_hessians);
281 data.patch_values_system.evaluation_points =
285 spacedim>::active_cell_iterator
286 dh_cell(&(*cell)->get_triangulation(),
289 this->dof_data[dataset]->dof_handler);
290 data.patch_values_system.template set_cell<dim>(dh_cell);
293 data.patch_values_system,
294 data.postprocessed_values[dataset]);
297 for (
unsigned int component = 0;
298 component < this->dof_data[dataset]->n_output_variables;
304 for (
unsigned int x = 0; x < n_points; ++x)
305 for (
unsigned int y = 0; y < n_points; ++y)
306 my_patches[angle].
data(offset + component,
308 data.postprocessed_values[dataset][x](
313 for (
unsigned int x = 0; x < n_points; ++x)
314 for (
unsigned int y = 0; y < n_points; ++y)
315 for (
unsigned int z = 0; z < n_points; ++z)
316 my_patches[angle].
data(offset + component,
320 data.postprocessed_values[dataset]
330 else if (n_components == 1)
332 this->dof_data[dataset]->get_function_values(
336 data.patch_values_scalar.solution_values);
341 for (
unsigned int x = 0; x < n_points; ++x)
342 for (
unsigned int y = 0; y < n_points; ++y)
343 my_patches[angle].
data(offset, x * n_points + y) =
344 data.patch_values_scalar.solution_values[x];
348 for (
unsigned int x = 0; x < n_points; ++x)
349 for (
unsigned int y = 0; y < n_points; ++y)
350 for (
unsigned int z = 0; z < n_points; ++z)
351 my_patches[angle].
data(offset,
352 x * n_points * n_points +
354 data.patch_values_scalar
355 .solution_values[x * n_points + z];
365 data.resize_system_vectors(n_components);
366 this->dof_data[dataset]->get_function_values(
370 data.patch_values_system.solution_values);
372 for (
unsigned int component = 0; component < n_components;
378 for (
unsigned int x = 0; x < n_points; ++x)
379 for (
unsigned int y = 0; y < n_points; ++y)
380 my_patches[angle].
data(offset + component,
382 data.patch_values_system.solution_values[x](
387 for (
unsigned int x = 0; x < n_points; ++x)
388 for (
unsigned int y = 0; y < n_points; ++y)
389 for (
unsigned int z = 0; z < n_points; ++z)
390 my_patches[angle].
data(offset + component,
394 data.patch_values_system
395 .solution_values[x * n_points + z](
404 offset += this->dof_data[dataset]->n_output_variables;
408 for (
unsigned int dataset = 0; dataset < this->cell_data.size();
414 Assert((*cell)->is_active(),
415 ExcMessage(
"Cell must be active for cell data"));
416 const unsigned int cell_number = std::distance(
417 this->triangulation->begin_active(),
421 this->cell_data[dataset]->get_cell_data_value(
428 for (
unsigned int x = 0; x < n_points; ++x)
429 for (
unsigned int y = 0; y < n_points; ++y)
430 my_patches[angle].
data(dataset + offset,
431 x * n_points + y) = value;
435 for (
unsigned int x = 0; x < n_points; ++x)
436 for (
unsigned int y = 0; y < n_points; ++y)
437 for (
unsigned int z = 0; z < n_points; ++z)
438 my_patches[angle].
data(dataset + offset,
439 x * n_points * n_points +
440 y * n_points + z) = value;
456 const unsigned int n_patches_per_circle,
457 const unsigned int nnnn_subdivisions)
459 Assert(this->triangulation !=
nullptr,
462 const unsigned int n_subdivisions =
463 (nnnn_subdivisions != 0) ? nnnn_subdivisions : this->default_subdivisions;
464 Assert(n_subdivisions >= 1,
468 this->validate_dataset_names();
470 unsigned int n_datasets = this->cell_data.size();
471 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
472 n_datasets += this->dof_data[i]->n_output_variables;
475 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
476 if (this->dof_data[i]->postprocessor)
478 this->dof_data[i]->postprocessor->get_needed_update_flags();
483 ExcMessage(
"The update of normal vectors may not be requested for "
484 "evaluation of data on cells via DataPostprocessor."));
489 std::vector<cell_iterator> all_cells;
490 for (
cell_iterator cell = first_cell(); cell != this->triangulation->end();
491 cell = next_cell(cell))
492 all_cells.push_back(cell);
499 this->patches.clear();
500 this->patches.reserve(all_cells.size() * n_patches_per_circle);
503 std::vector<unsigned int> n_postprocessor_outputs(this->dof_data.size());
504 for (
unsigned int dataset = 0; dataset < this->dof_data.size(); ++dataset)
505 if (this->dof_data[dataset]->postprocessor)
506 n_postprocessor_outputs[dataset] =
507 this->dof_data[dataset]->n_output_variables;
509 n_postprocessor_outputs[dataset] = 0;
512 const auto reference_cell = this->triangulation->get_reference_cells()[0];
514 thread_data(n_datasets,
516 n_patches_per_circle,
517 n_postprocessor_outputs,
518 reference_cell.template get_default_linear_mapping<spacedim>(),
521 std::vector<DataOutBase::Patch<patch_dim, patch_spacedim>> new_patches(
522 n_patches_per_circle);
523 for (
unsigned int i = 0; i < new_patches.size(); ++i)
525 new_patches[i].n_subdivisions = n_subdivisions;
526 new_patches[i].reference_cell = ReferenceCells::get_hypercube<dim + 1>();
528 new_patches[i].data.reinit(
529 n_datasets, Utilities::fixed_power<patch_dim>(n_subdivisions + 1));
535 all_cells.data() + all_cells.size(),
541 this->build_one_patch(cell, data, my_patches);
545 internal::DataOutRotationImplementation::append_patch_to_list<dim,
547 new_patches, this->patches);
virtual void evaluate_vector_field(const DataPostprocessorInputs::Vector< dim > &input_data, std::vector< Vector< double > > &computed_quantities) const
virtual void evaluate_scalar_field(const DataPostprocessorInputs::Scalar< dim > &input_data, std::vector< Vector< double > > &computed_quantities) const