Reference documentation for deal.II version 8.5.1
operator.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2010 - 2015 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  ~OperatorBase();
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  {
110  public:
111  OutputOperator ();
115  virtual ~OutputOperator();
116 
121  void initialize_stream(std::ostream &stream);
125  void set_step(const unsigned int step);
129  virtual OutputOperator<VectorType> &operator<< (const AnyData &vectors);
130 
131  protected:
132  unsigned int step;
133  private:
134  std::ostream *os;
135  };
136 
137  template <typename VectorType>
138  inline
139  void
141  {
142  step = s;
143  }
144 
145 
151  template <typename VectorType>
152  inline
154  operator<< (OutputOperator<VectorType> &out, unsigned int step)
155  {
156  out.set_step(step);
157  return out;
158  }
159 }
160 
161 DEAL_II_NAMESPACE_CLOSE
162 
163 #endif
void initialize_stream(std::ostream &stream)
virtual void operator()(AnyData &out, const AnyData &in)=0
virtual OutputOperator< VectorType > & operator<<(const AnyData &vectors)
virtual void notify(const Event &)
Definition: operator.cc:43
void set_step(const unsigned int step)
Definition: operator.h:140