Skip to content

Commit 6fc8c82

Browse files
committed
Quick-fix Stratton-Chu test
1 parent 6bba335 commit 6fc8c82

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

palace/utils/iodata.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ class IoData
3939
private:
4040
bool init;
4141

42-
// Check configuration file options and compatibility with requested problem type.
42+
public:
43+
// Check configuration file options and compatibility with requested problem type. Should
44+
// not be called by user, but temporarily made public for testing.
4345
void CheckConfiguration();
4446

45-
public:
4647
explicit IoData(const Units &units) : units(units), init(false) {}
4748

4849
// Take parsed json and override options defaults.

test/unit/test-strattonchu.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void runFarFieldTest(double freq_Hz, std::unique_ptr<mfem::Mesh> serial_mesh,
162162

163163
Units units(0.496, 1.453); // Pick some arbitrary non-trivial units for testing
164164

165-
IoData iodata = IoData(units);
165+
IoData iodata{units};
166166
// We need to have at least one material. By default it's vacuum.
167167
iodata.domains.materials.emplace_back().attributes = {1};
168168
// We also need to have a non-empty farfield and a compatible problem type, or
@@ -171,6 +171,8 @@ void runFarFieldTest(double freq_Hz, std::unique_ptr<mfem::Mesh> serial_mesh,
171171
iodata.boundaries.postpro.farfield.thetaphis.emplace_back();
172172
iodata.problem.type = ProblemType::DRIVEN;
173173

174+
iodata.CheckConfiguration();
175+
174176
auto comm = Mpi::World();
175177

176178
// Read parallel mesh.
@@ -332,7 +334,7 @@ TEST_CASE("PostOperator", "[strattonchu][Serial]")
332334
TEST_CASE("FarField constructor fails with anisotropic materials", "[strattonchu][Serial]")
333335
{
334336
Units units(0.496, 1.453);
335-
IoData iodata = IoData(units);
337+
IoData iodata{units};
336338

337339
auto &material = iodata.domains.materials.emplace_back();
338340
material.attributes = {1};
@@ -342,6 +344,8 @@ TEST_CASE("FarField constructor fails with anisotropic materials", "[strattonchu
342344
iodata.boundaries.postpro.farfield.thetaphis.emplace_back();
343345
iodata.problem.type = ProblemType::DRIVEN;
344346

347+
iodata.CheckConfiguration();
348+
345349
MPI_Comm comm = Mpi::World();
346350
std::unique_ptr<mfem::Mesh> serial_mesh = std::make_unique<mfem::Mesh>(
347351
mfem::Mesh::MakeCartesian3D(2, 2, 2, mfem::Element::TETRAHEDRON));

0 commit comments

Comments
 (0)