Skip to content

Commit 09162ca

Browse files
committed
Fix bug in test_snb
Update existing dy and J fields, to avoid invalid values in the guard cells.
1 parent 77fb0c9 commit 09162ca

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

tests/integrated/test-snb/test_snb.cxx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,18 @@ int main(int argc, char** argv) {
209209
// Change the mesh spacing and cell volume (Jdy)
210210
Coordinates* coord = Te.getCoordinates();
211211

212-
{
213-
auto dy = emptyFrom(coord->dx());
214-
auto J = emptyFrom(coord->J());
215-
for (int x = mesh->xstart; x <= mesh->xend; x++) {
216-
for (int y = mesh->ystart; y <= mesh->yend; y++) {
217-
const double y_n = (double(y) + 0.5) / double(mesh->yend + 1);
218-
219-
dy(x, y) = 1. - 0.9 * y_n;
220-
J(x, y) = 1. + y_n * y_n;
221-
}
212+
auto dy_copy = coord->dy();
213+
auto J_copy = coord->J();
214+
for (int x = mesh->xstart; x <= mesh->xend; x++) {
215+
for (int y = mesh->ystart; y <= mesh->yend; y++) {
216+
const double y_n = (double(y) + 0.5) / double(mesh->yend + 1);
217+
218+
dy_copy(x, y) = 1. - 0.9 * y_n;
219+
J_copy(x, y) = 1. + y_n * y_n;
222220
}
223-
coord->setDy(dy);
224-
coord->setJ(J);
225221
}
222+
coord->setDy(dy_copy);
223+
coord->setJ(J_copy);
226224

227225
HeatFluxSNB snb;
228226

0 commit comments

Comments
 (0)