Reference documentation for deal.II version 8.4.2
data_postprocessor.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2007 - 2015 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 at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #include <deal.II/numerics/data_postprocessor.h>
17 
18 DEAL_II_NAMESPACE_OPEN
19 
20 
21 
22 // -------------------------- DataPostprocessor ---------------------------
23 
24 template <int dim>
26 {}
27 
28 
29 
30 template <int dim>
31 void
33 compute_derived_quantities_scalar (const std::vector<double> &/*uh*/,
34  const std::vector<Tensor<1,dim> > &/*duh*/,
35  const std::vector<Tensor<2,dim> > &/*dduh*/,
36  const std::vector<Point<dim> > &/*normals*/,
37  const std::vector<Point<dim> > &/*evaluation_points*/,
38  std::vector<Vector<double> > &computed_quantities) const
39 {
40  computed_quantities.clear();
41  AssertThrow(false,ExcPureFunctionCalled());
42 }
43 
44 
45 
46 template <int dim>
47 void
50  const std::vector<std::vector<Tensor<1,dim> > > &/*duh*/,
51  const std::vector<std::vector<Tensor<2,dim> > > &/*dduh*/,
52  const std::vector<Point<dim> > &/*normals*/,
53  const std::vector<Point<dim> > &/*evaluation_points*/,
54  std::vector<Vector<double> > &computed_quantities) const
55 {
56  computed_quantities.clear();
57  AssertThrow(false,ExcPureFunctionCalled());
58 }
59 
60 
61 
62 template <int dim>
63 std::vector<DataComponentInterpretation::DataComponentInterpretation>
65 {
66  // default implementation assumes that all
67  // components are independent scalars
68  return
69  std::vector<DataComponentInterpretation::DataComponentInterpretation>
70  (get_names().size(),
72 }
73 
74 
75 // -------------------------- DataPostprocessorScalar ---------------------------
76 
77 template <int dim>
79 DataPostprocessorScalar (const std::string &name,
80  const UpdateFlags update_flags)
81  :
82  name (name),
83  update_flags (update_flags)
84 {}
85 
86 
87 
88 template <int dim>
89 std::vector<std::string>
91 get_names () const
92 {
93  return std::vector<std::string> (1, name);
94 }
95 
96 
97 
98 template <int dim>
99 std::vector<DataComponentInterpretation::DataComponentInterpretation>
102 {
103  return
104  std::vector<DataComponentInterpretation::DataComponentInterpretation>
106 }
107 
108 
109 template <int dim>
113 {
114  return update_flags;
115 }
116 
117 
118 
119 // -------------------------- DataPostprocessorVector ---------------------------
120 
121 template <int dim>
123 DataPostprocessorVector (const std::string &name,
124  const UpdateFlags update_flags)
125  :
126  name (name),
127  update_flags (update_flags)
128 {}
129 
130 
131 
132 template <int dim>
133 std::vector<std::string>
135 get_names () const
136 {
137  return std::vector<std::string> (dim, name);
138 }
139 
140 
141 
142 template <int dim>
143 std::vector<DataComponentInterpretation::DataComponentInterpretation>
146 {
147  return
148  std::vector<DataComponentInterpretation::DataComponentInterpretation>
150 }
151 
152 
153 template <int dim>
157 {
158  return update_flags;
159 }
160 
161 
162 // explicit instantiation
163 #include "data_postprocessor.inst"
164 
165 
166 DEAL_II_NAMESPACE_CLOSE
virtual std::vector< DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() const
#define AssertThrow(cond, exc)
Definition: exceptions.h:358
DataPostprocessorScalar(const std::string &name, const UpdateFlags update_flags)
virtual UpdateFlags get_needed_update_flags() const
UpdateFlags
virtual void compute_derived_quantities_vector(const std::vector< Vector< double > > &uh, const std::vector< std::vector< Tensor< 1, dim > > > &duh, const std::vector< std::vector< Tensor< 2, dim > > > &dduh, const std::vector< Point< dim > > &normals, const std::vector< Point< dim > > &evaluation_points, std::vector< Vector< double > > &computed_quantities) const
virtual void compute_derived_quantities_scalar(const std::vector< double > &uh, const std::vector< Tensor< 1, dim > > &duh, const std::vector< Tensor< 2, dim > > &dduh, const std::vector< Point< dim > > &normals, const std::vector< Point< dim > > &evaluation_points, std::vector< Vector< double > > &computed_quantities) const
virtual std::vector< std::string > get_names() const
virtual std::vector< std::string > get_names() const
virtual UpdateFlags get_needed_update_flags() const
DataPostprocessorVector(const std::string &name, const UpdateFlags update_flags)
virtual std::vector< DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() const
virtual std::vector< DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() const