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_postprocessor.cc
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2007 - 2018 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 
17 
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 std::vector<DataComponentInterpretation::DataComponentInterpretation>(
54 }
55 
56 
57 // -------------------------- DataPostprocessorScalar -------------------------
58 
59 template <int dim>
61  const std::string &name,
62  const UpdateFlags update_flags)
63  : name(name)
64  , update_flags(update_flags)
65 {}
66 
67 
68 
69 template <int dim>
70 std::vector<std::string>
72 {
73  return std::vector<std::string>(1, name);
74 }
75 
76 
77 
78 template <int dim>
79 std::vector<DataComponentInterpretation::DataComponentInterpretation>
81 {
82  return std::vector<DataComponentInterpretation::DataComponentInterpretation>(
84 }
85 
86 
87 template <int dim>
90 {
91  return update_flags;
92 }
93 
94 
95 
96 // -------------------------- DataPostprocessorVector -------------------------
97 
98 template <int dim>
100  const std::string &name,
101  const UpdateFlags update_flags)
102  : name(name)
103  , update_flags(update_flags)
104 {}
105 
106 
107 
108 template <int dim>
109 std::vector<std::string>
111 {
112  return std::vector<std::string>(dim, name);
113 }
114 
115 
116 
117 template <int dim>
118 std::vector<DataComponentInterpretation::DataComponentInterpretation>
120 {
121  return std::vector<DataComponentInterpretation::DataComponentInterpretation>(
123 }
124 
125 
126 template <int dim>
129 {
130  return update_flags;
131 }
132 
133 
134 
135 // -------------------------- DataPostprocessorTensor -------------------------
136 
137 template <int dim>
139  const std::string &name,
140  const UpdateFlags update_flags)
141  : name(name)
142  , update_flags(update_flags)
143 {}
144 
145 
146 
147 template <int dim>
148 std::vector<std::string>
150 {
151  static_assert(dim <= 3,
152  "The following variable needs to be expanded for dim>3");
153  static const char suffixes[] = {'x', 'y', 'z'};
154 
155  std::vector<std::string> names;
156  for (unsigned int d = 0; d < dim; ++d)
157  for (unsigned int e = 0; e < dim; ++e)
158  names.push_back(name + '_' + suffixes[d] + suffixes[e]);
159  return names;
160 }
161 
162 
163 
164 template <int dim>
165 std::vector<DataComponentInterpretation::DataComponentInterpretation>
167 {
168  return std::vector<DataComponentInterpretation::DataComponentInterpretation>(
170 }
171 
172 
173 template <int dim>
176 {
177  return update_flags;
178 }
179 
180 
181 
182 // explicit instantiation
183 #include "data_postprocessor.inst"
184 
185 
DataPostprocessorScalar::get_names
virtual std::vector< std::string > get_names() const override
Definition: data_postprocessor.cc:71
DataPostprocessorVector::get_needed_update_flags
virtual UpdateFlags get_needed_update_flags() const override
Definition: data_postprocessor.cc:128
DataPostprocessorTensor::get_needed_update_flags
virtual UpdateFlags get_needed_update_flags() const override
Definition: data_postprocessor.cc:175
DataPostprocessorTensor::get_names
virtual std::vector< std::string > get_names() const override
Definition: data_postprocessor.cc:149
DataPostprocessorTensor::DataPostprocessorTensor
DataPostprocessorTensor(const std::string &name, const UpdateFlags update_flags)
Definition: data_postprocessor.cc:138
DataComponentInterpretation::component_is_scalar
@ component_is_scalar
Definition: data_component_interpretation.h:55
DataPostprocessorScalar::DataPostprocessorScalar
DataPostprocessorScalar(const std::string &name, const UpdateFlags update_flags)
Definition: data_postprocessor.cc:60
Physics::Elasticity::Kinematics::e
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
DataPostprocessorTensor::get_data_component_interpretation
virtual std::vector< DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() const override
Definition: data_postprocessor.cc:166
Physics::Elasticity::Kinematics::d
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
StandardExceptions::ExcPureFunctionCalled
static ::ExceptionBase & ExcPureFunctionCalled()
DataPostprocessor::evaluate_vector_field
virtual void evaluate_vector_field(const DataPostprocessorInputs::Vector< dim > &input_data, std::vector< Vector< double >> &computed_quantities) const
Definition: data_postprocessor.cc:37
DataPostprocessorInputs::Scalar
Definition: data_postprocessor.h:238
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
DataPostprocessorScalar::get_data_component_interpretation
virtual std::vector< DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() const override
Definition: data_postprocessor.cc:80
UpdateFlags
UpdateFlags
Definition: fe_update_flags.h:66
data_postprocessor.h
DataPostprocessorVector::get_data_component_interpretation
virtual std::vector< DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() const override
Definition: data_postprocessor.cc:119
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
Vector< double >
DataPostprocessor::evaluate_scalar_field
virtual void evaluate_scalar_field(const DataPostprocessorInputs::Scalar< dim > &input_data, std::vector< Vector< double >> &computed_quantities) const
Definition: data_postprocessor.cc:26
DataPostprocessorVector::DataPostprocessorVector
DataPostprocessorVector(const std::string &name, const UpdateFlags update_flags)
Definition: data_postprocessor.cc:99
AssertThrow
#define AssertThrow(cond, exc)
Definition: exceptions.h:1531
DataPostprocessorInputs::Vector
Definition: data_postprocessor.h:318
DataPostprocessorScalar::get_needed_update_flags
virtual UpdateFlags get_needed_update_flags() const override
Definition: data_postprocessor.cc:89
DataPostprocessor::get_data_component_interpretation
virtual std::vector< DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() const
Definition: data_postprocessor.cc:48
DataComponentInterpretation::component_is_part_of_vector
@ component_is_part_of_vector
Definition: data_component_interpretation.h:61
DataPostprocessorVector::get_names
virtual std::vector< std::string > get_names() const override
Definition: data_postprocessor.cc:110