SampleGenerator.h 1.25 KB
Newer Older
1
2
3
#ifndef SAMPLEGENERATOR_H
#define SAMPLEGENERATOR_H

4
5
#include <utility>

6
#include "utils/IndentedLogger.hpp"
niklas.baumgarten's avatar
niklas.baumgarten committed
7
#include "utils/MultilevelPlotter.hpp"
8
9
10


class SampleGenerator {
11
12
protected:
    int plotting = 0;
13
14
15

    int verbose = 0;
    IndentedLogger *logger = nullptr;
16

17
18
    string sampleDir = "";

19
20
21
22
    virtual void generateFineSample(Vector &fineField) = 0;

    virtual void generateCoarseSample(const Vector &fineField, Vector &coarseField) = 0;

23
24
public:
    int l;
25
    Meshes &meshes;
26

27
28
    explicit SampleGenerator(int l, Meshes &meshes) : l(l), meshes(meshes) {
        config.get("GeneratorPlotting", plotting);
29
30
        config.get("GeneratorVerbose", verbose);
        logger = IndentedLogger::GetInstance();
31
    }
32

33
    void GetFineSample(Vector &fineField) {
niklas.baumgarten's avatar
niklas.baumgarten committed
34
        logger->StartMethod("Start Generator Fine Sample", verbose);
35
        generateFineSample(fineField);
niklas.baumgarten's avatar
niklas.baumgarten committed
36
        logger->EndMethod(verbose);
37
    }
38

39
    void GetCoarseSample(const Vector &fineField, Vector &coarseField) {
40
        logger->StartMethod("Start Generator Coarse Sample", verbose);
41
        generateCoarseSample(fineField, coarseField);
42
        logger->EndMethod(verbose);
43
    }
44

45
    void SetSampleDir(const string &sampleDirName) {
46
47
        sampleDir = sampleDirName;
    }
48
49
50
};

#endif //SAMPLEGENERATOR_H