Reference documentation for deal.II version Git bcb2fdb641 2020-09-17 14:58:24 -0400
\(\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 ::hp::MappingCollection<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 
146 template <int dim, typename DoFHandlerType = DoFHandler<dim>>
147 class DataOut : public DataOut_DoFData<DoFHandlerType,
148  DoFHandlerType::dimension,
149  DoFHandlerType::space_dimension>
150 {
151 public:
152  static_assert(dim == DoFHandlerType::dimension,
153  "The dimension given explicitly as a template argument to "
154  "this class must match the dimension of the DoFHandler "
155  "template argument");
156  static constexpr unsigned int spacedim = DoFHandlerType::space_dimension;
157 
162  using cell_iterator =
163  typename DataOut_DoFData<DoFHandlerType,
164  DoFHandlerType::dimension,
165  DoFHandlerType::space_dimension>::cell_iterator;
166 
171  using FirstCellFunctionType =
172  typename std::function<cell_iterator(const Triangulation<dim, spacedim> &)>;
173 
178  using NextCellFunctionType =
179  typename std::function<cell_iterator(const Triangulation<dim, spacedim> &,
180  const cell_iterator &)>;
181 
196  {
206 
215 
222  curved_inner_cells
223  };
224 
228  DataOut();
229 
288  virtual void
289  build_patches(const unsigned int n_subdivisions = 0);
290 
319  virtual void
320  build_patches(const Mapping<DoFHandlerType::dimension,
321  DoFHandlerType::space_dimension> &mapping,
322  const unsigned int n_subdivisions = 0,
323  const CurvedCellRegion curved_region = curved_boundary);
324 
328  virtual void
329  build_patches(
330  const hp::MappingCollection<DoFHandlerType::dimension,
331  DoFHandlerType::space_dimension> &mapping,
332  const unsigned int n_subdivisions = 0,
333  const CurvedCellRegion curved_region = curved_boundary);
334 
379  void
380  set_cell_selection(
381  const std::function<cell_iterator(const Triangulation<dim, spacedim> &)>
382  & first_cell,
383  const std::function<cell_iterator(const Triangulation<dim, spacedim> &,
384  const cell_iterator &)> &next_cell);
385 
422  void
423  set_cell_selection(const FilteredIterator<cell_iterator> &filtered_iterator);
424 
429  const std::pair<FirstCellFunctionType, NextCellFunctionType>
430  get_cell_selection() const;
431 
440  virtual cell_iterator
441  first_cell();
442 
458  virtual cell_iterator
459  next_cell(const cell_iterator &cell);
460 
461 private:
467  std::function<cell_iterator(const Triangulation<dim, spacedim> &)>
468  first_cell_function;
469 
475  std::function<cell_iterator(const Triangulation<dim, spacedim> &,
476  const cell_iterator &)>
477  next_cell_function;
478 
487  virtual cell_iterator
488  first_locally_owned_cell();
489 
498  virtual cell_iterator
499  next_locally_owned_cell(const cell_iterator &cell);
500 
510  void
511  build_one_patch(const std::pair<cell_iterator, unsigned int> *cell_and_index,
513  DoFHandlerType::dimension,
514  DoFHandlerType::space_dimension> &scratch_data,
515  const unsigned int n_subdivisions,
516  const CurvedCellRegion curved_cell_region);
517 };
518 
519 
520 
522 
523 #endif
typename std::function< cell_iterator(const Triangulation< dim, spacedim > &, const cell_iterator &)> NextCellFunctionType
Definition: data_out.h:180
std::vector< Point< spacedim > > patch_evaluation_points
Definition: data_out.h:54
ParallelData(const unsigned int n_datasets, const unsigned int n_subdivisions, const std::vector< unsigned int > &n_postprocessor_outputs, const ::hp::MappingCollection< 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
const std::vector< std::shared_ptr<::hp::FECollection< dim, spacedim > > > finite_elements
const std::vector< std::vector< unsigned int > > * cell_to_patch_index_map
Definition: data_out.h:56
typename DataOut_DoFData< DoFHandler< dim >, DoFHandler< dim > ::dimension, DoFHandler< dim > ::space_dimension >::cell_iterator cell_iterator
Definition: data_out.h:165
typename std::function< cell_iterator(const Triangulation< dim, spacedim > &)> FirstCellFunctionType
Definition: data_out.h:172
UpdateFlags
Abstract base class for mapping classes.
Definition: mapping.h:301
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:363
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:362
#define DEAL_II_DEPRECATED
Definition: config.h:152