Reference documentation for deal.II version Git 1aa49a030b 2021-12-07 05:12:24 -0500
\(\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\}}\)
operator.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2010 - 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 
17 #ifndef dealii_operator_h
18 #define dealii_operator_h
19 
20 #include <deal.II/base/config.h>
21 
23 
24 #include <deal.II/base/event.h>
25 
26 #include <fstream>
27 
29 
38 namespace Algorithms
39 {
66  class OperatorBase : public Subscriptor
67  {
68  public:
72  virtual ~OperatorBase() override = default;
73 
77  virtual void
78  operator()(AnyData &out, const AnyData &in) = 0;
79 
83  virtual void
84  notify(const Event &);
85 
89  void
90  clear_events();
91 
92  protected:
98  };
99 
104  template <typename VectorType>
106  {
107  public:
111  OutputOperator();
112 
117  OutputOperator(const OutputOperator<VectorType> &) = delete;
118 
122  virtual ~OutputOperator() override = default;
123 
128  void
129  initialize_stream(std::ostream &stream);
130 
134  void
135  set_step(const unsigned int step);
136 
141  operator<<(const AnyData &vectors);
142 
143  protected:
144  unsigned int step;
145 
146  private:
147  std::ostream *os;
148  };
149 
150  template <typename VectorType>
151  inline void
153  {
154  step = s;
155  }
156 
157 
163  template <typename VectorType>
165  operator<<(OutputOperator<VectorType> &out, unsigned int step)
166  {
167  out.set_step(step);
168  return out;
169  }
170 } // namespace Algorithms
171 
173 
174 #endif
virtual void operator()(AnyData &out, const AnyData &in)=0
virtual void notify(const Event &)
Definition: operator.cc:41
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:404
virtual ~OperatorBase() override=default
OutputOperator< VectorType > & operator<<(OutputOperator< VectorType > &out, unsigned int step)
Definition: operator.h:165
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:403
void set_step(const unsigned int step)
Definition: operator.h:152