forked from idies/turblib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathturblib.c
2994 lines (2581 loc) · 85.1 KB
/
turblib.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2011 Johns Hopkins University
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* $Id: turblib.c,v 1.13 2009-10-23 17:58:57 eric Exp $ */
#include <stdio.h>
#include <math.h>
#include "soapH.h"
#include "TurbulenceServiceSoap.nsmap"
#include "turblib.h"
/* global gSOAP runtime environment
* Temporary until we can figure out how to pass a pointer
* to and from a function correctly in Fortran.
*/
struct soap __jhuturbsoap;
char * __version_info = "20210108";
/* Error reporting - C */
char __turblib_err[TURB_ERROR_LENGTH];
int __turblib_errno = 0;
int __turblib_exit_on_error = 1;
int __turblib_prefetching = 0;
//Linked list of all added cutout files
set_info DataSets[14] = {
{ 0, 0, 0 },//=0
{ 0, 0, 0 },//=1
{ 0, 0, 0 },//=2
{ 2.0f * 3.14159265358979f / 1024.0f, .0025f, 1024 }, //mhd1024=3
{ 2.0f * 3.14159265358979f / 1024.0f, .002f, 1024 }, //isotropic1024coarse=4
{ 2.0f * 3.14159265358979f / 1024.0f, .0002f, 1024 }, //isotropic1024fine=5
{ 0, 0, 0 },//channel=6
{ 2.0f * 3.14159265358979f / 1024.0f, .04f, 1024 }, //mixing_dataset=7
{ 0, 0, 0 },//rmhd=8
{ 0, 0, 0 },//=9
{ 2.0f * 3.14159265358979f / 4096.0f, .0002f, 4096 }, //isotropic4096=10
{ 2.0f * 3.14159265358979f / 4096.0f, 1.0f, 4096 }, //strat4096=11
{ 0, 0, 0 },//transition_bl=12
{ 0, 0, 0 }//channel5200=13
};
turb_fn TurbFields[6] =
{
{ 'u', 3}, //velocity
{ 'p', 1}, //pressure
{ 'b', 3}, //magnetic
{ 'a', 3}, //vector potential
{ 'd', 1}, //density
{ 't', 1} //temperature
};
char * turblibGetErrorString() {
return __turblib_err;
}
int turblibGetErrorNumber() {
return __turblib_errno;
}
void turblibPrintError() {
fprintf(stderr, "%d: %s\n", turblibGetErrorNumber(), turblibGetErrorString());
}
void turblibSetExitOnError(int v) {
__turblib_exit_on_error = v;
}
/* Error reporting - Fortran */
void turblibgeterrorstring_(char *dest, int len) {
strncpy(dest, __turblib_err, len);
}
int turblibgeterrornumber_() {
return turblibGetErrorNumber();
}
void turblibprinterror_() {
turblibPrintError();
}
void turblibsetexitonerror_(int *v) {
turblibSetExitOnError(*v);
}
/* Determine appropriate error behavior */
void turblibHandleError() {
turblibPrintError();
if (__turblib_exit_on_error) {
exit(1);
}
}
/* Return the enum relating to the Fortran constant */
enum turb1__SpatialInterpolation SpatialIntToEnum(enum SpatialInterpolation spatial)
{
switch (spatial)
{
case 0:
return turb1__SpatialInterpolation__None;
case 4:
return turb1__SpatialInterpolation__Lag4;
case 6:
return turb1__SpatialInterpolation__Lag6;
case 8:
return turb1__SpatialInterpolation__Lag8;
case 40:
return turb1__SpatialInterpolation__None_USCOREFd4;
case 44:
return turb1__SpatialInterpolation__Fd4Lag4;
case 60:
return turb1__SpatialInterpolation__None_USCOREFd6;
case 80:
return turb1__SpatialInterpolation__None_USCOREFd8;
case 104:
return turb1__SpatialInterpolation__M1Q4;
case 106:
return turb1__SpatialInterpolation__M1Q6;
case 108:
return turb1__SpatialInterpolation__M1Q8;
case 110:
return turb1__SpatialInterpolation__M1Q10;
case 112:
return turb1__SpatialInterpolation__M1Q12;
case 114:
return turb1__SpatialInterpolation__M1Q14;
case 204:
return turb1__SpatialInterpolation__M2Q4;
case 206:
return turb1__SpatialInterpolation__M2Q6;
case 208:
return turb1__SpatialInterpolation__M2Q8;
case 210:
return turb1__SpatialInterpolation__M2Q10;
case 212:
return turb1__SpatialInterpolation__M2Q12;
case 214:
return turb1__SpatialInterpolation__M2Q14;
case 304:
return turb1__SpatialInterpolation__M3Q4;
case 306:
return turb1__SpatialInterpolation__M3Q6;
case 308:
return turb1__SpatialInterpolation__M3Q8;
case 310:
return turb1__SpatialInterpolation__M3Q10;
case 312:
return turb1__SpatialInterpolation__M3Q12;
case 314:
return turb1__SpatialInterpolation__M3Q14;
case 404:
return turb1__SpatialInterpolation__M4Q4;
case 406:
return turb1__SpatialInterpolation__M4Q6;
case 408:
return turb1__SpatialInterpolation__M4Q8;
case 410:
return turb1__SpatialInterpolation__M4Q10;
case 412:
return turb1__SpatialInterpolation__M4Q12;
case 414:
return turb1__SpatialInterpolation__M4Q14;
default:
return -1;
}
return -1;
}
/* Return the enum relating to the Fortran constant */
enum turb1__TemporalInterpolation TemporalIntToEnum(enum TemporalInterpolation temporal)
{
switch (temporal)
{
case 0:
return turb1__TemporalInterpolation__None;
case 1:
return turb1__TemporalInterpolation__PCHIP;
}
return -1;
}
/* Get turblib version */
char * getVersion_(void) {
return getVersion();
}
char * getVersion(void) {
return __version_info;
}
/* Intialize the gSOAP runtime environment */
void soapinit_() {
soapinit();
}
void soapinit() {
soap_init(&__jhuturbsoap);
}
/* Destroy the gSOAP environment */
void soapdestroy_() {
soap_destroy(&__jhuturbsoap);
}
void soapdestroy() {
soap_destroy(&__jhuturbsoap);
}
int getVelocity(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3])
{
return getVelocitySoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getVelocityAndPressure(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][4])
{
return getVelocityAndPressureSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getPressure(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[])
{
return getPressureSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getPressureHessian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][6])
{
return getPressureHessianSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getVelocityGradient(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9])
{
return getVelocityGradientSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getVelocityHessian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][18])
{
return getVelocityHessianSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getVelocityLaplacian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3])
{
return getVelocityLaplacianSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getPressureGradient(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3])
{
return getPressureGradientSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getMagneticFieldGradient(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9])
{
return getMagneticFieldGradientSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getVectorPotentialGradient(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9])
{
return getVectorPotentialGradientSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getMagneticFieldHessian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][18])
{
return getMagneticFieldHessianSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getMagneticFieldLaplacian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3])
{
return getMagneticFieldLaplacianSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getMagneticField(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3])
{
return getMagneticFieldSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getVectorPotentialHessian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][18])
{
return getVectorPotentialHessianSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getVectorPotentialLaplacian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3])
{
return getVectorPotentialLaplacianSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getVectorPotential(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3])
{
return getVectorPotentialSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getDensity(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[])
{
return getDensitySoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getDensityGradient(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3])
{
return getDensityGradientSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getDensityHessian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][6])
{
return getDensityHessianSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getInvariant(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][2])
{
return getInvariantSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout);
}
int getVelocitySoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3])
{
int rc;
struct _turb1__GetVelocity input;
struct _turb1__GetVelocityResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.time = time;
input.spatialInterpolation = SpatialIntToEnum(spatial);
input.temporalInterpolation = TemporalIntToEnum(temporal);
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetVelocity(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetVelocityResult->Vector3,
output.GetVelocityResult->__sizeVector3 * sizeof(float) * 3);
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}
int getthreshold_(char *authToken,
char *dataset, char *field, float *time, float *threshold,
int *spatial,
int *x_start, int *y_start, int *z_start, int *x_end, int *y_end, int *z_end,
ThresholdInfo** dataout, int *result_size)
{
return getThreshold(authToken, dataset, field, *time, *threshold, *spatial,
*x_start, *y_start, *z_start, *x_end, *y_end, *z_end, dataout, result_size);
}
void deallocate_array_(ThresholdInfo **threshold_array)
{
free(*threshold_array);
}
int getThreshold(char *authToken,
char *dataset, char *field, float time, float threshold,
enum SpatialInterpolation spatial,
int x_start, int y_start, int z_start, int x_end, int y_end, int z_end,
ThresholdInfo **dataout, int *result_size)
{
int rc;
struct _turb1__GetThreshold input;
struct _turb1__GetThresholdResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.field = field;
input.time = time;
input.threshold = threshold;
input.spatialInterpolation = SpatialIntToEnum(spatial);
input.x_USCOREstart = x_start;
input.y_USCOREstart = y_start;
input.z_USCOREstart = z_start;
input.x_USCOREend = x_end;
input.y_USCOREend = y_end;
input.z_USCOREend = z_end;
input.addr = NULL;
rc = soap_call___turb1__GetThreshold(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
*result_size = output.GetThresholdResult->__sizeThresholdInfo;
*dataout = (ThresholdInfo *)malloc(sizeof(ThresholdInfo) * (*result_size));
memcpy(*dataout, output.GetThresholdResult->ThresholdInfo,
output.GetThresholdResult->__sizeThresholdInfo * sizeof(ThresholdInfo));
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); // remove deserialized data and clean up
soap_done(&__jhuturbsoap); // detach the gSOAP environment
__turblib_errno = rc;
return rc;
}
int getboxfilter_(char *authToken,
char *dataset, char *field, float *time, float *filterwidth,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d)
{
return getBoxFilter(authToken,
dataset, field, *time, *filterwidth,
*count, datain, dataout);
}
int getBoxFilter(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[][3])
{
int rc;
struct _turb1__GetBoxFilter input;
struct _turb1__GetBoxFilterResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.field = field;
input.time = time;
input.filterwidth = filterwidth;
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetBoxFilter(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetBoxFilterResult->Vector3,
output.GetBoxFilterResult->__sizeVector3 * sizeof(float) * 3);
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}
int getboxfiltersgs_(char *authToken,
char *dataset, char *field, float *time, float *filterwidth,
int *count, float datain[][3], float dataout[][6],
int len_a, int len_d)
{
return getBoxFilterSGS(authToken,
dataset, field, *time, *filterwidth,
*count, datain, dataout);
}
int getBoxFilterSGS(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[][6])
{
int rc;
struct _turb1__GetBoxFilterSGS input;
struct _turb1__GetBoxFilterSGSResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.field = field;
input.time = time;
input.filterwidth = filterwidth;
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetBoxFilterSGS(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetBoxFilterSGSResult->SGSTensor,
output.GetBoxFilterSGSResult->__sizeSGSTensor * sizeof(float) * 6);
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}
int getboxfiltersgsscalar_(char *authToken,
char *dataset, char *field, float *time, float *filterwidth,
int *count, float datain[][3], float dataout[],
int len_a, int len_d)
{
return getBoxFilterSGSscalar(authToken,
dataset, field, *time, *filterwidth,
*count, datain, dataout);
}
int getBoxFilterSGSscalar(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[])
{
int rc;
struct _turb1__GetBoxFilterSGSscalar input;
struct _turb1__GetBoxFilterSGSscalarResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.field = field;
input.time = time;
input.filterwidth = filterwidth;
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetBoxFilterSGSscalar(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetBoxFilterSGSscalarResult->float_,
output.GetBoxFilterSGSscalarResult->__sizefloat_ * sizeof(float));
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}
int getboxfiltersgsvector_(char *authToken,
char *dataset, char *field, float *time, float *filterwidth,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d)
{
return getBoxFilterSGSvector(authToken,
dataset, field, *time, *filterwidth,
*count, datain, dataout);
}
int getBoxFilterSGSvector(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[][3])
{
int rc;
struct _turb1__GetBoxFilterSGSvector input;
struct _turb1__GetBoxFilterSGSvectorResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.field = field;
input.time = time;
input.filterwidth = filterwidth;
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetBoxFilterSGSvector(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetBoxFilterSGSvectorResult->Vector3,
output.GetBoxFilterSGSvectorResult->__sizeVector3 * sizeof(float) * 3);
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}
int getboxfiltersgssymtensor_(char *authToken,
char *dataset, char *field, float *time, float *filterwidth,
int *count, float datain[][3], float dataout[][6],
int len_a, int len_d)
{
return getBoxFilterSGSsymtensor(authToken,
dataset, field, *time, *filterwidth,
*count, datain, dataout);
}
int getBoxFilterSGSsymtensor(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[][6])
{
int rc;
struct _turb1__GetBoxFilterSGSsymtensor input;
struct _turb1__GetBoxFilterSGSsymtensorResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.field = field;
input.time = time;
input.filterwidth = filterwidth;
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetBoxFilterSGSsymtensor(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetBoxFilterSGSsymtensorResult->SGSTensor,
output.GetBoxFilterSGSsymtensorResult->__sizeSGSTensor * sizeof(float) * 6);
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}
int getboxfiltersgstensor_(char *authToken,
char *dataset, char *field, float *time, float *filterwidth,
int *count, float datain[][3], float dataout[][9],
int len_a, int len_d)
{
return getBoxFilterSGStensor(authToken,
dataset, field, *time, *filterwidth,
*count, datain, dataout);
}
int getBoxFilterSGStensor(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[][9])
{
int rc;
struct _turb1__GetBoxFilterSGStensor input;
struct _turb1__GetBoxFilterSGStensorResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.field = field;
input.time = time;
input.filterwidth = filterwidth;
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetBoxFilterSGStensor(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetBoxFilterSGStensorResult->VelocityGradient,
output.GetBoxFilterSGStensorResult->__sizeVelocityGradient * sizeof(float) * 9);
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}
int getboxfiltergradient_(char *authToken,
char *dataset, char* field, float *time,
float *filterwidth, float *spacing,
int *count, float datain[][3], float dataout[][9],
int len_a, int len_d)
{
return getBoxFilterGradient(authToken,
dataset, field, *time,
*filterwidth, *spacing,
*count, datain, dataout);
}
int getBoxFilterGradient(char *authToken,
char *dataset, char *field, float time,
float filterwidth, float spacing,
int count, float datain[][3], float dataout[][9])
{
int rc;
struct _turb1__GetBoxFilterGradient input;
struct _turb1__GetBoxFilterGradientResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.field = field;
input.time = time;
input.filterwidth = filterwidth;
input.spacing = spacing;
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetBoxFilterGradient(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetBoxFilterGradientResult->VelocityGradient,
output.GetBoxFilterGradientResult->__sizeVelocityGradient * sizeof(float) * 9);
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}
int getVelocityAndPressureSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][4])
{
int rc;
struct _turb1__GetVelocityAndPressure input;
struct _turb1__GetVelocityAndPressureResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.time = time;
input.spatialInterpolation = SpatialIntToEnum(spatial);
input.temporalInterpolation = TemporalIntToEnum(temporal);
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetVelocityAndPressure(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetVelocityAndPressureResult->Vector3P,
output.GetVelocityAndPressureResult->__sizeVector3P * sizeof(float) * 4);
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}
int getPressureHessianSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][6])
{
int rc;
struct _turb1__GetPressureHessian input;
struct _turb1__GetPressureHessianResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.time = time;
input.spatialInterpolation = SpatialIntToEnum(spatial);
input.temporalInterpolation = TemporalIntToEnum(temporal);
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetPressureHessian(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetPressureHessianResult->PressureHessian,
output.GetPressureHessianResult->__sizePressureHessian * sizeof(float) * 6);
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}
int getVelocityGradientSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9])
{
int rc;
struct _turb1__GetVelocityGradient input;
struct _turb1__GetVelocityGradientResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.time = time;
input.spatialInterpolation = SpatialIntToEnum(spatial);
input.temporalInterpolation = TemporalIntToEnum(temporal);
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetVelocityGradient(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetVelocityGradientResult->VelocityGradient,
output.GetVelocityGradientResult->__sizeVelocityGradient * sizeof(float) * 9);
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}
int getMagneticFieldGradientSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9])
{
int rc;
struct _turb1__GetMagneticFieldGradient input;
struct _turb1__GetMagneticFieldGradientResponse output;
input.authToken = authToken;
input.dataset = dataset;
input.time = time;
input.spatialInterpolation = SpatialIntToEnum(spatial);
input.temporalInterpolation = TemporalIntToEnum(temporal);
struct turb1__ArrayOfPoint3 pointArray;
pointArray.__sizePoint3 = count;
pointArray.Point3 = (void *)datain;
input.points = &pointArray;
input.addr = NULL;
rc = soap_call___turb1__GetMagneticFieldGradient(&__jhuturbsoap, NULL, NULL, &input, &output);
if (rc == SOAP_OK) {
memcpy(dataout, output.GetMagneticFieldGradientResult->VelocityGradient,
output.GetMagneticFieldGradientResult->__sizeVelocityGradient * sizeof(float) * 9);
bzero(__turblib_err, TURB_ERROR_LENGTH);
}
else {
soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH);
turblibHandleError();
}
soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */
soap_done(&__jhuturbsoap); /* detach the gSOAP environment */
__turblib_errno = rc;
return rc;
}