Skip to content

Instantly share code, notes, and snippets.

@erthalion
Created July 4, 2015 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erthalion/8e22eab55b2191b72fec to your computer and use it in GitHub Desktop.
Save erthalion/8e22eab55b2191b72fec to your computer and use it in GitHub Desktop.
long double TImmersedBoundaryProblem::Coord(T3dNormalGrid *grid, const int index, const int type, const int data_axis)
{
long double step;
if (type == COORD_X) {
step = grid->GetSeparator1().Separation[0];
}
else if (type == COORD_Y) {
step = grid->GetSeparator2().Separation[0];
}
else if (type == COORD_Z) {
step = grid->GetSeparator3().Separation[0];
}
else {
throw "Incorrect type of axis";
}
return index * step + (type == data_axis ? 0.5 * step : 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment