-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathturblib.h
846 lines (699 loc) · 27.9 KB
/
turblib.h
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
// 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.h,v 1.18 2009-12-06 16:01:01 eric Exp $ */
#ifndef TURBLIB_H_
#define TURBLIB_H_
#include "soapH.h"
#ifdef __cplusplus
extern "C" {
#endif//__cplusplus
#define TURBLIB_VERSION "0.2"
#define TURB_ERROR_LENGTH 2048
/* Global gSOAP handle
* TODO: Figure out how to pass this to/from Fortran
*/
extern struct soap __jhuturbsoap;
/* Spatial Interpolation Options */
enum SpatialInterpolation
{
/* Spatial Interpolation Flags for GetVelocity & GetVelocityAndPressure */
NoSInt = 0, /* No spatial interpolation */
Lag4 = 4, /* 4th order Lagrangian interpolation in space */
Lag6 = 6, /* 4th order Lagrangian interpolation in space */
Lag8 = 8, /* 4th order Lagrangian interpolation in space */
M1Q4 = 104,
M1Q6 = 106,
M1Q8 = 108,
M1Q10 = 110,
M1Q12 = 112,
M1Q14 = 114,
M2Q4 = 204,
M2Q6 = 206,
M2Q8 = 208,
M2Q10 = 210,
M2Q12 = 212,
M2Q14 = 214,
M3Q4 = 304,
M3Q6 = 306,
M3Q8 = 308,
M3Q10 = 310,
M3Q12 = 312,
M3Q14 = 314,
M4Q4 = 404,
M4Q6 = 406,
M4Q8 = 408,
M4Q10 = 410,
M4Q12 = 412,
M4Q14 = 414,
/* Spatial Differentiation and Interpolation Flags for GetVelocityGradient
* and GetPressureGradient. */
FD4NoInt = 40, /* 4th order finite differential scheme for grid values, no spatial interpolation */
FD6NoInt = 60, /* 6th order finite differential scheme for grid values, no spatial interpolation */
FD8NoInt = 80, /* 8th order finite differential scheme for grid values, no spatial interpolation */
FD4Lag4 = 44, /* 4th order finite differential scheme for grid values, 4th order Lagrangian interpolation in space */
/* Old names, for backward compatibility */
NoSpatialInterpolation = 0,
Lagrangian4thOrder = 4,
Lagrangian6thOrder = 6,
Lagrangian8thOrder = 8
};
/* Temporal Interpolation Options */
enum TemporalInterpolation
{
NoTInt = 0, /* No temporal interpolation */
PCHIPInt = 1, /* Piecewise cubic Hermite interpolation in time */
/* Old names, for backward compatibility */
NoTemporalInterpolation = 0,
PCHIPInterpolation = 1
};
typedef struct
{
int x;
int y;
int z;
float value;
} ThresholdInfo;
typedef enum
{
//isotropic1024old = 1,
//isotropic1024fine_old = 2,
//mhd1024 = 3,
//isotropic1024coarse = 4,
//isotropic1024fine = 5,
//channel = 6,
//custom_dataset = 7,
//mixing = 8
mhd1024 = 3,
isotropic1024coarse = 4,
isotropic1024fine = 5,
channel = 6,
mixing = 7,
rmhd = 8,
isotropic4096 = 10,
rotstrat4096 = 11,
transition_bl = 12,
channel5200 = 13
} TurbDataset;
typedef enum
{
turb_velocity = 0,
turb_pressure = 1,
turb_magnetic = 2,
turb_potential = 3,
turb_vp = 4,
turb_density = 5,
turb_temperature = 6,
} TurbField;
typedef struct
{
float dx, dt;
int size;
} set_info;
typedef struct
{
char prefix;
int comps;
} turb_fn;
typedef struct dataBlock dataBlock;
struct dataBlock
{
float *data;
TurbField function;
TurbDataset dataset;
int xl, yl, zl; //Lower bounds
int hx, hy, hz, comps; //Dimensions
dataBlock* next;
};
// typedef struct cutoutFile cutoutFile;
// struct cutoutFile
// {
// hid_t file;
// int start[4], size[4];
// int contents[5];
// dataBlock *data[4][1024];
// TurbDataset dataset;
// cutoutFile *next;
// };
typedef struct
{
float* data;
int x, y, z;
int hx, hy, hz, comps;
int persist;
} dataKernel;
/* C */
char *getVersion();
void soapinit(void);
void soapdestroy(void);
/* Fortran */
char *getVersion_();
void soapinit_(void);
void soapdestroy_(void);
/* C */
char *turblibGetErrorString(void);
int turblibGetErrorNumber(void);
void turblibPrintError(void);
void turblibSetExitOnError(int);
/* Fortran */
void turblibgeterrorstring_(char *dest, int len);
int turblibgeterrornumber_(void);
void turblibprinterror_(void);
void turblibsetexitonerror_(int *);
/* C */
int getVelocitySoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
int getvelocity_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d);
/* C */
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);
/* Fortran */
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);
void deallocate_array_(ThresholdInfo **threshold_array);
/* C */
int getBoxFilter(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
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);
/* C */
int getBoxFilterSGS(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[][6]);
/* Fortran */
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);
/* C */
int getBoxFilterSGSscalar(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[]);
/* Fortran */
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);
/* C */
int getBoxFilterSGSvector(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
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);
/* C */
int getBoxFilterSGSsymtensor(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[][6]);
/* Fortran */
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);
/* C */
int getBoxFilterSGStensor(char *authToken,
char *dataset, char *field, float time, float filterwidth,
int count, float datain[][3], float dataout[][9]);
/* Fortran */
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);
/* C */
int getBoxFilterGradient(char *authToken,
char *dataset, char *field, float time,
float filterwidth, float spacing,
int count, float datain[][3], float dataout[][9]);
/* Fortran */
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);
/* C */
int getVelocityAndPressureSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][4]);
/* Fortran */
int getvelocityandpressure_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][4],
int len_a, int len_d);
/* C */
int getPressureHessianSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][6]);
/* Fortran */
int getpressurehessian_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][6],
int len_a, int len_d);
/* C */
int getVelocityGradientSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9]);
/* Fortran */
int getvelocitygradient_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][9],
int len_a, int len_d);
/* C */
int getMagneticFieldGradientSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9]);
/* Fortran */
int getmagneticfieldgradient_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][9],
int len_a, int len_d);
/* C */
int getVectorPotentialGradientSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9]);
/* Fortran */
int getvectorpotentialgradient_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][9],
int len_a, int len_d);
/* C */
int getPressureGradientSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
int getpressuregradient_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d);
/* C */
int getVelocityHessianSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][18]);
/* Fortran */
int getvelocityhessian_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][18],
int len_a, int len_d);
/* C */
int getVelocityLaplacianSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
int getvelocitylaplacian_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d);
/* C */
int getMagneticFieldHessianSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][18]);
/* Fortran */
int getmagneticfieldhessian_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][18],
int len_a, int len_d);
/* C */
int getMagneticFieldLaplacianSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
int getmagneticfieldlaplacian_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d);
/* C */
int getVectorPotentialHessianSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][18]);
/* Fortran */
int getvectorpotentialhessian_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][18],
int len_a, int len_d);
/* C */
int getVectorPotentialLaplacianSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
int getvectorpotentiallaplacian_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d);
/* C */
int nullOp(char *authToken, int count,
float datain[][3], float dataout[][3]);
/* Fortran */
int nullop_(char *authToken, int *count,
float datain[][3], float dataout[][3],
int len_a, int len_d);
/* C */
int getForce(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
int getforce_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d);
/*C*/
int getPosition(char *authToken,
char *dataset, float startTime, float endTime,
float dt,
enum SpatialInterpolation spatial,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
int getposition_(char *authToken,
char *dataset, float *startTime, float *endTime,
float *dt,
int *spatial,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d);
/* C */
int getRawVelocity(char *authToken,
char *dataset, int time_step,
int X, int Y, int Z, int Xwidth, int Ywidth, int Zwidth, char dataout[]);
/* Fortran */
int getrawvelocity_(char *authToken,
char *dataset, int *time_step,
int *X, int *Y, int *Z, int *Xwidth, int *Ywidth, int *Zwidth,
float dataout[]);
/* C */
int getMagneticFieldSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
int getmagneticfield_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d);
/* C */
int getRawMagneticField(char *authToken,
char *dataset, int time_step,
int X, int Y, int Z, int Xwidth, int Ywidth, int Zwidth, char dataout[]);
/* Fortran */
int getrawmagneticfield_(char *authToken,
char *dataset, int *time_step,
int *X, int *Y, int *Z, int *Xwidth, int *Ywidth, int *Zwidth,
float dataout[]);
/* C */
int getVectorPotentialSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
int getvectorpotential_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d);
/* C */
int getRawVectorPotential(char *authToken,
char *dataset, int time_step,
int X, int Y, int Z, int Xwidth, int Ywidth, int Zwidth, char dataout[]);
/* Fortran */
int getrawvectorpotential_(char *authToken,
char *dataset, int *time_step,
int *X, int *Y, int *Z, int *Xwidth, int *Ywidth, int *Zwidth,
float dataout[]);
/* C */
int getPressureSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[]);
/* Fortran */
int getpressure_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[],
int len_a, int len_d);
/* C */
int getRawPressure(char *authToken,
char *dataset, int time_step,
int X, int Y, int Z, int Xwidth, int Ywidth, int Zwidth, char dataout[]);
/* Fortran */
int getrawpressure_(char *authToken,
char *dataset, int *time_step,
int *X, int *Y, int *Z, int *Xwidth, int *Ywidth, int *Zwidth, float dataout[]);
/* C */
int getDensitySoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[]);
/* Fortran */
int getdensity_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[],
int len_a, int len_d);
/* C */
int getDensityGradientSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
/* Fortran */
int getdensitygradient_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][3],
int len_a, int len_d);
/* C */
int getDensityHessianSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][6]);
/* Fortran */
int getdensityhessian_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][6],
int len_a, int len_d);
/* C */
int getInvariantSoap(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][2]);
/* C */
int getInvariant(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][2]);
/* Fortran */
int getinvariant_(char *authToken,
char *dataset, float *time,
int *spatial, int *temporal,
int *count, float datain[][3], float dataout[][2],
int len_a, int len_d);
/* C */
int getRawDensity(char *authToken,
char *dataset, int time_step,
int X, int Y, int Z, int Xwidth, int Ywidth, int Zwidth, char dataout[]);
/* Fortran */
int getrawdensity_(char *authToken,
char *dataset, int *time_step,
int *X, int *Y, int *Z, int *Xwidth, int *Ywidth, int *Zwidth, float dataout[]);
/* C */
int getCutout(char *authToken,
char *dataset, char *field, int time_step,
int x_start, int y_start, int z_start,
int x_end, int y_end, int z_end,
int x_step, int y_step, int z_step, int filter_width,
float dataout[]);
/* Fortran */
int getcutout_(char *authToken,
char *dataset, char *field, int *time_step,
int *x_start, int *y_start, int *z_start,
int *x_end, int *y_end, int *z_end,
int *x_step, int *y_step, int *z_step, int *filter_width,
float dataout[]);
/* Local vs Soap functions */
int getVelocityGradientLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float input[][3], float output[][9]);
int getVelocityLaplacianLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float input[][3], float output[][3]);
int getVelocityHessianLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float input[][3], float output[][18]);
int getVelocityAndPressureLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][4]);
int getMagneticFieldLaplacianLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getVectorPotentialLaplacianLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getPressureHessianLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][6]);
int getMagneticFieldHessianLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][18]);
int getVectorPotentialHessianLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][18]);
int getPressureGradientLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getMagneticFieldGradientLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9]);
int getVectorPotentialGradientLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9]);
int getDensityGradientLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getDensityHessianLocal(TurbDataset dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][6]);
/* Cutout functions */
int lagrangianInterp(int comps, float *kernel, float position[3], int nOrder, float dx, float *result);
int lagrangianInterp2(int comps, dataKernel *kernel, float position[3], int nOrder, float dx, float *result);
int pchipInterp(int comps, float *data[4], float time, int timestep, float dt, float *result);
int computeGradient(dataKernel* kernel, int comps, float dx, int size, int nOrder, float *output);
int computeHessian(dataKernel* kernel, int comps, float dx, int size, int nOrder, float *output);
int computeLaplacian(dataKernel* kernel, int comps, float dx, int size, int nOrder, float *output);
#define SecFiniteDiff4(dx, x1, x2, x3, x4, x5) 4.0f / 3.0f / dx / dx * (x2 + x4 - 2.0f * x3) - 1.0f / 12.0f / dx / dx * (x1 + x5 - 2.0f * x3)
#define SecFiniteDiff6(dx, x1, x2, x3, x4, x5, x6, x7) 3.0f / 2.0f / dx / dx * (x3 + x5 - 2.0f * x4) - 3.0f / 20.0f / dx / dx * (x2 + x6 - 2.0f * x4) + 1.0f / 90.0f / dx / dx * (x1 + x7 - 2.0f * x4)
#define SecFiniteDiff8(dx, x1, x2, x3, x4, x5, x6, x7, x8, x9) 792.0f / 591.0f / dx / dx * (x4 + x6 - 2.0f * x5) - 207.0f / 2955.0f / dx / dx * (x3 + x7 - 2.0f * x5) - 104.0f / 8865.0f / dx / dx * (x2 + x8 - 2.0f * x5) + 9.0f / 3152.0f / dx / dx * (x1 + x9 - 2.0f * x5)
#define CrossFiniteDiff4(dx, x1, x2, x3, x4, x5, x6, x7, x8) 1.0f / 3.0f / dx / dx * (x5 + x7 - x6 - x8) - 1.0f / 48.0f / dx / dx * (x1 + x3 - x2 - x4)
#define CrossFiniteDiff6(dx, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) 3.0f / 8.0f / dx / dx * (x9 + x11 - x10 - x12) - 3.0f / 80.0f / dx / dx * (x5 + x7 - x6 - x8) + 1.0f / 360.0f / dx / dx * (x1 + x3 - x2 - x4)
#define CrossFiniteDiff8(dx, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) 14.0f / 35.0f / dx / dx * (x13 + x15 - x14 - x16) - 1.0f / 20.0f / dx / dx * (x9 + x11 - x10 - x12) + 2.0f / 315.0f / dx / dx * (x5 + x7 - x6 - x8) - 1.0f / 2240.0f / dx / dx * (x1 + x3 - x2 - x4)
#ifdef __cplusplus
}
#endif//__cplusplus
int getVelocity(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getVelocityAndPressure(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][4]);
int getVelocityGradient(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9]);
int getVelocityHessian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][18]);
int getVelocityLaplacian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getPressure(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[]);
int getPressureGradient(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getPressureHessian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][6]);
int getMagneticField(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getMagneticFieldGradient(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9]);
int getMagneticFieldHessian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][18]);
int getMagneticFieldLaplacian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getVectorPotential(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getVectorPotentialGradient(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][9]);
int getVectorPotentialHessian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][18]);
int getVectorPotentialLaplacian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getDensity(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[]);
int getDensityGradient(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][3]);
int getDensityHessian(char *authToken,
char *dataset, float time,
enum SpatialInterpolation spatial, enum TemporalInterpolation temporal,
int count, float datain[][3], float dataout[][6]);
#endif//TURBLIB_H_