Commit f64e12ec authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

new sampel generator

parent 63dc6eb8
#ifndef SAMPLEGENERATOR_HPP
#define SAMPLEGENERATOR_HPP
#include <utility>
#include "utility/Config.hpp"
#include "Algebra.h"
#include "montecarlo/SampleID.hpp"
#include "utility/SampleID.hpp"
#include "mesh/Meshes.hpp"
template<typename Sample>
class SampleGenerator {
protected:
int plotting = 0;
int verbose = 0;
virtual void generateFineSample(SampleID id,
Sample *&fineSample,
Sample *&coarseSample) = 0;
virtual void generateCoarseSample(SampleID id,
Sample *&fineSample,
Sample *&coarseSample) = 0;
virtual void drawSample(SampleID id) = 0;
public:
int l;
Meshes &meshes;
explicit SampleGenerator(int l, Meshes &meshes) : l(l), meshes(meshes) {
explicit SampleGenerator(Meshes &meshes) : meshes(meshes) {
config.get("GeneratorPlotting", plotting);
config.get("GeneratorVerbose", verbose);
}
void DrawSample(SampleID id, Sample *&fineSample, Sample *&coarseSample) {
mout.StartBlock("Sample Generator");
virtual ~SampleGenerator() {}
void DrawSample(SampleID id) {
mout.StartBlock(Name()); // Todo use Generator Name
vout(1) << id.Str() << endl;
if (!id.coarse)
generateFineSample(id, fineSample, coarseSample);
else
generateCoarseSample(id, fineSample, coarseSample);
drawSample(id);
mout.EndBlock(verbose == 0);
}
virtual string Name() const = 0;
/*
* Scalar return values
*/
virtual Scalar EvalScalarSample(const Point &) {
Exit("Not implemented")
}
virtual Scalar EvalScalarSample(int, const Point &) {
Exit("Not implemented")
}
virtual Scalar EvalScalarSample(double, const Point &) {
Exit("Not implemented")
}
virtual Scalar EvalScalarSample(const cell &) {
Exit("Not implemented")
}
virtual Scalar EvalScalarSample(int, const cell &) {
Exit("Not implemented")
}
virtual Scalar EvalScalarSample(double, const cell &) {
Exit("Not implemented")
}
/*
* VectorField return values
*/
virtual VectorField EvalVectorFieldSample(const Point &) {
Exit("Not implemented")
}
virtual VectorField EvalVectorFieldSample(int, const Point &) {
Exit("Not implemented")
}
virtual VectorField EvalVectorFieldSample(double, const Point &) {
Exit("Not implemented")
}
virtual VectorField EvalVectorFieldSample(const cell &) {
Exit("Not implemented")
}
virtual VectorField EvalVectorFieldSample(int, const cell &) {
Exit("Not implemented")
}
virtual VectorField EvalVectorFieldSample(double, const cell &) {
Exit("Not implemented")
}
/*
* Tensor return values
*/
virtual Tensor EvalTensorSample(const Point &) {
Exit("Not implemented")
}
virtual Tensor EvalTensorSample(int, const Point &) {
Exit("Not implemented")
}
virtual Tensor EvalTensorSample(double, const Point &) {
Exit("Not implemented")
}
virtual Tensor EvalTensorSample(const cell &) {
Exit("Not implemented")
}
virtual Tensor EvalTensorSample(int, const cell &) {
Exit("Not implemented")
}
virtual Tensor EvalTensorSample(double, const cell &) {
Exit("Not implemented")
}
};
#endif //SAMPLEGENERATOR_HPP
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment