PyNEC 1.8.1__tar.gz → 2.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pynec-1.8.1 → pynec-2.2.1}/MANIFEST.in +1 -1
- {pynec-1.8.1 → pynec-2.2.1}/PKG-INFO +5 -1
- {pynec-1.8.1 → pynec-2.2.1}/PyNEC.egg-info/PKG-INFO +5 -1
- {pynec-1.8.1 → pynec-2.2.1}/PyNEC.egg-info/SOURCES.txt +10 -2
- pynec-2.2.1/PyNEC.egg-info/requires.txt +5 -0
- {pynec-1.8.1 → pynec-2.2.1}/README.md +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/antenna_util.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/basic_usage.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/context_clean.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/dipole.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/impedance_plot.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/logperiodic_opt.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/monopole.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/monopole_realistic_ground_plane.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/optimized.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/radiation_pattern.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/test_ai.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/test_charge_densities.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/test_ne_nh.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/test_nrp.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/test_rp.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/test_rp2.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/test_se.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/test_structure_currents.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/example/test_surface_patch_currents.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/c_evlcom.cpp +76 -36
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/c_evlcom.h +5 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/c_geometry.cpp +137 -163
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/c_geometry.h +13 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/common.h +5 -6
- pynec-2.2.1/necpp_src/src/config.h.in +10 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/matrix_algebra.cpp +13 -264
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/matrix_algebra.h +2 -14
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/misc.cpp +64 -8
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/misc.h +2 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_context.cpp +68 -48
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_output.cpp +19 -4
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_output.h +3 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_structure_currents.cpp +12 -14
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_structure_currents.h +4 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/safe_array.h +1 -1
- {pynec-1.8.1 → pynec-2.2.1}/pyproject.toml +9 -1
- {pynec-1.8.1 → pynec-2.2.1}/setup.py +5 -3
- pynec-2.2.1/tests/test_charge_densities.py +48 -0
- {pynec-1.8.1 → pynec-2.2.1}/tests/test_examples.py +1 -0
- {pynec-1.8.1 → pynec-2.2.1}/tests/test_get_gain.py +1 -0
- pynec-2.2.1/tests/test_input_parameters.py +75 -0
- pynec-2.2.1/tests/test_near_field.py +69 -0
- pynec-2.2.1/tests/test_norm_rx_pattern.py +64 -0
- pynec-2.2.1/tests/test_patches.py +69 -0
- pynec-2.2.1/tests/test_radiation_pattern.py +88 -0
- pynec-2.2.1/tests/test_structure_currents.py +69 -0
- pynec-2.2.1/tests/test_structure_excitation.py +75 -0
- pynec-1.8.1/PyNEC.egg-info/requires.txt +0 -1
- pynec-1.8.1/necpp_src/config.h +0 -70
- {pynec-1.8.1 → pynec-2.2.1}/LICENCE.txt +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/PyNEC.egg-info/dependency_links.txt +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/PyNEC.egg-info/top_level.txt +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/PyNEC.py +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/PyNEC_wrap.cxx +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/AntennaInput.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/BaseInput.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/CurrentInput.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/PowerBudget.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/RadiationInput.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/XGetopt.cpp +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/XGetopt.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/c_ggrid.cpp +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/c_ggrid.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/c_plot_card.cpp +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/c_plot_card.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/electromag.cpp +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/electromag.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/libNEC.cpp +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/libnecpp.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/math_util.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec2cpp.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_card_parser.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_context.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_debug.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_exception.cpp +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_exception.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_ground.cpp +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_ground.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_radiation_pattern.cpp +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_radiation_pattern.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_results.cpp +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_results.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/nec_wire.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/necpp_src/src/typesafe_stdint.h +0 -0
- {pynec-1.8.1 → pynec-2.2.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyNEC
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.2.1
|
|
4
4
|
Summary: Python Antenna Simulation Module (nec2++) object-oriented interface
|
|
5
5
|
Author-email: Tim Molteno <tim@physics.otago.ac.nz>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -16,8 +16,12 @@ Requires-Python: >=3.9
|
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENCE.txt
|
|
18
18
|
Requires-Dist: numpy
|
|
19
|
+
Provides-Extra: test
|
|
20
|
+
Requires-Dist: pytest; extra == "test"
|
|
21
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
19
22
|
Dynamic: license-file
|
|
20
23
|
|
|
24
|
+
<!-- Copyright (c) 2008-2026 Tim Molteno (tim@elec.ac.nz) -->
|
|
21
25
|
# Python NEC2++ Module
|
|
22
26
|
|
|
23
27
|
This module wraps the C++ API for antenna simulation of nec2++. It is easier to work with, and more powerful than the C-style API wrapper. Works with Python 2.7 and 3+.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyNEC
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.2.1
|
|
4
4
|
Summary: Python Antenna Simulation Module (nec2++) object-oriented interface
|
|
5
5
|
Author-email: Tim Molteno <tim@physics.otago.ac.nz>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -16,8 +16,12 @@ Requires-Python: >=3.9
|
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENCE.txt
|
|
18
18
|
Requires-Dist: numpy
|
|
19
|
+
Provides-Extra: test
|
|
20
|
+
Requires-Dist: pytest; extra == "test"
|
|
21
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
19
22
|
Dynamic: license-file
|
|
20
23
|
|
|
24
|
+
<!-- Copyright (c) 2008-2026 Tim Molteno (tim@elec.ac.nz) -->
|
|
21
25
|
# Python NEC2++ Module
|
|
22
26
|
|
|
23
27
|
This module wraps the C++ API for antenna simulation of nec2++. It is easier to work with, and more powerful than the C-style API wrapper. Works with Python 2.7 and 3+.
|
|
@@ -29,7 +29,6 @@ example/test_rp2.py
|
|
|
29
29
|
example/test_se.py
|
|
30
30
|
example/test_structure_currents.py
|
|
31
31
|
example/test_surface_patch_currents.py
|
|
32
|
-
necpp_src/config.h
|
|
33
32
|
necpp_src/src/AntennaInput.h
|
|
34
33
|
necpp_src/src/BaseInput.h
|
|
35
34
|
necpp_src/src/CurrentInput.h
|
|
@@ -46,6 +45,7 @@ necpp_src/src/c_ggrid.h
|
|
|
46
45
|
necpp_src/src/c_plot_card.cpp
|
|
47
46
|
necpp_src/src/c_plot_card.h
|
|
48
47
|
necpp_src/src/common.h
|
|
48
|
+
necpp_src/src/config.h.in
|
|
49
49
|
necpp_src/src/electromag.cpp
|
|
50
50
|
necpp_src/src/electromag.h
|
|
51
51
|
necpp_src/src/libNEC.cpp
|
|
@@ -75,5 +75,13 @@ necpp_src/src/nec_structure_currents.h
|
|
|
75
75
|
necpp_src/src/nec_wire.h
|
|
76
76
|
necpp_src/src/safe_array.h
|
|
77
77
|
necpp_src/src/typesafe_stdint.h
|
|
78
|
+
tests/test_charge_densities.py
|
|
78
79
|
tests/test_examples.py
|
|
79
|
-
tests/test_get_gain.py
|
|
80
|
+
tests/test_get_gain.py
|
|
81
|
+
tests/test_input_parameters.py
|
|
82
|
+
tests/test_near_field.py
|
|
83
|
+
tests/test_norm_rx_pattern.py
|
|
84
|
+
tests/test_patches.py
|
|
85
|
+
tests/test_radiation_pattern.py
|
|
86
|
+
tests/test_structure_currents.py
|
|
87
|
+
tests/test_structure_excitation.py
|
|
@@ -186,7 +186,7 @@ void c_evlcom::gshank( nec_complex start, nec_complex dela, complex_array& sum,
|
|
|
186
186
|
if (den < denm)
|
|
187
187
|
den=denm;
|
|
188
188
|
a1=q1[i][j]-a1;
|
|
189
|
-
amg=fabs(real(a1)+fabs(imag(a1))
|
|
189
|
+
amg=fabs(real(a1))+fabs(imag(a1));
|
|
190
190
|
if (amg > den)
|
|
191
191
|
{
|
|
192
192
|
brk = true;
|
|
@@ -563,54 +563,52 @@ void c_evlcom::evlua( nec_complex *erv, nec_complex *ezv,
|
|
|
563
563
|
gshank(cp1,delta,ans,6,sum,0,bk,bk);
|
|
564
564
|
rmis=m_rho*(real(m_ck1)-m_ck2);
|
|
565
565
|
|
|
566
|
-
bool jump
|
|
567
|
-
if ( (rmis
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
{
|
|
571
|
-
bk=nec_complex(-m_zph,m_rho)*(m_ck1-cp3);
|
|
572
|
-
rmis = -real(bk)/fabs(imag(bk));
|
|
573
|
-
if (rmis > 4.*m_rho/m_zph)
|
|
574
|
-
jump = true;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
if ( false == jump )
|
|
578
|
-
{
|
|
579
|
-
/* integrate up between branch cuts, then to + infinity */
|
|
580
|
-
cp1=m_ck1- nec_complex(0.1,+0.2);
|
|
581
|
-
cp2=cp1+.2;
|
|
582
|
-
bk=nec_complex(0.,del);
|
|
583
|
-
gshank(cp1,bk,sum,6,ans,0,bk,bk);
|
|
584
|
-
m_contour_a=cp1;
|
|
585
|
-
m_contour_b=cp2;
|
|
586
|
-
rom1(6,ans,1);
|
|
587
|
-
for (int i = 0; i < 6; i++ )
|
|
588
|
-
ans[i] -= sum[i];
|
|
589
|
-
|
|
590
|
-
gshank(cp3,bk,sum,6,ans,0,bk,bk);
|
|
591
|
-
gshank(cp2,delta2,ans,6,sum,0,bk,bk);
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
jump = true;
|
|
595
|
-
} /* if ( (rmis >= 2.*m_ck2) || (m_rho >= 1.e-10) ) */
|
|
596
|
-
else
|
|
566
|
+
bool jump;
|
|
567
|
+
if ( (rmis < 2.*m_ck2) || (m_rho < 1.e-10) )
|
|
568
|
+
jump = true;
|
|
569
|
+
else if ( m_zph < 1.e-10 )
|
|
597
570
|
jump = false;
|
|
598
|
-
|
|
571
|
+
else
|
|
572
|
+
{
|
|
573
|
+
bk=nec_complex(-m_zph,m_rho)*(m_ck1-cp3);
|
|
574
|
+
rmis = -real(bk)/fabs(imag(bk));
|
|
575
|
+
if (rmis > 4.*m_rho/m_zph)
|
|
576
|
+
jump = true;
|
|
577
|
+
else
|
|
578
|
+
jump = false;
|
|
579
|
+
}
|
|
580
|
+
|
|
599
581
|
if ( false == jump )
|
|
582
|
+
{
|
|
583
|
+
/* integrate up between branch cuts, then to + infinity */
|
|
584
|
+
cp1=m_ck1- nec_complex(0.1,+0.2);
|
|
585
|
+
cp2=cp1+.2;
|
|
586
|
+
bk=nec_complex(0.,del);
|
|
587
|
+
gshank(cp1,bk,sum,6,ans,0,bk,bk);
|
|
588
|
+
m_contour_a=cp1;
|
|
589
|
+
m_contour_b=cp2;
|
|
590
|
+
rom1(6,ans,1);
|
|
591
|
+
for (int i = 0; i < 6; i++ )
|
|
592
|
+
ans[i] -= sum[i];
|
|
593
|
+
|
|
594
|
+
gshank(cp3,bk,sum,6,ans,0,bk,bk);
|
|
595
|
+
gshank(cp2,delta2,ans,6,sum,0,bk,bk);
|
|
596
|
+
}
|
|
597
|
+
else
|
|
600
598
|
{
|
|
601
599
|
/* integrate below branch points, then to + infinity */
|
|
602
600
|
for (int i = 0; i < 6; i++ )
|
|
603
601
|
sum[i] = -ans[i];
|
|
604
|
-
|
|
602
|
+
|
|
605
603
|
rmis=real(m_ck1)*1.01;
|
|
606
604
|
if ( (m_ck2+1.) > rmis )
|
|
607
605
|
rmis=m_ck2+1.;
|
|
608
|
-
|
|
606
|
+
|
|
609
607
|
bk=nec_complex(rmis,.99*imag(m_ck1));
|
|
610
608
|
delta=bk-cp3;
|
|
611
609
|
delta *= del/abs(delta);
|
|
612
610
|
gshank(cp3,delta,ans,6,sum,1,bk,delta2);
|
|
613
|
-
}
|
|
611
|
+
}
|
|
614
612
|
|
|
615
613
|
ans[5] *= m_ck1;
|
|
616
614
|
|
|
@@ -841,3 +839,45 @@ void hankel( nec_complex z, nec_complex *h0, nec_complex *h0p )
|
|
|
841
839
|
}
|
|
842
840
|
|
|
843
841
|
|
|
842
|
+
|
|
843
|
+
/* Numerical integration convergence tests used by Sommerfeld integration. */
|
|
844
|
+
|
|
845
|
+
void test(
|
|
846
|
+
nec_float f1r, nec_float f2r, nec_float *tr,
|
|
847
|
+
nec_float f1i, nec_float f2i, nec_float *ti,
|
|
848
|
+
nec_float dmin )
|
|
849
|
+
{
|
|
850
|
+
static nec_float _min_val = 1.0e-37;
|
|
851
|
+
|
|
852
|
+
nec_float den = fabs( f2r);
|
|
853
|
+
nec_float temp_tr = fabs( f2i);
|
|
854
|
+
|
|
855
|
+
if( den < temp_tr)
|
|
856
|
+
den = temp_tr;
|
|
857
|
+
if( den < dmin)
|
|
858
|
+
den = dmin;
|
|
859
|
+
|
|
860
|
+
if( den < _min_val) {
|
|
861
|
+
*tr = 0.0;
|
|
862
|
+
*ti = 0.0;
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
*tr= fabs((f1r - f2r)/ den);
|
|
867
|
+
*ti= fabs((f1i - f2i)/ den);
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
nec_float test_simple( nec_float f1r, nec_float f2r, nec_float dmin )
|
|
871
|
+
{
|
|
872
|
+
static nec_float _min_val = 1.0e-37;
|
|
873
|
+
|
|
874
|
+
nec_float den = fabs(f2r);
|
|
875
|
+
|
|
876
|
+
if( den < dmin)
|
|
877
|
+
den = dmin;
|
|
878
|
+
if (den < _min_val) {
|
|
879
|
+
return 0.0;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
return fabs((f1r - f2r) / den);
|
|
883
|
+
}
|
|
@@ -61,3 +61,8 @@ private:
|
|
|
61
61
|
/*! \brief Flag to select Bessel or Hankel function form (was jh) */
|
|
62
62
|
bool m_bessel_flag;
|
|
63
63
|
};
|
|
64
|
+
|
|
65
|
+
/* Numerical integration convergence tests (used by Sommerfeld integration) */
|
|
66
|
+
void test(nec_float f1r, nec_float f2r, nec_float *tr, nec_float f1i,
|
|
67
|
+
nec_float f2i, nec_float *ti, nec_float dmin);
|
|
68
|
+
nec_float test_simple( nec_float f1r, nec_float f2r, nec_float dmin );
|