8 if(!strcmp(
Block[b].Name,
"ADDED"))
continue;
9 if(!strcmp(
Block[b].Name,
"CHOL"))
continue;
12 double *FileAverage = (
double *)calloc(NDim*NChain*
NFileTot,
sizeof(
double));
13 double *ChainDiff = (
double *)calloc(NFileTot,
sizeof(*ChainDiff));
14 double *ChainOrigin = (
double *)calloc(NFileTot,
sizeof(*ChainDiff));
15 double *Count = (
double *)calloc(NFileTot,
sizeof(*Count));
16 double *Time = (
double *)calloc(NFileTot,
sizeof(*Time));
17 double CmInit[3] = {
pCm(0),
pCm(1),
pCm(2)};
18 double InitTime =
pTime();
19 for(
int f=NFile[0];f<NFile[1];f++){
21 if(
OpenRisk(cFile[f],BF_NO))
return 1;
23 Time[f] =
pTime() - InitTime;
24 if(Time[f]<=0.) Time[f] = (double)f;
25 for(
int c=0;c<NChain;c++){
26 int ff = f - NFile[0];
27 for(
int d=0;d<NDim;d++){
28 FileAverage[(c*NFileTot+ff)*NDim+d] =
Ch[c].Pos[d];
34 MPI_Allreduce(MPI_IN_PLACE,FileAverage,NDim*NChain*NFileTot, MPI_DOUBLE, MPI_SUM, Proc->CommGrid);
36 MPI_Comm_rank(Proc->CommGrid, &Rank);
40 for(
int c=0;c<NChain;c++){
41 for(
int d=0;d<NDim;d++){
43 SQR((FileAverage[(c*NFileTot)*NDim+d]-FileAverage[(c*NFileTot+f)*NDim+d]));
50 for(
int c=0;c<NChain;c++){
51 for(
int d=0;d<NDim;d++){
53 SQR((FileAverage[(c*NFileTot+ff)*NDim+d]-FileAverage[(c*NFileTot+f)*NDim+d]));
61 sprintf(FileName,
"Diffusivity.dat");
62 FILE *FileToWrite = fopen(FileName,
"w");
63 char cSystem[STRSIZE];
65 fprintf(FileToWrite,
"%s",cSystem);
66 fprintf(FileToWrite,
"#Time ChainOrigin OriginSum DiffSum ChainDiff Count\n");
68 double Inv = Count[f] > 0. ? Count[f] : 1.;
69 fprintf(FileToWrite,
"%lf %.5g %.5g %.5g\n",Time[f],ChainOrigin[f]/(
double)(NChain),ChainDiff[f]/Inv,ChainDiff[f]/(Inv*Time[f]) );
88 double InvBoxRad = 1./BoxRad;
89 double *OldPos = (
double *)calloc(3*
pNPart(),
sizeof(double));
90 double *Diff = (
double *)calloc(NBin*
pNPart(),
sizeof(double));
91 double *Count = (
double *)calloc(NSlab,
sizeof(
double));
92 int *PartOr = (
int *)calloc(
pNPart(),
sizeof(int));
94 for(
int p = 0;p<
pNPart();p++){
97 OldPos[3*p+d] =
Pm[p].
Pos[d];
102 int vr = (int)(dr2/BoxRad*NSlab);
104 if(vr < 0 || vr >= NSlab)
continue;
109 FILE *FRepr = fopen(
"SystemSlab.dat",
"w");
110 for(
int p=0;p<
pNPart();p++){
111 fprintf(FRepr,
"%lf %lf %lf 0\n",
Pm[p].Pos[
CLat1],
Pm[p].Pos[
CLat2],.5);
113 for(
int v=0;v<NSlab;v++){
114 double Dist = v*BoxRad/(double)NSlab;
115 for(
int i=0;i<100;i++){
116 double ang = i*.01*2.*M_PI;
119 fprintf(FRepr,
"%lf %lf %lf 2\n",x,y,.51);
123 double Norm = 1./(double)
pNPart();
124 for(
int v=0;v<NSlab;v++){
125 double Dist = v*BoxRad/(double)NSlab;
126 sprintf(FName,
"MeanSqDispl%.3f.dat",Dist);
127 FILE *FWrite = fopen(FName,
"w");
132 for(
int f=NFile[0];f<NFile[1];f++){
135 double OutRatio = 100.*NOut/(double)(f*
pNPart());
136 fprintf(stderr,
"step %d)/%d fraction of number of beads out of the slab %lf %%\r",f,NBin,OutRatio);
137 double Rad2Mean = 0.;
138 for(
int p = 0;p<
pNPart();p++){
140 if(vr1 < 0 || vr1 >= NSlab)
continue;
142 for(
int d=0;d<3;d++){
147 int vr = (int)(dr2*InvBoxRad*NSlab);
152 for(
int d=0;d<2;d++){
153 double Dist =
Pm[p].
Pos[d] - OldPos[3*p+d];
158 Diff[f*NSlab+vr1] += Rad2;
162 Rad2Mean =
pNPart()/Rad2Mean;
163 sprintf(FName,
"DisplPos%05d.dat",f);
164 FILE *FWrite = fopen(FName,
"w");
166 for(
int p=0;p<
pNPart();p++){
168 for(
int d=0;d<2;d++){
169 double Dist =
Pm[p].
Pos[d] - OldPos[3*p+d];
174 double Vel = Rad2*Rad2Mean;
175 fprintf(FWrite,
"{x(%lf %lf %lf) v(%lf %lf %lf)\n",
Pm[p].Pos[
CLat1],
Pm[p].Pos[
CLat2],Vel,Vel,Vel,Vel);
181 double DisplMean = 0.;
183 for(
int v=0;v<NSlab;v++){
184 Count[v] = Count[v] > 0. ? 1./Count[v] : 1.;
185 for(
int b=0;b<NBin;b++){
186 Diff[b*NSlab+v] *= Count[v];
189 for(
int v=0;v<NSlab;v++){
190 DisplMean += Diff[(NBin-1)*NSlab+v] ;
191 double Dist = v*BoxRad/(double)NSlab;
192 sprintf(FName,
"MeanSqDispl%.3f.dat",Dist);
193 FILE *FWrite = fopen(FName,
"w");
194 for(
int b=1;b<NBin;b++){
195 fprintf(FWrite,
"%d %lf\n",b,Diff[b*NSlab+v]);
199 DisplMean /= (double) NSlab;
201 sprintf(FName,
"SlabMeadDispl.dat");
202 FILE *FWrite = fopen(FName,
"w");
204 for(
int sx=0;sx<100;sx++){
205 for(
int sy=0;sy<100;sy++){
209 int vr = (int)(Rad2*InvBoxRad*NSlab);
210 if(vr < 0 || vr >= NSlab)
continue;
211 double Vel = Diff[(NBin-1)*NSlab+vr];
212 fprintf(FWrite,
"{x(%lf %lf %lf) v(%lf %lf %lf)\n",x,y,Vel,Vel,Vel,Vel);
227 if(NDim == 2) NAlloc = NBin*NBin;
228 double *Prob = (
double *)calloc(NAlloc,
sizeof(
double));
237 for(
int p1=0;p1<
pNPart();p1++){
238 for(
int p2=p1+1;p2<
pNPart();p2++){
246 int r = (int)(DistRel[3]/CutOff*NBin);
247 if(r < 0 || r >= NBin)
continue;
256 Norm *= NFile[1] - NFile[0];
257 double rInv = 1.*CutOff/(double)NBin;
258 FILE *FPair = fopen(
"PairCorrelation.dat",
"w");
259 fprintf(FPair,
"%lf %lf \n",0.,Prob[0]/Norm);
260 for(
int r=1;r<NBin;r++){
261 double rr = r*CutOff/(double)NBin;
262 Prob[r] /= Norm*(CUBE(rr)-CUBE(rr-rInv));
263 fprintf(FPair,
"%lf %lf \n",rr,Prob[r]);
270 Plot = (
double **)calloc(NBin,
sizeof(
double));
271 for(
int i=0;i<NBin;i++){
272 *(Plot+i) = (
double *)calloc(NBin,
sizeof(
double));
275 dDensity = (
double *)calloc(NBin,
sizeof(
double));
277 dDensity1 = (
double *)calloc(NBin,
sizeof(
double));
281 if(
OpenRisk(cFile[f],BF_CHAIN))
return 1;
282 if(How == 0 || How == 1)
290 for(
int v=0;v<NBin;v++){
292 dDensity1[v] += dDensity[v];
296 if(How == 0 || How == 1){
297 FILE *FileToWrite = fopen(
"PairCorrelation.dat",
"w");
298 fprintf(FileToWrite,
"# RadDist Density \n");
299 for(
int v=0;v<NBin;v++){
300 dDensity1[v] /= NFile[1] - NFile[0];
301 fprintf(FileToWrite,
"%lf %lf\n",(
double)v/(
double)NBin*
pEdge(3),dDensity1[v]);
307 double InvNBin=1./(double)NBin;
308 for(
int v=0;v<NBin;v++){
309 for(
int vv=0;vv<NBin;vv++){
311 if(Max < Plot[v][vv])
315 FILE *FileToWrite = fopen(
"PairCorrelation.xvl",
"w");
317 int vRef = (int)(NBin/2.);
318 for(
int v=0;v<NBin;v++){
319 for(
int vv=0;vv<NBin;vv++){
320 if(Plot[v][vv] > 0.){
322 double PosX =
pEdge(3) + InvNBin*(double)v*
pEdge(3)*cos((
double)vv*InvNBin*DUE_PI);
323 double PosY =
pEdge(3) + InvNBin*(double)v*
pEdge(3)*sin((
double)vv*InvNBin*DUE_PI);
324 fprintf(FileToWrite,
"{x(%lf %lf %lf)}\n",
325 PosX,PosY,Plot[v][vv]/Max*
pEdge(3));
330 fprintf(FileToWrite,
"{x(%lf %lf %lf)}\n",
331 PosX,PosY,Plot[v][vv]/Max*
pEdge(3));
346 Plot = (
double **)calloc(NBin,
sizeof(
double));
347 for(
int i=0;i<NBin;i++){
348 *(Plot+i) = (
double *)calloc(NBin,
sizeof(
double));
354 if(
OpenRisk(cFile[f],BF_CHAIN))
return 1;
359 double InvNBin=1./(double)NBin;
360 for(
int v=0;v<NBin;v++){
361 for(
int vv=0;vv<NBin;vv++){
362 Plot[v][vv] = POS(Plot[v][vv]);
363 if(Max < Plot[v][vv])
368 FILE *FileToWrite = NULL;
370 FileToWrite = fopen(
"Scattering.xvl",
"w");
372 FileToWrite = fopen(
"Scattering2.xvl",
"w");
375 for(
int q=0;q<4;q++){
376 double Signx = !(q%2) ? 1. : -1.;
377 double Signy = q > 1 ? 1. : -1.;
378 for(
int vx=0;vx<NBin;vx++){
379 for(
int vy=0;vy<NBin;vy++){
385 fprintf(FileToWrite,
"{x(%lf %lf %lf) v(%lf %lf %lf)}\n",
386 PosX,PosY,Plot[vx][vy]*.001,Plot[vx][vy],0.,0.);
398 double *ChainPArea = (
double *)calloc(3*NTimes,
sizeof(
double));
399 double MeanSigma = 0.;
400 int SubDiv[3] = {NTimes,NTimes,1};
403 if(
OpenRisk(cFile[f],BF_PART))
return 1;
407 for(
int t=0;t<NTimes;t++){
413 double *Plot = (
double *)calloc((
int)
NEdge,
sizeof(double));
417 for(
int p=0;p<
pNPart();p++){
419 if(vx > SubDiv[
CLat1])
continue;
421 if(vy > SubDiv[CLat2])
continue;
422 Plot[vx*SubDiv[
CLat2] + vy] += 1.;
424 for(
int n=0;n<
NEdge;n++){
425 SumX += Plot[n]/Area;
426 SumX2 += QUAD((Plot[n]/Area));
430 double *Intervalli = (
double *)calloc(Valori,
sizeof(
double));
433 ChainPArea[3*t+0] =
NEdge;
435 double Media = SumX/
NEdge;
436 ChainPArea[3*t+1] = sqrt((SumX2 - Media*Media*NEdge)/(NEdge-1));
437 printf(
"%lf %lf-%lf\n",m1.
Uno,ChainPArea[3*t+1],m1.
Due);
438 ChainPArea[3*t+2] = Area*QUAD(m1.
Due)/QUAD(m1.
Uno);
444 char *FileName = (
char *)calloc(60,
sizeof(
char));
445 sprintf(FileName,
"ChainPArea%.0fKappa%.0fRho%.0f.dat",
pchiN(),
pkappaN(),
prho());
446 FILE *FileToWrite = fopen(FileName,
"w");
447 char cSystem[STRSIZE];
449 fprintf(FileToWrite,
"# %s",cSystem);
450 fprintf(FileToWrite,
"#%lf\n",MeanSigma/(
double)(NFile[1]-NFile[0]));
451 fprintf(FileToWrite,
"# NEdge SDeviation Area*Dev/NEdge\n");
452 for(
int t=0;t<NTimes;t++)
453 fprintf(FileToWrite,
"%lf %lf %lf\n",ChainPArea[3*t+0],ChainPArea[3*t+1],ChainPArea[3*t+2]);
460 int NHalf = NSample/2;
461 double InvNFile = 1./(double)(
NFile[1]-
NFile[0]);
462 double InvNSample = 1./(double)NSample;
463 double InvNSample2 = 1./(double)SQR(NSample);
464 double *Plot = (
double *) calloc(SQR(NSample),
sizeof(double));
465 double *PlotUp = (
double *) calloc(SQR(NSample),
sizeof(double));
466 double *PlotDown = (
double *) calloc(SQR(NSample),
sizeof(double));
467 double *CountUp = (
double *) calloc(SQR(NSample),
sizeof(double));
468 double *CountDown = (
double *) calloc(SQR(NSample),
sizeof(double));
469 double *PlotBS = (
double *) calloc(SQR(NSample),
sizeof(double));
470 double *PlotA = (
double *)calloc(SQR(NSample),
sizeof(double));
471 double *PlotAUp = (
double *)calloc(SQR(NSample),
sizeof(double));
472 double *PlotADown = (
double *)calloc(SQR(NSample),
sizeof(double));
473 double *PlotThin = (
double *)calloc(SQR(NSample),
sizeof(double));
474 double *Count = (
double *) calloc(NSample*NSample,
sizeof(
double));
476 fftw_complex *out = (fftw_complex *)fftw_malloc(SQR(NSample)*
sizeof(fftw_complex));
477 fftw_complex *in = (fftw_complex *)fftw_malloc(SQR(NSample)*
sizeof(fftw_complex));
478 fftw_plan plan = fftw_plan_dft_2d(NSample,NSample,
479 in, out,FFTW_FORWARD,FFTW_PATIENT);
480 fftw_complex *outUp = (fftw_complex *)fftw_malloc(SQR(NSample)*
sizeof(fftw_complex));
481 fftw_complex *inUp = (fftw_complex *)fftw_malloc(SQR(NSample)*
sizeof(fftw_complex));
482 fftw_plan planUp = fftw_plan_dft_2d(NSample,NSample,
483 inUp, outUp,FFTW_FORWARD,FFTW_PATIENT);
484 fftw_complex *outDown = (fftw_complex *)fftw_malloc(SQR(NSample)*
sizeof(fftw_complex));
485 fftw_complex *inDown = (fftw_complex *)fftw_malloc(SQR(NSample)*
sizeof(fftw_complex));
486 fftw_plan planDown = fftw_plan_dft_2d(NSample,NSample,
487 inDown, outDown,FFTW_FORWARD,FFTW_PATIENT);
489 fftw_complex *outThin = (fftw_complex *)fftw_malloc(SQR(NSample)*
sizeof(fftw_complex));
490 fftw_complex *inThin = (fftw_complex *)fftw_malloc(SQR(NSample)*
sizeof(fftw_complex));
491 fftw_plan planThin = fftw_plan_dft_2d(NSample,NSample,
492 inThin, outThin,FFTW_FORWARD,FFTW_PATIENT);
499 for(
int s=0;s<SQR(NSample);s++){
507 if(
OpenRisk(cFile[f],BF_CHAIN))
return 0;
508 for(
int p=0;p<
pNPart();p++){
511 if(sx < 0 || sx >= NSample)
continue;
512 if(sy < 0 || sy >= NSample)
continue;
514 Count[sx*NSample+sy] += 1.;
516 if(VAR_IF_TYPE(
Ch[
pChain(p)].Type,CHAIN_UP)){
518 CountUp[sx*NSample+sy] += 1.;
521 PlotDown[sx*NSample+sy] +=
pPos(p,
CNorm);
522 CountDown[sx*NSample+sy] += 1.;
525 double MeanThick = 0.;
526 for(
int s=0;s<SQR(NSample);s++){
527 Plot[s] /= Count[s] > 0. ? Count[s] : 1.;
528 PlotUp[s] /= CountUp[s] > 0. ? CountUp[s] : 1.;
529 PlotDown[s] /= CountDown[s] > 0. ? CountDown[s] : 1.;
530 MeanThick += CountUp[s] - CountDown[s];
532 MeanThick /= (double)SQR(NSample);
537 for(
int s=0;s<SQR(NSample);s++){
540 inThin[s][0] = PlotUp[s]-PlotDown[s];
542 inUp[s][0] = PlotUp[s];
544 inDown[s][0] = PlotDown[s];
548 fftw_execute(planThin);
549 fftw_execute(planUp);
550 fftw_execute(planDown);
551 for(
int sx=0;sx<NSample;sx++){
552 int ssx = sx < NHalf ? sx + NHalf : sx - NHalf;
553 for(
int sy=0;sy<NSample;sy++){
554 int ssy = sy < NHalf ? sy + NHalf : sy - NHalf;
555 PlotA[ssx*NSample+ssy] += (SQR(out[sx*NSample+sy][0])+SQR(out[sx*NSample+sy][1]))*SQR(InvNSample2);
556 PlotThin[ssx*NSample+ssy] += (SQR(outThin[sx*NSample+sy][0])+SQR(outThin[sx*NSample+sy][1]))*SQR(InvNSample2);
557 PlotAUp[ssx*NSample+ssy] += (SQR(outUp[sx*NSample+sy][0])+SQR(outUp[sx*NSample+sy][1]))*SQR(InvNSample2);
558 PlotADown[ssx*NSample+ssy] += (SQR(outDown[sx*NSample+sy][0])+SQR(outDown[sx*NSample+sy][1]))*SQR(InvNSample2);
566 double dNMax = 1./(double)NMax;
567 int NHalf = (int)(NMax/2.);
568 for(
int kx=-NHalf;kx<NHalf;kx++){
569 double qx = kx*dNMax;
570 for(
int ky=-NHalf;ky<NHalf;ky++){
571 double qy = ky*dNMax;
572 double Re2=0.,Im2=0.;
573 double Re1=0.,Im1=0.;
574 for(
int lx=0;lx<NMax;lx++){
575 for(
int ly=0;ly<NMax;ly++){
576 double Arg = 2.*M_PI*(lx*qx + ly*qy);
577 double cy = cos(Arg);
578 double sy = sin(Arg);
579 Re1 += st[lx*NMax+ly]*cy;
580 Im1 += st[lx*NMax+ly]*sy;
583 int kkx = kx + NHalf;
584 int kky = ky + NHalf;
585 sw[kkx*NMax+kky] += SQR(Re1*dNMax) + SQR(Im1*dNMax);
590 FILE *FMidplane = fopen(
"Midplane.dat",
"w");
591 FILE *FThickness = fopen(
"Thickness.dat",
"w");
592 for(
int sx=0;sx<NSample;sx++){
594 for(
int sy=0;sy<NSample;sy++){
596 fprintf(FMidplane,
"%lf %lf %lf \n",x,y, Plot[sx*NSample+sy]);
597 fprintf(FThickness,
"%lf %lf %lf \n",x,y,PlotUp[sx*NSample+sy]-PlotDown[sx*NSample+sy]);
609 MPI_Allreduce(MPI_IN_PLACE,PlotA,NSample*NSample, MPI_DOUBLE, MPI_SUM, Proc->CommGrid);
611 MPI_Comm_rank(Proc->CommGrid, &Rank);
614 char *NomeFile = (
char*)calloc(60,
sizeof(
char));
616 FILE *FileToWrite = fopen(NomeFile,
"w");
618 for(
int sx=0;sx<NSample;sx++){
619 for(
int sy=0;sy<NSample;sy++){
622 fprintf(FileToWrite,
"{x(%lf %lf %lf) v(%lf %lf %lf)}\n",x,y,PlotA[sx*NSample+sy]*InvNFile,fabs(log10(PlotA[sx*NSample+sy]*InvNFile)),0.,0.);
628 FileToWrite = fopen(NomeFile,
"w");
629 fprintf(FileToWrite,
"# 1) q^2 2) h(q)^2*L_xL_y | q_x=s2pi/(L_x) NSample %d\n",NSample);
630 for(
int kx=0;kx<NSample;kx++){
631 int kx1 = kx - NSample/2;
634 for(
int ky=0;ky<NSample;ky++){
635 int ky1 = ky - NSample/2;
638 double qq = SQR(qxt) + SQR(qyt);
643 fprintf(FileToWrite,
"%lf %g %g %g %g\n",qq,Spe,SpeUp,SpeDown,SpeThin);
656 fftw_destroy_plan(plan);
661 int NHalf = NSample/2;
662 double InvNFile = 1./(double)(
NFile[1]-
NFile[0]);
663 double InvNSample = 1./(double)NSample;
664 double *PlotBS = (
double *) calloc(SQR(NSample),
sizeof(double));
665 double *Count = (
double *) calloc(NSample*NSample,
sizeof(
double));
666 double *Plot = (
double *) calloc(SQR(NSample),
sizeof(double));
667 double *PlotA = (
double *) calloc(SQR(NSample),
sizeof(double));
672 for(
int sx=0;sx<NSample;sx++){
673 for(
int sy=0;sy<NSample;sy++){
674 Plot[sx*NSample+sy] = 0.;
678 for(
int p=0;p<
pNPart();p++){
681 if(sx < 0 || sx >= NSample)
continue;
682 if(sy < 0 || sy >= NSample)
continue;
684 Count[sx*NSample+sy] += 1.;
686 for(
int sx=0;sx<NSample;sx++){
687 for(
int sy=0;sy<NSample;sy++){
688 Plot[sx*NSample+sy] /= Count[sx*NSample+sy] > 0. ? Count[sx*NSample+sy] : 1.;
689 PlotA[sx*NSample+sy] += Plot[sx*NSample+sy];
695 sprintf(FName,
"Midplane%05d.dat",f);
696 FILE *FMid = fopen(FName,
"w");
697 for(
int sy=0;sy<NSample;sy++){
698 for(
int sx=0;sx<NSample;sx++){
701 fprintf(FMid,
"%lf %lf %lf\n",x,y,Plot[sx*NSample+sy]);
707 FILE *FMid = fopen(
"average_middplane.dat",
"w");
708 for(
int sy=0;sy<NSample;sy++){
709 for(
int sx=0;sx<NSample;sx++){
712 fprintf(FMid,
"%lf %lf %lf\n",x,y,PlotA[sx*NSample+sy]*InvNFile);
727 int NHalf = NSample/2;
728 double InvNSample = 1./(double)NSample;
729 double *Plot = (
double *) calloc(NSample*NSample,
sizeof(
double));
730 double *Count = (
double *) calloc(NSample*NSample,
sizeof(
double));
731 double *PlotA = (
double *) calloc(NSample*NSample,
sizeof(
double));
732 int NPoint = (int)(NSample*sqrt(2.));
733 double *Density = (
double *) calloc(NPoint,
sizeof(
double));
735 fftw_complex *out = (fftw_complex *)fftw_malloc(SQR(NSample)*
sizeof(fftw_complex));
736 fftw_complex *in = (fftw_complex *)fftw_malloc(SQR(NSample)*
sizeof(fftw_complex));
737 fftw_plan plan1 = fftw_plan_dft_2d(NSample,NSample,
738 in, out,FFTW_FORWARD,FFTW_PATIENT);
741 for(
int sx=0;sx<NSample;sx++){
742 for(
int sy=0;sy<NSample;sy++){
743 Plot[sx*NSample+sy] = 0.;
744 Count[sx*NSample+sy] = 0.;
747 FILE *Ciccia = fopen(cFile[f],
"r");
749 for(
int p=0;!(fgets(cLine,STRSIZE,Ciccia)==NULL);p++){
750 double x = 0., y = 0., z = 0.;
751 sscanf(cLine,
"%lf %lf %lf\n",&x,&y,&z);
754 if(v < 0 || v >= NSample)
continue;
755 if(vv < 0 || vv >= NSample)
continue;
756 Plot[v*NSample+vv] += z;
757 Count[v*NSample+vv] += 1.;
759 for(
int s=0;s<NSample;s++){
760 for(
int ss=0;ss<NSample;ss++){
761 Plot[s*NSample+ss] /= Count[s*NSample+ss] > 0. ? Count[s*NSample+ss] : 1.;
766 for(
int sx=0;sx<NSample;sx++){
767 for(
int sy=0;sy<NSample;sy++){
768 in[sx*NSample+sy][0] = Plot[sx*NSample+sy];
769 in[sx*NSample+sy][1] = 0.;
773 for(
int sx=0;sx<NSample;sx++){
774 int sx1 = sx + NHalf;
775 if(sx1 >= NSample) sx1 -= NSample;
776 for(
int sy=0;sy<NSample;sy++){
777 int sy1 = sy + NHalf;
778 if(sy1 >= NSample) sy1 -= NSample;
779 PlotA[sx*NSample+sy] += (SQR(out[sx*NSample+sy][0])+SQR(out[sx*NSample+sy][1]))*SQR(InvNSample);
788 double dNMax = 1./(double)NMax;
789 int NHalf = (int)(NMax/2.);
790 for(
int kx=-NHalf;kx<NHalf;kx++){
791 double qx = kx*dNMax;
792 for(
int ky=-NHalf;ky<NHalf;ky++){
793 double qy = ky*dNMax;
794 double Re2=0.,Im2=0.;
795 double Re1=0.,Im1=0.;
796 for(
int lx=0;lx<NMax;lx++){
797 for(
int ly=0;ly<NMax;ly++){
798 double Arg = 2.*M_PI*(lx*qx + ly*qy);
799 double cy = cos(Arg);
800 double sy = sin(Arg);
801 Re1 += st[lx*NMax+ly]*cy;
802 Im1 += st[lx*NMax+ly]*sy;
805 int kkx = kx + NMax/2;
806 int kky = ky + NMax/2;
807 sw[kkx*NMax+kky] += SQR(Re1*dNMax) + SQR(Im1*dNMax);
815 MPI_Allreduce(MPI_IN_PLACE,PlotA,NSample*NSample, MPI_DOUBLE, MPI_SUM, Proc->CommGrid);
817 MPI_Comm_rank(Proc->CommGrid, &Rank);
820 char *NomeFile = (
char*)calloc(60,
sizeof(
char));
821 sprintf(NomeFile,
"SpectrumChi%.0fKappa%.0fRho%.0f.xvl",
pchiN(),
pkappaN(),
prho());
822 FILE *FileToWrite = fopen(NomeFile,
"w");
824 double DivInv = 1./(double)(NFile[1]-NFile[0]);
825 for(
int s=0;s<NSample;s++){
826 for(
int ss=0;ss<NSample;ss++){
827 fprintf(FileToWrite,
"%lf %lf %lf\n",
pEdge(
CLat1)*s*InvNSample,
pEdge(
CLat2)*ss*InvNSample,PlotA[s*NSample+ss]*DivInv);
832 sprintf(NomeFile,
"SpectrumChi%.0fKappa%.0fRho%.0f.dat",
pchiN(),
pkappaN(),
prho());
833 FileToWrite = fopen(NomeFile,
"w");
837 for(
int kx=0;kx<NSample;kx++){
838 int kx1 = kx - NSample/2;
839 double qx = kx*InvNSample;
840 double qxt = kx1*InvNSample;
841 for(
int ky=0;ky<NSample;ky++){
842 int ky1 = ky - NSample/2;
843 double qy = ky*InvNSample;
844 double qyt = ky1*InvNSample;
845 double qq = SQR(qx/dx - .5/dx) + SQR(qy/dy - .5/dy);
847 fprintf(FileToWrite,
"%lf %g\n",qq,PlotA[kx*NSample+ky]*DivInv);
864 printf(
"The specified nanoparticle doesn't exist\n");
870 double *Area = (
double *)calloc(NumFile,
sizeof(
double));
871 double *NanoPos = (
double *)calloc(6*NumFile,
sizeof(
double));
872 double *NanoDiff = (
double *)calloc(2*NumFile,
sizeof(
double));
873 double *NanoCount = (
double *)calloc(NumFile,
sizeof(
double));
874 double *NanoDist = (
double *)calloc(2*NumFile,
sizeof(
double));
875 double *Time = (
double *)calloc(NumFile,
sizeof(
double));
879 double InitTime =
pTime();
882 for(
int f=NFile[0];f<NFile[1];f++){
885 if((File2Read = fopen(cFile[f],
"r"))==0){
886 printf(
"The file is missing\n");
894 Time[f] =
pTime() - InitTime;
895 for(
int d=0;d<3;d++) NanoPos[f*6+d] =
Nano[nNano].Pos[d];
896 NanoPos[f*6+3] =
Nano[nNano].
Rad;
899 for(
int ff=f;ff>=0;ff--){
901 NanoDiff[fff*2] += SQR(NanoPos[f*6+0]-NanoPos[ff*6+0]) + SQR(NanoPos[f*6+1]-NanoPos[ff*6+1]);
902 NanoCount[fff] += 1.;
904 NanoDiff[f*2+1] = SQR(NanoPos[f*6+0]-NanoInit[0]) + SQR(NanoPos[f*6+1]-NanoInit[1]);
909 for(
int d=0;d<3;d++){
915 NanoDist[f*2+1] = Dist;
918 AreaAv /= (double)(NFile[1] - NFile[0]);
919 AreaErr = sqrt( AreaErr - (NFile[1] - NFile[0])*SQR(AreaAv))/(double)(NFile[1] - NFile[0]);
921 printf(
"Area %lf \\pm %lf\n",AreaAv,AreaErr);
922 FILE *File2Write = fopen(
"AreaTime.dat",
"w");
923 fprintf(File2Write,
"# Time Area %lf pm %lf\n",AreaAv,AreaErr);
925 sprintf(FName,
"NanoDiffR%.1fS%.1fH%.1f.dat",
Nano[nNano].Rad,
Nano[nNano].Hamaker,
Nano[nNano].Height);
926 FILE *FNano = fopen(FName,
"w");
927 fprintf(FNano,
"# t <msd> msd Dz NpDist rad hei\n");
928 for(
int f=0;f<NumFile;f++){
929 NanoDiff[f*2] /= NanoCount[f] > 0. ? NanoCount[f] : 1.;
930 fprintf(File2Write,
"%lf %lf\n",Time[f],Area[f]);
931 fprintf(FNano,
"%lf %lf %lf %lf %lf %lf %lf\n",Time[f],NanoDiff[f*2 ],NanoDiff[f*2+1],NanoDist[f*2],NanoDist[f*2+1],NanoPos[f*6+3],NanoPos[f*6+4]);
945 FILE *FileLast = fopen(
"LastChain.dat",
"w");
947 fprintf(FileLast,
"%lf %lf %lf %lf %lf %lf %d\n",
pPos(p,0),
pPos(p,1),
pPos(p,2),
pVel(p,0),
pVel(p,1),
pVel(p,2),
pType(p));
956 sprintf(FileName,
"SnapOut%05d.dat",
pNChain()-1);
958 for(
int c=0;c<
pNChain()-1;c++){
960 sprintf(FileName,
"SnapOut%05d.dat",c);
973 for(
int f=0;f<
NFile;f++){
974 for(
int d=0;d<3;d++){
977 for(
int p=p1+1;p<
pNPart();p++){
978 for(
int d=0;d<3;d++){
984 sprintf(FileName,
"SnapIn%05d.dat",f);
993 int NAddPart = NChains*
pNPCh();
994 FILE *FileLast = fopen(
"SnapIn.dat",
"a");
997 for(
int c=0;c<NChains;c++){
999 for(
int d=0;d<3;d++){
1002 for(
int p=1;p<
pNPCh();p++){
1003 for(
int d=0;d<3;d++){
1007 if(p >=
Block[0].Asym){
1012 for(
int p=0;p<NAddPart;p++){
1013 fprintf(FileLast,
"%lf %lf %lf %lf %lf %lf %d\n",Pn[p].Pos[0],Pn[p].Pos[1],Pn[p].Pos[2],Pn[p].Vel[0],Pn[p].Vel[1],Pn[p].Vel[2],Pn[p].Typ);
1021 sprintf(FileName,
"%s%04d.dat",OutFile,f);
1022 FILE *File2Write = fopen(FileName,
"w");
1024 if(
OpenRisk(cFile[f],BF_NO))
return;
1028 double End2End = 0.;
1029 for(
int d=0;d<3;d++){
1030 End2End += SQR(
pPos(p1,d) -
pPos(p2,d));
1032 fprintf(File2Write,
"%lf ",End2End);
1033 fprintf(File2Write,
"\n");
1040 double *Angles = (
double *)calloc((NFile[1]-NFile[0])*
pNChain(),
sizeof(double));
1041 double *Count = (
double *)calloc((NFile[1]-NFile[0]),
sizeof(double));
1042 double *AnglesNano = (
double *)calloc((NFile[1]-NFile[0])*
pNNano(),
sizeof(double));
1043 double *Time = (
double *)calloc((NFile[1]-NFile[0]),
sizeof(double));
1044 double *AngleDiff = (
double *)calloc(
pNChain(),
sizeof(double));
1045 double *AngleDiff2 = (
double *)calloc(
pNChain(),
sizeof(double));
1048 double InvPhob =
Block[0].
Asym > 0 ? 1./(double)
Block[0].Asym : 1.;
1053 double Average = 0.;
1054 double Variance = 0.;
1055 double InitTime =
pTime();
1056 for(
int f=NFile[0];f<NFile[1];f++){
1058 int ff = f - NFile[0];
1059 if(
OpenRisk(cFile[f],BF_CHAIN))return ;
1060 Time[f] =
pTime() - InitTime;
1061 for(
int n=0;n<
pNNano();n++){
1062 for(
int d=0;d<3;d++){
1063 NanoAx.
Set(
Nano[n].Axis[d],d);
1068 for(
int c=0,b=0;c<
pNChain();c++){
1070 ChDir.
Set(
Ch[c].Dir[0],0);
1071 ChDir.
Set(
Ch[c].Dir[1],1);
1073 if(isnan(Angle)) Angles[ff*
pNChain()+c] = Angles[(ff-1)*
pNChain()+c];
1079 Average += Angles[ff*
pNChain()+c];
1080 Variance += SQR(Angles[ff*
pNChain()+c]);
1084 double NTot = (double)(
pNChain()*(NFile[1]-NFile[0]));
1085 Average /= NTot > 0. ? NTot : 1.;
1086 double PreVar = Variance;
1087 Variance = (Variance - SQR(Average)*NTot)/(NTot-1);
1088 if(isnan(Variance)){
1089 printf(
"Variance is not a number %lf %lf %lf\n",PreVar,Average,NTot);
1094 AngleDiff2[f] += (Angles[f*
pNChain()+c]-Average)*(Angles[0*
pNChain()+c]-Average);
1096 for(
int ff = f+1; ff<
NFileTot;ff++){
1099 AngleDiff[fff] += (Angles[ff*
pNChain()+c]-Average)*(Angles[f*
pNChain()+c]-Average);
1106 sprintf(FileName,
"DirDecoupling.dat");
1108 sprintf(FileName,
"E2EDecoupling.dat");
1109 FILE *FileToWrite = fopen(FileName,
"w");
1110 char cSystem[STRSIZE];
1113 fprintf(FileToWrite,
"#Time AngleProd\n");
1115 double Inv = Count[f] > 0. ? Count[f] : 1.;
1116 fprintf(FileToWrite,
"%lf %lf %lf\n",Time[f],AngleDiff[f]/(Inv*Variance),AngleDiff2[f]/(Variance*
pNChain()) );
1118 fclose(FileToWrite);
1119 for(
int n=0;n<
pNNano();n++){
1120 sprintf(FileName,
"NanoAngles%d.dat",n);
1121 FILE *FNanoAng = fopen(FileName,
"w");
1123 fprintf(FNanoAng,
"%lf %lf \n",Time[f],AnglesNano[f*
pNNano()+n]*360./DUE_PI);
1147 int SubDiv[3] = {NSample,NSample,1};
1150 double *ChainPArea = (
double *)calloc(3*NSample,
sizeof(
double));
1151 double *Plot = (
double *)calloc(NEdge,
sizeof(
double));
1152 double *Area = (
double *)calloc(NSample,
sizeof(
double));
1153 double *NDiv = (
double *)calloc(NSample,
sizeof(
double));
1157 double InvEdge[3] = {1./Edge[0],1./Edge[1],1./Edge[2]};
1161 for(
int t=0;t<NSample;t++){
1162 SubDiv[
CLat1] = NSample-t;
1163 SubDiv[
CLat2] = NSample-t;
1164 if(t == NSample -1) SubDiv[
CLat2] = 2;
1167 for(
int n=0;n<
NEdge;n++) Plot[n] = 0.;
1171 int vx = (int)(Posx*InvEdge[
CLat1]*SubDiv[
CLat1]);
1172 int vy = (int)(Posy*InvEdge[
CLat2]*SubDiv[
CLat2]);
1173 if(vx < 0 || vx >= SubDiv[CLat1])
continue;
1174 if(vy < 0 || vy >= SubDiv[CLat2])
continue;
1175 Plot[vx*NSample+vy] += 1.;
1180 for(
int sx = 0;sx<SubDiv[
CLat1];sx++){
1181 for(
int sy = 0;sy<SubDiv[
CLat2];sy++){
1182 int n = sx*NSample+sy;
1188 double NInv = Count > 0. ? 1./Count : 1.;
1189 double MeanVal = SumX*NInv;
1190 for(
int sx = 0;sx < SubDiv[
CLat1];sx++){
1191 for(
int sy = 0;sy < SubDiv[
CLat2];sy++){
1192 int n = sx*NSample+sy;
1193 SumX2 += SQR(Plot[n] - MeanVal);
1196 ChainPArea[3*t ] += MeanVal;
1197 ChainPArea[3*t+1] += SumX2/(Count - 1.);
1198 ChainPArea[3*t+2] += 1.;
1200 sprintf(FileName,
"Distr%.0fKappa%02d.dat",
pkappaN(),t);
1201 FILE *FileToWrite = fopen(FileName,
"a");
1202 for(
int l1=0;l1<SubDiv[
CLat1];l1++){
1203 for(
int l2=0;l2<SubDiv[
CLat2];l2++){
1204 fprintf(FileToWrite,
"%lf\n",Plot[l1*NSample+l2]);
1207 fclose(FileToWrite);
1212 MPI_Allreduce(MPI_IN_PLACE,ChainPArea,3*NSample, MPI_DOUBLE, MPI_SUM, Proc->CommGrid);
1214 MPI_Comm_rank(Proc->CommGrid, &Rank);
1220 double Norm = 1./(double)(NFile[1]-NFile[0]);
1221 for(
int t=0;t<NSample;t++){
1222 ChainPArea[3*t ] *= Norm;
1223 ChainPArea[3*t+1] *= Norm;
1224 ChainPArea[3*t+2] *= Norm;
1226 sprintf(FileName,
"ChainPArea%.0fRho%.0fChiN%.0fKappa.dat",
prho(),
pchiN(),
pkappaN());
1227 FILE *FileToWrite = fopen(FileName,
"w");
1228 char cSystem[STRSIZE];
1230 fprintf(FileToWrite,
"# %s",cSystem);
1231 fprintf(FileToWrite,
"# Area MeanChPArea SDeviation Area*Dev/MeanChPArea\n");
1232 for(
int t=0;t<NSample;t++){
1233 double Compr = Area[t]*ChainPArea[3*t+1]/SQR(ChainPArea[3*t ]);
1234 fprintf(FileToWrite,
"%lf %lf %lf %lf\n",Area[t],(ChainPArea[3*t ]),ChainPArea[3*t+1],Compr);
1237 fclose(FileToWrite);
1250 int SubDiv[3] = {NSample,NSample,1};
1252 double *ElCoup = (
double *)calloc(3*(NSample+1),
sizeof(double));
1253 double *Area = (
double *)calloc((NSample+1),
sizeof(double));
1254 double *NDiv = (
double *)calloc((NSample+1),
sizeof(double));
1255 double MeanSigma = 0.;
1258 double InvEdge[3] = {1./Edge[0],1./Edge[1],1./Edge[2]};
1259 double *PosUp = (
double *)calloc(SQR(NSample),
sizeof(double));
1260 double *PosDown = (
double *)calloc(SQR(NSample),
sizeof(double));
1261 double *CountUp = (
double *)calloc(SQR(NSample),
sizeof(double));
1262 double *CountDown= (
double *)calloc(SQR(NSample),
sizeof(double));
1266 for(
int t=0;t<NSample+1;t++){
1270 SubDiv[
CLat1] = NSample - t;
1271 SubDiv[
CLat2] = NSample - t;
1272 if(t == NSample-1) SubDiv[
CLat2] = 2;
1279 for(
int n=0;n<SQR(NSample);n++){
1285 for(
int p=0;p<
pNPart();p++){
1286 if(
pType(p) != 1)
continue;
1289 int sx = (int)(x*InvEdge[
CLat1]*SubDiv[
CLat1]);
1290 if(sx < 0 || sx >= SubDiv[CLat1])
continue;
1291 int sy = (int)(y*InvEdge[CLat2]*SubDiv[CLat2]);
1292 if(sy < 0 || sy >= SubDiv[CLat2])
continue;
1295 CountUp[sx*NSample+sy] += 1.;
1298 PosDown[sx*NSample+sy] +=
pPos(p,
CNorm);
1299 CountDown[sx*NSample+sy] += 1.;
1305 for(
int sx = 0;sx<SubDiv[
CLat1];sx++){
1306 for(
int sy = 0;sy<SubDiv[
CLat2];sy++){
1307 int n = sx*NSample+sy;
1308 PosUp[n] /= CountUp[n] > 1. ? CountUp[n] : 1.;
1309 PosDown[n] /= CountDown[n] > 1. ? CountDown[n] : 1.;
1310 double Val = (PosUp[n]-PosDown[n]);
1313 ElCoup[3*t+2] += 1.;
1316 double NInv = Count > 0. ? 1./Count : 1.;
1317 double MeanVal = SumX*NInv;
1318 for(
int sx = 0;sx < SubDiv[
CLat1];sx++){
1319 for(
int sy = 0;sy < SubDiv[
CLat2];sy++){
1320 int n = sx*NSample+sy;
1321 double Val = (PosUp[n]-PosDown[n]);
1322 SumX2 += SQR(Val - MeanVal);
1325 ElCoup[3*t ] += MeanVal;
1326 ElCoup[3*t+1] += SumX2/(Count - 1.);
1328 sprintf(FileName,
"Distr%.0fKappa%02d.dat",
pkappaN(),t);
1329 FILE *FileToWrite = fopen(FileName,
"a");
1330 for(
int l1=0;l1<SubDiv[
CLat1];l1++){
1331 for(
int l2=0;l2<SubDiv[
CLat2];l2++){
1332 int n = l1*NSample+l2;
1333 fprintf(FileToWrite,
"%lf\n",(PosUp[n]-PosDown[n]));
1336 fclose(FileToWrite);
1341 MPI_Allreduce(MPI_IN_PLACE,ElCoup,3*NSample, MPI_DOUBLE, MPI_SUM, Proc->CommGrid);
1343 MPI_Comm_rank(Proc->CommGrid, &Rank);
1348 double Norm = 1./(double)(NFile[1]-NFile[0]);
1349 for(
int t=0;t<NSample+1;t++){
1350 ElCoup[3*t ] *= Norm;
1351 ElCoup[3*t+1] *= Norm;
1352 ElCoup[3*t+2] *= Norm;
1354 ElCoup[3*NSample+1] = 0.;
1355 sprintf(FileName,
"ElasticCoupling%.0fRho%.0fChiN%.0fKappa.dat",
prho(),
pchiN(),
pkappaN());
1356 FILE *FileToWrite = fopen(FileName,
"w");
1357 char cSystem[STRSIZE];
1359 fprintf(FileToWrite,
"# %s",cSystem);
1360 fprintf(FileToWrite,
"# Area Thickness ThickStdDev Area*ThickStdDev\n");
1361 for(
int t=0;t<NSample+1;t++){
1362 fprintf(FileToWrite,
"%lf %lf %lf %lf \n",Area[t],ElCoup[3*t ],ElCoup[3*t+1],Area[t]*ElCoup[3*t+1]/SQR(ElCoup[3*t ]));
1364 fclose(FileToWrite);
1379 double ElCoup[3] = {0.,0.,0.};
1381 char cSystem[STRSIZE];
1383 sprintf(FileName,
"ElCoupNVT%.0fRho%.0fChiN%.0fKappa.dat",
prho(),
pchiN(),
pkappaN());
1384 FILE *FileToWrite = fopen(FileName,
"w");
1386 fprintf(FileToWrite,
"# %s",cSystem);
1387 fprintf(FileToWrite,
"# step Thickness ThickStdDev\n");
1392 double PosDown = 0.;
1393 double CountUp = 0.;
1394 double CountDown = 0.;
1395 for(
int p=0;p<
pNPart();p++){
1396 if(
pType(p) != 1)
continue;
1397 if(VAR_IF_TYPE(
Ch[
pChain(p)].Type,CHAIN_UP)){
1406 PosUp /= CountUp > 1. ? CountUp : 1.;
1407 PosDown /= CountDown > 1. ? CountDown : 1.;
1408 ElCoup[0] += (PosUp-PosDown);
1409 ElCoup[1] += SQR(PosUp-PosDown);
1410 fprintf(FileToWrite,
"%d %lf\n",f,PosUp-PosDown);
1413 ElCoup[1] = sqrt((ElCoup[1] - SQR(ElCoup[0])*(NFile[1]-NFile[1]))/((
double)(NFile[0]-NFile[1])-1.));
1415 fclose(FileToWrite);
1418 FILE *File2Write = fopen(OutFile,
"w");
1423 if(
OpenRisk(cFile[f],BF_CHAIN))
return;
1424 double *PosLay = (
double *)calloc(4*NSample*NSample,
sizeof(
double));
1425 double *CountLay = (
double *)calloc(4*NSample*NSample,
sizeof(
double));
1428 if(!strcmp(
Block[b].Name,
"LIPID1")) Level = 2;
1430 for(
int d=0;d<3;d++){
1434 if(CHAIN_IF_TYPE(
Ch[c].Type,CHAIN_UP)) cLevel += 1;
1437 if(sx < 0 || sx >= NSample)
continue;
1438 if(sy < 0 || sy >= NSample)
continue;
1439 PosLay[(sx*NSample+sy)*4+cLevel] +=
Ch[c].Pos[
CNorm];
1440 CountLay[(sx*NSample+sy)*4+cLevel] += 1.;
1443 for(
int sx = 0;sx < NSample;sx++){
1444 for(
int sy = 0;sy < NSample;sy++){
1445 for(
int l=0;l<4;l++){
1446 PosLay[(sx*NSample+sy)*4+l] /= CountLay[(sx*NSample+sy)*4+l] > 0. ? CountLay[(sx*NSample+sy)*4+l] : 1.;
1448 double h1 = PosLay[(sx*NSample+sy)*4+2]-PosLay[(sx*NSample+sy)*4+1];
1449 double h2 = PosLay[(sx*NSample+sy)*4+3]-PosLay[(sx*NSample+sy)*4+0];
1452 fprintf(File2Write,
"%lf %lf %lf %lf %lf\n",MIN(h1,h2),PosLay[(sx*NSample+sy)*4+0],PosLay[(sx*NSample+sy)*4+1],PosLay[(sx*NSample+sy)*4+2],PosLay[(sx*NSample+sy)*4+3]);
1462 FILE *File2Write = fopen(OutFile,
"w");
1471 if(
OpenRisk(cFile[f],BF_NO))
return;
1474 for(
int p=0;p<
pNPCh()-1;p++){
1475 int p1 = p + c*
pNPCh();
1476 for(
int d=0;d<3;d++){
1479 fprintf(File2Write,
"%lf %lf %lf %lf\n",Dist[0],Dist[1],Dist[2],sqrt(SQR(Dist[0])+SQR(Dist[1])+SQR(Dist[2])));
1505 double *EndToEnd = (
double *) calloc(
pNPart()*(
NFile[1]-
NFile[0]),
sizeof(
double));
1506 double *Distr = (
double *) calloc((
NFile[1]-
NFile[0]),
sizeof(double));
1509 if(
OpenRisk(cFile[f],BF_NO))
return;
CHAIN * Ch
Information on all chains.
void SpectrumMidplane(int NBin)
Calculates the 1d, 2d spectrum spe.
double pTime()
Total time.
int Diffusivity()
Diffusivity coefficient of the chains diff.
void SysDef(char *cSystem)
Print a string with the system definitions.
int Type
Type of the chain (see list CHAIN_)
bool OpenRisk(char *InFile, int BF)
Opens a file without reallocationg.
double prho()
Density coexistence.
double pVel(int p, int d)
Return the velocity.
double pChPos(int p, int d)
Return back folded position.
BLOCK * Block
Information for every block.
void Midplane(int NBin)
Midplanes for a sequence of snapshots.
int NFileTot
Total number of file.
NANO * Nano
Extra particle.
int PairCorrelationPep(double **Point, int NSample, int Type)
2-d pair correlation on a square fererring to the pep position
void BilayerDistance(char *OutFile, int NBin)
Measure the elastic coupling between the two sheets.
int SetNChain(int NewNCh)
Set and reallocate the number of chains.
int pChain(int p)
Return the chain.
bool Write(char *OutFile)
Writes a "system-file" or a "x y z" file".
Geometrical operations on vectors.
int Asym
Diblock limit of the chain.
void SetPos(int p, double *Pos)
Set the particle position.
int BfDefChain()
Definition of the chain.
double pInvEdge(int d)
Inverted xyzr edges of the simulation box.
int Scattering2d(double **Point, int NSample, int Type)
2-d Scattering
double Height
Height of the cylinder.
int NChType
Type of chain selected.
int pType(int p)
Return the type.
double pCm(int d)
Center of mass of the system.
int CLat2
lateral coordinate
void Decoupling(int What)
Decoupling of the direction/end to end distance of the chains.
int ScatteringF(int NBin, int How)
2d Scattering scatt scatt2
void EndToEndDist()
Distribution of the end to end distances.
double Pos[3]
xyz Position of the particle
void AreaCompr(int NSample)
Calculates the number of chain per area area.
MOMENTI Distribuzione(const double *st, int NMass)
Moments of a signal.
void PairCorr(int NBin, int NDim)
1d pair correlation
double Area
Area of a pore or a stalk.
void HeaderAverage(int nNano)
Read the header and average the information.
int Angle(int NBin)
Calculation of the contact angle angle Boh?
void ReadHeader(FILE *FileToRead)
Reads a header.
void WidomIn()
Create a set of files with a chain more.
double pNanoPos(int n, int d)
Return back folded nano position.
int SetNPart(int NewNPart)
Set and reallocate the number of particles.
double pEdge(int d)
xyzr edges of the simulation box
void BondDistr(int NSample)
Distribution of the bond lengths.
int pNPCh()
Number of particle per chain.
Moments of a distribution.
double TwoPartDist(int p1, int p2, double *RelDist)
Return the relative distance between two particles (wrapped)
int NChainPSquareF()
Calculates the number of chain per area area.
int pNBlock()
Number of blocks.
double pchiN()
Incompatibility.
bool WriteXvt(char *OutFile)
Writes a "system-file" or a "x y z" file".
int SpectrumF(int NBin)
Calculates the 1d, 2d spectrum spe.
int NEdge
Number of particles per edge.
double Casuale()
Random uniform number.
void SetType(int p, int t)
Set the particle type.
void ElasticCouplingNVT()
Measure the elastic coupling between the two sheets.
void DiffSlab(int NSlab)
Diffusivity of particles starting from an initial slab.
void WidomOut()
Create NCh systems with a chain less.
int pNNano()
Number of nanoparticles.
int NBackFold
Type of backfold.
void SwapChain(int c1, int c2, int b)
Swap two chains.
void Spettro2d(double *st, double *sw, int NMass)
Compute the 2d spectrum of.
double Pos[4]
xyzr Postion of the chain
int PairCorrelation(double *Point, int NSample, int How, int Type)
1-d pair correlation
void End2EndDistr(char *OutFile)
Write the end to end distance of the chains.
int PairCorrelationF(int NBin, int How)
1d, 2d pair correlation of the chains pairRound pairSquare (obsolete)
double Gaussiano(double Media, double Scarto)
Gaussian random number.
char * ChooseDraw(int ExtWhat2Draw)
Convert the internal definition for the menu of ElPoly in string.
double pReOverCutOff()
Re/CutOff.
Matematica * Mat
Implementation of all usefull algorythms.
void ElasticCoupling(int NSample)
Measure the elastic coupling between the two sheets.
double pPos(int p, int d)
Return back folded position.
int pNChain()
Number of chain.
int NFile[2]
First and last file of the list.
double Angle(Vettore *u, Vettore *v)
Computes the angle between two Vetttore.
int CLat1
lateral coordinate
Information of every particle.
int PairCorrelationSquare(double **Point, int NSample, int Type)
2-d pair correlation on a square
Domain decomposition as pointer to linked particles.
PART * Pm
Particle information of all particle.
void Set(double Val, int Col)
Set the N column.
int PairCorrelationRound(double **Point, int NSample, int Type)
Circular 2-d pair correlation.
void Processing(int f)
Information on the current file elaborated.
void SetEdge(double Val, int d)
Set Edge.
double pkappaN()
Incompressibility.
int CNorm
Normal coordinate.
int pNPart()
Number of particle.