Skip to content

Commit

Permalink
Set coordinates on Bxy field before calling its setter
Browse files Browse the repository at this point in the history
(because now communicate() is called in the setter)
  • Loading branch information
tomchapman committed Dec 19, 2024
1 parent 1bcb9eb commit 1e1f1f7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/unit/test_extras.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ public:
// Need some options for parallelTransform
options = Options::getRoot();
mpi = bout::globals::mpi;
source = static_cast<GridDataSource*>(new GridFromOptions(options));
}

void setCoordinates(std::shared_ptr<Coordinates> coords,
Expand Down Expand Up @@ -440,7 +439,6 @@ public:
Field2D{1.0}, Field2D{1.0}, Field2D{1.0}, Field2D{1.0}, Field2D{0.0},
Field2D{0.0}, Field2D{0.0}, Field2D{1.0}, Field2D{1.0}, Field2D{1.0},
Field2D{0.0}, Field2D{0.0}, Field2D{0.0}, Field2D{0.0}, Field2D{0.0});
static_cast<FakeMesh*>(bout::globals::mesh)->setCoordinates(test_coords);


// Set nonuniform corrections
Expand All @@ -451,6 +449,7 @@ public:
#if BOUT_USE_METRIC_3D

FieldMetric mutable_Bxy = test_coords->Bxy();
static_cast<FakeMesh*>(mutable_Bxy.getMesh())->setCoordinates(test_coords);
mutable_Bxy.splitParallelSlices();
test_coords->setBxy(mutable_Bxy);

Expand Down

0 comments on commit 1e1f1f7

Please sign in to comment.