Reference documentation for deal.II version 9.0.0
data_postprocessor.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2007 - 2017 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>
25 void
28  std::vector<Vector<double> > &) const
29 {
31 }
32 
33 
34 
35 template <int dim>
36 void
39  std::vector<Vector<double> > &) const
40 {
42 }
43 
44 
45 
46 template <int dim>
47 std::vector<DataComponentInterpretation::DataComponentInterpretation>
49 {
50  // default implementation assumes that all
51  // components are independent scalars
52  return
53  std::vector<DataComponentInterpretation::DataComponentInterpretation>
54  (get_names().size(),
56 }
57 
58 
59 // -------------------------- DataPostprocessorScalar ---------------------------
60 
61 template <int dim>
63 DataPostprocessorScalar (const std::string &name,
64  const UpdateFlags update_flags)
65  :
66  name (name),
67  update_flags (update_flags)
68 {}
69 
70 
71 
72 template <int dim>
73 std::vector<std::string>
75 get_names () const
76 {
77  return std::vector<std::string> (1, name);
78 }
79 
80 
81 
82 template <int dim>
83 std::vector<DataComponentInterpretation::DataComponentInterpretation>
86 {
87  return
88  std::vector<DataComponentInterpretation::DataComponentInterpretation>
90 }
91 
92 
93 template <int dim>
97 {
98  return update_flags;
99 }
100 
101 
102 
103 // -------------------------- DataPostprocessorVector ---------------------------
104 
105 template <int dim>
107 DataPostprocessorVector (const std::string &name,
108  const UpdateFlags update_flags)
109  :
110  name (name),
111  update_flags (update_flags)
112 {}
113 
114 
115 
116 template <int dim>
117 std::vector<std::string>
119 get_names () const
120 {
121  return std::vector<std::string> (dim, name);
122 }
123 
124 
125 
126 template <int dim>
127 std::vector<DataComponentInterpretation::DataComponentInterpretation>
130 {
131  return
132  std::vector<DataComponentInterpretation::DataComponentInterpretation>
134 }
135 
136 
137 template <int dim>
141 {
142  return update_flags;
143 }
144 
145 
146 
147 
148 // -------------------------- DataPostprocessorTensor ---------------------------
149 
150 template <int dim>
152 DataPostprocessorTensor (const std::string &name,
153  const UpdateFlags update_flags)
154  :
155  name (name),
156  update_flags (update_flags)
157 {}
158 
159 
160 
161 template <int dim>
162 std::vector<std::string>
164 get_names () const
165 {
166  static_assert (dim <= 3,
167  "The following variable needs to be expanded for dim>3");
168  static const char suffixes[] = { 'x', 'y', 'z' };
169 
170  std::vector<std::string> names;
171  for (unsigned int d=0; d<dim; ++d)
172  for (unsigned int e=0; e<dim; ++e)
173  names.push_back (name + '_' + suffixes[d] + suffixes[e]);
174  return names;
175 }
176 
177 
178 
179 template <int dim>
180 std::vector<DataComponentInterpretation::DataComponentInterpretation>
183 {
184  return
185  std::vector<DataComponentInterpretation::DataComponentInterpretation>
187 }
188 
189 
190 template <int dim>
194 {
195  return update_flags;
196 }
197 
198 
199 
200 
201 // explicit instantiation
202 #include "data_postprocessor.inst"
203 
204 
205 DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcPureFunctionCalled()
DataPostprocessorTensor(const std::string &name, const UpdateFlags update_flags)
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
virtual std::vector< std::string > get_names() const
virtual std::vector< DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() const
#define AssertThrow(cond, exc)
Definition: exceptions.h:1221
DataPostprocessorScalar(const std::string &name, const UpdateFlags update_flags)
virtual UpdateFlags get_needed_update_flags() const
UpdateFlags
virtual std::vector< DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() 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 UpdateFlags get_needed_update_flags() const
virtual std::vector< DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() const
virtual std::vector< DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() const