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

New File for SampleGeneratorContainer

parent 623588c9
#include "SampleGeneratorContainer.hpp"
void SampleGeneratorContainer::init(Meshes &meshes) {
scalarGenerator = new ScalarDummy(meshes);
complexGenerator = new ComplexDummy(meshes);
vectorFieldGenerator = new VectorFieldDummy(meshes);
tensorGenerator = new TensorDummy(meshes);
scalarSequence1DGenerator = new ScalarSequence1DDummy(meshes);
complexSequence1DGenerator = new ComplexSequence1DDummy(meshes);
scalarSequence2DGenerator = new ScalarSequence2DGenerator(meshes);
complexSequence2DGenerator = new ComplexSequence2DGenerator(meshes);
}
void SampleGeneratorContainer::initWithGenNames(Meshes &meshes, GeneratorNames names) {
for (auto const &genName: names) {
if (genName == "NormalDistribution")
scalarGenerator = new NormalDistribution(meshes);
if (genName == "ComplexNormalDistribution")
complexGenerator = new ComplexNormalDistribution(meshes);
if (genName == "CirculantEmbedding")
tensorGenerator = new MultilevelCirculantEmbedding(meshes);
if (genName == "HybridFluxGenerator")
new HybridFaceNormalFluxGenerator(meshes);
}
}
void SampleGeneratorContainer::DrawSample(const SampleID &id) {
scalarGenerator->DrawSample(id);
complexGenerator->DrawSample(id);
vectorFieldGenerator->DrawSample(id);
tensorGenerator->DrawSample(id);
scalarSequence1DGenerator->DrawSample(id);
complexSequence1DGenerator->DrawSample(id);
scalarSequence2DGenerator->DrawSample(id);
complexSequence2DGenerator->DrawSample(id);
}
#ifndef SAMPLEGENERATORCONTAINER_HPP
#define SAMPLEGENERATORCONTAINER_HPP
#include "SampleGenerator.hpp"
#include "algorithms/CirculantEmbedding.hpp"
#include "algorithms/HybridFluxGenerator.hpp"
#include "algorithms/NormalDistribution.hpp"
#include "algorithms/UniformDistribution.hpp"
typedef std::vector<std::string> GeneratorNames;
class SampleGeneratorContainer {
void init(Meshes &meshes);
void initWithGenNames(Meshes &meshes, GeneratorNames names);
public:
SampleGenerator<Scalar> *scalarGenerator;
SampleGenerator<Complex> *complexGenerator;
SampleGenerator<VectorField> *vectorFieldGenerator;
SampleGenerator<Tensor> *tensorGenerator;
SampleGenerator<ScalarSequence1D> *scalarSequence1DGenerator;
SampleGenerator<ComplexSequence1D> *complexSequence1DGenerator;
SampleGenerator<ScalarSequence2D> *scalarSequence2DGenerator;
SampleGenerator<ComplexSequence2D> *complexSequence2DGenerator;
SampleGeneratorContainer(GeneratorNames names, Meshes &meshes) {
init(meshes);
initWithGenNames(meshes, GeneratorNames());
}
void DrawSample(const SampleID &id);
};
#endif //SAMPLEGENERATORCONTAINER_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