SampleGeneratorContainer.cpp 2.13 KB
Newer Older
1
2
3
4
#include "SampleGeneratorContainer.hpp"


void SampleGeneratorContainer::init(Meshes &meshes) {
niklas.baumgarten's avatar
niklas.baumgarten committed
5
6
7
8
9
10
11
12
  scalarGenerator = new ScalarDummy(meshes);
  complexGenerator = new ComplexDummy(meshes);
  vectorFieldGenerator = new VectorFieldDummy(meshes);
  tensorGenerator = new TensorDummy(meshes);
  rVectorGenerator = new RVectorDummy(meshes);
  cVectorGenerator = new CVectorDummy(meshes);
  rMatrixGenerator = new RMatrixDummy(meshes);
  cMatrixGenerator = new CMatrixDummy(meshes);
13
14
15
}

void SampleGeneratorContainer::initWithGenNames(Meshes &meshes, GeneratorNames names) {
niklas.baumgarten's avatar
niklas.baumgarten committed
16
17
18
19
20
21
22
23
24
25
26
27
28
  for (auto const &genName: names) {
    if (genName == "NormalDistributionReal")
      scalarGenerator = new NormalDistributionReal(meshes);
    if (genName == "NormalDistributionComplex")
      complexGenerator = new NormalDistributionComplex(meshes);
    if (genName == "NormalDistributionRVector")
      rVectorGenerator = new NormalDistributionRVector(meshes);
    if (genName == "NormalDistributionCVector")
      cVectorGenerator = new NormalDistributionCVector(meshes);
    if (genName == "NormalDistributionRMatrix")
      rMatrixGenerator = new NormalDistributionRMatrix(meshes);
    if (genName == "NormalDistributionCMatrix")
      cMatrixGenerator = new NormalDistributionCMatrix(meshes);
29

30
    if (genName == "UniformDistributionReal")
niklas.baumgarten's avatar
fix    
niklas.baumgarten committed
31
      scalarGenerator = new UniformDistributionReal(meshes, 0.0, 1.0);
niklas.baumgarten's avatar
niklas.baumgarten committed
32
33
34

    if (genName == "UniformDistributionRVector")
      rVectorGenerator = new UniformDistributionRVector(meshes, 2, -1.0, 1.0);
35
36


niklas.baumgarten's avatar
niklas.baumgarten committed
37
38
39
40
41
    if (genName == "CirculantEmbedding") {
      if (meshes.dim() == 1)
        tensorGenerator = new CirculantEmbedding1D(meshes);
      else
        tensorGenerator = new CirculantEmbedding2D(meshes);
42
    }
niklas.baumgarten's avatar
niklas.baumgarten committed
43
44
45
    if (genName == "HybridFluxGenerator")
      new HybridFaceNormalFluxGenerator(meshes);
  }
46
47
48
}

void SampleGeneratorContainer::DrawSample(const SampleID &id) {
niklas.baumgarten's avatar
niklas.baumgarten committed
49
50
51
52
53
54
55
56
  scalarGenerator->DrawSample(id);
  complexGenerator->DrawSample(id);
  vectorFieldGenerator->DrawSample(id);
  tensorGenerator->DrawSample(id);
  rVectorGenerator->DrawSample(id);
  cVectorGenerator->DrawSample(id);
  rMatrixGenerator->DrawSample(id);
  cMatrixGenerator->DrawSample(id);
57
}