Commit f76aebc8 authored by Leon Merten Lohse's avatar Leon Merten Lohse
Browse files

reorder terms in fd

parent c55aa9af
Pipeline #195075 failed with stages
in 26 seconds
......@@ -134,17 +134,17 @@ namespace finite_differences {
m(0, i) = -rxx + rhix; // lower
m(1, i) = rz + 2.0 * rxx - f(i); // diagonal
m(2, i) = -rxx - rhix; // upper;
r(i) = (rz - 2.0 * rxx + f(i)) * up(i)
+ (rxx - rhix) * up(i-1)
+ (rxx + rhix) * up(i+1);
r(i) = (rz + f(i)) * up(i)
+ rxx * (up(i-1) - 2.0 * up(i) + up(i+1))
+ rhix * (up(i+1) - up(i-1));
}
// left boundary
m(0, 0) = 0; // lower
m(1, 0) = rz + 2. * rxx + 2. * rx - f(0); // diagonal
m(2, 0) = -2. * rxx - 2.0 * rx; // upper;
r(0) = (rz - 2. * rxx - 2.0 * rx + f(0)) * up(0)
+ (2. * rxx + 2. * rx) * up(1);
m(1, 0) = rz + 2.0 * rxx + 2.0 * rx - f(0); // diagonal
m(2, 0) = -2.0 * rxx - 2.0 * rx; // upper;
r(0) = (rz + f(0)) * up(0)
+ (2.0 * rxx + 2.0 * rx) * (up(1) - up(0));
// right boundary
......
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