Commit 5c13e0d9 authored by Christopher Subich's avatar Christopher Subich
Browse files

Correct sign error in automatic generation of grids

Previously, the automatic_grid function was creating Chebyshev-type
grids with points ordered as:

{x,z} = L/2 + L/2*cos(pi*ii/(N-1))

This is incorrect.  The expected ordering is actually the reverse, or

{x,z} = L/2 - L/2*cos(...)
parent d4bb5300
......@@ -190,13 +190,13 @@ void BaseCase::automatic_grid(double MinX, double MinY, double MinZ,
// Generate 1D arrays
if (type_x() == NO_SLIP) {
*xx = MinX+length_x()*(0.5+0.5*cos(M_PI*ii/(size_x()-1)));
*xx = MinX+length_x()*(0.5-0.5*cos(M_PI*ii/(size_x()-1)));
} else {
*xx = MinX + length_x()*(ii+0.5)/size_x();
}
*yy = MinY + length_y()*(ii+0.5)/size_y();
if (type_z() == NO_SLIP) {
*zz = MinZ+length_z()*(0.5+0.5*cos(M_PI*ii/(size_z()-1)));
*zz = MinZ+length_z()*(0.5-0.5*cos(M_PI*ii/(size_z()-1)));
} else {
*zz = MinZ + length_z()*(0.5+ii)/size_z();
}
......
Supports Markdown
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