Commit 0a1d9c95 authored by Leon Merten Lohse's avatar Leon Merten Lohse
Browse files

fix linter warnings

parent a66ae3c6
Pipeline #235246 passed with stage
in 29 seconds
......@@ -86,8 +86,8 @@ namespace finite_differences {
// setup tridiagonal n x n matrix M = tridiag(a,b,c) and rhs r
algebra::TriMatrix<scalar> m (3, n);
array_1D r (n, 1);
algebra::TriMatrix<scalar> m(3, n);
array_1D r(n, 1);
// Note that matrix indices go from 1 to up.size()-1, so that indices are off by 1
......@@ -98,15 +98,15 @@ namespace finite_differences {
r(i-1) = a * up(i-1) + (2.0 - 2.0 * a + fp(i)) * up(i) + a * up(i+1);
}
m(0,0) = 0;
m(2,n-1) = 0;
m(0, 0) = 0;
m(2, n-1) = 0;
// boundary
r(0) += a * bl;
r(n-1) += a * br;
// initialize writeable copy
array_1D u_new (up.size(), 1);
array_1D u_new(up.size(), 1);
// insert boundary values
u_new(0) = bl;
......@@ -130,8 +130,8 @@ namespace finite_differences {
// setup tridiagonal n x n matrix M = tridiag(a,b,c) and rhs r
algebra::TriMatrix<scalar> m (3, n);
array_1D r (n, 1);
algebra::TriMatrix<scalar> m(3, n);
array_1D r(n, 1);
for (size_t i = 1; i < n; ++i) {
complex rhix = 1.0 / static_cast<complex>(i);
......@@ -157,7 +157,7 @@ namespace finite_differences {
m(2, n-1) = 0;
// initialize writeable copy
array_1D u_new (up.size());
array_1D u_new(up.size());
u_new(n) = br;
u_new.segment(0, n) = algebra::tridiagonal(std::move(m), std::move(r));
......@@ -191,7 +191,7 @@ namespace finite_differences {
size_t ny = up.cols() - 2;
// first halfstep
array_2D uhalf (up.rows(), up.cols());
array_2D uhalf(up.rows(), up.cols());
// interpolate boundary values
// WARNING: from my understand this should work without the tranpose(). it compiles fine but produces NaNs...
......@@ -206,8 +206,8 @@ namespace finite_differences {
#pragma omp parallel for
for (size_t iy = 1; iy <= ny; ++iy) {
algebra::TriMatrix<scalar> m (3, nx);
array_1D r (nx, 1);
algebra::TriMatrix<scalar> m(3, nx);
array_1D r(nx, 1);
for (size_t ix = 1; ix <= nx; ++ix) {
m(0, ix-1) = -ax;
......@@ -233,7 +233,7 @@ namespace finite_differences {
// note: internal storage is column-major such that column-wise access would be much faster
// TODO(Leon): transpose uhalf, fp, and f
array_2D u_new_trans (up.cols(), up.rows()); // transposed shape
array_2D u_new_trans(up.cols(), up.rows()); // transposed shape
// populate boundary values. y is done in the loop
u_new_trans.col(0) = bxl;
......@@ -241,8 +241,8 @@ namespace finite_differences {
#pragma omp parallel for
for (size_t ix = 1; ix <= nx; ++ix) {
algebra::TriMatrix<scalar> m (3, ny);
array_1D r (ny, 1);
algebra::TriMatrix<scalar> m(3, ny);
array_1D r(ny, 1);
for (size_t iy = 1; iy <= ny; ++iy) {
m(0, iy-1) = -ay;
......@@ -256,8 +256,8 @@ namespace finite_differences {
r(0) += ay * byl(ix);
r(ny-1) += ay * byr(ix);
u_new_trans(0,ix) = byl(ix);
u_new_trans(ny+1,ix) = byr(ix);
u_new_trans(0, ix) = byl(ix);
u_new_trans(ny+1, ix) = byr(ix);
u_new_trans.col(ix).segment(1, ny) = algebra::tridiagonal(std::move(m), std::move(r));
}
......
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