enbid-ananke 0.3.1__py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
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.
- enbid_ananke/Enbid-2.0/.DS_Store +0 -0
- enbid_ananke/Enbid-2.0/COPYING +341 -0
- enbid_ananke/Enbid-2.0/COPYRIGHT +18 -0
- enbid_ananke/Enbid-2.0/Documentation/enbid.pdf +0 -0
- enbid_ananke/Enbid-2.0/Documentation/users-guide.pdf +0 -0
- enbid_ananke/Enbid-2.0/Documentation/users-guide.tex +679 -0
- enbid_ananke/Enbid-2.0/Documentation/users-guide.tex.flc +4 -0
- enbid_ananke/Enbid-2.0/Enbid +0 -0
- enbid_ananke/Enbid-2.0/Examples/hernquist1_small/snapshot_ici +0 -0
- enbid_ananke/Enbid-2.0/Examples/hernquist1_small/snapshot_ici_typelist +2 -0
- enbid_ananke/Enbid-2.0/Examples/uniform_6d_box_4/snapshot_ici +0 -0
- enbid_ananke/Enbid-2.0/Examples/uniform_6d_box_4/snapshot_ici_3d.ascii +10000 -0
- enbid_ananke/Enbid-2.0/Examples/uniform_6d_box_4/snapshot_ici_6d.ascii +10000 -0
- enbid_ananke/Enbid-2.0/parameterfiles/myparameterfile1 +37 -0
- enbid_ananke/Enbid-2.0/parameterfiles/myparameterfile2 +37 -0
- enbid_ananke/Enbid-2.0/parameterfiles/myparameterfile3 +37 -0
- enbid_ananke/Enbid-2.0/parameterfiles/myparameterfile4 +37 -0
- enbid_ananke/Enbid-2.0/periodic_lengths.txt +5 -0
- enbid_ananke/Enbid-2.0/src/Makefile +43 -0
- enbid_ananke/Enbid-2.0/src/allocate.cpp +47 -0
- enbid_ananke/Enbid-2.0/src/allocate.o +0 -0
- enbid_ananke/Enbid-2.0/src/allvars.cpp +62 -0
- enbid_ananke/Enbid-2.0/src/allvars.h +263 -0
- enbid_ananke/Enbid-2.0/src/allvars.o +0 -0
- enbid_ananke/Enbid-2.0/src/begrun.cpp +361 -0
- enbid_ananke/Enbid-2.0/src/begrun.o +0 -0
- enbid_ananke/Enbid-2.0/src/density_nd.cpp +130 -0
- enbid_ananke/Enbid-2.0/src/density_nd.o +0 -0
- enbid_ananke/Enbid-2.0/src/functions.cpp +256 -0
- enbid_ananke/Enbid-2.0/src/functions.h +20 -0
- enbid_ananke/Enbid-2.0/src/functions.o +0 -0
- enbid_ananke/Enbid-2.0/src/init.cpp +299 -0
- enbid_ananke/Enbid-2.0/src/init.o +0 -0
- enbid_ananke/Enbid-2.0/src/io.cpp +255 -0
- enbid_ananke/Enbid-2.0/src/io.o +0 -0
- enbid_ananke/Enbid-2.0/src/main.cpp +108 -0
- enbid_ananke/Enbid-2.0/src/main.o +0 -0
- enbid_ananke/Enbid-2.0/src/ngb_search.cpp +2315 -0
- enbid_ananke/Enbid-2.0/src/ngb_search.h +35 -0
- enbid_ananke/Enbid-2.0/src/ngb_search.o +0 -0
- enbid_ananke/Enbid-2.0/src/nr.cpp +186 -0
- enbid_ananke/Enbid-2.0/src/nr.h +13 -0
- enbid_ananke/Enbid-2.0/src/nr.o +0 -0
- enbid_ananke/Enbid-2.0/src/proto.h +22 -0
- enbid_ananke/Enbid-2.0/src/read_ic.cpp +434 -0
- enbid_ananke/Enbid-2.0/src/read_ic.o +0 -0
- enbid_ananke/Enbid-2.0/src/tree.cpp +973 -0
- enbid_ananke/Enbid-2.0/src/tree.h +34 -0
- enbid_ananke/Enbid-2.0/src/tree.o +0 -0
- enbid_ananke/Enbid-2.0/src/tree_search.cpp +597 -0
- enbid_ananke/Enbid-2.0/src/tree_search.o +0 -0
- enbid_ananke/__init__.py +318 -0
- enbid_ananke/__license__/LICENSE +339 -0
- enbid_ananke/__license__/__init__.py +9 -0
- enbid_ananke/__metadata__.py +160 -0
- enbid_ananke/_builtin_utils.py +62 -0
- enbid_ananke/_constants.py +56 -0
- enbid_ananke/_defaults.py +36 -0
- enbid_ananke/_name.py +10 -0
- enbid_ananke/_templates.py +71 -0
- enbid_ananke/_version.py +21 -0
- enbid_ananke/utils.py +11 -0
- enbid_ananke-0.3.1.dist-info/LICENSE +339 -0
- enbid_ananke-0.3.1.dist-info/METADATA +33 -0
- enbid_ananke-0.3.1.dist-info/RECORD +67 -0
- enbid_ananke-0.3.1.dist-info/WHEEL +7 -0
- enbid_ananke-0.3.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,361 @@
|
|
1
|
+
#include <stdio.h>
|
2
|
+
#include <stdlib.h>
|
3
|
+
#include <string.h>
|
4
|
+
#include <math.h>
|
5
|
+
#include "allvars.h"
|
6
|
+
#include "proto.h"
|
7
|
+
#include "functions.h"
|
8
|
+
|
9
|
+
/*
|
10
|
+
* Does the initial set-up.
|
11
|
+
* Reading the parameterfile, setting units,
|
12
|
+
* getting IC's etc.
|
13
|
+
*/
|
14
|
+
void begrun(void)
|
15
|
+
{
|
16
|
+
t11=second();
|
17
|
+
read_parameter_file(ParameterFile); /* ... read in parameters for this run */
|
18
|
+
|
19
|
+
cout<<"Dimensions = "<<ND<<endl;
|
20
|
+
|
21
|
+
#ifdef MEDIAN
|
22
|
+
if(All.MedianSplittingOn==0)
|
23
|
+
{
|
24
|
+
cout<<"MedianSplittingOn should be set to 1"<<endl;
|
25
|
+
endrun(10);
|
26
|
+
}
|
27
|
+
#endif
|
28
|
+
|
29
|
+
|
30
|
+
set_sph_kernel(All.TypeOfKernel,ND);
|
31
|
+
|
32
|
+
|
33
|
+
srand48(42);
|
34
|
+
|
35
|
+
t22=second(); t00+=timediff(t11,t22);
|
36
|
+
|
37
|
+
init(); /* ... read in initial model */
|
38
|
+
}
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
/*
|
43
|
+
* This function parses the parameterfile in a simple way.
|
44
|
+
* Each paramater is defined by a keyword (`tag'), and can be
|
45
|
+
* either of type douple, int, or character string.
|
46
|
+
* The routine makes sure that each parameter appears
|
47
|
+
* exactly once in the parameterfile. (Taken from GADGET)
|
48
|
+
*/
|
49
|
+
void read_parameter_file(char *fname)
|
50
|
+
{
|
51
|
+
#define DOUBLE 1
|
52
|
+
#define STRING 2
|
53
|
+
#define INT 3
|
54
|
+
#define MAXTAGS 300
|
55
|
+
|
56
|
+
FILE *fd,*fdout;
|
57
|
+
|
58
|
+
char buf[200],buf1[200],buf2[200],buf3[200];
|
59
|
+
int i,j,nt;
|
60
|
+
int id[MAXTAGS];
|
61
|
+
void *addr[MAXTAGS];
|
62
|
+
char tag[MAXTAGS][50];
|
63
|
+
int errorFlag=0;
|
64
|
+
|
65
|
+
nt=0;
|
66
|
+
|
67
|
+
|
68
|
+
strcpy(tag[nt],"SpatialScale");
|
69
|
+
addr[nt]=&All.SpatialScale;
|
70
|
+
id[nt++]=DOUBLE;
|
71
|
+
|
72
|
+
strcpy(tag[nt],"Anisotropy");
|
73
|
+
addr[nt]=&All.Anisotropy;
|
74
|
+
id[nt++]=DOUBLE;
|
75
|
+
|
76
|
+
|
77
|
+
// strcpy(tag[nt],"InputDir"); // for batch processing input dir
|
78
|
+
// addr[nt]=All.InputDir;
|
79
|
+
// id[nt++]=STRING;
|
80
|
+
|
81
|
+
// strcpy(tag[nt],"InitFileBase"); // for batch processing initial file base
|
82
|
+
// addr[nt]=All.InitFileBase;
|
83
|
+
// id[nt++]=STRING;
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
strcpy(tag[nt],"TypeOfSmoothing");
|
88
|
+
addr[nt]=&All.TypeOfSmoothing;
|
89
|
+
id[nt++]=INT;
|
90
|
+
|
91
|
+
strcpy(tag[nt],"AnisotropicKernel");
|
92
|
+
addr[nt]=&All.AnisotropicKernel;
|
93
|
+
id[nt++]=INT;
|
94
|
+
|
95
|
+
strcpy(tag[nt],"CubicCells");
|
96
|
+
addr[nt]=&All.CubicCells;
|
97
|
+
id[nt++]=INT;
|
98
|
+
|
99
|
+
|
100
|
+
strcpy(tag[nt],"VolCorr");
|
101
|
+
addr[nt]=&All.VolCorr;
|
102
|
+
id[nt++]=INT;
|
103
|
+
|
104
|
+
strcpy(tag[nt],"KernelBiasCorrection");
|
105
|
+
addr[nt]=&All.KernelBiasCorrection;
|
106
|
+
id[nt++]=INT;
|
107
|
+
|
108
|
+
strcpy(tag[nt],"TypeOfKernel");
|
109
|
+
addr[nt]=&All.TypeOfKernel;
|
110
|
+
id[nt++]=INT;
|
111
|
+
|
112
|
+
strcpy(tag[nt],"PartBoundary");
|
113
|
+
addr[nt]=&All.PartBoundary;
|
114
|
+
id[nt++]=INT;
|
115
|
+
|
116
|
+
strcpy(tag[nt],"NodeSplittingCriterion");
|
117
|
+
addr[nt]=&All.NodeSplittingCriterion;
|
118
|
+
id[nt++]=INT;
|
119
|
+
|
120
|
+
strcpy(tag[nt],"MedianSplittingOn");
|
121
|
+
addr[nt]=&All.MedianSplittingOn;
|
122
|
+
id[nt++]=INT;
|
123
|
+
|
124
|
+
|
125
|
+
strcpy(tag[nt],"InitCondFile");
|
126
|
+
addr[nt]=All.InitCondFile;
|
127
|
+
id[nt++]=STRING;
|
128
|
+
|
129
|
+
strcpy(tag[nt],"TypeListOn");
|
130
|
+
addr[nt]=&All.TypeListOn;
|
131
|
+
id[nt++]=INT;
|
132
|
+
|
133
|
+
strcpy(tag[nt],"SnapshotFileBase");
|
134
|
+
addr[nt]=All.SnapshotFileBase;
|
135
|
+
id[nt++]=STRING;
|
136
|
+
|
137
|
+
|
138
|
+
strcpy(tag[nt],"DesNumNgb");
|
139
|
+
addr[nt]=&All.DesNumNgb;
|
140
|
+
id[nt++]=INT;
|
141
|
+
|
142
|
+
|
143
|
+
strcpy(tag[nt],"DesNumNgbA");
|
144
|
+
addr[nt]=&All.DesNumNgbA;
|
145
|
+
id[nt++]=INT;
|
146
|
+
|
147
|
+
|
148
|
+
strcpy(tag[nt],"ICFormat");
|
149
|
+
addr[nt]=&All.ICFormat;
|
150
|
+
id[nt++]=INT;
|
151
|
+
|
152
|
+
|
153
|
+
strcpy(tag[nt],"PeriodicBoundaryOn"); // read from file periodic_lengths.txt
|
154
|
+
addr[nt]=&All.PeriodicBoundaryOn;
|
155
|
+
id[nt++]=INT;
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
if((fd=fopen(fname,"r")))
|
162
|
+
{
|
163
|
+
sprintf(buf,"%s%s",fname,"_enbid-usedvalues");
|
164
|
+
if(!(fdout=fopen(buf,"w")))
|
165
|
+
{
|
166
|
+
fprintf(stdout,"error opening file '%s' \n",buf);
|
167
|
+
errorFlag=1;
|
168
|
+
}
|
169
|
+
else
|
170
|
+
{
|
171
|
+
while(!feof(fd))
|
172
|
+
{
|
173
|
+
fgets(buf,200,fd);
|
174
|
+
if(sscanf(buf,"%s%s%s",buf1,buf2,buf3)<2)
|
175
|
+
continue;
|
176
|
+
|
177
|
+
if(buf1[0]=='%')
|
178
|
+
continue;
|
179
|
+
|
180
|
+
for(i=0,j=-1;i<nt;i++)
|
181
|
+
if(strcmp(buf1,tag[i])==0)
|
182
|
+
{
|
183
|
+
j=i;
|
184
|
+
tag[i][0]=0;
|
185
|
+
break;
|
186
|
+
}
|
187
|
+
|
188
|
+
if(j>=0)
|
189
|
+
{
|
190
|
+
switch(id[j])
|
191
|
+
{
|
192
|
+
case DOUBLE:
|
193
|
+
*((double*)addr[j])=atof(buf2);
|
194
|
+
fprintf(fdout,"%-35s%g\n",buf1,*((double*)addr[j]));
|
195
|
+
break;
|
196
|
+
case STRING:
|
197
|
+
strcpy((char *)addr[j],buf2);
|
198
|
+
fprintf(fdout,"%-35s%s\n",buf1,buf2);
|
199
|
+
break;
|
200
|
+
case INT:
|
201
|
+
*((int*)addr[j])=atoi(buf2);
|
202
|
+
fprintf(fdout,"%-35s%d\n",buf1,*((int*)addr[j]));
|
203
|
+
break;
|
204
|
+
}
|
205
|
+
}
|
206
|
+
else
|
207
|
+
{
|
208
|
+
fprintf(stdout,"Error in file %s: Tag '%s' not allowed or multiple defined.\n",fname,buf1);
|
209
|
+
errorFlag=1;
|
210
|
+
}
|
211
|
+
}
|
212
|
+
}
|
213
|
+
fclose(fd);
|
214
|
+
fclose(fdout);
|
215
|
+
|
216
|
+
// sprintf(buf1, "%s%s", fname, "_enbid-usedvalues");
|
217
|
+
}
|
218
|
+
else
|
219
|
+
{
|
220
|
+
fprintf(stdout,"Parameter file %s not found.\n", fname);
|
221
|
+
errorFlag=1;
|
222
|
+
endrun(1);
|
223
|
+
}
|
224
|
+
|
225
|
+
|
226
|
+
for(i=0;i<nt;i++)
|
227
|
+
{
|
228
|
+
if(*tag[i])
|
229
|
+
{
|
230
|
+
fprintf(stdout,"Error. I miss a value for tag '%s' in parameter file '%s'.\n",tag[i],fname);
|
231
|
+
errorFlag=1;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
if(errorFlag)
|
241
|
+
endrun(1);
|
242
|
+
|
243
|
+
|
244
|
+
#undef DOUBLE
|
245
|
+
#undef STRING
|
246
|
+
#undef INT
|
247
|
+
#undef MAXTAGS
|
248
|
+
}
|
249
|
+
|
250
|
+
|
251
|
+
/* Here the lookup table for the kernel of the SPH calculation
|
252
|
+
* is initialized.
|
253
|
+
*/
|
254
|
+
void set_sph_kernel(int TypeOfKernel, int dim)
|
255
|
+
{
|
256
|
+
int i,nd1;
|
257
|
+
double vd,f1=0.0,f2;
|
258
|
+
// more accurate 11/16/05
|
259
|
+
float fsp[]={1.3333369,1.8189136,2.5464790,3.6606359,5.4037953,8.1913803,12.748839,20.366416,33.380983,56.102186,96.621159,170.39909,307.49826,567.37865,1069.6362,2058.8172,4043.1010,8095.3490,16515.921,34312.457};
|
260
|
+
float fbw[]={0.93750176,0.95492964,1.0444543,1.2158542,1.4960706,1.9350925,2.6191784,3.6957561,5.4191207,8.2347774,12.937213,20.969717,35.003422,60.073937,105.84864,191.22182,353.77415,669.54824,1295.0185,2557.4981};
|
261
|
+
|
262
|
+
float fcic[]={1.0000020,0.95492963,0.95492963,1.0132118,1.1398631,1.3545643,1.6932052,2.2174514,3.0316711,4.3134446,6.3690677,9.7358945,15.373955,25.030601,41.945765,72.238385,127.67576,231.29376,428.98102,813.72530};
|
263
|
+
|
264
|
+
float
|
265
|
+
fep[]={0.75000113,0.63661975,0.59683102,0.60792705,0.66492015,0.77403670,0.95242788,1.2319173,1.6674189,2.3527875,3.4499109,5.2424031,8.2360444,13.349647,22.283674,38.243824,67.384374,121.73344,225.21478,426.23651};
|
266
|
+
|
267
|
+
float
|
268
|
+
ftsc[]={1.6875038,1.9833154,2.4171656,3.0521959,3.9950015,5.4207369,7.6205882,11.087829,16.674494,25.880863,41.399134,68.151573,115.30531,200.24626,356.54234,650.15322,1212.9379,2312.9804,4504.4024,8951.2220};
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
if((All.TypeOfSmoothing==4)||(All.TypeOfSmoothing==5)) nd1=1; else nd1=dim;
|
273
|
+
|
274
|
+
vd=2.0*pow(PI,ND/2.0)/(ND*exp(gammln(ND/2.0)));
|
275
|
+
f2=1/4.0;
|
276
|
+
|
277
|
+
switch (TypeOfKernel)
|
278
|
+
{
|
279
|
+
case 0:f1=fsp[nd1-1];break; //Spline
|
280
|
+
case 1:f1=1.0/vd;break; //Top Hat
|
281
|
+
case 2:f1=fbw[nd1-1];break; //Bi-weight
|
282
|
+
case 3:f1=fep[nd1-1];break; //Epanechikov
|
283
|
+
case 4:f1=fcic[nd1-1];break; //CIC
|
284
|
+
case 5:f1=ftsc[nd1-1];break; //TSC
|
285
|
+
case 6:f1=1.0/pow(f2*sqrt(2*PI),nd1);break; //Gaussian
|
286
|
+
default:cout<<"specify the Kernel Type"<<endl;endrun(10);
|
287
|
+
}
|
288
|
+
|
289
|
+
if((ND<1)||(ND>20))
|
290
|
+
{
|
291
|
+
cout<<"Specify the Normalization constant for dimensions > 20"<<endl;
|
292
|
+
;endrun(10);
|
293
|
+
}
|
294
|
+
else
|
295
|
+
{
|
296
|
+
cout<<"Normalization constant of Kernel type "<< TypeOfKernel<<": "<<f1<<endl;
|
297
|
+
}
|
298
|
+
|
299
|
+
|
300
|
+
for(i=0;i<=KERNEL_TABLE+1;i++)
|
301
|
+
KernelRad[i] = ((double)i)/KERNEL_TABLE;
|
302
|
+
|
303
|
+
Kernel[KERNEL_TABLE+1] = KernelDer[KERNEL_TABLE+1]= 0;
|
304
|
+
for(i=0;i<=KERNEL_TABLE;i++)
|
305
|
+
{
|
306
|
+
|
307
|
+
if(TypeOfKernel==0)
|
308
|
+
{
|
309
|
+
if(KernelRad[i]<=0.5)
|
310
|
+
{
|
311
|
+
Kernel[i] = f1 *(1-6*KernelRad[i]*KernelRad[i]*(1-KernelRad[i]));
|
312
|
+
KernelDer[i] = f1 *( -12*KernelRad[i] + 18*KernelRad[i]*KernelRad[i]);
|
313
|
+
KernelDer2[i] = f1 *( -12 + 36*KernelRad[i]);
|
314
|
+
}
|
315
|
+
else
|
316
|
+
{
|
317
|
+
Kernel[i] = f1 * 2*(1-KernelRad[i])*(1-KernelRad[i])*(1-KernelRad[i]);
|
318
|
+
KernelDer[i] = f1 *( -6*(1-KernelRad[i])*(1-KernelRad[i]));
|
319
|
+
KernelDer2[i] = f1 *( 12*(1-KernelRad[i]));
|
320
|
+
}
|
321
|
+
}
|
322
|
+
|
323
|
+
if(TypeOfKernel==1)
|
324
|
+
{
|
325
|
+
Kernel[i] = f1;
|
326
|
+
}
|
327
|
+
|
328
|
+
if(TypeOfKernel==2)
|
329
|
+
{
|
330
|
+
Kernel[i] = f1 *(1-KernelRad[i]*KernelRad[i])*(1-KernelRad[i]*KernelRad[i]);
|
331
|
+
}
|
332
|
+
if(TypeOfKernel==3)
|
333
|
+
{
|
334
|
+
Kernel[i] = f1 *(1-KernelRad[i]*KernelRad[i]);
|
335
|
+
}
|
336
|
+
if(TypeOfKernel==4)
|
337
|
+
{
|
338
|
+
Kernel[i] = f1 *(1-KernelRad[i]);
|
339
|
+
}
|
340
|
+
if(TypeOfKernel==5)
|
341
|
+
{
|
342
|
+
|
343
|
+
if(KernelRad[i]<1.0/3.0)
|
344
|
+
{
|
345
|
+
Kernel[i] = f1 *(2.0/3.0-2*KernelRad[i]*KernelRad[i]);
|
346
|
+
}
|
347
|
+
else
|
348
|
+
{
|
349
|
+
Kernel[i] = f1 *(1-KernelRad[i])*(1-KernelRad[i]);
|
350
|
+
}
|
351
|
+
}
|
352
|
+
if(TypeOfKernel==6)
|
353
|
+
{
|
354
|
+
Kernel[i] = f1 *exp(-KernelRad[i]*KernelRad[i]/(2*f2*f2));
|
355
|
+
}
|
356
|
+
}
|
357
|
+
|
358
|
+
}
|
359
|
+
|
360
|
+
|
361
|
+
|
Binary file
|
@@ -0,0 +1,130 @@
|
|
1
|
+
#include <stdio.h>
|
2
|
+
#include <stdlib.h>
|
3
|
+
#include <string>
|
4
|
+
#include <math.h>
|
5
|
+
#include <algorithm>
|
6
|
+
#include "allvars.h"
|
7
|
+
#include "nr.h"
|
8
|
+
#include "tree.h"
|
9
|
+
#include "functions.h"
|
10
|
+
#include "ngb_search.h"
|
11
|
+
#include "proto.h"
|
12
|
+
|
13
|
+
void density_par(void)
|
14
|
+
{
|
15
|
+
int i,j,ii,ji,pi=1,i1;
|
16
|
+
double t0;
|
17
|
+
struct NODE* nodes1=NULL;
|
18
|
+
|
19
|
+
struct linklist *pqStart=NULL;
|
20
|
+
struct pqueue *pqx=NULL;
|
21
|
+
bool *imark=NULL,*idone=NULL;
|
22
|
+
struct linklist *pqStartA=NULL;
|
23
|
+
struct pqueue *pqxA=NULL;
|
24
|
+
bool *imarkA=NULL,*idoneA=NULL;
|
25
|
+
|
26
|
+
|
27
|
+
create_linklist(pqx,pqStart,imark,idone,All.DesNumNgb,NumPart);
|
28
|
+
if(All.AnisotropicKernel==1)
|
29
|
+
{
|
30
|
+
d=fvector(1,ND); ve=matrix(1,ND,1,ND); mrho=matrix(1,ND,1,ND);
|
31
|
+
create_linklist(pqxA,pqStartA,imarkA,idoneA,All.DesNumNgbA,NumPart);
|
32
|
+
}
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
cout<<"Density Calculation. Smoothing ....."<<endl;
|
37
|
+
t0=t00;
|
38
|
+
t22=second();
|
39
|
+
|
40
|
+
|
41
|
+
t11=t22; t22=second();t00+=timediff(t11,t22);
|
42
|
+
t0=t00;
|
43
|
+
t22=second();
|
44
|
+
/* Main loop over all particles */
|
45
|
+
i=0;i1=1;pi=NumPart/100;
|
46
|
+
|
47
|
+
for(j=0;j<ND;j++)
|
48
|
+
metric[j]=1.0;
|
49
|
+
|
50
|
+
|
51
|
+
for(j=0; j<int(npart.size()); j++)
|
52
|
+
{
|
53
|
+
|
54
|
+
i=npartc[j];
|
55
|
+
if(npart[j]>1)
|
56
|
+
{
|
57
|
+
|
58
|
+
|
59
|
+
// cout<<"Smoothing Particle Type "<<j<<" "<<npart[j]<<endl;
|
60
|
+
if(npart[j]<All.DesNumNgb)
|
61
|
+
{
|
62
|
+
cout<<"Min "<<All.DesNumNgb<<" particles needed for smoothing"<<endl;
|
63
|
+
endrun(10);
|
64
|
+
}
|
65
|
+
|
66
|
+
nodes1=nodes+trees[j]-1;
|
67
|
+
if(All.AnisotropicKernel==1)
|
68
|
+
initialize_linklist(pqStartA,imarkA,i,All.DesNumNgbA,NumPart);
|
69
|
+
initialize_linklist(pqStart,imark,i,All.DesNumNgb,NumPart);
|
70
|
+
|
71
|
+
|
72
|
+
pnew=1;
|
73
|
+
pnext=i+1;
|
74
|
+
|
75
|
+
for(ji=0; ji<npart[j]; ji++)
|
76
|
+
{
|
77
|
+
ii=i;
|
78
|
+
|
79
|
+
while(idone[ii]==0)
|
80
|
+
{
|
81
|
+
idone[ii]=1;
|
82
|
+
Part[ii].Density= density_general(Part[ii].Pos, nodes1,All.DesNumNgbA,pqxA,pqStartA,idoneA,imarkA,All.DesNumNgb,pqx,pqStart,idone,imark);
|
83
|
+
|
84
|
+
if(i1==pi)
|
85
|
+
{
|
86
|
+
pi=pi+NumPart/100;
|
87
|
+
t11=t22; t22=second();t00+=timediff(t11,t22);
|
88
|
+
printf("Evaluated = %3d %c Time Left = %f s of %f s Par no = %d Density = %e \n",((i1)*100)/NumPart,'%',(t00-t0)*(NumPart-i1-1)*1.0/(i1),(t00-t0)*NumPart*1.0/(i1),list_kdt[ii]+1,Part[ii].Density);
|
89
|
+
fflush(stdout);
|
90
|
+
}
|
91
|
+
i1++;
|
92
|
+
|
93
|
+
ii=pnext;
|
94
|
+
}
|
95
|
+
i++;
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
|
103
|
+
// order_particles(P+1,list_kdt,NumPart,1);
|
104
|
+
// for(i=0; i<NumPart; i=i+1000)
|
105
|
+
// cout<<i<<" "<<Part[i].Density<<endl;
|
106
|
+
|
107
|
+
if(All.AnisotropicKernel==1)
|
108
|
+
{
|
109
|
+
free_fvector(d, 1,ND);
|
110
|
+
free_matrix(ve,1,ND,1,ND);
|
111
|
+
free_matrix(mrho,1,ND,1,ND);
|
112
|
+
delete [] pqStartA;
|
113
|
+
delete [] pqxA;
|
114
|
+
delete [] imarkA;
|
115
|
+
delete [] idoneA;
|
116
|
+
}
|
117
|
+
delete [] pqStart;
|
118
|
+
delete [] pqx;
|
119
|
+
delete [] imark;
|
120
|
+
delete [] idone;
|
121
|
+
|
122
|
+
t11=t22; t22=second();t00+=timediff(t11,t22);
|
123
|
+
cout<<"\nTotal Smoothing Time = "<<t00-t0<<" s"<<endl;
|
124
|
+
cout<<All.VolCorr<<" "<<All.TypeOfSmoothing<<endl;
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
Binary file
|