Reference documentation for deal.II version 9.6.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\}}\)
Loading...
Searching...
No Matches
operator.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2010 - 2020 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15
16#ifndef dealii_operator_h
17#define dealii_operator_h
18
19#include <deal.II/base/config.h>
20
22
23#include <deal.II/base/event.h>
24
25#include <fstream>
26
28
37namespace Algorithms
38{
66 {
67 public:
71 virtual ~OperatorBase() override = default;
72
76 virtual void
77 operator()(AnyData &out, const AnyData &in) = 0;
78
82 virtual void
83 notify(const Event &);
84
88 void
90
91 protected:
97 };
98
103 template <typename VectorType>
105 {
106 public:
111
117
121 virtual ~OutputOperator() override = default;
122
127 void
128 initialize_stream(std::ostream &stream);
129
133 void
134 set_step(const unsigned int step);
135
140 operator<<(const AnyData &vectors);
141
142 protected:
143 unsigned int step;
144
145 private:
146 std::ostream *os;
147 };
148
149 template <typename VectorType>
150 inline void
152 {
153 step = s;
154 }
155
156
162 template <typename VectorType>
164 operator<<(OutputOperator<VectorType> &out, unsigned int step)
165 {
166 out.set_step(step);
167 return out;
168 }
169} // namespace Algorithms
170
172
173#endif
virtual void notify(const Event &)
Definition operator.cc:38
virtual void operator()(AnyData &out, const AnyData &in)=0
virtual ~OperatorBase() override=default
virtual OutputOperator< VectorType > & operator<<(const AnyData &vectors)
void initialize_stream(std::ostream &stream)
void set_step(const unsigned int step)
Definition operator.h:151
virtual ~OutputOperator() override=default
OutputOperator(const OutputOperator< VectorType > &)=delete
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
OutputOperator< VectorType > & operator<<(OutputOperator< VectorType > &out, unsigned int step)
Definition operator.h:164