Loading [MathJax]/extensions/TeX/AMSsymbols.js
 deal.II version GIT relicensing-3075-gc235bd4825 2025-04-15 08:10:00+00:00
\(\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\}}\)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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
24#include <deal.II/base/event.h>
25
26#include <fstream>
27
29
38namespace Algorithms
39{
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
91
92 protected:
98 };
99
104 template <typename VectorType>
106 {
107 public:
112
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 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:152
virtual ~OutputOperator() override=default
OutputOperator(const OutputOperator< VectorType > &)=delete
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:35
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:36
OutputOperator< VectorType > & operator<<(OutputOperator< VectorType > &out, unsigned int step)
Definition operator.h:165