54 namespace DataOutRotationImplementation
56 template <
int dim,
int spacedim>
58 const unsigned int n_datasets,
59 const unsigned int n_subdivisions,
60 const unsigned int n_patches_per_circle,
61 const std::vector<unsigned int> &n_postprocessor_outputs,
67 :
internal::DataOutImplementation::ParallelDataBase<dim, spacedim>(
70 n_postprocessor_outputs,
75 , n_patches_per_circle(n_patches_per_circle)
84 template <
int dim,
int spacedim>
96 for (
unsigned int i = 0; i < new_patches.size(); ++i)
98 patches.push_back(new_patches[i]);
99 patches.back().patch_index = patches.size() - 1;
107template <
int dim,
int spacedim>
133 std::vector<Point<dim + 1>> angle_directions(n_patches_per_circle + 1);
134 for (
unsigned int i = 0; i <= n_patches_per_circle; ++i)
136 angle_directions[i][dim - 1] =
138 angle_directions[i][dim] =
142 for (
unsigned int angle = 0; angle < n_patches_per_circle; ++angle)
151 const double r1 = (*cell)->vertex(0)(0),
152 r2 = (*cell)->vertex(1)(0);
153 Assert(r1 >= 0, ExcRadialVariableHasNegativeValues(r1));
154 Assert(r2 >= 0, ExcRadialVariableHasNegativeValues(r2));
156 my_patches[angle].vertices[0] = r1 * angle_directions[angle];
157 my_patches[angle].vertices[1] = r2 * angle_directions[angle];
158 my_patches[angle].vertices[2] = r1 * angle_directions[angle + 1];
159 my_patches[angle].vertices[3] = r2 * angle_directions[angle + 1];
166 for (
const unsigned int vertex :
172 Assert(v(0) >= 0, ExcRadialVariableHasNegativeValues(v(0)));
175 my_patches[angle].vertices[vertex] =
176 v(0) * angle_directions[angle];
177 my_patches[angle].vertices[vertex][0] = v(1);
181 v(0) * angle_directions[angle + 1];
197 unsigned int offset = 0;
201 for (
unsigned int dataset = 0; dataset < this->dof_data.size();
206 const unsigned int n_components =
209 this->dof_data[dataset]->postprocessor;
210 if (postprocessor !=
nullptr)
218 if (n_components == 1)
224 this->dof_data[dataset]->get_function_values(
230 this->dof_data[dataset]->get_function_gradients(
236 this->dof_data[dataset]->get_function_hessians(
247 spacedim>::active_cell_iterator
248 dh_cell(&(*cell)->get_triangulation(),
251 this->dof_data[dataset]->dof_handler);
265 this->dof_data[dataset]->get_function_values(
271 this->dof_data[dataset]->get_function_gradients(
277 this->dof_data[dataset]->get_function_hessians(
288 spacedim>::active_cell_iterator
289 dh_cell(&(*cell)->get_triangulation(),
292 this->dof_data[dataset]->dof_handler);
300 for (
unsigned int component = 0;
301 component < this->dof_data[dataset]->n_output_variables;
307 for (
unsigned int x = 0; x < n_points; ++x)
308 for (
unsigned int y = 0; y < n_points; ++y)
309 my_patches[angle].data(offset + component,
316 for (
unsigned int x = 0; x < n_points; ++x)
317 for (
unsigned int y = 0; y < n_points; ++y)
318 for (
unsigned int z = 0; z < n_points; ++z)
319 my_patches[angle].data(offset + component,
333 else if (n_components == 1)
335 this->dof_data[dataset]->get_function_values(
344 for (
unsigned int x = 0; x < n_points; ++x)
345 for (
unsigned int y = 0; y < n_points; ++y)
346 my_patches[angle].data(offset, x * n_points + y) =
351 for (
unsigned int x = 0; x < n_points; ++x)
352 for (
unsigned int y = 0; y < n_points; ++y)
353 for (
unsigned int z = 0; z < n_points; ++z)
354 my_patches[angle].data(offset,
355 x * n_points * n_points +
358 .solution_values[x * n_points + z];
369 this->dof_data[dataset]->get_function_values(
375 for (
unsigned int component = 0; component < n_components;
381 for (
unsigned int x = 0; x < n_points; ++x)
382 for (
unsigned int y = 0; y < n_points; ++y)
383 my_patches[angle].data(offset + component,
390 for (
unsigned int x = 0; x < n_points; ++x)
391 for (
unsigned int y = 0; y < n_points; ++y)
392 for (
unsigned int z = 0; z < n_points; ++z)
393 my_patches[angle].data(offset + component,
398 .solution_values[x * n_points + z](
407 offset += this->dof_data[dataset]->n_output_variables;
411 for (
unsigned int dataset = 0; dataset < this->cell_data.size();
417 Assert((*cell)->is_active(),
418 ExcMessage(
"Cell must be active for cell data"));
419 const unsigned int cell_number = std::distance(
424 this->cell_data[dataset]->get_cell_data_value(
431 for (
unsigned int x = 0; x < n_points; ++x)
432 for (
unsigned int y = 0; y < n_points; ++y)
433 my_patches[angle].data(dataset + offset,
434 x * n_points + y) = value;
438 for (
unsigned int x = 0; x < n_points; ++x)
439 for (
unsigned int y = 0; y < n_points; ++y)
440 for (
unsigned int z = 0; z < n_points; ++z)
441 my_patches[angle].data(dataset + offset,
442 x * n_points * n_points +
443 y * n_points + z) = value;
456template <
int dim,
int spacedim>
459 const unsigned int n_patches_per_circle,
460 const unsigned int nnnn_subdivisions)
465 const unsigned int n_subdivisions =
466 (nnnn_subdivisions != 0) ? nnnn_subdivisions : this->default_subdivisions;
467 Assert(n_subdivisions >= 1,
471 this->validate_dataset_names();
473 unsigned int n_datasets = this->cell_data.size();
474 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
475 n_datasets += this->dof_data[i]->n_output_variables;
478 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
479 if (this->dof_data[i]->postprocessor)
481 this->dof_data[i]->postprocessor->get_needed_update_flags();
486 ExcMessage(
"The update of normal vectors may not be requested for "
487 "evaluation of data on cells via DataPostprocessor."));
492 std::vector<cell_iterator> all_cells;
494 cell = next_cell(cell))
495 all_cells.push_back(cell);
502 this->patches.clear();
503 this->patches.reserve(all_cells.size() * n_patches_per_circle);
506 std::vector<unsigned int> n_postprocessor_outputs(this->dof_data.size());
507 for (
unsigned int dataset = 0; dataset < this->dof_data.size(); ++dataset)
508 if (this->dof_data[dataset]->postprocessor)
509 n_postprocessor_outputs[dataset] =
510 this->dof_data[dataset]->n_output_variables;
512 n_postprocessor_outputs[dataset] = 0;
515 const auto reference_cell = this->
triangulation->get_reference_cells()[0];
520 n_patches_per_circle,
521 n_postprocessor_outputs,
522 reference_cell.template get_default_linear_mapping<dim, spacedim>(),
525 std::vector<DataOutBase::Patch<patch_dim, patch_spacedim>> new_patches(
526 n_patches_per_circle);
527 for (
unsigned int i = 0; i < new_patches.size(); ++i)
529 new_patches[i].n_subdivisions = n_subdivisions;
530 new_patches[i].reference_cell = ReferenceCells::get_hypercube<dim + 1>();
532 new_patches[i].data.reinit(
533 n_datasets, Utilities::fixed_power<patch_dim>(n_subdivisions + 1));
539 all_cells.data() + all_cells.size(),
545 this->build_one_patch(cell, data, my_patches);
549 internal::DataOutRotationImplementation::append_patch_to_list<dim,
551 new_patches, this->patches);
559template <
int dim,
int spacedim>
567template <
int dim,
int spacedim>
583#include "data_out_rotation.inst"
virtual void build_patches(const unsigned int n_patches_per_circle, const unsigned int n_subdivisions=0)
void build_one_patch(const cell_iterator *cell, internal::DataOutRotationImplementation::ParallelData< dim, spacedim > &data, std::vector< DataOutBase::Patch< patch_dim, patch_spacedim > > &my_patches)
typename DataOut_DoFData< dim, patch_dim, spacedim, patch_spacedim >::cell_iterator cell_iterator
virtual cell_iterator next_cell(const cell_iterator &cell)
virtual cell_iterator first_cell()
virtual UpdateFlags get_needed_update_flags() const =0
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
const std::vector< Point< spacedim > > & get_quadrature_points() const
const FiniteElement< dim, spacedim > & get_fe() const
unsigned int n_components() const
Abstract base class for mapping classes.
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcInvalidNumberOfSubdivisions(int arg1)
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcNoTriangulationSelected()
static ::ExceptionBase & ExcMessage(std::string arg1)
@ update_hessians
Second derivatives of shape functions.
@ update_values
Shape function values.
@ update_normal_vectors
Normal vectors.
@ update_gradients
Shape function gradients.
@ update_quadrature_points
Transformed quadrature points.
void run(const std::vector< std::vector< Iterator > > &colored_iterators, Worker worker, Copier copier, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data, const unsigned int queue_length=2 *MultithreadInfo::n_threads(), const unsigned int chunk_size=8)
void append_patch_to_list(const std::vector< DataOutBase::Patch< DataOutRotation< dim, spacedim >::patch_dim, DataOutRotation< dim, spacedim >::patch_spacedim > > &new_patches, std::vector< DataOutBase::Patch< DataOutRotation< dim, spacedim >::patch_dim, DataOutRotation< dim, spacedim >::patch_spacedim > > &patches)
static constexpr double PI
::VectorizedArray< Number, width > cos(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sin(const ::VectorizedArray< Number, width > &)
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
static std_cxx20::ranges::iota_view< unsigned int, unsigned int > vertex_indices()
const FEValuesBase< dim, spacedim > & get_present_fe_values(const unsigned int dataset) const
const unsigned int n_datasets
DataPostprocessorInputs::Scalar< spacedim > patch_values_scalar
const unsigned int n_subdivisions
std::vector< std::vector<::Vector< double > > > postprocessed_values
DataPostprocessorInputs::Vector< spacedim > patch_values_system
void reinit_all_fe_values(std::vector< std::shared_ptr< DataEntryBase< dim, spacedim > > > &dof_data, const typename ::Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face=numbers::invalid_unsigned_int)
void resize_system_vectors(const unsigned int n_components)
const unsigned int n_patches_per_circle
ParallelData(const unsigned int n_datasets, const unsigned int n_subdivisions, const unsigned int n_patches_per_circle, const std::vector< unsigned int > &n_postprocessor_outputs, const Mapping< dim, spacedim > &mapping, const std::vector< std::shared_ptr<::hp::FECollection< dim, spacedim > > > &finite_elements, const UpdateFlags update_flags)