diff --git a/python/gvec/util/params.py b/python/gvec/util/params.py index dee76582..9242ebb2 100644 --- a/python/gvec/util/params.py +++ b/python/gvec/util/params.py @@ -646,7 +646,8 @@ def power_series(kind: str) -> bool: pres = np.where(s_pres > spres_ped, np.interp(spres_ped, s_pres, pres), pres) params["pres"] = sampled(pres) else: - logger.warning("No pressure profile defined.") + # VMEC's default AM is zero + params["pres"] = {"type": "polynomial", "coefs": [0.0]} if "ai" in nml or "ai_aux_f" in nml: if power_series("piota") and not nml.get("lrfp", False): diff --git a/test-CI/unit-pygvec/test_util.py b/test-CI/unit-pygvec/test_util.py index 92990986..8d702476 100644 --- a/test-CI/unit-pygvec/test_util.py +++ b/test-CI/unit-pygvec/test_util.py @@ -262,6 +262,19 @@ def test_parameters_from_vmec_reads_legacy_and_scalar_axis(): assert "init_average_axis" not in parameters +def test_parameters_from_vmec_defaults_to_zero_pressure(): + import f90nml + + nml = f90nml.reads("&INDATA\n RBC(0, 0) = 5.5 RBC(0, 1) = 0.7 ZBS(0, 1) = 0.7\n/\n")[ + "indata" + ] + + assert util.parameters_from_vmec(nml, "no_pressure")["pres"] == { + "type": "polynomial", + "coefs": [0.0], + } + + def test_parameters_from_vmec_converts_vmec_profile_types(): """Non-polynomial VMEC profiles convert to the profiles VMEC evaluates.""" import f90nml