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

moved matrix graph

parent c93f9825
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
void CirculantEmbedding1D::generateFineSample(SampleID id, void CirculantEmbedding1D::generateFineSample(SampleID id,
Vector *&fineSample, Vector *&fineSample,
Vector *&coarseSample) { Vector *&coarseSample) {
MatrixGraphs cellMatrixGraphs(this->meshes, dof(new CellDoF(1))); fineSample = new Vector(cellMGraphs[id.level - this->meshes.pLevel()]);
fineSample = new Vector(cellMatrixGraphs[id.level - this->meshes.pLevel()]);
coarseSample = nullptr;
if (internalCounter == 0) if (internalCounter == 0)
fineComplexField = generateField(); fineComplexField = generateField();
...@@ -29,6 +27,8 @@ void CirculantEmbedding1D::generateFineSample(SampleID id, ...@@ -29,6 +27,8 @@ void CirculantEmbedding1D::generateFineSample(SampleID id,
internalCounter += 1; internalCounter += 1;
internalCounter %= 2; internalCounter %= 2;
if (coarseSample) delete coarseSample;
if (plotting) if (plotting)
plotter->PlotVector("kappa", *fineSample, plotter->PlotVector("kappa", *fineSample,
1, l, "CellData"); 1, l, "CellData");
...@@ -37,8 +37,7 @@ void CirculantEmbedding1D::generateFineSample(SampleID id, ...@@ -37,8 +37,7 @@ void CirculantEmbedding1D::generateFineSample(SampleID id,
void CirculantEmbedding1D::generateCoarseSample(SampleID id, void CirculantEmbedding1D::generateCoarseSample(SampleID id,
Vector *&fineSample, Vector *&fineSample,
Vector *&coarseSample) { Vector *&coarseSample) {
MatrixGraphs cellMatrixGraphs(this->meshes, dof(new CellDoF(1))); coarseSample = new Vector(cellMGraphs[l - this->meshes.pLevel() - 1]);
coarseSample = new Vector(cellMatrixGraphs[l - this->meshes.pLevel() - 1]);
(*coarseSample) = 0; (*coarseSample) = 0;
for (cell c = coarseSample->cells(); c != coarseSample->cells_end(); c++) { for (cell c = coarseSample->cells(); c != coarseSample->cells_end(); c++) {
...@@ -53,6 +52,8 @@ void CirculantEmbedding1D::generateCoarseSample(SampleID id, ...@@ -53,6 +52,8 @@ void CirculantEmbedding1D::generateCoarseSample(SampleID id,
coarseSample->operator()(coarseRow, i) /= c.Children(); coarseSample->operator()(coarseRow, i) /= c.Children();
} }
if (fineSample) delete fineSample;
if (plotting) if (plotting)
plotter->PlotVector("kappa", *coarseSample, 1, plotter->PlotVector("kappa", *coarseSample, 1,
l - 1, "CellData"); l - 1, "CellData");
......
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