From 879030bbd810d5eef6291e210145f31ca4a64b59 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 22 Jun 2022 15:31:17 +0200 Subject: [PATCH] Add a warning when Lundin's correction factor is not calculated because the geometries are too small (< 1um). --- src/spicelib/devices/ind/indsetup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spicelib/devices/ind/indsetup.c b/src/spicelib/devices/ind/indsetup.c index a33d7c31a..7aa995915 100644 --- a/src/spicelib/devices/ind/indsetup.c +++ b/src/spicelib/devices/ind/indsetup.c @@ -145,8 +145,11 @@ static double Lundin(double l, double csec) /* x = solenoid diam. / length */ double num, den, kk, x, xx, xxxx; - if (csec < 1e-12 || l < 1e-6) + if (csec < 1e-12 || l < 1e-6) { + fprintf(stderr, "Warning: coil geometries too small (< 1um length dimensions),\n"); + fprintf(stderr, " Lundin's correction factor will not be calculated\n"); return 1; + } x = sqrt(csec / PI) * 2. / l;