suanPan
Loading...
Searching...
No Matches
Recorder.h
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright (C) 2017-2025 Theodore Chang
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
******************************************************************************/
27
#ifndef RECORDER_H
28
#define RECORDER_H
29
30
#include <
Domain/Tag.h
>
31
#include <
Recorder/OutputType.h
>
32
33
class
DomainBase
;
34
35
class
Recorder
:
public
UniqueTag
{
36
uvec object_tag;
37
OutputType
variable_type;
38
std::vector<double> time_pool;
// recorded data
39
std::vector<std::vector<std::vector<vec>>> data_pool;
// recorded data
40
41
const
bool
record_time;
42
const
bool
use_hdf5;
43
44
protected
:
45
const
unsigned
interval
;
46
unsigned
counter
= 0;
47
48
bool
if_perform_record
();
49
50
public
:
51
Recorder
(
52
unsigned
,
// tag
53
uvec&&,
// object tags
54
OutputType
,
// recorder type
55
unsigned
,
// interval
56
bool
,
// if to record time
57
bool
// if to use hdf5
58
);
59
60
virtual
void
initialize
(
const
shared_ptr<DomainBase>&);
61
62
void
set_object_tag
(uvec&&);
63
[[nodiscard]]
const
uvec&
get_object_tag
()
const
;
64
65
void
set_variable_type
(
OutputType
);
66
[[nodiscard]]
const
OutputType
&
get_variable_type
()
const
;
67
68
[[nodiscard]]
bool
if_hdf5
()
const
;
69
[[nodiscard]]
bool
if_record_time
()
const
;
70
71
void
insert
(
double
);
72
void
insert
(
const
std::vector<vec>&,
unsigned
);
73
74
[[nodiscard]]
const
std::vector<std::vector<std::vector<vec>>>&
get_data_pool
()
const
;
75
[[nodiscard]]
const
std::vector<double>&
get_time_pool
()
const
;
76
77
virtual
void
record
(
const
shared_ptr<DomainBase>&) = 0;
78
79
void
clear_status
();
80
81
virtual
void
save
();
82
83
void
print
()
override
;
84
};
85
86
#endif
87
OutputType.h
OutputType
OutputType
Definition
OutputType.h:23
Tag.h
DomainBase
The DomainBase class is a template.
Definition
DomainBase.h:102
Recorder
A Recorder class.
Definition
Recorder.h:35
Recorder::get_time_pool
const std::vector< double > & get_time_pool() const
Definition
Recorder.cpp:67
Recorder::if_record_time
bool if_record_time() const
Definition
Recorder.cpp:57
Recorder::get_variable_type
const OutputType & get_variable_type() const
Definition
Recorder.cpp:53
Recorder::set_variable_type
void set_variable_type(OutputType)
Definition
Recorder.cpp:51
Recorder::interval
const unsigned interval
Definition
Recorder.h:45
Recorder::counter
unsigned counter
Definition
Recorder.h:46
Recorder::set_object_tag
void set_object_tag(uvec &&)
Definition
Recorder.cpp:47
Recorder::record
virtual void record(const shared_ptr< DomainBase > &)=0
Recorder::insert
void insert(double)
Definition
Recorder.cpp:61
Recorder::save
virtual void save()
Definition
Recorder.cpp:74
Recorder::clear_status
void clear_status()
Definition
Recorder.cpp:69
Recorder::initialize
virtual void initialize(const shared_ptr< DomainBase > &)
Definition
Recorder.cpp:45
Recorder::if_perform_record
bool if_perform_record()
Definition
Recorder.cpp:59
Recorder::get_data_pool
const std::vector< std::vector< std::vector< vec > > > & get_data_pool() const
Definition
Recorder.cpp:65
Recorder::get_object_tag
const uvec & get_object_tag() const
Definition
Recorder.cpp:49
Recorder::if_hdf5
bool if_hdf5() const
Definition
Recorder.cpp:55
Recorder::print
void print() override
Definition
Recorder.cpp:153
UniqueTag
Definition
Tag.h:77
Recorder
Recorder.h
Generated by
1.9.8