40 template <
int dim,
int spacedim>
44 const std::vector<unsigned int> &n_postprocessor_outputs,
53 n_postprocessor_outputs,
66 template <
int dim,
int spacedim>
77 patches.push_back(patch);
78 patches.back().patch_index = patches.size() - 1;
85template <
int dim,
int spacedim>
92template <
int dim,
int spacedim>
100 const unsigned int face_number = cell_and_face->second;
112 for (
const unsigned int vertex : cell->face(face_number)->vertex_indices())
114 const Point<dim> vertex_reference_coordinates =
115 cell->reference_cell().vertex(
116 cell->reference_cell().face_to_cell_vertices(
117 face_number, vertex, cell->combined_face_orientation(face_number)));
121 cell, vertex_reference_coordinates);
123 patch.
vertices[vertex] = vertex_real_coordinates;
136 const std::vector<Point<dim>> &q_points =
145 for (
unsigned int i = 0; i < dim; ++i)
147 patch.
data(patch.
data.size(0) - dim + i, q) = q_points[q][i];
150 unsigned int offset = 0;
153 for (
unsigned int dataset = 0; dataset < this->
dof_data.size(); ++dataset)
157 const unsigned int n_components =
160 this->
dof_data[dataset]->postprocessor;
161 if (postprocessor !=
nullptr)
165 const UpdateFlags update_flags =
168 if (n_components == 1)
173 this->
dof_data[dataset]->get_function_values(
174 this_fe_patch_values,
179 this->
dof_data[dataset]->get_function_gradients(
180 this_fe_patch_values,
185 this->
dof_data[dataset]->get_function_hessians(
186 this_fe_patch_values,
200 dh_cell(&cell->get_triangulation(),
203 this->dof_data[dataset]->dof_handler);
205 dh_cell, face_number);
217 this->
dof_data[dataset]->get_function_values(
218 this_fe_patch_values,
223 this->
dof_data[dataset]->get_function_gradients(
224 this_fe_patch_values,
229 this->
dof_data[dataset]->get_function_hessians(
230 this_fe_patch_values,
244 dh_cell(&cell->get_triangulation(),
247 this->dof_data[dataset]->dof_handler);
249 dh_cell, face_number);
257 for (
unsigned int component = 0;
258 component < this->
dof_data[dataset]->n_output_variables;
260 patch.
data(offset + component, q) =
267 if (n_components == 1)
269 this->
dof_data[dataset]->get_function_values(
270 this_fe_patch_values,
275 patch.
data(offset, q) =
281 this->
dof_data[dataset]->get_function_values(
282 this_fe_patch_values,
286 for (
unsigned int component = 0; component < n_components;
289 patch.
data(offset + component, q) =
293 offset += this->
dof_data[dataset]->n_output_variables;
297 for (
unsigned int dataset = 0; dataset < this->
cell_data.size();
306 "The current function is trying to generate cell-data output "
307 "for a face that does not belong to an active cell. This is "
309 const unsigned int cell_number = std::distance(
313 const double value = this->
cell_data[dataset]->get_cell_data_value(
324template <
int dim,
int spacedim>
334 ExcMessage(
"The DataOutFaces class can currently not be "
335 "used on meshes that do not have the same cell type "
341template <
int dim,
int spacedim>
345 const unsigned int n_subdivisions_)
347 const unsigned int n_subdivisions =
350 Assert(n_subdivisions >= 1,
359 unsigned int n_datasets = this->
cell_data.size();
360 for (
unsigned int i = 0; i < this->
dof_data.size(); ++i)
361 n_datasets += this->
dof_data[i]->n_output_variables;
367 std::vector<FaceDescriptor> all_faces;
372 all_faces.push_back(face);
376 this->
patches.reserve(all_faces.size());
380 std::vector<unsigned int> n_postprocessor_outputs(this->
dof_data.size());
381 for (
unsigned int dataset = 0; dataset < this->
dof_data.size(); ++dataset)
382 if (this->
dof_data[dataset]->postprocessor)
383 n_postprocessor_outputs[dataset] =
384 this->
dof_data[dataset]->n_output_variables;
386 n_postprocessor_outputs[dataset] = 0;
389 for (
unsigned int i = 0; i < this->
dof_data.size(); ++i)
390 if (this->
dof_data[i]->postprocessor)
392 this->
dof_data[i]->postprocessor->get_needed_update_flags();
398 n_postprocessor_outputs,
408 all_faces.data() + all_faces.size(),
413 this->build_one_patch(cell_and_face, data, patch);
416 internal::DataOutFacesImplementation::append_patch_to_list<dim, spacedim>(
417 patch, this->patches);
425template <
int dim,
int spacedim>
430 for (
const auto &cell : this->
triangulation->active_cell_iterators())
431 if (cell->is_locally_owned())
432 for (
const unsigned int f : cell->face_indices())
433 if ((
surface_only ==
false) || cell->face(f)->at_boundary())
444template <
int dim,
int spacedim>
453 for (
unsigned int f = face.second + 1; f < face.first->n_faces(); ++f)
454 if (!
surface_only || face.first->face(f)->at_boundary())
476 if (active_cell->is_locally_owned())
477 for (
const unsigned int f : face.first->face_indices())
478 if (!
surface_only || active_cell->face(f)->at_boundary())
480 face.first = active_cell;
499#include "numerics/data_out_faces.inst"
static constexpr int patch_dim
void build_one_patch(const FaceDescriptor *cell_and_face, internal::DataOutFacesImplementation::ParallelData< dim, spacedim > &data, DataOutBase::Patch< patch_dim, patch_spacedim > &patch)
typename DataOut_DoFData< dim, patch_dim, spacedim, patch_spacedim >:: cell_iterator cell_iterator
virtual FaceDescriptor next_face(const FaceDescriptor &face)
typename std::pair< cell_iterator, unsigned int > FaceDescriptor
virtual void build_patches(const unsigned int n_subdivisions=0)
static constexpr int patch_spacedim
DataOutFaces(const bool surface_only=true)
virtual FaceDescriptor first_face()
unsigned int default_subdivisions
void validate_dataset_names() const
std::vector< std::shared_ptr<::hp::FECollection< dim, spacedim > > > get_fes() const
std::vector< std::shared_ptr< internal::DataOutImplementation::DataEntryBase< dim, spacedim > > > cell_data
std::vector< Patch > patches
std::vector< std::shared_ptr< internal::DataOutImplementation::DataEntryBase< dim, spacedim > > > dof_data
ObserverPointer< const Triangulation< dim, spacedim > > triangulation
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.
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcInvalidNumberOfSubdivisions(int arg1)
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcNoTriangulationSelected()
static ::ExceptionBase & ExcMessage(std::string arg1)
TriaActiveIterator< CellAccessor< dim, spacedim > > active_cell_iterator
typename ActiveSelector::active_cell_iterator active_cell_iterator
const bool IsBlockVector< VectorType >::value
@ 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)
MappingQ< dim, spacedim > StaticMappingQ1< dim, spacedim >::mapping
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 unsigned int n_q_points
ReferenceCell< dim > 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
ParallelDataBase(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 bool use_face_values)
const unsigned int n_subdivisions
const std::vector< std::shared_ptr<::hp::FECollection< dim, spacedim > > > finite_elements
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)
const UpdateFlags update_flags
void resize_system_vectors(const unsigned int n_components)