1 #include "../include/VarData.h" 9 for(
int p=0;p<NIn;p++){
10 if(PmIn[p].Pos[0] < Minx)
11 Minx = PmIn[p].
Pos[0];
12 if(PmIn[p].Pos[0] > Maxx)
13 Maxx = PmIn[p].
Pos[0];
15 double DeltaxIn=(Maxx-Minx)/(
double)(NIn-1);
16 double DeltaxOut=(Maxx-Minx)/(
double)(NOut-1);
18 for(
int p=0,pp=0;p<NIn;p++){
20 Par1 =
Mat->
Parab(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,1);
21 Par2 =
Mat->
Parab(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,2);
23 for(;x < DeltaxIn*(p+1);x += DeltaxOut){
24 if(pp == NOut-1)
return NOut;
26 PmOut[pp].
Pos[1] = Par1.
a2*x*x+Par1.
a1*x+Par1.
a0;
27 PmOut[pp].
Pos[2] = Par2.
a2*x*x+Par2.
a1*x+Par2.
a0;
31 PmOut[pp].
Idx = PmIn[p].
Idx;
39 double Maxx=PmIn[0].
Pos[0];
40 double Minx=PmIn[0].
Pos[0];
41 for(
int p=0;p<NIn;p++){
42 if(PmIn[p].Pos[0] < Minx)
43 Minx = PmIn[p].
Pos[0];
44 if(PmIn[p].Pos[0] > Maxx)
45 Maxx = PmIn[p].
Pos[0];
47 double DeltaxIn=(double)NIn/((Maxx-Minx)*(double)NOut);
51 for(
int p=0,pp=0;p<NIn;p++){
53 Par1 =
Mat->
Parab2(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,1);
54 Par2 =
Mat->
Parab2(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,2);
55 DeltaxOut = (PmIn[p+1].
Pos[0] - PmIn[p].
Pos[0])*DeltaxIn;
56 for(
double x = PmIn[p].Pos[0], Stepx = 0.;
57 x <= PmIn[p+1].
Pos[0];
59 Stepx = (x-PmIn[p].
Pos[0]);
61 PmOut[pp].
Pos[1] = Par1.
a2*Stepx*Stepx+Par1.
a1*Stepx+Par1.
a0;
62 PmOut[pp].
Pos[2] = Par2.
a2*Stepx*Stepx+Par2.
a1*Stepx+Par2.
a0;
67 Par1 =
Mat->
Parab2(PmIn[p-1].Pos,PmIn[p].Pos,PmIn[p+1].Pos,0,1);
68 Par2 =
Mat->
Parab2(PmIn[p-1].Pos,PmIn[p].Pos,PmIn[p+1].Pos,0,2);
69 DeltaxOut = (PmIn[p+1].
Pos[0] - PmIn[p].
Pos[0])*DeltaxIn;
70 for(
double x = PmIn[p].Pos[0], Stepx = 0.;
71 x <= PmIn[p+1].
Pos[0];
73 Stepx = (x-PmIn[p].
Pos[0]);
74 if(pp == NOut-1)
return NOut;
76 PmOut[pp].
Pos[1] = Par1.
a2*Stepx*Stepx+Par1.
a1*Stepx+Par1.
a0;
77 PmOut[pp].
Pos[2] = Par2.
a2*Stepx*Stepx+Par2.
a1*Stepx+Par2.
a0;
79 PmOut[pp].
Idx = PmIn[p].
Idx;
89 double Maxx=PmIn[0].
Pos[0];
90 double Minx=PmIn[0].
Pos[0];
91 for(
int p=0;p<NIn;p++){
92 if(PmIn[p].Pos[0] < Minx)
93 Minx = PmIn[p].
Pos[0];
94 if(PmIn[p].Pos[0] > Maxx)
95 Maxx = PmIn[p].
Pos[0];
97 double DeltaxIn=(double)NIn/((Maxx-Minx)*(double)NOut);
101 for(
int p=0,pp=0;p<NIn-2;p++){
102 Cub1 =
Mat->
Cubica(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,PmIn[p+3].Pos,0,1);
103 Cub2 =
Mat->
Cubica(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,PmIn[p+3].Pos,0,2);
104 DeltaxOut = (PmIn[p+1].
Pos[0] - PmIn[p].
Pos[0])*DeltaxIn;
105 for(
double x = PmIn[p].Pos[0], Dx = 0.;
106 x <= PmIn[p+1].
Pos[0];
107 x += DeltaxOut,pp++){
108 Dx = (x-PmIn[p+1].
Pos[0]);
109 if(pp == NOut-1)
return NOutShow;
110 PmOut[pp].
Pos[0] = x;
111 PmOut[pp].
Pos[1] = Cub1.
a0+Cub1.
a1*Dx+Cub1.
a2*Dx*Dx+Cub1.
a3*Dx*Dx*Dx;
112 PmOut[pp].
Pos[2] = Cub2.
a0+Cub2.
a1*Dx+Cub2.
a2*Dx*Dx+Cub2.
a3*Dx*Dx*Dx;
114 PmOut[pp].
Idx = PmIn[p].
Idx;
123 double Maxx=PmIn[0].
Pos[0];
124 double Minx=PmIn[0].
Pos[0];
125 for(
int p=0;p<NIn;p++){
126 if(PmIn[p].Pos[0] < Minx)
127 Minx = PmIn[p].
Pos[0];
128 if(PmIn[p].Pos[0] > Maxx)
129 Maxx = PmIn[p].
Pos[0];
131 double DeltaxIn=(double)NIn/((Maxx-Minx)*(double)NOut);
136 for(
int p=0,pp=0;p<NIn;p++){
138 Forth1 =
Mat->
Forth(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,PmIn[p+3].Pos,PmIn[p+4].Pos,0,1);
139 Forth2 =
Mat->
Forth(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,PmIn[p+3].Pos,PmIn[p+4].Pos,0,2);
140 Ref = PmIn[p+2].
Pos[0];
143 Forth1 =
Mat->
Forth(PmIn[p-1].Pos,PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,PmIn[p+3].Pos,0,1);
144 Forth2 =
Mat->
Forth(PmIn[p-1].Pos,PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,PmIn[p+3].Pos,0,2);
145 Ref = PmIn[p+1].
Pos[0];
148 Forth1 =
Mat->
Forth(PmIn[p-2].Pos,PmIn[p-1].Pos,PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,1);
149 Forth2 =
Mat->
Forth(PmIn[p-2].Pos,PmIn[p-1].Pos,PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,2);
150 Ref = PmIn[p].
Pos[0];
153 Forth1 =
Mat->
Forth(PmIn[p-3].Pos,PmIn[p-2].Pos,PmIn[p-1].Pos,PmIn[p].Pos,PmIn[p+1].Pos,0,1);
154 Forth2 =
Mat->
Forth(PmIn[p-3].Pos,PmIn[p-2].Pos,PmIn[p-1].Pos,PmIn[p].Pos,PmIn[p+1].Pos,0,2);
155 Ref = PmIn[p-1].
Pos[0];
158 Forth1 =
Mat->
Forth(PmIn[p-4].Pos,PmIn[p-3].Pos,PmIn[p-2].Pos,PmIn[p-1].Pos,PmIn[p].Pos,0,1);
159 Forth2 =
Mat->
Forth(PmIn[p-4].Pos,PmIn[p-3].Pos,PmIn[p-2].Pos,PmIn[p-1].Pos,PmIn[p].Pos,0,2);
160 Ref = PmIn[p-2].
Pos[0];
163 DeltaxOut = (PmIn[p+1].
Pos[0] - PmIn[p].
Pos[0])*DeltaxIn;
164 for(
double x = PmIn[p].Pos[0], Dx = 0.;
165 x <= PmIn[p+1].
Pos[0];
166 x += DeltaxOut,pp++){
168 if(pp == NOut-1)
return NOut;
169 PmOut[pp].
Pos[0] = x;
170 PmOut[pp].
Pos[1] = Forth1.
a0+Forth1.
a1*Dx+Forth1.
a2*Dx*Dx+Forth1.
a3*Dx*Dx*Dx+Forth1.
a4*Dx*Dx*Dx*Dx;
171 PmOut[pp].
Pos[2] = Forth2.
a0+Forth2.
a1*Dx+Forth2.
a2*Dx*Dx+Forth2.
a3*Dx*Dx*Dx+Forth2.
a4*Dx*Dx*Dx*Dx;;
173 PmOut[pp].
Idx = PmIn[p].
Idx;
181 double Maxx=PmIn[0].
Pos[0];
182 double Minx=PmIn[0].
Pos[0];
183 for(
int p=0;p<NIn;p++){
184 if(PmIn[p].Pos[0] < Minx)
185 Minx = PmIn[p].
Pos[0];
186 if(PmIn[p].Pos[0] > Maxx)
187 Maxx = PmIn[p].
Pos[0];
189 double DeltaxIn=(double)(NIn-1)/((Maxx-Minx)*(
double)NOut);
192 double RatioOutIn = DeltaxOut/DeltaxIn;
193 for(
int p=0,pp=0;p<NIn;p+=1){
195 Sp1 =
Mat->
Spline3Beg(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,2);
197 Sp1 =
Mat->
Spline3(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,2);
198 else if( p == NIn - 2 )
200 DeltaxOut = (PmIn[p+1].
Pos[0] - PmIn[p].
Pos[0])*DeltaxIn;
201 for(
double x = PmIn[p].Pos[0], Stepx = 0.;
202 x <= PmIn[p+1].
Pos[0];
203 x += DeltaxOut,pp++){
205 if(pp == NOut-1)
break;
206 Stepx = (x-PmIn[p].
Pos[0]);
207 PmOut[pp].
Pos[0] = x;
208 PmOut[pp].
Pos[2] = Sp1.
a3*Stepx*Stepx*Stepx +
210 Sp1.
a1*Stepx + Sp1.
a0;
213 for(
int p=0,pp=0;p<NIn;p+=1){
216 Sp2 =
Mat->
Spline3Beg(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,1);
218 Sp2 =
Mat->
Spline3(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,1);
219 else if( p == NIn - 2 )
221 DeltaxOut = (PmIn[p+1].
Pos[0] - PmIn[p].
Pos[0])*DeltaxIn;
222 for(
double x = PmIn[p].Pos[0], Stepx = 0.;
223 x <= PmIn[p+1].
Pos[0];
224 x += DeltaxOut,pp++){
225 if(pp == NOut-1)
return NOutShow;
226 Stepx = (x-PmIn[p].
Pos[0]);
227 PmOut[pp].
Pos[1] = Sp2.
a3*Stepx*Stepx*Stepx +
229 Sp2.
a1*Stepx + Sp2.
a0;
232 PmOut[pp].
Idx = PmIn[p].
Idx;
240 double Maxx=PmIn[0].
Pos[0];
241 double Minx=PmIn[0].
Pos[0];
242 for(
int p=0;p<NIn;p++){
243 if(PmIn[p].Pos[0] < Minx)
244 Minx = PmIn[p].
Pos[0];
245 if(PmIn[p].Pos[0] > Maxx)
246 Maxx = PmIn[p].
Pos[0];
248 double DeltaxIn=(double)(NIn-1)/((Maxx-Minx)*(
double)NOut);
251 double RatioOutIn = DeltaxOut/DeltaxIn;
252 for(
int p=0,pp=0;p<NIn;p+=1){
254 Sp1 =
Mat->
Spline4Beg(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,PmIn[p+3].Pos,0,1);
261 Sp1 =
Mat->
Spline4(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,1);
262 else if( p == NIn - 2 )
265 DeltaxOut = (PmIn[p+1].
Pos[0] - PmIn[p].
Pos[0])*DeltaxIn;
266 for(
double x = PmIn[p].Pos[0], Dx = 0.;
267 x <= PmIn[p+1].
Pos[0];
268 x += DeltaxOut,pp++){
270 if(pp == NOut-1)
break;
271 Dx = (x-PmIn[p].
Pos[0]);
272 PmOut[pp].
Pos[0] = x;
273 PmOut[pp].
Pos[1] = Sp1.
a0+Sp1.
a1*Dx+Sp1.
a2*Dx*Dx+Sp1.
a3*Dx*Dx*Dx+Sp1.
a4*Dx*Dx*Dx*Dx;
276 for(
int p=0,pp=0;p<NIn;p+=1){
279 Sp2 =
Mat->
Spline4Beg(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,PmIn[p+3].Pos,0,2);
285 else if(p < NIn - 2){
286 Sp2 =
Mat->
Spline4(PmIn[p].Pos,PmIn[p+1].Pos,PmIn[p+2].Pos,0,2);
288 else if( p == NIn - 2 )
291 DeltaxOut = (PmIn[p+1].
Pos[0] - PmIn[p].
Pos[0])*DeltaxIn;
292 for(
double x = PmIn[p].Pos[0], Dx = 0.;
293 x <= PmIn[p+1].
Pos[0];
294 x += DeltaxOut,pp++){
295 if(pp == NOut-1)
return NOutShow;
296 Dx = (x-PmIn[p].
Pos[0]);
297 PmOut[pp].
Pos[2] = Sp2.
a0+Sp2.
a1*Dx+Sp2.
a2*Dx*Dx+Sp2.
a3*Dx*Dx*Dx+Sp2.
a4*Dx*Dx*Dx*Dx;
300 PmOut[pp].
Idx = PmIn[p].
Idx;
309 for(
int p=0;p<NIn;p++){
310 if(PmIn[p].Pos[
CLat1] < Minx)
312 if(PmIn[p].Pos[
CLat1] > Maxx)
315 double DeltaxIn=(Maxx-Minx)/(
double)(NIn-1);
316 double DeltaxOut=(Maxx-Minx)/(
double)(NOut-1);
318 double *dArray = (
double *)calloc(NIn+NOrder+1,
sizeof(
double));
319 for(
int p=0;p<=NIn+NOrder;p++){
322 else if( (NOrder<=p) && (p<=NIn) )
323 dArray[p] = (p-NOrder+1)*DeltaxIn+Minx;
325 dArray[p] = (p-NOrder+2)*DeltaxIn+Minx;
327 for(
int pp=0;pp<NOut-1;pp++){
328 for(
int d=0;d<3;d++) PmOut[pp].Pos[d] = 0.;
329 double x = DeltaxOut*pp+Minx;
330 int vPos = (int)((x-Minx)/(Maxx-Minx)*NIn);
331 for(
int p=vPos-1;p<vPos+NOrder;p++){
332 if(p >= NIn || p <0)
continue;
333 double Blend =
Mat->
Blend(dArray,x,p,NOrder);
334 PmOut[pp].
Pos[0] += Blend * PmIn[p].
Pos[0];
335 PmOut[pp].
Pos[1] += Blend * PmIn[p].
Pos[1];
336 PmOut[pp].
Pos[2] += Blend * PmIn[p].
Pos[2];
339 PmOut[NOut-1].
Pos[0] = PmIn[NIn-1].
Pos[0];
340 PmOut[NOut-1].
Pos[1] = PmIn[NIn-1].
Pos[1];
341 PmOut[NOut-1].
Pos[2] = PmIn[NIn-1].
Pos[2];
349 double DeltaIn=(Max-Min)/(
double)(NIn-1);
350 double DeltaOut=(Max-Min)/(
double)(NOut-1);
351 double RatioInOut = (double)(NIn/(
double)NOut);
353 double *dArray = (
double *)calloc(NIn+NOrder+1,
sizeof(
double));
354 for(
int p=0;p<=NIn+NOrder;p++){
358 else if( (NOrder<=p) && (p<=NIn) ){
359 dArray[p] = (p-NOrder+1)*DeltaIn+Min;
362 dArray[p] = (p-NOrder+2)*DeltaIn+Min;
365 for(
int vo=0;vo<NOut;vo++){
366 for(
int vvo=0;vvo<NOut;vvo++){
368 double x = DeltaOut*vo+Min;
369 int vxPos = (int)(vo*RatioInOut);
370 for(
int vi=vxPos-1,vn=0;vi<vxPos+NOrder+1;vi++){
372 if(vi < 0) vn = NIn + vi;
373 if(vi >= NIn) vn = vi - NIn;
374 double Blendx =
Mat->
Blend(dArray,x,vn,NOrder);
375 double y = DeltaOut*vvo+Min;
376 int vyPos = (int)(vvo*RatioInOut);
377 for(
int vvi=vyPos-1,vvn=0;vvi<vyPos+NOrder+1;vvi++){
379 if(vvi < 0) vvn = NIn + vvi;
380 if(vvi >= NIn) vvn = vvi - NIn;
381 double Blendy =
Mat->
Blend(dArray,y,vvn,NOrder);
382 PlOut[vo][vvo] += Blendx*Blendy*PlIn[vn][vvn];
402 double *PlotIn = (
double *)calloc(SQR(NSample),
sizeof(double));
403 double *PlotOut = (
double *)calloc(SQR(NSample),
sizeof(double));
404 for(
int nx=0;nx<NSample;nx++){
405 for(
int ny=0;ny<NSample;ny++){
406 int n = nx*NSample+ny;
407 PlotIn[n] =
Pm[n].
Pos[2];
411 for(
int nx=0;nx<NSample;nx++){
412 for(
int ny=0;ny<NSample;ny++){
413 int n = nx*NSample+ny;
414 if(
pType(n) != 0)
continue;
415 Pm[n].
Pos[2] = PlotOut[n];
428 double DeltaIn = (Max-Min)/(
double)(NIn-1);
429 double DeltaOut = (Max-Min)/(
double)(NOut-1);
430 double RatioInOut = (double)(NIn/(
double)NOut);
432 double *dArray = (
double *)calloc(NIn+NOrder+1,
sizeof(
double));
433 for(
int p=0;p<=NIn+NOrder;p++){
437 else if( (NOrder<=p) && (p<=NIn) ){
438 dArray[p] = (p-NOrder+1)*DeltaIn+Min;
441 dArray[p] = (p-NOrder+2)*DeltaIn+Min;
444 for(
int vo=0;vo<NOut;vo++){
445 for(
int vvo=0;vvo<NOut;vvo++){
446 PlOut[vo*NOut+vvo] = 0.;
447 double x = DeltaOut*vo+Min;
448 int vxPos = (int)(vo*RatioInOut);
449 for(
int vi=vxPos-1,vn=0;vi<vxPos+NOrder+1;vi++){
451 if(vi < 0) vn = NIn + vi;
452 if(vi >= NIn) vn = vi - NIn;
453 double Blendx =
Mat->
Blend(dArray,x,vn,NOrder);
454 double y = DeltaOut*vvo+Min;
455 int vyPos = (int)(vvo*RatioInOut);
456 for(
int vvi=vyPos-1,vvn=0;vvi<vyPos+NOrder+1;vvi++){
458 if(vvi < 0) vvn = NIn + vvi;
459 if(vvi >= NIn) vvn = vvi - NIn;
460 double Blendy =
Mat->
Blend(dArray,y,vvn,NOrder);
461 PlOut[vo*NOut+vvo] += Blendx*Blendy*PlIn[vn*NIn+vvn];
482 double DeltaIn=(Max-Min)/(
double)(NIn-1);
483 double DeltaOut=(Max-Min)/(
double)(NOut-1);
485 double *dArray = (
double *)calloc(NIn+2*NOrder+2,
sizeof(
double));
486 for(
int vi=0;vi<=NIn+2*NOrder;vi++){
491 dArray[vi] = (vi-NOrder+2)*DeltaIn+Min;
494 dArray[vi] = (vi-NOrder+1)*DeltaIn+Min;
497 for(
int vo=0;vo<NOut;vo++){
499 if(vo > NOut-NOrder)
continue;
501 double x = DeltaOut*vo+Min;
502 for(
int vi=vo-1,vn=0;vi<vo+NOrder+1;vi++){
510 double Blendx =
Mat->
Blend(dArray,x,vn,NOrder);
511 PlOut[vo] += Blendx*PlIn[vn];
519 double *Pz = (
double *)calloc(NIn,
sizeof(
double));
520 double *Px = (
double *)calloc(NIn,
sizeof(
double));
521 double *Py = (
double *)calloc(NIn,
sizeof(
double));
522 for(
int p=0;p<NIn;p++){
532 double Deltax = Length / (double)NOut;
534 for(
int p=0;p<NOut;p++){
539 for(
int n=0;n<NIn;n++){
545 delete Sp1;
delete Sp2;
546 free(Pz);free(Py);free(Px);
588 double InvNSample = 1./(double)NSample;
589 double **PlotIn = (
double **)calloc(SQR(NSample),
sizeof(double));
590 double **PlotOut = (
double **)calloc(SQR(NSample),
sizeof(double));
591 double **Count = (
double **)calloc(SQR(NSample),
sizeof(double));
592 double Round = 0.00001;
593 for(
int v=0;v<NSample;v++){
594 PlotIn[v] = (
double *)calloc(NSample,
sizeof(
double));
595 PlotOut[v] = (
double *)calloc(NSample,
sizeof(
double));
596 Count[v] = (
double *)calloc(NSample,
sizeof(
double));
600 for(
int p=0;p<
pNPart();p++){
605 Nx = (int)(
pNPart()/(double)Ny);
606 for(
int p=0;p<
pNPart();p++){
609 if(vx < 0 || vx >= NSample)
continue;
610 if(vy < 0 || vy >= NSample)
continue;
614 for(
int vx=0;vx<NSample;vx++)
615 for(
int vy=0;vy<NSample;vy++)
616 PlotIn[vx][vy] *= Count[vx][vy] > 0. ? 1./Count[vx][vy] : 1.;
619 FILE *F2Write = fopen(FWrite,
"w");
620 for(
int vx=0;vx<NSample;vx++){
621 for(
int vy=0;vy<NSample;vy++){
624 fprintf(F2Write,
"%lf %lf %lf\n",x,y,PlotOut[vx][vy]);
629 for(
int v=0;v<NSample;v++){
int InterSpline3(PART *PmIn, PART *PmOut, int NIn, int NOut)
third order spline
SPLINE Spline4Beg(double *P1, double *P2, double *P3, double *P4, int x, int y)
Four order spline first boundary.
double a4
a0 + a1*x + a2*x^2 + a3*x^3 + a4^4
double GetCoe(int n)
Print the n coefficient.
int InterBSpline1D(double *PlIn, double *PmOut, int NIn, int NOut)
1-d BSpline
int InterSpline4(PART *PmIn, PART *PmOut, int NIn, int NOut)
forth order spline
coeficients of a N order spline
double Edge[4]
xyzr edges of the simulation box
SPLINE Spline3Beg(double *P1, double *P2, double *P3, int x, int y)
Three order spline first boundary.
double pInvEdge(int d)
Inverted xyzr edges of the simulation box.
int pType(int p)
Return the type.
int CLat2
lateral coordinate
double Pos[3]
xyz Position of the particle
double pEdge(int d)
xyzr edges of the simulation box
SPLINE Parab2(double *PA, double *PB, double *PC, int x, int y)
Three points parabolic interpolation.
int Idx
Particle identifier.
double a3
a0 + a1*x + a2*x^2 + a3*x^3 + a4^4
SPLINE Spline4(double *P1, double *P2, double *P3, double *P4, int x, int y)
Four order spline.
int InterBSpline(PART *PmIn, PART *PmOut, int NIn, int NOut)
BSpline.
int InterParab(PART *PmIn, PART *PmOut, int NIn, int nOut)
Discontinous parabolas.
int InterParab2(PART *PmIn, PART *PmOut, int NIn, int NOut)
Discontinous parabolas.
int InterPoly(PART *PmIn, PART *PmOut, int NIn, int nOut)
NIn-polynomian.
double a2
a0 + a1*x + a2*x^2 + a3*x^3 + a4^4
double a1
a0 + a1*x + a2*x^2 + a3*x^3 + a4^4
int InterForth(PART *PmIn, PART *PmOut, int NIn, int NOut)
Discontinous forth degree.
int Polinomio(double *P1, double *P2, int NMass, Spline *Sp)
Polinimial interpolation of NMass order.
SPLINE Spline3End(double *P1, double *P2, int x, int y)
Three order spline last boundary.
double Elevato(double x, int Volte)
Integer power.
void SmoothGrid(int NSample, char *FWrite)
Smooth a grid with BSplines.
Matematica * Mat
Implementation of all usefull algorythms.
SPLINE Parab(double *P1, double *P2, double *P3, int x, int y)
Three points parabolic interpolation.
int CLat1
lateral coordinate
Information of every particle.
SPLINE Spline3(double *P1, double *P2, double *P3, int x, int y)
Three order spline.
int InterCubica(PART *PmIn, PART *PmOut, int NIn, int NOut)
Discontinous cubic.
double a0
a0 + a1*x + a2*x^2 + a3*x^3 + a4^4
SPLINE Forth(double *PA, double *PB, double *PC, double *PD, double *PE, int x, int y)
Five points four order interpolation.
SPLINE Cubica(double *PA, double *PB, double *PC, double *PD, int x, int y)
Four point cubic interpolation.
double Blend(const double *dPoint, double x, int nPoint, int nOrder)
For the BSpline.
PART * Pm
Particle information of all particle.
int InterBSpline2D(double **PlIn, double **PmOut, int NIn, int NOut)
2-d BSpline
int CNorm
Normal coordinate.
int pNPart()
Number of particle.