OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ResultSink.h
Go to the documentation of this file.
1#pragma once
5
6#include <cmath>
7
9{
10public:
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
31protected:
32 std::vector<ResultPostProcessor *> _postProcessors;
37};
Definition IGridIteratorVolume.h:7
Definition ResultContainer.h:5
Definition ResultPostprocessors.h:5
Definition ResultSink.h:9
int _nbOfExecutions
Definition ResultSink.h:35
IGridIteratorVolume * _volumeIterator
Definition ResultSink.h:36
virtual void SetVolumeIterator(IGridIteratorVolume *volumeIter)
Definition ResultSink.h:26
virtual ~ResultSink()
Definition ResultSink.h:16
ResultSink(int executionFrequency, int totalTimeSteps)
Definition ResultSink.h:11
int _executionFrequency
Definition ResultSink.h:33
virtual void PerformPostProcessing()=0
std::vector< ResultPostProcessor * > _postProcessors
Definition ResultSink.h:32
const int GetNbOfExectutions() const
Definition ResultSink.h:27
void AddPostProcessor(ResultPostProcessor *postProcessor)
Definition ResultSink.h:29
virtual void ConsumeResultContainer(ResultContainer *container)=0
int _totalTimesteps
Definition ResultSink.h:34