Commit c95e8155 authored by Dmitry Bagaev's avatar Dmitry Bagaev

Small fix to prev commit

parent 20991c88
...@@ -94,7 +94,7 @@ int main(int argc, char ** argv) ...@@ -94,7 +94,7 @@ int main(int argc, char ** argv)
int n = atoi(argv[2]); int n = atoi(argv[2]);
int r = atoi(argv[3]); int r = atoi(argv[3]);
Solver::Initialize(&argc,&argv,argc > 3 ? argv[3] : NULL); // Initialize the linear solver in accordance with args Solver::Initialize(&argc,&argv,argc > 4 ? argv[4] : NULL); // Initialize the linear solver in accordance with args
{ {
#if defined(USE_MPI) #if defined(USE_MPI)
MPI_Comm_rank(MPI_COMM_WORLD,&rank); // Get the rank of the current process MPI_Comm_rank(MPI_COMM_WORLD,&rank); // Get the rank of the current process
...@@ -227,10 +227,12 @@ void Band(int n, int r, Sparse::Matrix & A) ...@@ -227,10 +227,12 @@ void Band(int n, int r, Sparse::Matrix & A)
for (int i=idmin; i<idmax; i++) { for (int i=idmin; i<idmax; i++) {
for (int j=0; j<n; j++) { for (int j=0; j<n; j++) {
if (i == j) { if (abs(i - j) < r) {
A[i][j] = (ndiag - 1.) + 1e-3; if (i == j) {
} else { A[i][j] = (ndiag - 1.) + 1e-3;
A[i][j] = -1.; } else {
A[i][j] = -1.;
}
} }
} }
} }
......
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