Skip to content

Commit f7f47ff

Browse files
Scan the complete cross-section for the geometry table of a lasym run (#779)
1 parent aa7f4ce commit f7f47ff

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4028,11 +4028,13 @@ vmecpp::ComputeThreed1GeometricMagneticQuantities(
40284028
// double zxmax = 0.0;
40294029
// double zxmin = 0.0;
40304030

4031-
// Only theta in [0, pi] is stored under stellarator symmetry. The
4032-
// second pass takes the reflected plane 2 pi - zeta with Z -> -Z, which
4033-
// supplies the missing half of the cross-section, so that the extrema
4034-
// searched for below are those of the complete closed contour.
4035-
for (int icount = 0; icount < 2; ++icount) {
4031+
// Under stellarator symmetry only theta in [0, pi] is stored, and the
4032+
// second pass takes the reflected plane 2 pi - zeta with Z -> -Z to
4033+
// supply the other half of the cross-section. A lasym run stores the
4034+
// complete contour, which is scanned in a single pass.
4035+
const int num_passes = s.lasym ? 1 : 2;
4036+
const int num_theta = s.lasym ? s.nThetaEff : s.nThetaReduced;
4037+
for (int icount = 0; icount < num_passes; ++icount) {
40364038
int k1 = k;
40374039
int t1 = 1;
40384040
if (icount == 1) {
@@ -4041,7 +4043,7 @@ vmecpp::ComputeThreed1GeometricMagneticQuantities(
40414043
t1 = -1;
40424044
}
40434045

4044-
for (int l = 0; l < s.nThetaReduced; ++l) {
4046+
for (int l = 0; l < num_theta; ++l) {
40454047
const int l_off = (jF * s.nZeta + k1) * s.nThetaEff + l;
40464048

40474049
const double yr1u = vmec_internal_results.r_e(l_off) +

0 commit comments

Comments
 (0)