|
@@ -80,9 +80,9 @@ public:
|
80
|
80
|
Real dy = 20;
|
81
|
81
|
Real dz = 20;
|
82
|
82
|
|
83
|
|
- int nx = 5; //13
|
84
|
|
- int ny = 5; //13
|
85
|
|
- int nz = 5; //13
|
|
83
|
+ int nx = 11; //13
|
|
84
|
+ int ny = 11; //13
|
|
85
|
+ int nz = 11; //13
|
86
|
86
|
Delta = nx*ny*nz*1e-9;
|
87
|
87
|
|
88
|
88
|
receivers->SetNumberOfPoints(nx*ny*nz);
|
|
@@ -114,40 +114,41 @@ public:
|
114
|
114
|
|
115
|
115
|
void test_Hz() {
|
116
|
116
|
|
|
117
|
+ std::cout.precision(4);
|
|
118
|
+
|
117
|
119
|
dipole->SetType(MAGNETICDIPOLE);
|
118
|
120
|
dipole->SetPolarisation(ZPOLARISATION);
|
119
|
121
|
|
120
|
122
|
// Put in a unit test that will be slow.
|
121
|
123
|
std::cout << "MAGNETICDIPOLE Z polarisation" << std::endl;
|
122
|
124
|
std::cout << "=====================================\n";
|
123
|
|
- std::cout << "Lemma/C++: ";
|
|
125
|
+ std::cout << std::setw(18) << "Lemma/C++: ";
|
124
|
126
|
std::cout.flush();
|
125
|
127
|
|
126
|
128
|
timer.begin();
|
127
|
129
|
EmEarth->MakeCalc3();
|
128
|
130
|
Real lemmaTime = timer.end();
|
129
|
|
- std::cout << lemmaTime << " [s]" << std::endl;
|
|
131
|
+ std::cout << std::setw(14) << lemmaTime << std::setw(6) << " [s]" << std::endl;
|
130
|
132
|
|
131
|
133
|
auto lc = receivers->GetEfield( 0 );
|
132
|
134
|
|
133
|
135
|
#ifdef KIHALEE_EM1D
|
134
|
136
|
receivers->ClearFields();
|
135
|
|
- std::cout << "FORTRAN KiHa: ";
|
|
137
|
+ std::cout << std::setw(18) << "KiHa/Fortran: ";
|
136
|
138
|
std::cout.flush();
|
137
|
139
|
|
138
|
140
|
timer.begin();
|
139
|
141
|
EmEarth->MakeCalc();
|
140
|
142
|
Real kihaTime = timer.end();
|
141
|
|
-
|
142
|
|
- std::cout << kihaTime << " [s]" << std::endl;
|
|
143
|
+ std::cout << std::setw(14) << kihaTime << std::setw(6) << " [s]" << std::endl;
|
143
|
144
|
|
144
|
145
|
auto fc = receivers->GetEfield( 0 ); //0,0);
|
145
|
146
|
|
146
|
|
- std::cout.precision(16);
|
147
|
|
- std::cout << "Lemma norm |" << (lc).norm() << "|" << std::endl;
|
148
|
|
- std::cout << "KiHa norm |" << (fc).norm() << "|" << std::endl;
|
149
|
|
- std::cout << "Difference norm |" << (lc - fc).norm() << "|\n";
|
150
|
|
- std::cout << "Speedup:" << kihaTime/lemmaTime << "\n" << std::endl;
|
|
147
|
+ //std::cout.precision(16);
|
|
148
|
+ std::cout << std::setw(18) << "Lemma norm: " << std::setw(14) << (lc).norm() << std::endl;
|
|
149
|
+ std::cout << std::setw(18) << "KiHa norm: " << std::setw(14) << (fc).norm() << std::endl;
|
|
150
|
+ std::cout << std::setw(18) << "Difference norm: " << std::setw(14) << (lc - fc).norm() << "\n";
|
|
151
|
+ std::cout << std::setw(18) << "Speedup: " << std::setw(14) << kihaTime/lemmaTime << "\n" << std::endl;
|
151
|
152
|
|
152
|
153
|
TS_ASSERT_DELTA((lc-fc).norm(), 0.0, Delta);
|
153
|
154
|
#endif
|
|
@@ -155,37 +156,39 @@ public:
|
155
|
156
|
|
156
|
157
|
void test_Hx() {
|
157
|
158
|
|
|
159
|
+ std::cout.precision(4);
|
|
160
|
+
|
158
|
161
|
dipole->SetType(MAGNETICDIPOLE);
|
159
|
162
|
dipole->SetPolarisation(XPOLARISATION);
|
160
|
163
|
|
161
|
164
|
// Put in a unit test that will be slow.
|
162
|
165
|
std::cout << "MAGNETICDIPOLE X polarisation" << std::endl;
|
163
|
166
|
std::cout << "=====================================\n";
|
164
|
|
- std::cout << "Lemma/C++: ";
|
|
167
|
+ std::cout << std::setw(18) << "Lemma/C++: ";
|
165
|
168
|
std::cout.flush();
|
166
|
169
|
|
167
|
170
|
timer.begin();
|
168
|
171
|
EmEarth->MakeCalc3();
|
169
|
172
|
Real lemmaTime = timer.end();
|
170
|
|
- std::cout << lemmaTime << " [s]" << std::endl;
|
|
173
|
+ std::cout << std::setw(14) << lemmaTime << std::setw(6) << " [s]" << std::endl;
|
171
|
174
|
|
172
|
175
|
auto lc = receivers->GetEfield( 0 );
|
173
|
176
|
|
174
|
177
|
#ifdef KIHALEE_EM1D
|
175
|
178
|
receivers->ClearFields();
|
176
|
|
- std::cout << "FORTRAN KiHa: ";
|
|
179
|
+ std::cout << std::setw(18) << "KiHa/Fortran: ";
|
177
|
180
|
timer.begin();
|
178
|
181
|
EmEarth->MakeCalc();
|
179
|
182
|
Real kihaTime = timer.end();
|
180
|
|
- std::cout << kihaTime << " [s]" << std::endl;
|
|
183
|
+ std::cout << std::setw(14) << kihaTime << std::setw(6) << " [s]" << std::endl;
|
181
|
184
|
|
182
|
185
|
auto fc = receivers->GetEfield( 0 ); //0,0);
|
183
|
186
|
|
184
|
|
- std::cout.precision(16);
|
185
|
|
- std::cout << "Lemma norm |" << (lc).norm() << "|" << std::endl;
|
186
|
|
- std::cout << "KiHa norm |" << (fc).norm() << "|" << std::endl;
|
187
|
|
- std::cout << "Difference norm |" << (lc - fc).norm() << "|\n";
|
188
|
|
- std::cout << "Speedup:" << kihaTime/lemmaTime << "\n" << std::endl;
|
|
187
|
+ //std::cout.precision(16);
|
|
188
|
+ std::cout << std::setw(18) << "Lemma norm: " << std::setw(14) << (lc).norm() << std::endl;
|
|
189
|
+ std::cout << std::setw(18) << "KiHa norm: " << std::setw(14) << (fc).norm() << std::endl;
|
|
190
|
+ std::cout << std::setw(18) << "Difference norm: " << std::setw(14) << (lc - fc).norm() << "\n";
|
|
191
|
+ std::cout << std::setw(18) << "Speedup: " << std::setw(14) << kihaTime/lemmaTime << "\n" << std::endl;
|
189
|
192
|
|
190
|
193
|
TS_ASSERT_DELTA((lc-fc).norm(), 0.0, Delta);
|
191
|
194
|
#endif
|
|
@@ -193,38 +196,40 @@ public:
|
193
|
196
|
|
194
|
197
|
void test_Hy() {
|
195
|
198
|
|
|
199
|
+ std::cout.precision(4);
|
|
200
|
+
|
196
|
201
|
dipole->SetType(MAGNETICDIPOLE);
|
197
|
202
|
dipole->SetPolarisation(YPOLARISATION);
|
198
|
203
|
|
199
|
204
|
// Put in a unit test that will be slow.
|
200
|
205
|
std::cout << "MAGNETICDIPOLE Y polarisation" << std::endl;
|
201
|
206
|
std::cout << "=====================================\n";
|
202
|
|
- std::cout << "Lemma/C++: ";
|
|
207
|
+ std::cout << std::setw(18) << "Lemma/C++: ";
|
203
|
208
|
std::cout.flush();
|
204
|
209
|
|
205
|
210
|
timer.begin();
|
206
|
211
|
EmEarth->MakeCalc3();
|
207
|
212
|
Real lemmaTime = timer.end();
|
208
|
|
- std::cout << lemmaTime << " [s]" << std::endl;
|
|
213
|
+ std::cout << std::setw(14) << lemmaTime << std::setw(6) << " [s]" << std::endl;
|
209
|
214
|
|
210
|
215
|
auto lc = receivers->GetEfield( 0 );
|
211
|
216
|
|
212
|
217
|
#ifdef KIHALEE_EM1D
|
213
|
218
|
receivers->ClearFields();
|
214
|
|
- std::cout << "FORTRAN KiHa: ";
|
|
219
|
+ std::cout << std::setw(18) << "KiHa/Fortran: ";
|
215
|
220
|
std::cout.flush();
|
216
|
221
|
timer.begin();
|
217
|
222
|
EmEarth->MakeCalc();
|
218
|
223
|
Real kihaTime = timer.end();
|
219
|
|
- std::cout << kihaTime << " [s]" << std::endl;
|
|
224
|
+ std::cout << std::setw(14) << kihaTime << std::setw(6) << " [s]" << std::endl;
|
220
|
225
|
|
221
|
226
|
auto fc = receivers->GetEfield( 0 ); //0,0);
|
222
|
227
|
|
223
|
|
- std::cout.precision(16);
|
224
|
|
- std::cout << "Lemma norm |" << (lc).norm() << "|" << std::endl;
|
225
|
|
- std::cout << "KiHa norm |" << (fc).norm() << "|" << std::endl;
|
226
|
|
- std::cout << "Difference norm |" << (lc - fc).norm() << "|\n";
|
227
|
|
- std::cout << "Speedup:" << kihaTime/lemmaTime << "\n" << std::endl;
|
|
228
|
+ //std::cout.precision(16);
|
|
229
|
+ std::cout << std::setw(18) << "Lemma norm: " << std::setw(14) << (lc).norm() << std::endl;
|
|
230
|
+ std::cout << std::setw(18) << "KiHa norm: " << std::setw(14) << (fc).norm() << std::endl;
|
|
231
|
+ std::cout << std::setw(18) << "Difference norm: " << std::setw(14) << (lc - fc).norm() << "\n";
|
|
232
|
+ std::cout << std::setw(18) << "Speedup: " << std::setw(14) << kihaTime/lemmaTime << "\n" << std::endl;
|
228
|
233
|
|
229
|
234
|
TS_ASSERT_DELTA((lc-fc).norm(), 0.0, Delta);
|
230
|
235
|
#endif
|
|
@@ -232,38 +237,40 @@ public:
|
232
|
237
|
|
233
|
238
|
void test_Ex() {
|
234
|
239
|
|
|
240
|
+ std::cout.precision(4);
|
|
241
|
+
|
235
|
242
|
dipole->SetType(GROUNDEDELECTRICDIPOLE);
|
236
|
243
|
dipole->SetPolarisation(XPOLARISATION);
|
237
|
244
|
|
238
|
245
|
// Put in a unit test that will be slow.
|
239
|
246
|
std::cout << "GROUNDEDELECTRICDIPOLE X polarisation" << std::endl;
|
240
|
247
|
std::cout << "=====================================\n";
|
241
|
|
- std::cout << "Lemma/C++: ";
|
|
248
|
+ std::cout << std::setw(18) << "Lemma/C++: ";
|
242
|
249
|
std::cout.flush();
|
243
|
250
|
|
244
|
251
|
timer.begin();
|
245
|
252
|
EmEarth->MakeCalc3();
|
246
|
253
|
Real lemmaTime = timer.end();
|
247
|
|
- std::cout << lemmaTime << " [s]" << std::endl;
|
|
254
|
+ std::cout << std::setw(14) << lemmaTime << std::setw(6) << " [s]" << std::endl;
|
248
|
255
|
|
249
|
256
|
auto lc = receivers->GetEfield( 0 );
|
250
|
257
|
|
251
|
258
|
#ifdef KIHALEE_EM1D
|
252
|
259
|
receivers->ClearFields();
|
253
|
|
- std::cout << "FORTRAN KiHa: ";
|
|
260
|
+ std::cout << std::setw(18) << "KiHa/Fortran: ";
|
254
|
261
|
std::cout.flush();
|
255
|
262
|
timer.begin();
|
256
|
263
|
EmEarth->MakeCalc();
|
257
|
264
|
Real kihaTime = timer.end();
|
258
|
|
- std::cout << kihaTime << " [s]" << std::endl;
|
|
265
|
+ std::cout << std::setw(14) << kihaTime << std::setw(6) << " [s]" << std::endl;
|
259
|
266
|
|
260
|
267
|
auto fc = receivers->GetEfield( 0 ); //0,0);
|
261
|
268
|
|
262
|
|
- std::cout.precision(16);
|
263
|
|
- std::cout << "Lemma norm |" << (lc).norm() << "|" << std::endl;
|
264
|
|
- std::cout << "KiHa norm |" << (fc).norm() << "|" << std::endl;
|
265
|
|
- std::cout << "Difference norm |" << (lc - fc).norm() << "|\n";
|
266
|
|
- std::cout << "Speedup:" << kihaTime/lemmaTime << "\n" << std::endl;
|
|
269
|
+ //std::cout.precision(16);
|
|
270
|
+ std::cout << std::setw(18) << "Lemma norm: " << std::setw(14) << (lc).norm() << std::endl;
|
|
271
|
+ std::cout << std::setw(18) << "KiHa norm: " << std::setw(14) << (fc).norm() << std::endl;
|
|
272
|
+ std::cout << std::setw(18) << "Difference norm: " << std::setw(14) << (lc - fc).norm() << "\n";
|
|
273
|
+ std::cout << std::setw(18) << "Speedup: " << std::setw(14) << kihaTime/lemmaTime << "\n" << std::endl;
|
267
|
274
|
|
268
|
275
|
TS_ASSERT_DELTA((lc-fc).norm(), 0.0, Delta);
|
269
|
276
|
#endif
|
|
@@ -271,41 +278,41 @@ public:
|
271
|
278
|
|
272
|
279
|
void test_Ey() {
|
273
|
280
|
|
|
281
|
+ std::cout.precision(4);
|
|
282
|
+
|
274
|
283
|
dipole->SetType(GROUNDEDELECTRICDIPOLE);
|
275
|
284
|
dipole->SetPolarisation(YPOLARISATION);
|
276
|
285
|
|
277
|
286
|
// Put in a unit test that will be slow.
|
278
|
287
|
std::cout << "GROUNDEDELECTRICDIPOLE Y polarisation" << std::endl;
|
279
|
288
|
std::cout << "=====================================\n";
|
280
|
|
- std::cout << "Lemma/C++: ";
|
|
289
|
+ std::cout << std::setw(18) << "Lemma/C++: ";
|
281
|
290
|
std::cout.flush();
|
282
|
291
|
|
283
|
292
|
timer.begin();
|
284
|
293
|
EmEarth->MakeCalc3();
|
285
|
294
|
Real lemmaTime = timer.end();
|
286
|
|
- std::cout << lemmaTime << " [s]" << std::endl;
|
|
295
|
+ std::cout << std::setw(14) << lemmaTime << std::setw(6) << " [s]" << std::endl;
|
287
|
296
|
|
288
|
297
|
auto lc = receivers->GetEfield( 0 );
|
289
|
298
|
|
290
|
299
|
#ifdef KIHALEE_EM1D
|
291
|
300
|
receivers->ClearFields();
|
292
|
|
- std::cout << "KiHa/FORTRAN: ";
|
|
301
|
+ std::cout << std::setw(18) << "KiHa/Fortran: ";
|
293
|
302
|
std::cout.flush();
|
294
|
303
|
|
295
|
304
|
timer.begin();
|
296
|
305
|
EmEarth->MakeCalc();
|
297
|
306
|
Real kihaTime = timer.end();
|
298
|
|
- std::cout << kihaTime << " [s]" << std::endl;
|
|
307
|
+ std::cout << std::setw(14) << kihaTime << std::setw(6) << " [s]" << std::endl;
|
299
|
308
|
|
300
|
309
|
auto fc = receivers->GetEfield( 0 ); //0,0);
|
301
|
310
|
|
302
|
|
- std::cout << "Lemma time:" << lemmaTime << "\tKiHa time:" << kihaTime << std::endl;
|
303
|
|
-
|
304
|
|
- std::cout.precision(16);
|
305
|
|
- std::cout << "Lemma norm |" << (lc).norm() << "|" << std::endl;
|
306
|
|
- std::cout << "KiHa norm |" << (fc).norm() << "|" << std::endl;
|
307
|
|
- std::cout << "Difference norm |" << (lc - fc).norm() << "|\n";
|
308
|
|
- std::cout << "Speedup:" << kihaTime/lemmaTime << "\n" << std::endl;
|
|
311
|
+ //std::cout.precision(16);
|
|
312
|
+ std::cout << std::setw(18) << "Lemma norm: " << std::setw(14) << (lc).norm() << std::endl;
|
|
313
|
+ std::cout << std::setw(18) << "KiHa norm: " << std::setw(14) << (fc).norm() << std::endl;
|
|
314
|
+ std::cout << std::setw(18) << "Difference norm: " << std::setw(14) << (lc - fc).norm() << "\n";
|
|
315
|
+ std::cout << std::setw(18) << "Speedup: " << std::setw(14) << kihaTime/lemmaTime << "\n" << std::endl;
|
309
|
316
|
|
310
|
317
|
TS_ASSERT_DELTA((lc-fc).norm(), 0.0, Delta);
|
311
|
318
|
#endif
|
|
@@ -313,41 +320,41 @@ public:
|
313
|
320
|
|
314
|
321
|
void test_Ez() {
|
315
|
322
|
|
|
323
|
+ std::cout.precision(4);
|
|
324
|
+
|
316
|
325
|
dipole->SetType(GROUNDEDELECTRICDIPOLE);
|
317
|
326
|
dipole->SetPolarisation(ZPOLARISATION);
|
318
|
327
|
|
319
|
328
|
// Put in a unit test that will be slow.
|
320
|
329
|
std::cout << "GROUNDEDELECTRICDIPOLE Z polarisation" << std::endl;
|
321
|
330
|
std::cout << "=====================================\n";
|
322
|
|
- std::cout << "Lemma/C++: ";
|
|
331
|
+ std::cout << std::setw(18) << "Lemma/C++: ";
|
323
|
332
|
std::cout.flush();
|
324
|
333
|
|
325
|
334
|
timer.begin();
|
326
|
335
|
EmEarth->MakeCalc3();
|
327
|
336
|
Real lemmaTime = timer.end();
|
328
|
|
- std::cout << lemmaTime << " [s]" << std::endl;
|
|
337
|
+ std::cout << std::setw(14) << lemmaTime << std::setw(6) << " [s]" << std::endl;
|
329
|
338
|
|
330
|
339
|
auto lc = receivers->GetEfield( 0 );
|
331
|
340
|
|
332
|
341
|
#ifdef KIHALEE_EM1D
|
333
|
342
|
receivers->ClearFields();
|
334
|
|
- std::cout << "KiHa/FORTRAN: ";
|
|
343
|
+ std::cout << std::setw(18) << "KiHa/Fortran: ";
|
335
|
344
|
std::cout.flush();
|
336
|
345
|
|
337
|
346
|
timer.begin();
|
338
|
347
|
EmEarth->MakeCalc();
|
339
|
348
|
Real kihaTime = timer.end();
|
340
|
|
- std::cout << kihaTime << " [s]" << std::endl;
|
|
349
|
+ std::cout << std::setw(14) << kihaTime << std::setw(6) << " [s]" << std::endl;
|
341
|
350
|
|
342
|
351
|
auto fc = receivers->GetEfield( 0 ); //0,0);
|
343
|
352
|
|
344
|
|
- std::cout << "Lemma time:" << lemmaTime << "\tKiHa time:" << kihaTime << std::endl;
|
345
|
|
-
|
346
|
|
- std::cout.precision(16);
|
347
|
|
- std::cout << "Lemma norm |" << (lc).norm() << "|" << std::endl;
|
348
|
|
- std::cout << "KiHa norm |" << (fc).norm() << "|" << std::endl;
|
349
|
|
- std::cout << "Difference norm |" << (lc - fc).norm() << "|\n";
|
350
|
|
- std::cout << "Speedup:" << kihaTime/lemmaTime << "\n" << std::endl;
|
|
353
|
+ //std::cout.precision(16);
|
|
354
|
+ std::cout << std::setw(18) << "Lemma norm: " << std::setw(14) << (lc).norm() << std::endl;
|
|
355
|
+ std::cout << std::setw(18) << "KiHa norm: " << std::setw(14) << (fc).norm() << std::endl;
|
|
356
|
+ std::cout << std::setw(18) << "Difference norm: " << std::setw(14) << (lc - fc).norm() << "\n";
|
|
357
|
+ std::cout << std::setw(18) << "Speedup: " << std::setw(14) << kihaTime/lemmaTime << "\n" << std::endl;
|
351
|
358
|
|
352
|
359
|
TS_ASSERT_DELTA((lc-fc).norm(), 0.0, Delta);
|
353
|
360
|
#endif
|