Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
data_out.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2020 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_data_out_h
17 #define dealii_data_out_h
18 
19 
20 
21 #include <deal.II/base/config.h>
22 
24 
26 
27 #include <memory>
28 
30 
31 namespace internal
32 {
33  namespace DataOutImplementation
34  {
40  template <int dim, int spacedim>
41  struct ParallelData : public ParallelDataBase<dim, spacedim>
42  {
44  const unsigned int n_datasets,
45  const unsigned int n_subdivisions,
46  const std::vector<unsigned int> &n_postprocessor_outputs,
47  const Mapping<dim, spacedim> & mapping,
48  const std::vector<
49  std::shared_ptr<::hp::FECollection<dim, spacedim>>>
52  const std::vector<std::vector<unsigned int>> &cell_to_patch_index_map);
53 
54  std::vector<Point<spacedim>> patch_evaluation_points;
55 
56  const std::vector<std::vector<unsigned int>> *cell_to_patch_index_map;
57  };
58  } // namespace DataOutImplementation
59 } // namespace internal
60 
61 
62 
147 template <int dim, typename DoFHandlerType = DoFHandler<dim>>
148 class DataOut : public DataOut_DoFData<DoFHandlerType,
149  DoFHandlerType::dimension,
150  DoFHandlerType::space_dimension>
151 {
152 public:
153  static_assert(dim == DoFHandlerType::dimension,
154  "The dimension given explicitly as a template argument to "
155  "this class must match the dimension of the DoFHandler "
156  "template argument");
157  static constexpr unsigned int spacedim = DoFHandlerType::space_dimension;
158 
163  using cell_iterator =
164  typename DataOut_DoFData<DoFHandlerType,
165  DoFHandlerType::dimension,
166  DoFHandlerType::space_dimension>::cell_iterator;
167 
172  using FirstCellFunctionType =
173  typename std::function<cell_iterator(const Triangulation<dim, spacedim> &)>;
174 
179  using NextCellFunctionType =
180  typename std::function<cell_iterator(const Triangulation<dim, spacedim> &,
181  const cell_iterator &)>;
182 
197  {
207 
216 
224  };
225 
229  DataOut();
230 
289  virtual void
290  build_patches(const unsigned int n_subdivisions = 0);
291 
323  virtual void
324  build_patches(const Mapping<DoFHandlerType::dimension,
325  DoFHandlerType::space_dimension> &mapping,
326  const unsigned int n_subdivisions = 0,
327  const CurvedCellRegion curved_region = curved_boundary);
328 
373  void
375  const std::function<cell_iterator(const Triangulation<dim, spacedim> &)>
376  & first_cell,
377  const std::function<cell_iterator(const Triangulation<dim, spacedim> &,
378  const cell_iterator &)> &next_cell);
379 
416  void
417  set_cell_selection(const FilteredIterator<cell_iterator> &filtered_iterator);
418 
423  const std::pair<FirstCellFunctionType, NextCellFunctionType>
424  get_cell_selection() const;
425 
434  virtual cell_iterator
435  first_cell();
436 
452  virtual cell_iterator
453  next_cell(const cell_iterator &cell);
454 
455 private:
461  std::function<cell_iterator(const Triangulation<dim, spacedim> &)>
463 
469  std::function<cell_iterator(const Triangulation<dim, spacedim> &,
470  const cell_iterator &)>
472 
481  virtual cell_iterator
483 
492  virtual cell_iterator
494 
504  void
505  build_one_patch(const std::pair<cell_iterator, unsigned int> *cell_and_index,
507  DoFHandlerType::dimension,
508  DoFHandlerType::space_dimension> &scratch_data,
509  const unsigned int n_subdivisions,
510  const CurvedCellRegion curved_cell_region);
511 };
512 
513 
514 
516 
517 #endif
DataOut::no_curved_cells
@ no_curved_cells
Definition: data_out.h:206
data_out_dof_data.h
internal::DataOutImplementation::ParallelDataBase
Definition: data_out_dof_data.h:405
Triangulation
Definition: tria.h:1109
DataOut::next_locally_owned_cell
virtual cell_iterator next_locally_owned_cell(const cell_iterator &cell)
Definition: data_out.cc:1381
DataOut::set_cell_selection
void set_cell_selection(const std::function< cell_iterator(const Triangulation< dim, spacedim > &)> &first_cell, const std::function< cell_iterator(const Triangulation< dim, spacedim > &, const cell_iterator &)> &next_cell)
Definition: data_out.cc:1274
DataOut::build_patches
virtual void build_patches(const unsigned int n_subdivisions=0)
Definition: data_out.cc:1071
DataOut::curved_boundary
@ curved_boundary
Definition: data_out.h:215
DataOut::first_cell
virtual cell_iterator first_cell()
Definition: data_out.cc:1339
Mapping
Abstract base class for mapping classes.
Definition: mapping.h:302
DataOut::DataOut
DataOut()
Definition: data_out.cc:69
FilteredIterator
Definition: filtered_iterator.h:529
DataOut::next_cell_function
std::function< cell_iterator(const Triangulation< dim, spacedim > &, const cell_iterator &)> next_cell_function
Definition: data_out.h:471
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
DataOut< dim >::NextCellFunctionType
typename std::function< cell_iterator(const Triangulation< dim, spacedim > &, const cell_iterator &)> NextCellFunctionType
Definition: data_out.h:181
DataOut< dim >::CurvedCellRegion
CurvedCellRegion
Definition: data_out.h:196
DataOut< dim >::cell_iterator
typename DataOut_DoFData< DoFHandler< dim >, DoFHandler< dim > ::dimension, DoFHandler< dim > ::space_dimension >::cell_iterator cell_iterator
Definition: data_out.h:166
DEAL_II_DEPRECATED
#define DEAL_II_DEPRECATED
Definition: config.h:98
internal::DataOutImplementation::ParallelData::ParallelData
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 std::vector< std::vector< unsigned int >> &cell_to_patch_index_map)
Definition: data_out.cc:44
DataOut_DoFData
Definition: data_out_dof_data.h:602
UpdateFlags
UpdateFlags
Definition: fe_update_flags.h:66
internal::DataOutImplementation::ParallelDataBase::n_datasets
const unsigned int n_datasets
Definition: data_out_dof_data.h:434
internal::DataOutImplementation::ParallelData::patch_evaluation_points
std::vector< Point< spacedim > > patch_evaluation_points
Definition: data_out.h:54
DataOut::get_cell_selection
const std::pair< FirstCellFunctionType, NextCellFunctionType > get_cell_selection() const
Definition: data_out.cc:1330
internal::DataOutImplementation::ParallelData::cell_to_patch_index_map
const std::vector< std::vector< unsigned int > > * cell_to_patch_index_map
Definition: data_out.h:56
DataOut::next_cell
virtual cell_iterator next_cell(const cell_iterator &cell)
Definition: data_out.cc:1348
internal::DataOutImplementation::ParallelDataBase::finite_elements
const std::vector< std::shared_ptr<::hp::FECollection< dim, spacedim > > > finite_elements
Definition: data_out_dof_data.h:444
config.h
internal::DataOutImplementation::ParallelDataBase::n_subdivisions
const unsigned int n_subdivisions
Definition: data_out_dof_data.h:435
internal::DataOutImplementation::ParallelDataBase::update_flags
const UpdateFlags update_flags
Definition: data_out_dof_data.h:445
DataOut::spacedim
static constexpr unsigned int spacedim
Definition: data_out.h:157
internal
Definition: aligned_vector.h:369
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
DataOut< dim >::FirstCellFunctionType
typename std::function< cell_iterator(const Triangulation< dim, spacedim > &)> FirstCellFunctionType
Definition: data_out.h:173
DataOut::first_cell_function
std::function< cell_iterator(const Triangulation< dim, spacedim > &)> first_cell_function
Definition: data_out.h:462
DataOut
Definition: data_out.h:148
internal::DataOutImplementation::ParallelData
Definition: data_out.h:41
DataOut::curved_inner_cells
@ curved_inner_cells
Definition: data_out.h:223
DataOut::first_locally_owned_cell
virtual cell_iterator first_locally_owned_cell()
Definition: data_out.cc:1364
filtered_iterator.h
hp::FECollection
Definition: fe_collection.h:54
DataOut::build_one_patch
void build_one_patch(const std::pair< cell_iterator, unsigned int > *cell_and_index, internal::DataOutImplementation::ParallelData< DoFHandlerType::dimension, DoFHandlerType::space_dimension > &scratch_data, const unsigned int n_subdivisions, const CurvedCellRegion curved_cell_region)
Definition: data_out.cc:88