Reference documentation for deal.II version 9.0.0
operator.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2010 - 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 at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 
17 #ifndef dealii_operator_h
18 #define dealii_operator_h
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/algorithms/any_data.h>
22 #include <deal.II/base/event.h>
23 
24 #include <fstream>
25 
26 DEAL_II_NAMESPACE_OPEN
27 
39 namespace Algorithms
40 {
70  class OperatorBase : public Subscriptor
71  {
72  public:
76  virtual ~OperatorBase() = default;
77 
81  virtual void operator() (AnyData &out, const AnyData &in) = 0;
82 
86  virtual void notify(const Event &);
90  void clear_events();
91  protected:
97 
98  };
99 
106  template <typename VectorType>
108  {
109  public:
113  OutputOperator ();
114 
119  OutputOperator(const OutputOperator<VectorType> &) = delete;
120 
124  virtual ~OutputOperator() = default;
125 
130  void initialize_stream(std::ostream &stream);
134  void set_step(const unsigned int step);
138  virtual OutputOperator<VectorType> &operator<< (const AnyData &vectors);
139 
140  protected:
141  unsigned int step;
142  private:
143  std::ostream *os;
144  };
145 
146  template <typename VectorType>
147  inline
148  void
150  {
151  step = s;
152  }
153 
154 
160  template <typename VectorType>
161  inline
163  operator<< (OutputOperator<VectorType> &out, unsigned int step)
164  {
165  out.set_step(step);
166  return out;
167  }
168 }
169 
170 DEAL_II_NAMESPACE_CLOSE
171 
172 #endif
void initialize_stream(std::ostream &stream)
virtual void operator()(AnyData &out, const AnyData &in)=0
virtual OutputOperator< VectorType > & operator<<(const AnyData &vectors)
virtual ~OutputOperator()=default
virtual void notify(const Event &)
Definition: operator.cc:40
virtual ~OperatorBase()=default
void set_step(const unsigned int step)
Definition: operator.h:149