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\}}\)
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 
41 namespace Algorithms
42 {
72  class OperatorBase : public Subscriptor
73  {
74  public:
78  virtual ~OperatorBase() override = default;
79 
83  virtual void
84  operator()(AnyData &out, const AnyData &in) = 0;
85 
89  virtual void
90  notify(const Event &);
91 
95  void
96  clear_events();
97 
98  protected:
104  };
105 
112  template <typename VectorType>
114  {
115  public:
119  OutputOperator();
120 
125  OutputOperator(const OutputOperator<VectorType> &) = delete;
126 
130  virtual ~OutputOperator() override = default;
131 
136  void
137  initialize_stream(std::ostream &stream);
138 
142  void
143  set_step(const unsigned int step);
144 
149  operator<<(const AnyData &vectors);
150 
151  protected:
152  unsigned int step;
153 
154  private:
155  std::ostream *os;
156  };
157 
158  template <typename VectorType>
159  inline void
161  {
162  step = s;
163  }
164 
165 
171  template <typename VectorType>
173  operator<<(OutputOperator<VectorType> &out, unsigned int step)
174  {
175  out.set_step(step);
176  return out;
177  }
178 } // namespace Algorithms
179 
181 
182 #endif
AnyData
Definition: any_data.h:37
Algorithms::OperatorBase
Definition: operator.h:72
Algorithms::OutputOperator::initialize_stream
void initialize_stream(std::ostream &stream)
Algorithms::Event
Definition: event.h:49
Algorithms::OutputOperator::set_step
void set_step(const unsigned int step)
Definition: operator.h:160
Algorithms::operator<<
OutputOperator< VectorType > & operator<<(OutputOperator< VectorType > &out, unsigned int step)
Definition: operator.h:173
Subscriptor
Definition: subscriptor.h:62
Algorithms::OperatorBase::operator()
virtual void operator()(AnyData &out, const AnyData &in)=0
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
Algorithms::OutputOperator::operator<<
virtual OutputOperator< VectorType > & operator<<(const AnyData &vectors)
Algorithms::OutputOperator::~OutputOperator
virtual ~OutputOperator() override=default
Algorithms::OperatorBase::notify
virtual void notify(const Event &)
Definition: operator.cc:41
event.h
Algorithms
Definition: newton.h:36
any_data.h
Algorithms::OutputOperator::step
unsigned int step
Definition: operator.h:152
Algorithms::OperatorBase::notifications
Event notifications
Definition: operator.h:103
Algorithms::OutputOperator::os
std::ostream * os
Definition: operator.h:155
config.h
Algorithms::OutputOperator::OutputOperator
OutputOperator()
Algorithms::OutputOperator
Definition: operator.h:113
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
Algorithms::OperatorBase::clear_events
void clear_events()
Definition: operator.cc:49
Algorithms::OperatorBase::~OperatorBase
virtual ~OperatorBase() override=default