mirror of
https://git.gfz-potsdam.de/naaice/tug.git
synced 2025-12-15 18:38:23 +01:00
Revert "Merge branch 'hannes-philipp' of git.gfz-potsdam.de:naaice/tug into hannes-philipp"
This reverts commit a16b67b15e02ddc6c98b655c9d85a4820e52438b
This commit is contained in:
parent
a16b67b15e
commit
6363585a00
@ -276,10 +276,10 @@ static VectorXd EigenLUAlgorithm(SparseMatrix<double> &A, VectorXd &b) {
|
|||||||
static VectorXd ThomasAlgorithm(SparseMatrix<double> &A, VectorXd &b) {
|
static VectorXd ThomasAlgorithm(SparseMatrix<double> &A, VectorXd &b) {
|
||||||
uint32_t n = b.size();
|
uint32_t n = b.size();
|
||||||
|
|
||||||
VectorXd a_diag(n);
|
Eigen::VectorXd a_diag(n);
|
||||||
VectorXd b_diag(n);
|
Eigen::VectorXd b_diag(n);
|
||||||
VectorXd c_diag(n);
|
Eigen::VectorXd c_diag(n);
|
||||||
VectorXd x_vec = b;
|
Eigen::VectorXd x_vec = b;
|
||||||
|
|
||||||
// Fill diagonals vectors
|
// Fill diagonals vectors
|
||||||
b_diag[0] = A.coeff(0, 0);
|
b_diag[0] = A.coeff(0, 0);
|
||||||
@ -365,7 +365,6 @@ static void BTCS_2D(Grid &grid, Boundary &bc, double timestep, VectorXd (*solver
|
|||||||
SparseMatrix<double> A;
|
SparseMatrix<double> A;
|
||||||
VectorXd b;
|
VectorXd b;
|
||||||
|
|
||||||
// const MatrixXd &alphaX = grid.getAlphaX(); // TODO check if this helps performance
|
|
||||||
MatrixXd alphaX = grid.getAlphaX();
|
MatrixXd alphaX = grid.getAlphaX();
|
||||||
MatrixXd alphaY = grid.getAlphaY();
|
MatrixXd alphaY = grid.getAlphaY();
|
||||||
vector<BoundaryElement> bcLeft = bc.getBoundarySide(BC_SIDE_LEFT);
|
vector<BoundaryElement> bcLeft = bc.getBoundarySide(BC_SIDE_LEFT);
|
||||||
@ -383,7 +382,7 @@ static void BTCS_2D(Grid &grid, Boundary &bc, double timestep, VectorXd (*solver
|
|||||||
b = createSolutionVector(concentrations, alphaX, alphaY, bcLeft, bcRight,
|
b = createSolutionVector(concentrations, alphaX, alphaY, bcLeft, bcRight,
|
||||||
bcTop, bcBottom, colMax, i, sx, sy);
|
bcTop, bcBottom, colMax, i, sx, sy);
|
||||||
|
|
||||||
SparseLU<SparseMatrix<double>> solver; // TODO what is this?
|
SparseLU<SparseMatrix<double>> solver;
|
||||||
|
|
||||||
row_t1 = solverFunc(A, b);
|
row_t1 = solverFunc(A, b);
|
||||||
|
|
||||||
@ -415,10 +414,10 @@ static void BTCS_2D(Grid &grid, Boundary &bc, double timestep, VectorXd (*solver
|
|||||||
|
|
||||||
// entry point for EigenLU solver; differentiate between 1D and 2D grid
|
// entry point for EigenLU solver; differentiate between 1D and 2D grid
|
||||||
static void BTCS_LU(Grid &grid, Boundary &bc, double timestep, int numThreads) {
|
static void BTCS_LU(Grid &grid, Boundary &bc, double timestep, int numThreads) {
|
||||||
if (grid.getDim() == 2) {
|
if (grid.getDim() == 1) {
|
||||||
BTCS_2D(grid, bc, timestep, EigenLUAlgorithm, numThreads);
|
|
||||||
} else if (grid.getDim() == 1) {
|
|
||||||
BTCS_1D(grid, bc, timestep, EigenLUAlgorithm);
|
BTCS_1D(grid, bc, timestep, EigenLUAlgorithm);
|
||||||
|
} else if (grid.getDim() == 2) {
|
||||||
|
BTCS_2D(grid, bc, timestep, EigenLUAlgorithm, numThreads);
|
||||||
} else {
|
} else {
|
||||||
throw_invalid_argument("Error: Only 1- and 2-dimensional grids are defined!");
|
throw_invalid_argument("Error: Only 1- and 2-dimensional grids are defined!");
|
||||||
}
|
}
|
||||||
@ -426,10 +425,10 @@ static void BTCS_LU(Grid &grid, Boundary &bc, double timestep, int numThreads) {
|
|||||||
|
|
||||||
// entry point for Thomas algorithm solver; differentiate 1D and 2D grid
|
// entry point for Thomas algorithm solver; differentiate 1D and 2D grid
|
||||||
static void BTCS_Thomas(Grid &grid, Boundary &bc, double timestep, int numThreads) {
|
static void BTCS_Thomas(Grid &grid, Boundary &bc, double timestep, int numThreads) {
|
||||||
if (grid.getDim() == 2) {
|
if (grid.getDim() == 1) {
|
||||||
BTCS_2D(grid, bc, timestep, ThomasAlgorithm, numThreads);
|
|
||||||
} else if (grid.getDim() == 1) {
|
|
||||||
BTCS_1D(grid, bc, timestep, ThomasAlgorithm);
|
BTCS_1D(grid, bc, timestep, ThomasAlgorithm);
|
||||||
|
} else if (grid.getDim() == 2) {
|
||||||
|
BTCS_2D(grid, bc, timestep, ThomasAlgorithm, numThreads);
|
||||||
} else {
|
} else {
|
||||||
throw_invalid_argument("Error: Only 1- and 2-dimensional grids are defined!");
|
throw_invalid_argument("Error: Only 1- and 2-dimensional grids are defined!");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user