Debian Codegraph @

examples/simulations/gray-scott/simulation/writer.h

raw
1 /*
2 * SPDX-FileCopyrightText: 2026 Oak Ridge National Laboratory and Contributors
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #ifndef __WRITER_H__
8 #define __WRITER_H__
9
10 #include <adios2.h>
11 #include <mpi.h>
12
13 #include "gray-scott.h"
14 #include "settings.h"
15
16 class Writer
17 {
18 public:
19 Writer(const Settings &settings, const GrayScott &sim, adios2::IO io);
20 void open(const std::string &fname, bool append);
21 void write(int step, const GrayScott &sim);
22 void close();
23
24 protected:
25 Settings settings;
26
27 adios2::IO io;
28 adios2::Engine writer;
29 adios2::Variable<double> var_u;
30 adios2::Variable<double> var_v;
31 adios2::Variable<int> var_step;
32 };
33
34 #endif