Commit 264c2c2e authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

added permeability plots to sample folders

parent af428305
......@@ -34,7 +34,7 @@ epsilon = 0.01
mcOnly = false
epsilon_lst = 0.01, 0.005, 0.001, 0.0005
maxLevel = 9
maxLevel = 7
plevel = 3
degree = 2
......
......@@ -25,17 +25,8 @@ void CirculantEmbedding1D::generateFineSample(Vector &fineField) {
if (plotting) generatePlot(fineField);
}
// void AssembleTransfer (TransferMatrix& TM) const {
// TM = 0;
// const matrixgraph& cg = TM.CoarseMatrixGraph();
// const matrixgraph& fg = TM.FineMatrixGraph();
// const Mesh& mesh = fg.GetMesh();
// for (cell c=cg.cells(); c!=cg.cells_end(); ++c)
// for (int k=0; k<c.Children(); ++k)
// TM(c(),c.Child(k))[0] = 1;
// }
void CirculantEmbedding1D::generateCoarseSample(const Vector &fineField, Vector &coarseField) {
void CirculantEmbedding1D::generateCoarseSample(const Vector &fineField,
Vector &coarseField) {
coarseField = 0;
for (cell c = coarseField.cells(); c != coarseField.cells_end(); c++) {
row coarseRow = coarseField.find_row(c());
......@@ -75,20 +66,8 @@ vector<complex<double>> CirculantEmbedding1D::generateField() {
return Xf_;
}
vector<double> CirculantEmbedding1D::generateInterpolField(const vector<double> &fieldf) {
vector<double> fieldc;
if (numberOfCells % 2 != 0) Exit(
"Interpolation of field does only work for evenly spaced grids.")
int N_interpol = numberOfCells / 2;
fieldc.resize(N_interpol);
for (int i = 0; i < N_interpol; i++)
fieldc[i] = (fieldf[2 * i] + fieldf[2 * i + 1]) / 2.0;
return fieldc;
}
void
CirculantEmbedding1D::createCovarianceMatrix(vector<double> &ar, vector<double> &ac) {
void CirculantEmbedding1D::createCovarianceMatrix(
vector<double> &ar, vector<double> &ac) {
const vector<double> &coordinate1 = linspace(domain_start, domain_end, numberOfCells);
ar.resize(numberOfCells);
ac.resize(numberOfCells);
......@@ -154,7 +133,7 @@ vector<double> CirculantEmbedding1D::getSqrtEV() {
embedCovarianceMatrix(ar, ac, br);
computeEV(br, ev);
for (double & i : ev) {
for (double &i : ev) {
if (i > 0) continue;
else if (i < 0 && i > evtol) i = 0.0;
else padding(ar, ac);
......@@ -187,9 +166,12 @@ void CirculantEmbedding2D::generateFineSample(Vector &fineField) {
}
internalCounter += 1;
internalCounter %= 2;
if (plotting) generatePlot(fineField);
}
void CirculantEmbedding2D::generateCoarseSample(const Vector &fineField, Vector &coarseField) {
void CirculantEmbedding2D::generateCoarseSample(const Vector &fineField,
Vector &coarseField) {
coarseField = 0;
for (cell c = coarseField.cells(); c != coarseField.cells_end(); ++c) {
row coarseRow = coarseField.find_row(c());
......@@ -201,6 +183,8 @@ void CirculantEmbedding2D::generateCoarseSample(const Vector &fineField, Vector
for (int i = 0; i < coarseRow.n(); ++i)
coarseField(coarseRow, i) /= c.Children();
}
if (plotting) generatePlot(coarseField);
}
vector<vector<complex<double>>> CirculantEmbedding2D::generateField() {
......@@ -235,24 +219,6 @@ vector<vector<complex<double>>> CirculantEmbedding2D::generateField() {
return Xf_;
}
vector<vector<double>>
CirculantEmbedding2D::generateInterpolField(vector<vector<double>> &fieldf) {
vector<vector<double>> fieldc;
if (numberOfCells[0] % 2 != 0 || numberOfCells[1] % 2 != 0) Exit(
"Interpolation of field does only work for evenly spaced grids.")
int N_interpol[2] = {numberOfCells[0] / 2, numberOfCells[1] / 2};
fieldc.resize(N_interpol[1]);
for (int i = 0; i < N_interpol[1]; i++) {
fieldc[i].resize(N_interpol[0]);
for (int j = 0; j < N_interpol[0]; j++)
fieldc[i][j] = (fieldf[2 * i][2 * j] +
fieldf[2 * i][2 * j + 1] +
fieldf[2 * i + 1][2 * j] +
fieldf[2 * i + 1][2 * j + 1]) / 4.0;
}
return fieldc;
}
void CirculantEmbedding2D::createCovarianceMatrix(vector<vector<double>> &ar,
vector<vector<double>> &ac) {
const vector<double>
......
......@@ -73,8 +73,6 @@ public:
private:
vector<complex<double>> generateField();
vector<double> generateInterpolField(const vector<double> &fieldf);
void createCovarianceMatrix(vector<double> &ar, vector<double> &ac);
static void embedCovarianceMatrix(vector<double> &ar,
......@@ -116,8 +114,6 @@ private:
vector<vector<complex<double>>> generateField();
vector<vector<double>> generateInterpolField(vector<vector<double>> &fieldf);
void createCovarianceMatrix(vector<vector<double>> &ar, vector<vector<double>> &ac);
static void embedCovarianceMatrix(vector<vector<double>> &ar,
......
......@@ -3,6 +3,8 @@
void HybridFluxGenerator::generateFineSample(Vector &fineField) {
initialize(true);
permeabilityGenerator->SetSampleDir(sampleDir);
permeabilityGenerator->SetPlot(plot);
permeabilityGenerator->GetFineSample(*finePerm);
assemble->problem->LoadNewSample(finePerm);
......
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