Skip to content

Commit

Permalink
Fix bug in test_snb
Browse files Browse the repository at this point in the history
Update existing dy and J fields, to avoid invalid values in the guard cells.
  • Loading branch information
tomchapman committed Jan 8, 2025
1 parent 77fb0c9 commit 09162ca
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions tests/integrated/test-snb/test_snb.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,18 @@ int main(int argc, char** argv) {
// Change the mesh spacing and cell volume (Jdy)
Coordinates* coord = Te.getCoordinates();

{
auto dy = emptyFrom(coord->dx());
auto J = emptyFrom(coord->J());
for (int x = mesh->xstart; x <= mesh->xend; x++) {
for (int y = mesh->ystart; y <= mesh->yend; y++) {
const double y_n = (double(y) + 0.5) / double(mesh->yend + 1);

dy(x, y) = 1. - 0.9 * y_n;
J(x, y) = 1. + y_n * y_n;
}
auto dy_copy = coord->dy();
auto J_copy = coord->J();
for (int x = mesh->xstart; x <= mesh->xend; x++) {
for (int y = mesh->ystart; y <= mesh->yend; y++) {
const double y_n = (double(y) + 0.5) / double(mesh->yend + 1);

dy_copy(x, y) = 1. - 0.9 * y_n;
J_copy(x, y) = 1. + y_n * y_n;
}
coord->setDy(dy);
coord->setJ(J);
}
coord->setDy(dy_copy);
coord->setJ(J_copy);

HeatFluxSNB snb;

Expand Down

0 comments on commit 09162ca

Please sign in to comment.