40 namespace DataOutFacesImplementation
42 template <
int dim,
int spacedim>
44 const unsigned int n_datasets,
45 const unsigned int n_subdivisions,
46 const std::vector<unsigned int> &n_postprocessor_outputs,
52 :
internal::DataOutImplementation::ParallelDataBase<dim, spacedim>(
55 n_postprocessor_outputs,
68 template <
int dim,
int spacedim>
79 patches.push_back(patch);
80 patches.back().patch_index = patches.size() - 1;
87template <
int dim,
int spacedim>
94template <
int dim,
int spacedim>
102 const unsigned int face_number = cell_and_face->second;
114 for (
const unsigned int vertex : cell->face(face_number)->vertex_indices())
116 const Point<dim> vertex_reference_coordinates =
117 cell->reference_cell().template vertex<dim>(
118 cell->reference_cell().face_to_cell_vertices(
119 face_number, vertex, cell->combined_face_orientation(face_number)));
123 cell, vertex_reference_coordinates);
125 patch.
vertices[vertex] = vertex_real_coordinates;
138 const std::vector<Point<dim>> &q_points =
147 for (
unsigned int i = 0; i < dim; ++i)
148 for (
unsigned int q = 0; q < n_q_points; ++q)
149 patch.
data(patch.
data.size(0) - dim + i, q) = q_points[q][i];
152 unsigned int offset = 0;
155 for (
unsigned int dataset = 0; dataset < this->dof_data.size(); ++dataset)
159 const unsigned int n_components =
162 this->dof_data[dataset]->postprocessor;
163 if (postprocessor !=
nullptr)
170 if (n_components == 1)
175 this->dof_data[dataset]->get_function_values(
176 this_fe_patch_values,
181 this->dof_data[dataset]->get_function_gradients(
182 this_fe_patch_values,
187 this->dof_data[dataset]->get_function_hessians(
188 this_fe_patch_values,
202 dh_cell(&cell->get_triangulation(),
205 this->dof_data[dataset]->dof_handler);
207 dh_cell, face_number);
219 this->dof_data[dataset]->get_function_values(
220 this_fe_patch_values,
225 this->dof_data[dataset]->get_function_gradients(
226 this_fe_patch_values,
231 this->dof_data[dataset]->get_function_hessians(
232 this_fe_patch_values,
246 dh_cell(&cell->get_triangulation(),
249 this->dof_data[dataset]->dof_handler);
251 dh_cell, face_number);
258 for (
unsigned int q = 0; q < n_q_points; ++q)
259 for (
unsigned int component = 0;
260 component < this->dof_data[dataset]->n_output_variables;
262 patch.
data(offset + component, q) =
269 if (n_components == 1)
271 this->dof_data[dataset]->get_function_values(
272 this_fe_patch_values,
276 for (
unsigned int q = 0; q < n_q_points; ++q)
277 patch.
data(offset, q) =
283 this->dof_data[dataset]->get_function_values(
284 this_fe_patch_values,
288 for (
unsigned int component = 0; component < n_components;
290 for (
unsigned int q = 0; q < n_q_points; ++q)
291 patch.
data(offset + component, q) =
295 offset += this->dof_data[dataset]->n_output_variables;
299 for (
unsigned int dataset = 0; dataset < this->cell_data.size();
308 "The current function is trying to generate cell-data output "
309 "for a face that does not belong to an active cell. This is "
311 const unsigned int cell_number = std::distance(
315 const double value = this->cell_data[dataset]->get_cell_data_value(
318 for (
unsigned int q = 0; q < n_q_points; ++q)
319 patch.
data(dataset + offset, q) = value;
326template <
int dim,
int spacedim>
336 ExcMessage(
"The DataOutFaces class can currently not be "
337 "used on meshes that do not have the same cell type "
343template <
int dim,
int spacedim>
347 const unsigned int n_subdivisions_)
349 const unsigned int n_subdivisions =
350 (n_subdivisions_ != 0) ? n_subdivisions_ : this->default_subdivisions;
352 Assert(n_subdivisions >= 1,
359 this->validate_dataset_names();
361 unsigned int n_datasets = this->cell_data.size();
362 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
363 n_datasets += this->dof_data[i]->n_output_variables;
369 std::vector<FaceDescriptor> all_faces;
373 face = next_face(face))
374 all_faces.push_back(face);
377 this->patches.clear();
378 this->patches.reserve(all_faces.size());
382 std::vector<unsigned int> n_postprocessor_outputs(this->dof_data.size());
383 for (
unsigned int dataset = 0; dataset < this->dof_data.size(); ++dataset)
384 if (this->dof_data[dataset]->postprocessor)
385 n_postprocessor_outputs[dataset] =
386 this->dof_data[dataset]->n_output_variables;
388 n_postprocessor_outputs[dataset] = 0;
391 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
392 if (this->dof_data[i]->postprocessor)
394 this->dof_data[i]->postprocessor->get_needed_update_flags();
400 n_postprocessor_outputs,
410 all_faces.data() + all_faces.size(),
415 this->build_one_patch(cell_and_face, data, patch);
418 internal::DataOutFacesImplementation::append_patch_to_list<dim, spacedim>(
419 patch, this->patches);
427template <
int dim,
int spacedim>
433 if (cell->is_locally_owned())
434 for (
const unsigned int f : cell->face_indices())
435 if ((surface_only ==
false) || cell->face(f)->at_boundary())
446template <
int dim,
int spacedim>
455 for (
unsigned int f = face.second + 1; f < face.first->n_faces(); ++f)
456 if (!surface_only || face.first->face(f)->at_boundary())
478 if (active_cell->is_locally_owned())
479 for (
const unsigned int f : face.first->face_indices())
480 if (!surface_only || active_cell->face(f)->at_boundary())
482 face.first = active_cell;
501#include "data_out_faces.inst"
void build_one_patch(const FaceDescriptor *cell_and_face, internal::DataOutFacesImplementation::ParallelData< dim, spacedim > &data, DataOutBase::Patch< patch_dim, patch_spacedim > &patch)
virtual FaceDescriptor next_face(const FaceDescriptor &face)
typename DataOut_DoFData< dim, patch_dim, spacedim, patch_spacedim >:: cell_iterator cell_iterator
typename std::pair< cell_iterator, unsigned int > FaceDescriptor
virtual void build_patches(const unsigned int n_subdivisions=0)
DataOutFaces(const bool surface_only=true)
virtual FaceDescriptor first_face()
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 unsigned int n_quadrature_points
const std::vector< Tensor< 1, spacedim > > & get_normal_vectors() const
const FiniteElement< dim, spacedim > & get_fe() const
unsigned int n_components() const
Abstract base class for mapping classes.
const std::vector< ReferenceCell > & get_reference_cells() const
cell_iterator end() const
active_cell_iterator begin_active(const unsigned int level=0) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
IteratorRange< active_cell_iterator > active_cell_iterators() const
static ::ExceptionBase & ExcInvalidNumberOfSubdivisions(int arg1)
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcNoTriangulationSelected()
static ::ExceptionBase & ExcMessage(std::string arg1)
typename ActiveSelector::active_cell_iterator active_cell_iterator
@ 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.
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
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 DataOutBase::Patch< DataOutFaces< dim, spacedim >::patch_dim, DataOutFaces< dim, spacedim >::patch_spacedim > &patch, std::vector< DataOutBase::Patch< DataOutFaces< dim, spacedim >::patch_dim, DataOutFaces< dim, spacedim >::patch_spacedim > > &patches)
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
ReferenceCell reference_cell
static const unsigned int space_dim
unsigned int n_subdivisions
std::array< Point< spacedim >, GeometryInfo< dim >::vertices_per_cell > vertices
bool points_are_available
ParallelData(const unsigned int n_datasets, const unsigned int n_subdivisions, 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)
const FEValuesBase< dim, spacedim > & get_present_fe_values(const unsigned int dataset) const
const unsigned int n_datasets
DataPostprocessorInputs::Scalar< spacedim > patch_values_scalar
std::vector< std::vector<::Vector< double > > > postprocessed_values
const ::hp::MappingCollection< dim, spacedim > mapping_collection
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)