Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct DataSource {
std::string identifier;
double tolerance = 0.0;
std::vector<int> iter2_to_test = {1, 2};
int target_ns = 0;
};

class ExternalMagneticFieldTest : public TestWithParam<DataSource> {
Expand All @@ -58,7 +59,7 @@ TEST_P(ExternalMagneticFieldTest, CheckExternalMagneticField) {
const FlowControl& fc = vmec.fc_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_BEXTERN, number_of_iterations).value();
vmec.run(VmecCheckpoint::VAC1_BEXTERN, number_of_iterations, data_source_.target_ns).value();
ASSERT_TRUE(reached_checkpoint);

filename = absl::StrFormat(
Expand Down Expand Up @@ -155,6 +156,10 @@ INSTANTIATE_TEST_SUITE_P(
Values(DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-10,
.iter2_to_test = {3, 4}},
DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-12,
.iter2_to_test = {2, 3},
.target_ns = 32},
DataSource{.identifier = "cth_like_free_bdy",
.tolerance = 1.0e-10,
.iter2_to_test = {53, 54}}));
Expand Down
23 changes: 14 additions & 9 deletions free_boundary/laplace_solver/laplace_solver_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct DataSource {
std::string identifier;
double tolerance = 0.0;
std::vector<int> iter2_to_test = {1, 2};
int target_ns = 0;
};

class FourPTest : public TestWithParam<DataSource> {
Expand All @@ -64,7 +65,7 @@ TEST_P(FourPTest, CheckFourP) {
const FlowControl& fc = vmec.fc_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_FOURP, number_of_iterations).value();
vmec.run(VmecCheckpoint::VAC1_FOURP, number_of_iterations, data_source_.target_ns).value();
ASSERT_TRUE(reached_checkpoint);

filename = absl::StrFormat(
Expand Down Expand Up @@ -183,7 +184,7 @@ TEST_P(FourISymmTest, CheckFourISymm) {
const FlowControl& fc = vmec.fc_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_FOURI_SYMM, number_of_iterations).value();
vmec.run(VmecCheckpoint::VAC1_FOURI_SYMM, number_of_iterations, data_source_.target_ns).value();
ASSERT_TRUE(reached_checkpoint);

filename = absl::StrFormat(
Expand Down Expand Up @@ -264,7 +265,7 @@ TEST_P(FourIAccumulateGrpmnTest, CheckFourIAccumulateGrpmn) {
const FlowControl& fc = vmec.fc_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_FOURI_KV_DFT, number_of_iterations)
vmec.run(VmecCheckpoint::VAC1_FOURI_KV_DFT, number_of_iterations, data_source_.target_ns)
.value();
ASSERT_TRUE(reached_checkpoint);

Expand Down Expand Up @@ -363,7 +364,7 @@ TEST_P(FourIKvDftTest, CheckFourIKvDft) {
const FlowControl& fc = vmec.fc_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_FOURI_KV_DFT, number_of_iterations)
vmec.run(VmecCheckpoint::VAC1_FOURI_KV_DFT, number_of_iterations, data_source_.target_ns)
.value();
ASSERT_TRUE(reached_checkpoint);

Expand Down Expand Up @@ -515,7 +516,7 @@ TEST_P(FourIKuDftTest, CheckFourIKuDft) {
const FlowControl& fc = vmec.fc_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_FOURI_KU_DFT, number_of_iterations)
vmec.run(VmecCheckpoint::VAC1_FOURI_KU_DFT, number_of_iterations, data_source_.target_ns)
.value();
ASSERT_TRUE(reached_checkpoint);

Expand Down Expand Up @@ -545,7 +546,7 @@ TEST_P(FourIKuDftTest, CheckFourIKuDft) {

if (vmec.m_[0]->get_ivacskip() == 0) {
for (int mn = 0; mn < mnpd; ++mn) {
bvec_sin[mn] += ls.bvec_sin[mn] + si.bvec_sin[mn] / s.nfp;
bvec_sin[mn] += ls.bvecSinShare[mn] + si.bvec_sin[mn] / s.nfp;
} // mn
} // fullUpdate
} // thread_id
Expand Down Expand Up @@ -631,7 +632,7 @@ TEST_P(SolverInputsTest, CheckSolverInputs) {
const FlowControl& fc = vmec.fc_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_FOURI_KU_DFT, number_of_iterations)
vmec.run(VmecCheckpoint::VAC1_FOURI_KU_DFT, number_of_iterations, data_source_.target_ns)
.value();
ASSERT_TRUE(reached_checkpoint);

Expand Down Expand Up @@ -661,7 +662,7 @@ TEST_P(SolverInputsTest, CheckSolverInputs) {

if (vmec.m_[0]->get_ivacskip() == 0) {
for (int mn = 0; mn < mnpd; ++mn) {
bvec_sin[mn] += ls.bvec_sin[mn] + si.bvec_sin[mn] / s.nfp;
bvec_sin[mn] += ls.bvecSinShare[mn] + si.bvec_sin[mn] / s.nfp;
} // mn
} // fullUpdate
} // thread_id
Expand Down Expand Up @@ -735,7 +736,7 @@ TEST_P(LinearSolverTest, CheckLinearSolver) {
const FlowControl& fc = vmec.fc_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_SOLVER, number_of_iterations).value();
vmec.run(VmecCheckpoint::VAC1_SOLVER, number_of_iterations, data_source_.target_ns).value();
ASSERT_TRUE(reached_checkpoint);

filename = absl::StrFormat(
Expand Down Expand Up @@ -768,6 +769,10 @@ INSTANTIATE_TEST_SUITE_P(
Values(DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-9,
.iter2_to_test = {3, 4}},
DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-12,
.iter2_to_test = {2, 3},
.target_ns = 32},
DataSource{.identifier = "cth_like_free_bdy",
.tolerance = 1.0e-9,
.iter2_to_test = {53, 54}}));
Expand Down
13 changes: 11 additions & 2 deletions free_boundary/nestor/nestor_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct DataSource {
std::string identifier;
double tolerance = 0.0;
std::vector<int> iter2_to_test = {1, 2};
int target_ns = 0;
};

class InputsToNestorCallTest : public TestWithParam<DataSource> {
Expand Down Expand Up @@ -64,7 +65,7 @@ TEST_P(InputsToNestorCallTest, CheckInputsToNestorCall) {
const HandoverStorage& h = vmec.h_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_VACUUM, number_of_iterations).value();
vmec.run(VmecCheckpoint::VAC1_VACUUM, number_of_iterations, data_source_.target_ns).value();
ASSERT_TRUE(reached_checkpoint);

filename = absl::StrFormat(
Expand Down Expand Up @@ -140,6 +141,10 @@ INSTANTIATE_TEST_SUITE_P(
Values(DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-12,
.iter2_to_test = {3, 4}},
DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-12,
.iter2_to_test = {2, 3},
.target_ns = 32},
DataSource{.identifier = "cth_like_free_bdy",
.tolerance = 1.0e-12,
.iter2_to_test = {53, 54}}));
Expand Down Expand Up @@ -169,7 +174,7 @@ TEST_P(BsqVacTest, CheckBsqVac) {
const HandoverStorage& h = vmec.h_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_BSQVAC, number_of_iterations).value();
vmec.run(VmecCheckpoint::VAC1_BSQVAC, number_of_iterations, data_source_.target_ns).value();
ASSERT_TRUE(reached_checkpoint);

filename = absl::StrFormat(
Expand Down Expand Up @@ -225,6 +230,10 @@ INSTANTIATE_TEST_SUITE_P(
Values(DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-10,
.iter2_to_test = {3, 4}},
DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-12,
.iter2_to_test = {2},
.target_ns = 32},
DataSource{.identifier = "cth_like_free_bdy",
.tolerance = 1.0e-10,
.iter2_to_test = {53, 54}}));
Expand Down
9 changes: 7 additions & 2 deletions free_boundary/singular_integrals/singular_integrals_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ struct DataSource {
std::string identifier;
double tolerance = 0.0;
std::vector<int> iter2_to_test = {1, 2};
int target_ns = 0;
};

class CmnsTest : public TestWithParam<DataSource> {
Expand All @@ -61,7 +62,7 @@ TEST_P(CmnsTest, CheckCmns) {
const FlowControl& fc = vmec.fc_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_VACUUM, number_of_iterations).value();
vmec.run(VmecCheckpoint::VAC1_VACUUM, number_of_iterations, data_source_.target_ns).value();
ASSERT_TRUE(reached_checkpoint);

filename = absl::StrFormat(
Expand Down Expand Up @@ -131,7 +132,7 @@ TEST_P(AnalytTest, CheckAnalyt) {
const FlowControl& fc = vmec.fc_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_ANALYT, number_of_iterations).value();
vmec.run(VmecCheckpoint::VAC1_ANALYT, number_of_iterations, data_source_.target_ns).value();
ASSERT_TRUE(reached_checkpoint);

filename = absl::StrFormat(
Expand Down Expand Up @@ -256,6 +257,10 @@ INSTANTIATE_TEST_SUITE_P(
Values(DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-9,
.iter2_to_test = {3, 4}},
DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-12,
.iter2_to_test = {2, 3},
.target_ns = 32},
DataSource{.identifier = "cth_like_free_bdy",
.tolerance = 1.0e-9,
.iter2_to_test = {53, 54}}));
Expand Down
7 changes: 6 additions & 1 deletion free_boundary/surface_geometry/surface_geometry_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct DataSource {
std::string identifier;
double tolerance = 0.0;
std::vector<int> iter2_to_test = {1, 2};
int target_ns = 0;
};

class SurfaceGeometryTest : public TestWithParam<DataSource> {
Expand All @@ -63,7 +64,7 @@ TEST_P(SurfaceGeometryTest, CheckSurfaceGeometry) {
const FlowControl& fc = vmec.fc_;

bool reached_checkpoint =
vmec.run(VmecCheckpoint::VAC1_SURFACE, number_of_iterations).value();
vmec.run(VmecCheckpoint::VAC1_SURFACE, number_of_iterations, data_source_.target_ns).value();
ASSERT_TRUE(reached_checkpoint);

filename = absl::StrFormat(
Expand Down Expand Up @@ -190,6 +191,10 @@ INSTANTIATE_TEST_SUITE_P(
Values(DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-12,
.iter2_to_test = {3, 4}},
DataSource{.identifier = "solovev_free_bdy",
.tolerance = 1.0e-12,
.iter2_to_test = {2, 3},
.target_ns = 32},
DataSource{.identifier = "cth_like_free_bdy",
.tolerance = 1.0e-12,
.iter2_to_test = {53, 54}}));
Expand Down
6 changes: 3 additions & 3 deletions vmec/ideal_mhd_model/ideal_mhd_model_hot_restart_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ TEST_P(FourierGeometryToStartWithFromWOutTest,
const auto checkpoint = VmecCheckpoint::FOURIER_GEOMETRY_TO_START_WITH;
const absl::StatusOr<bool> checkpoint_reached =
vmec.run(checkpoint, /*maximum_iterations=*/0,
/*maximum_multi_grid_step=*/500,
/*target_ns=*/0, /*maximum_multi_grid_step=*/500,
/*initial_state=*/HotRestartState(output_quantities));
ASSERT_TRUE(checkpoint_reached.ok());
ASSERT_TRUE(*checkpoint_reached);
Expand Down Expand Up @@ -183,7 +183,7 @@ TEST_P(FourierGeometryToStartWithFromDebugOutTest,
const auto checkpoint = VmecCheckpoint::FOURIER_GEOMETRY_TO_START_WITH;
const absl::StatusOr<bool> checkpoint_reached =
vmec.run(checkpoint, /*iterations_before_checkpointing=*/0,
/*maximum_multi_grid_step=*/500,
/*target_ns=*/0, /*maximum_multi_grid_step=*/500,
/*initial_state=*/HotRestartState(output_quantities));
ASSERT_TRUE(checkpoint_reached.ok());
ASSERT_TRUE(*checkpoint_reached);
Expand Down Expand Up @@ -279,7 +279,7 @@ TEST_P(InverseFourierTransformGeometryTest,
const auto checkpoint = VmecCheckpoint::INV_DFT_GEOMETRY;
const absl::StatusOr<bool> checkpoint_reached =
vmec.run(checkpoint, /*iterations_before_checkpointing=*/0,
/*maximum_multi_grid_step=*/500,
/*target_ns=*/0, /*maximum_multi_grid_step=*/500,
/*initial_state=*/HotRestartState(output_quantities));
ASSERT_TRUE(checkpoint_reached.ok());
ASSERT_TRUE(*checkpoint_reached);
Expand Down
Loading