nec2++ 2.1.1
nec_structure_currents.h
1/*
2 Copyright (C) 2004-2008 Timothy C.A. Molteno
3 tim@molteno.net
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19#pragma once
20
21#include "nec_results.h"
22#include "math_util.h"
23#include "nec_context.h"
24
25
26class nec_context;
27class c_geometry;
28
30{
31public:
32 /*Structure currents*/
33 nec_structure_currents(nec_context * in_context, enum excitation_type in_pattype,
34 nec_float in_xpr3, nec_float in_xpr6);
35
36 static std::string hpol(enum excitation_type e);
37
38 void analyze();
39
41 {
42 }
43
44 void add_segment_current(int i, nec_complex curi);
45
46public:
47
48 virtual void write_to_file(ostream& os)
49 {
50 write_to_file_aux(os);
51 }
52
53 virtual enum nec_result_type get_result_type()
54 {
55 return RESULT_STRUCTURE_CURRENTS;
56 }
57
58 int get_iptflg()
59 {
60 return iptflg;
61 }
62
63 int get_iptflq()
64 {
65 return iptflq;
66 }
67
68 int get_n();
69
70 int get_m();
71
72 vector<int> get_current_segment_number()
73 {
74 return _current_segment_number;
75 }
76
77 vector<int> get_current_segment_tag()
78 {
79 return _current_segment_tag;
80 }
81
82 vector<nec_float> get_current_segment_center_x()
83 {
84 return _current_segment_center_x;
85 }
86
87 vector<nec_float> get_current_segment_center_y()
88 {
89 return _current_segment_center_y;
90 }
91
92 vector<nec_float> get_current_segment_center_z()
93 {
94 return _current_segment_center_z;
95 }
96
97 vector<nec_float> get_current_segment_length()
98 {
99 return _current_segment_length;
100 }
101
102 vector<nec_float> get_current_theta()
103 {
104 return _current_theta;
105 }
106
107 vector<nec_float> get_current_phi()
108 {
109 return _current_phi;
110 }
111
112 vector<nec_complex> get_current()
113 {
114 return _current;
115 }
116
117 vector<int> get_q_density_segment_number()
118 {
119 return _q_density_segment_number;
120 }
121
122 vector<int> get_q_density_segment_tag()
123 {
124 return _q_density_segment_tag;
125 }
126
127 vector<nec_float> get_q_density_segment_center_x()
128 {
129 return _q_density_segment_center_x;
130 }
131
132 vector<nec_float> get_q_density_segment_center_y()
133 {
134 return _q_density_segment_center_y;
135 }
136
137 vector<nec_float> get_q_density_segment_center_z()
138 {
139 return _q_density_segment_center_z;
140 }
141
142 vector<nec_float> get_q_density_segment_length()
143 {
144 return _q_density_segment_length;
145 }
146
147 vector<nec_complex> get_q_density()
148 {
149 return _q_density;
150 }
151
152 vector<int> get_patch_number()
153 {
154 return _patch_number;
155 }
156
157 vector<nec_float> get_patch_center_x()
158 {
159 return _patch_center_x;
160 }
161
162 vector<nec_float> get_patch_center_y()
163 {
164 return _patch_center_y;
165 }
166
167 vector<nec_float> get_patch_center_z()
168 {
169 return _patch_center_z;
170 }
171
172 vector<nec_complex> get_patch_tangent_vector1()
173 {
174 return _patch_tangent_vector1;
175 }
176
177 vector<nec_complex> get_patch_tangent_vector2()
178 {
179 return _patch_tangent_vector2;
180 }
181
182 vector<nec_complex> get_patch_e_x()
183 {
184 return _patch_e_x;
185 }
186
187 vector<nec_complex> get_patch_e_y()
188 {
189 return _patch_e_y;
190 }
191
192 vector<nec_complex> get_patch_e_z()
193 {
194 return _patch_e_z;
195 }
196
197private:
198
199 nec_context *m_context;
200 c_geometry * m_geometry;
201 enum excitation_type pattype;
202
203 int iptflg;
204 int iptag, iptagf, iptagt;
205 int iptflq;
206 int iptaq, iptaqf, iptaqt;
207
208 nec_float xpr3, xpr6;
209 nec_float wavelength;
210 nec_float freq_mhz;
211
212 int current_nb_elements;
213 int q_density_nb_elements;
214 int q_density_last_printed;
215 int patch_nb_elements;
216
217 complex_array zarray;
218 real_array fnorm;
219
220 vector<int> _current_segment_number;
221 vector<int> _current_segment_tag;
222
223 vector<nec_float> _current_segment_center_x, _current_segment_center_y, _current_segment_center_z;
224 vector<nec_float> _current_segment_length;
225 vector<nec_float> _current_theta, _current_phi;
226
227 vector<nec_complex> _current;
228
229 vector<int> _q_density_segment_number;
230 vector<int> _q_density_segment_tag;
231
232 vector<nec_float> _q_density_segment_center_x, _q_density_segment_center_y, _q_density_segment_center_z;
233 vector<nec_float> _q_density_segment_length;
234
235 vector<nec_complex> _q_density;
236
237 vector<int> _patch_number;
238
239 vector<nec_float> _patch_center_x, _patch_center_y, _patch_center_z;
240
241 vector<nec_complex> _patch_tangent_vector1, _patch_tangent_vector2;
242 vector<nec_complex> _patch_e_x, _patch_e_y, _patch_e_z;
243
244 void write_to_file_aux(ostream& os);
245};
Definition c_geometry.h:52
Definition nec_results.h:208
Container for an nec2++ simulation.
Definition nec_context.h:80
Definition nec_structure_currents.h:30
Using nec_context.