aboutsummaryrefslogtreecommitdiffstats
path: root/comms/xnec2c/files
diff options
context:
space:
mode:
authorshurd <shurd@FreeBSD.org>2014-06-18 13:22:50 +0800
committershurd <shurd@FreeBSD.org>2014-06-18 13:22:50 +0800
commitb9c286f40586dffd7df52818e7ec498f171d8e64 (patch)
treeb4715aef487e8b53d3ddf2ee60bcfdb870396cd8 /comms/xnec2c/files
parent9904d6778a1bc9a1436d416cc49d56d1689fffc0 (diff)
downloadfreebsd-ports-gnome-b9c286f40586dffd7df52818e7ec498f171d8e64.tar.gz
freebsd-ports-gnome-b9c286f40586dffd7df52818e7ec498f171d8e64.tar.zst
freebsd-ports-gnome-b9c286f40586dffd7df52818e7ec498f171d8e64.zip
xnec2c is a GTK+ graphical interactive version of nec2c. It incorporates the
nec2c core which it uses for reading input files and calculating output data, but it does not need and indeed does not produce an output file by default. Graphs of frequency-related data and the current or charge distribution evolve as the frequency loop progresses, and radiation patterns (far and near field) are sequentially drawn for each frequency step. PR: ports/190815 Submitted by: shurd@FreeBSD.org Approved by: db, skreuzer (mentors)
Diffstat (limited to 'comms/xnec2c/files')
-rw-r--r--comms/xnec2c/files/cexp.c46
-rw-r--r--comms/xnec2c/files/cexp.h9
-rw-r--r--comms/xnec2c/files/clog.c46
-rw-r--r--comms/xnec2c/files/patch-src_common.h10
-rw-r--r--comms/xnec2c/files/patch-src_somnec.c12
5 files changed, 123 insertions, 0 deletions
diff --git a/comms/xnec2c/files/cexp.c b/comms/xnec2c/files/cexp.c
new file mode 100644
index 000000000000..595e913be5d8
--- /dev/null
+++ b/comms/xnec2c/files/cexp.c
@@ -0,0 +1,46 @@
+/* $NetBSD: cexp.c,v 1.1 2007/08/20 16:01:34 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <complex.h>
+#include <math.h>
+
+double complex
+cexp(double complex z)
+{
+ double complex w;
+ double r, x, y;
+
+ x = creal(z);
+ y = cimag(z);
+ r = exp(x);
+ w = r * cos(y) + r * sin(y) * I;
+ return w;
+}
diff --git a/comms/xnec2c/files/cexp.h b/comms/xnec2c/files/cexp.h
new file mode 100644
index 000000000000..41d925046428
--- /dev/null
+++ b/comms/xnec2c/files/cexp.h
@@ -0,0 +1,9 @@
+#ifndef CEXP_H_
+#define CEXP_H_
+
+#include <complex.h>
+#include <math.h>
+
+double complex cexp(double complex z);
+
+#endif
diff --git a/comms/xnec2c/files/clog.c b/comms/xnec2c/files/clog.c
new file mode 100644
index 000000000000..c097ca1b8a4f
--- /dev/null
+++ b/comms/xnec2c/files/clog.c
@@ -0,0 +1,46 @@
+/* $NetBSD: clog.c,v 1.1 2007/08/20 16:01:35 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <complex.h>
+#include <math.h>
+
+double complex
+clog(double complex z)
+{
+ double complex w;
+ double p, rr;
+
+ rr = cabs(z);
+ p = log(rr);
+ rr = atan2(cimag(z), creal(z));
+ w = p + rr * I;
+ return w;
+}
diff --git a/comms/xnec2c/files/patch-src_common.h b/comms/xnec2c/files/patch-src_common.h
new file mode 100644
index 000000000000..05991a06efaf
--- /dev/null
+++ b/comms/xnec2c/files/patch-src_common.h
@@ -0,0 +1,10 @@
+--- src/common.h.orig 2014-06-08 17:50:43.000000000 -0700
++++ src/common.h 2014-06-08 17:50:53.000000000 -0700
+@@ -37,6 +37,7 @@
+ #include <sys/types.h>
+ #include <sys/times.h>
+ #include <gtk/gtk.h>
++#include "cexp.h"
+
+ /* commonly used complex constants */
+ #define CPLX_00 (0.0+I*0.0)
diff --git a/comms/xnec2c/files/patch-src_somnec.c b/comms/xnec2c/files/patch-src_somnec.c
new file mode 100644
index 000000000000..5a71fccdbd1e
--- /dev/null
+++ b/comms/xnec2c/files/patch-src_somnec.c
@@ -0,0 +1,12 @@
+--- src/somnec.c.orig 2013-12-01 23:01:31.000000000 -0800
++++ src/somnec.c 2014-06-08 17:51:47.000000000 -0700
+@@ -38,6 +38,9 @@
+ #include "somnec.h"
+ #include "shared.h"
+
++#include "clog.c"
++#include "cexp.c"
++
+ /* common /evlcom/ */
+ static int jh;
+ static double ck2, ck2sq, tkmag, tsmag, ck1r, zph, rho;