OpenTwin
0.1
OpenTwin
Loading...
Searching...
No Matches
ResultSink.h
Go to the documentation of this file.
1
#pragma once
2
#include "
ResultFilter/ResultFilter.h
"
3
#include "
ResultFilter/ResultContainer.h
"
4
#include "
ResultPostProcessors/ResultPostprocessors.h
"
5
6
#include <cmath>
7
8
class
ResultSink
9
{
10
public
:
11
ResultSink
(
int
executionFrequency,
int
totalTimeSteps)
12
:
_executionFrequency
(executionFrequency),
_totalTimesteps
(totalTimeSteps)
13
{
14
_nbOfExecutions
=
static_cast<
int
>
(std::ceil(
_totalTimesteps
/
static_cast<
double
>
(executionFrequency)));
15
};
16
virtual
~ResultSink
()
17
{
18
for
(
auto
postProcessor :
_postProcessors
)
19
{
20
delete
postProcessor;
21
postProcessor =
nullptr
;
22
}
23
};
24
25
virtual
void
ConsumeResultContainer
(
ResultContainer
* container)=0;
26
virtual
void
SetVolumeIterator
(
IGridIteratorVolume
* volumeIter) {
_volumeIterator
= volumeIter; };
27
const
int
GetNbOfExectutions
()
const
{
return
_nbOfExecutions
; };
28
virtual
void
PerformPostProcessing
() =0;
29
void
AddPostProcessor
(
ResultPostProcessor
* postProcessor) {
_postProcessors
.push_back(postProcessor); };
30
31
protected
:
32
std::vector<ResultPostProcessor *>
_postProcessors
;
33
int
_executionFrequency
;
34
int
_totalTimesteps
;
35
int
_nbOfExecutions
;
36
IGridIteratorVolume
*
_volumeIterator
=
nullptr
;
37
};
ResultContainer.h
ResultFilter.h
ResultPostprocessors.h
IGridIteratorVolume
Definition
IGridIteratorVolume.h:7
ResultContainer
Definition
ResultContainer.h:5
ResultPostProcessor
Definition
ResultPostprocessors.h:5
ResultSink
Definition
ResultSink.h:9
ResultSink::_nbOfExecutions
int _nbOfExecutions
Definition
ResultSink.h:35
ResultSink::_volumeIterator
IGridIteratorVolume * _volumeIterator
Definition
ResultSink.h:36
ResultSink::SetVolumeIterator
virtual void SetVolumeIterator(IGridIteratorVolume *volumeIter)
Definition
ResultSink.h:26
ResultSink::~ResultSink
virtual ~ResultSink()
Definition
ResultSink.h:16
ResultSink::ResultSink
ResultSink(int executionFrequency, int totalTimeSteps)
Definition
ResultSink.h:11
ResultSink::_executionFrequency
int _executionFrequency
Definition
ResultSink.h:33
ResultSink::PerformPostProcessing
virtual void PerformPostProcessing()=0
ResultSink::_postProcessors
std::vector< ResultPostProcessor * > _postProcessors
Definition
ResultSink.h:32
ResultSink::GetNbOfExectutions
const int GetNbOfExectutions() const
Definition
ResultSink.h:27
ResultSink::AddPostProcessor
void AddPostProcessor(ResultPostProcessor *postProcessor)
Definition
ResultSink.h:29
ResultSink::ConsumeResultContainer
virtual void ConsumeResultContainer(ResultContainer *container)=0
ResultSink::_totalTimesteps
int _totalTimesteps
Definition
ResultSink.h:34
Services
FITTDService
include
ResultFilter
ResultSink.h
Generated by
1.10.0