Skip to content

Commit 3f1fcaf

Browse files
Implement unit tests for solovev_free_bdy
1 parent 021c212 commit 3f1fcaf

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/vmecpp/cpp/vmecpp/vmec/output_quantities/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ cc_test(
4141
data = [
4242
"//vmecpp/test_data:solovev",
4343
"//vmecpp/test_data:solovev_no_axis",
44+
"//vmecpp/test_data:solovev_free_bdy",
4445
"//vmecpp/test_data:cth_like_fixed_bdy",
4546
"//vmecpp/test_data:cth_like_fixed_bdy_nzeta_37",
4647
"//vmecpp/test_data:cma",

src/vmecpp/cpp/vmecpp/vmec/output_quantities/output_quantities_test.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ INSTANTIATE_TEST_SUITE_P(
415415
TestOutputQuantities, WOutFileContentsTest,
416416
Values(DataSource{.identifier = "solovev", .tolerance = 5.0e-7},
417417
DataSource{.identifier = "solovev_no_axis", .tolerance = 5.0e-7},
418+
DataSource{.identifier = "solovev_free_bdy", .tolerance = 5.0e-7},
418419
DataSource{.identifier = "cth_like_fixed_bdy", .tolerance = 1.0e-6},
419420
DataSource{.identifier = "cth_like_fixed_bdy_nzeta_37",
420421
.tolerance = 1.0e-6},

tests/test_free_boundary.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ def test_run_free_boundary_from_response_table():
6868
)
6969

7070

71+
@pytest.mark.skip(
72+
reason="Axisymmetric free-boundary code path not yet fully implemented (segfaults)"
73+
)
74+
def test_run_free_boundary_solovev():
75+
makegrid_params = vmecpp.MakegridParameters.from_file(
76+
TEST_DATA_DIR / "makegrid_parameters_solovev.json"
77+
)
78+
response = vmecpp.MagneticFieldResponseTable.from_coils_file(
79+
TEST_DATA_DIR / "coils.solovev", makegrid_params
80+
)
81+
vmec_input = vmecpp.VmecInput.from_file(TEST_DATA_DIR / "solovev_free_bdy.json")
82+
vmec_output = vmecpp.run(vmec_input, response, verbose=False)
83+
assert vmec_output.wout.volume == pytest.approx(128.8377, rel=1e-3, abs=1e-3)
84+
85+
7186
def test_raise_invalid_nzeta():
7287
makegrid_params = vmecpp.MakegridParameters.from_file(
7388
TEST_DATA_DIR / "makegrid_parameters_cth_like.json"

0 commit comments

Comments
 (0)