18 #include "../include/VarData.h" 28 double ChainPArea = 1./(0.01974*QUAD(ReOSigma));
29 double Thickness = 0.849*ReOSigma;
42 sigma = 1./sqrt(
pkSpr());
45 for(
int s=0;s<
NSoft;s++){
49 Thickness = 0.93*ReOSigma;
52 else if (Gen->
NPCh == 11){
57 else if (Gen->
NPCh == 12){
62 else if (Gen->
NPCh == 13){
67 else if (Gen->
NPCh == 10){
69 Thickness = 0.8*ReOSigma;
72 else if (Gen->
NPCh == 14){
74 Thickness = 0.5*ReOSigma;
77 else if (Gen->
NPCh==21||Gen->
NPCh==20){
79 Thickness = 0.6*ReOSigma;
82 else if (Gen->
NPCh == 32){
86 if(VAR_IF_TYPE(
SysType,VAR_TWOTAILS)){
87 if (Gen->
NPCh == 21 ||Gen->
NPCh == 20 ){
89 Thickness = 0.6*ReOSigma;
97 arch = (
int *)calloc(Gen->
NPCh,
sizeof(
int));
101 for(
int b=
Block[0].Asym;b<Gen->
NPCh;b++){
106 if(VAR_IF_TYPE(
Soft[s].Topology,VAR_PLANAR)){
109 else if(VAR_IF_TYPE(
Soft[s].Topology,VAR_COATING)){
113 Area = .3*2.*DUE_PI*SQR(
Nano->
Rad+Thickness);
114 if (Gen->
NPCh == 32){
116 Area = .1*2.*DUE_PI*SQR(
Nano->
Rad+Thickness);
120 else if(VAR_IF_TYPE(
Soft[s].Topology,VAR_TUBE)){
121 Area = DUE_PI*(
Soft[s].
Size[0]+Thickness)*
Soft[s].Size[1];
123 else if(VAR_IF_TYPE(
Soft[s].Topology,VAR_VESICLE)){
126 Area = DUE_PI*SQR(
Soft[s].Size[0]+.5*Thickness);
127 Area += DUE_PI*SQR(
Soft[s].Size[0]-.5*Thickness);
130 for(
int n=0;n<Gen->NNano;n++){
131 if(
Nano[n].Shape == SHAPE_NONE)
continue;
132 if(
Nano[n].Shape == SHAPE_WALL)
continue;
133 Area -= PI*SQR(
Nano[n].Rad);
137 Volume -= 4.*PI*CUB((
Nano->
Rad))/3.;
145 if(VAR_IF_TYPE(
Soft[s].Topology,VAR_DISTRIBUTED)){
147 NChain = (int)( Volume*
Soft[s].Size[2]/Gen->
NPCh);
149 else if(VAR_IF_TYPE(
Soft[s].Topology,VAR_PLANAR)){
150 NChain = (int)(Area*ChainPArea);
152 else if(VAR_IF_TYPE(
Soft[s].Topology,VAR_OBSTACLE)){
154 NChain = (int)(Area*ChainPArea*
Soft[s].Size[2]);
157 else if(VAR_IF_TYPE(
Soft[s].Topology,VAR_COATING)){
158 NChain = (int)( .53*Area*ChainPArea);
160 else if(VAR_IF_TYPE(
Soft[s].Topology,VAR_TUBE)){
161 NChain = (int)( .69*Area*ChainPArea);
163 else if(VAR_IF_TYPE(
Soft[s].Topology,VAR_VESICLE)){
166 NChain = (int)(Area*ChainPArea);
171 if(VAR_IF_TYPE(
Soft[s].Topology,VAR_PLANAR_PE)){
174 if(VAR_IF_TYPE(
Soft[s].Topology,VAR_OBSTACLE))
181 Gen->
NBlock = NSoft+AddNSoft;
183 for(
int n=0;n<Gen->NNano;n++){
184 if(
Nano[n].Shape == SHAPE_CLUSTER){
192 for(
int s=0;s<
NSoft;s++)
193 if( VAR_IF_TYPE(
Soft[s].Topology,VAR_PLANAR) )
201 for(
int s=1;s<
NSoft;s++){
204 for(
int s=0,s1=0;s<
NSoft;s++,s1++){
211 sprintf(
Block[s1].Name,
"LIPID%d",s);
212 if(VAR_IF_TYPE(
SysType,VAR_TWOTAILS))
213 sprintf(
Block[s1].Name,
"TT%d",s);
214 if(VAR_IF_TYPE(
Soft[s].Topology,VAR_VESICLE)){
215 int NLayerIn = (int)(
Soft[s].NChain*SQR(
Soft[s].Size[0])/(SQR(
Soft[s].Size[0])+SQR(
Soft[s].Size[0]+Thickness)));
223 sprintf(
Block[s1].Name,
"INNER%d",s);
224 sprintf(
Block[s1+1].Name,
"OUTER%d",s);
228 for(
int n=0,b=NSoft+AddNSoft;n<Gen->NNano;n++){
229 if(
Nano[n].Shape == SHAPE_CLUSTER){
235 sprintf(
Block[b].Name,
"PEP%d",n);
243 if(
Pm == NULL){printf(
"Non s'alloca\n");
return 1;}
244 for(
int p=0;p<Gen->
NPart;p++){
245 Ln[p].
Link = (
int *)calloc(Gen->
NLink,
sizeof(
int));
246 if(
Ln[p].Link == NULL){printf(
"Non s'alloca\n");
return 1;}
249 printf(
"%s\n",cSystem);
251 printf(
"%s",cSystem);
253 printf(
"%s",cSystem);
257 for(
int s=0,b=0;s<
NSoft;s++,b++){
259 if(VAR_IF_TYPE(
Soft[s].Topology,VAR_VESICLE))
263 for(
int n=0;n<Gen->NNano;n++){
264 if(
Nano[n].Shape == SHAPE_CLINKS){
267 if(
Nano[n].Shape != SHAPE_CLUSTER)
continue;
268 sprintf(ArchFile,
"Architecture%d.dat",n);
281 for(
int s=0;s<
NSoft;s++){
282 if( VAR_IF_TYPE(
Soft[s].Topology,VAR_PLANAR) ){
289 if( VAR_IF_TYPE(
Soft[s].Topology,VAR_COATING) )
291 else if( VAR_IF_TYPE(
Soft[s].Topology,VAR_VESICLE) )
293 else if( VAR_IF_TYPE(
Soft[s].Topology,VAR_TUBE) )
295 else if( VAR_IF_TYPE(
Soft[s].Topology,VAR_PLANAR) )
297 else if( VAR_IF_TYPE(
Soft[s].Topology,VAR_PLANAR_PE) )
299 else if( VAR_IF_TYPE(
Soft[s].Topology,VAR_OBSTACLE) )
301 else if( VAR_IF_TYPE(
Soft[s].Topology,VAR_DISTRIBUTED) ){
302 double sigma = 1./sqrt(
pkSpr());
308 for(
int i=1;i<Gen->
NPCh;i++){
320 printf(
"System topology not recognized\n");
324 printf(
"Efficency: %d Tries for %d Particle\n",Tries,
Soft[s].NPart);
329 double dValues = 1./(double)(Values);
330 double **Plot = (
double **)calloc(Values,
sizeof(
double));
331 Gen->
NPart = Values*Values;
334 for(
int d=0;d<3;d++){
335 Gen->
Edge[d] = (double)Values;
339 for(
int i=0;i<Values;i++){
340 Plot[i] = (
double *)malloc(Values*
sizeof(
double));
341 for(
int j=0;j<Values;j++){
345 Gen->
Edge[
CNorm]*.5 + cos(DUE_PI*(i)*dValues) + cos(DUE_PI*(i)*dValues*2.) + cos(DUE_PI*(i)*dValues*4.) +
346 cos(DUE_PI*(j)*dValues) + cos(DUE_PI*(j)*dValues*2.) + cos(DUE_PI*(j)*dValues*4.);
352 double sigma = 1./sqrt(
pkSpr());
355 for(
int d=0;d <3;d++){
358 if(i ==
Soft[s].NPCh-1){
371 if( VAR_IF_TYPE(
Soft[s].Topology,VAR_ADDED) )
383 if( j <=
Block[0].Asym){
385 for(
int d=0;d <3;d++){
388 if( VAR_IF_TYPE(
SysType,VAR_TWOTAILS) ){
390 for(
int d=0;d <3;d++)
395 else if(j>
Block[0].Asym){
397 for(
int d=0;d <3;d++){
405 int HalfLim = (int)(
Block[0].Asym*.5);
406 double Dz = Thickness/16.;
407 double Leaflet = -.5*Thickness - 2.*Dz;
419 if( (pn < 2) || (pn >=
Soft[s].NPCh - 2)){
427 int HalfLim = (int)(
Block[0].Asym*.5);
429 printf(
"%d %d %d %lf \r",p,c,Tries,p/(
double)
Soft[s].NPart);
430 double Leaflet = -.5*Thickness;
431 if(c >=
Soft[s].NChain/2) Leaflet = .5*Thickness;
440 int i =
PutPart(j,p,HalfLim,sigma);
450 else if (arch[i] == 1 ){
468 int NLayerIn = (int)(
Soft[s].NChain*SQR(
Soft[s].Size[0])/(SQR(
Soft[s].Size[0])+SQR(
Soft[s].Size[0]+Thickness)) );
470 int HalfLim = (int)(
Block[0].Asym*.5);
471 double inc = M_PI * (3. - sqrt(5.));
472 double NInv = 1. / (double)NLayerIn;
473 double Leaflet = -.5*Thickness;
475 printf(
"%d %d %d %lf \r",p,c,Tries,p/(
double)
Soft[s].NPart);
478 NInv = 1./(double)NLayerOut;
479 Leaflet = .5*Thickness;
481 double x = cc*2.*NInv - 1. + (NInv);
482 double r = sqrt(1.-x*x);
484 double y = cos(phi)*r;
485 double z = sin(phi)*r;
495 for(
int j=1;j<Gen->
NPCh;j++){
496 int i =
PutPart(j,p,HalfLim,sigma);
500 if( Dist < SQR(
Soft[s].Size[0]-.5*Thickness) || Dist > SQR(
Soft[s].Size[0]+.5*Thickness) ) {
506 else if(arch[i] == 1){
507 if(Dist < SQR(
Soft[s].Size[0]+.5*Thickness) && Dist > SQR(
Soft[s].Size[0] - .5*Thickness) ){
527 int HalfLim = (int)(
Block[0].Asym*.5);
528 double NInv = 1./(double)
Soft[s].NChain;
529 double inc = 3.141592654 * (3. - sqrt(5.));
532 printf(
"%d %d %d %lf \r",p,c,Tries,p/(
double)
Soft[s].NPart);
543 else if(VAR_IF_TYPE(
Nano->
Shape,SHAPE_SPH)){
544 double x = c*2.*NInv - 1. + (NInv);
545 double r = sqrt(1.-x*x);
546 double y = cos(c*inc)*r;
547 double z = sin(c*inc)*r;
557 for(
int j=1;j<Gen->
NPCh;j++){
558 int i =
PutPart(j,p,HalfLim,sigma);
562 else if(VAR_IF_TYPE(
Nano->
Shape,SHAPE_SPH))
564 if(arch[i] == 0 && Dist > SQR(
Nano->
Rad+.5*Thickness) ){
569 else if(arch[i] == 1 && Dist < SQR(
Nano->
Rad+.5*Thickness) ){
584 int HalfLim = (int)(
Block[0].Asym*.5);
585 int NLayerIn = (int)(
Soft[s].NChain/2.*SQR(
Soft[s].Size[0])/(SQR(
Soft[s].Size[0])+SQR(
Soft[s].Size[0]+Thickness)) );
587 printf(
"%d %d %d %lf \r",p,c,Tries,p/(
double)
Soft[s].NPart);
588 double Leaflet = -.5*Thickness;
589 if(c >= NLayerIn) Leaflet = .5*Thickness;
601 for(
int j=1;j<Gen->
NPCh;j++){
602 int i =
PutPart(j,p,HalfLim,sigma);
606 if( Dist < SQR(
Soft[s].Size[0]-.5*Thickness) || Dist > SQR(
Soft[s].Size[0]+.5*Thickness) ) {
611 else if(arch[i] == 1)
612 if(Dist > SQR(
Soft[s].Size[0]-.5*Thickness) || Dist < SQR(
Soft[s].Size[0] + .5*Thickness) ){
626 for(
int n=0;n<
pNNano();n++){
630 if(VAR_IF_TYPE(
Nano[n].Shape,SHAPE_BOUND)) Add = .3;
631 if(VAR_IF_TYPE(
Nano[n].Shape,SHAPE_NONE))
continue;
649 if(Radius2 < QUAD(
Nano[n].Rad+Add)){
658 int NPart = NCircle*NHeight;
660 double CirInv = 1./(double)NCircle;
661 double HeiInv =
Nano[nNano].
Height/(double)NHeight;
662 for(
int c=0;c<NCircle;c++){
663 double Sin = sin(c*CirInv*DUE_PI);
664 double Cos = cos(c*CirInv*DUE_PI);
667 for(
int h=0;h<NHeight;h++){
668 int p = c*NHeight + h;
675 FILE *ReSave = fopen(filename,
"a");
676 fprintf(ReSave,
"# n=1 N=%d name=PEP1\n",NPart);
677 for(
int p=0;p<NPart;p++)
678 fprintf(ReSave,
"%lf %lf %lf %lf %lf %lf %d\n",
679 Pn[p].Pos[0],Pn[p].Pos[1],Pn[p].Pos[2],
686 int NCyl = NCircle*NHeight;
687 int NSph = (NCircle)*(NCircle/2-1) + 2;
689 int IfDoubleSided = 0;
691 double AsymPhil = -.1*
Nano[nNano].
Rad;
692 double CirInv = 1./(double)NCircle;
693 double HeiInv =
Nano[nNano].
Height/(double)(NHeight-1);
695 if(
Nano[nNano].NHeight == 0 ) HeiSph + HeiInv;
697 double Shift = .5*sin(1*CirInv*DUE_PI);
699 double SegCirc = DUE_PI*
Nano[nNano].
Rad/(double)
Nano[nNano].NCircle;
702 for(
int c=0;c<NCircle;c++){
703 for(
int h=0;h<NHeight;h++){
705 int p = c*NHeight + h;
707 double Sin = sin(c*CirInv*DUE_PI);
708 double Cos = cos(c*CirInv*DUE_PI);
713 Axes[0] += .25*
Nano->
Height*(fabs((
double)(h-NHeight/2))/(double)(NHeight));
718 Sin = sin((c+.5)*CirInv*DUE_PI);
719 Cos = cos((c+.5)*CirInv*DUE_PI);
723 Pm[p+np].
Pos[0] = Rad * Cos + Axes[0];
724 Pm[p+np].
Pos[1] = Rad * Sin + Axes[1];
725 Pm[p+np].
Pos[2] = h*HeiInv*Weight - .5*
Nano[nNano].
Height*Weight + Axes[2];
728 if(
Pm[p+np].Pos[0] < (
Nano[nNano].Pos[0] + AsymPhil))
731 if(h < 2 || h > NHeight - 3)
Pm[p+np].
Typ = 1;
735 int pp = (c+1)*NHeight + h;
736 if( pp >= NCyl ) pp -= NCyl;
737 Ln[p+np].
Link[NLink++] = pp + np;
739 if( (pp%NHeight)!=0 )
Ln[p+np].Link[NLink++] = pp + np;
741 pp = (c-1)*NHeight + h + 1;
742 if(c==0) pp = (NCircle-1)*NHeight + h + 1;
744 pp = (c+1)*NHeight + h + 1;
745 if(c==NCircle-1) pp = 0 + h + 1;
747 if( (pp%
Nano[nNano].NHeight) )
Ln[p+np].Link[NLink++] = pp + np;
750 pp = (c)*NHeight + NHeight - 2;
753 pp = (c+NCircle/2)*NHeight + NHeight-2;
754 if(pp > NCyl) pp = (c-NCircle/2)*NHeight + NHeight-2;
758 pp = p + NCircle/2*NHeight;
766 Axis2 = Axis1 + Axis;
767 for(
int d=0;d<3;d++){
768 Axis2.
Set(Axis1.
Val(d)+Axis.Val(d),d);
771 int b = nNano +
NSoft;
774 sprintf(Filename,
"Architecture%d.dat",nNano);
775 FILE *CSave = fopen(Filename,
"w");
776 fprintf(CSave,
"# Cylinder\n");
778 for(
int p=np;p<NTot+np;p++){
779 for(
int l=0;l<
Ln[p].
NLink;l++){
781 double Dist = sqrt( SQR(
Pm[p].Pos[0]-
Pm[l2].Pos[0]) + SQR(
Pm[p].Pos[1]-
Pm[l2].Pos[1]) + SQR(
Pm[p].Pos[2]-
Pm[l2].Pos[2]) );
782 double kSpr = 10000.;
783 if(Dist > 2.) kSpr = 10000.;
784 if(Dist > 4.) kSpr = 10000.;
785 fprintf(CSave,
"%d %d %lf %.0f\n",p-np,l2-np,Dist,kSpr);
788 fclose(CSave);
return;
791 fprintf(CSave,
"# Cupola\n");
793 int NCircHalf = NCircle/2;
795 for(
int cc=1;cc<NCircHalf-1;cc++){
796 double Sin2 = sin(cc*CirInv*DUE_PI);
797 double Cos2 = cos(cc*CirInv*DUE_PI);
799 for(
int c=0;c<NCircle;c++){
800 double Sin = sin(c*CirInv*DUE_PI);
801 double Cos = cos(c*CirInv*DUE_PI);
803 Sin = sin((c+.5)*CirInv*DUE_PI);
804 Cos = cos((c+.5)*CirInv*DUE_PI);
809 if(cc > NCircle/4) Quota = -
Nano[nNano].
Height*.5;
814 double Dx = x -
Nano[nNano].
Rad*cos((c+1)*CirInv*DUE_PI)*Sin2 -
Nano[nNano].
Pos[0];
815 double Dy = y -
Nano[nNano].
Rad*sin((c+1)*CirInv*DUE_PI)*Sin2 -
Nano[nNano].
Pos[1];
816 double Elong = sqrt(SQR(Dx)+SQR(Dy));
817 int p = NCyl + c + cc*NCircle;
818 int pp = NCyl + (c+1) + cc*NCircle;
819 if( c+1==NCircle ) pp = NCyl + (0) + cc*NCircle;
820 if(c != 0 && c != NCircle-1) fprintf(CSave,
"%d %d %lf\n",p,pp,Elong);
821 if( cc != NCircle/2-1 && cc != NCircle/4){
822 pp = NCyl + (c+1) + (cc+1)*NCircle;
823 Elong = sqrt( SQR(
Nano[nNano].Rad*1.*CirInv*DUE_PI) + SQR(.5*Elong));
824 fprintf(CSave,
"%d %d %lf\n",p,pp,Elong);
825 pp = NCyl + (c) + (cc-1)*NCircle;
827 pp = NCyl + (c+1) + (cc)*NCircle;
828 fprintf(CSave,
"%d %d %lf\n",p,pp,Elong);
833 fprintf(CSave,
"# Extrema\n");
847 fprintf(CSave,
"%d %d %lf\n",p,pp,Elong);
849 for(
int c=0;c<NCircle;c++){
851 int pp = c + NCyl + NCircle*(NCircle/2-2);
852 double Elong =
Nano[nNano].
Rad * 1.*CirInv*DUE_PI;
853 fprintf(CSave,
"%d %d %lf\n",p,pp,Elong);
856 fprintf(CSave,
"%d %d %lf\n",p,pp,Elong);
859 pp = c + NCyl + NCircle*(NCircle/4);
861 fprintf(CSave,
"%d %d %lf\n",p,pp,Elong);
862 p = c*(NHeight) + NHeight - 1;
863 pp = c + NCyl + NCircle*(NCircle/4-1);
864 fprintf(CSave,
"%d %d %lf\n",p,pp,Elong);
871 if(NWater == 0)
return;
872 FILE *PSave = fopen(filename,
"a");
873 fprintf(PSave,
"# n=%d N=10 name=STUFFING\n",NWater/10);
874 for(
int p=0;p<NWater;p++){
877 double x = cos(Angle)*Rad +
Nano[nNano].
Pos[0];
878 double y = sin(Angle)*Rad +
Nano[nNano].
Pos[1];
880 fprintf(PSave,
"%lf %lf %lf %lf %lf %lf %d\n",x,y,z,0.,0.,0.,1);
886 FILE *PSave = fopen(filename,
"a");
887 double sigma = 1./sqrt(
pkSpr());
888 fprintf(PSave,
"# n=%d N=1 name=SOLVENT\n",NWater);
889 for(
int p=0;p<NWater;p++){
893 fprintf(PSave,
"%lf %lf %lf %lf %lf %lf %d\n",x,y,z,
Mat->
Gaussiano(0.,sigma),
Mat->
Gaussiano(0.,sigma),
Mat->
Gaussiano(0.,sigma),2);
899 double sigma = 1./sqrt(
pkSpr());
901 FILE *PSave = fopen(filename,
"a");
902 int NPCh = (int)(.5*
pNPCh());
903 fprintf(PSave,
"# n=%d N=%d name=ADDED\n",
NAddChain,NPCh);
909 int IfContinue = !
CheckNano(Pn[0].Pos,s);
910 for(
int i=1;i<NPCh;i++){
922 for(
int i=0;i<NPCh;i++){
923 fprintf(PSave,
"%lf %lf %lf %lf %lf %lf %d\n",Pn[i].Pos[0],Pn[i].Pos[1],Pn[i].Pos[2],
Mat->
Gaussiano(0.,sigma),
Mat->
Gaussiano(0.,sigma),
Mat->
Gaussiano(0.,sigma),0);
934 double sigma = 1./sqrt(
pkSpr());
935 int HalfLim = (int)(
Block[0].Asym*.5);
939 FILE *PSave = fopen(filename,
"a");
940 fprintf(PSave,
"# n=%d N=%d name=CHOL%d\n",
NAddChol,NPCh,s);
942 printf(
"%d %d %lf \r",c,Tries,c/(
double)(NAddChol));
943 double Leaflet = -.5*Thickness;
944 if(c >= NAddChol/2) Leaflet = +.5*Thickness;
951 int IfContinue = !
CheckNano(Pn[DLim].Pos,s);
953 for(
int j=DLim-1;j>=0;j--){
963 if(
CheckNano(Pn[j].Pos,s)){IfContinue=0;
break;}
966 for(
int i=0;i<NPCh;i++){
967 fprintf(PSave,
"%lf %lf %lf %lf %lf %lf %d\n",Pn[i].Pos[0],Pn[i].Pos[1],Pn[i].Pos[2],
Mat->
Gaussiano(0.,sigma),
Mat->
Gaussiano(0.,sigma),
Mat->
Gaussiano(0.,sigma),Pn[i].
Typ);
980 int NPair = (int)(
pNChain()/10.);
984 if(strcmp(
Block[b].Name,
"INNER0"))
continue;
994 for(
int d=0;d<3;d++){
1006 double *cPair = (
double *)calloc(3*
pNChain(),
sizeof(double));
1010 cPair[c*3+2] = 1000.;
1018 FILE *FWrite = fopen(FileName,
"w");
1019 for(
int c=NChOffSet;c<NChOffSet+
Block[bInner].
NChain-1;c++){
1020 cPair[c*3+0] = (double)c;
1022 double MinDist = 1000.;
1023 int NNei = Pc->
GetNei(
Pm[p1].Pos,NeiList);
1024 for(
int i=0;i<NNei;i++){
1025 int c1 = NeiList[i];
1028 if(c2 <= c)
continue;
1031 for(
int d=0;d<3;d++){
1032 Dist2 += SQR(
Ch[c].Pos[d] -
Ch[c2].Pos[d]);
1035 if(MinDist > Dist2){
1037 cPair[c*3+1] = (double)c2;
1038 cPair[c*3+2] = MinDist;
1045 for(
int c1=c;c1>=0;c1--){
1046 if(cPair[c1*3+2] >= cPair[(c1-1)*3+2])
break;
1047 for(
int d=0;d<3;d++){
1048 Temp[d] = cPair[c1*3+d];
1049 cPair[c1*3+d] = cPair[(c1-1)*3+d];
1050 cPair[(c1-1)*3+d] = Temp[d];
1058 for(
int c=0;c<NPair;c++){
1059 int p1 = (int)cPair[c*3+0]*
pNPCh(bInner)+
pNPCh(bInner)-1;
1060 int p2 = (int)cPair[c*3+1]*
pNPCh(bInner)+
pNPCh(bInner)-1;
1062 for(
int d=0;d<3;d++){
1063 Dist += SQR(
Ch[(
int)cPair[c*3+0]].Pos[d] -
Ch[(
int)cPair[c*3+1]].Pos[d]);
1068 fprintf(FWrite,
"%d %d %lf %lf\n",p1-pRef,p2-pRef,Dist,KEl);
int CheckNano(double *Pos, int s)
No particle inside the nano.
void AddPart(const int p, double *Pos)
Add a particle to the cell c.
CHAIN * Ch
Information on all chains.
void CreatePlanar(int *arch, double Thickness, int s)
planar membrane
int NLink
How many links per particle.
void AddStuffing(char *filename, int nStuffing, int nNano)
Fill the protein with water.
void SetCounters(int c)
Set the counters to the initial position.
void SysDef(char *cSystem)
Print a string with the system definitions.
double NanoDist2(double *Pos, int n)
Pointer to a generic function.
BLOCK * Block
Information for every block.
void SysInfo(char *cSystem)
Print a string with the system information.
int NAddChol
Additional cholesterol chains into the membrane.
double Vel[4]
xyzr Velocity of the particle
LINKS * Ln
Array of linking between the particles.
NANO * Nano
Extra particle.
int SetNChain(int NewNCh)
Set and reallocate the number of chains.
void CreateVesicle(int *arch, double Thickness, int s)
vesicle
void AddSolvent(char *filename, int nWater)
Add phantom solvent at the bottom.
void CreateObstacle(int *arch, double Thickness, int s)
Creates obstacles.
void AddCholesterol(char *filename, double Thickness, int s)
Add cholesterol chains in the bilayer.
bool Write(char *OutFile)
Writes a "system-file" or a "x y z" file".
Geometrical operations on vectors.
double Edge[4]
xyzr edges of the simulation box
int Asym
Diblock limit of the chain.
bool InizializzaGaussiano(double Scarto, int N)
Initialize the Gaussian number generator.
double Height
Height of the cylinder.
int CLat2
lateral coordinate
Information for every block.
double Pos[3]
xyz Position of the particle
void AddProtein(int NCircle, int NHeight, int nNano, char *filename)
Defines the nanoparticle as a net of monomers.
void DefRest(int *arch, int s)
set the remaining information
int InitIdx
Initial Position.
int NLink
Maximum number of bonds.
double pkSpr()
Spring coupling.
double Val(int N)
Value of the N column.
int IfItCell(const int c)
Stop the loop and set the counter to zero.
Structure with the links of the particles.
int NAddChain
Additional homopolymer chains into the membrane.
Information of every chain.
int TrialSys()
Creates a trial system.
void CreateCoating(int *arch, double Thickness, int s)
coating around a cylindrical nanoparticle
void FindNeighbours(char *FileName)
Find the couples of most neighbouring chains.
int InitIdx
Initial particle position.
int Shape
0 none, 1 spherical, 2 cylindrical 3 wall
double pNanoPos(int n, int d)
Return back folded nano position.
int nBlock
In which block is the peptide written.
int NStuffing
Stuffing for the cylinder.
double pEdge(int d)
xyzr edges of the simulation box
int pNPCh()
Number of particle per chain.
int Idx
Particle identifier.
int pNBlock()
Number of blocks.
void RotateBlock(Vettore *Axis, Vettore *Origin, int b)
Rotate a block wrt to the Axis from the Origin.
MatInt * MInt
Matrix of the prefactor of the interactions.
int NChain
Number of chain.
int * Link
with whom is bonded
void IncrCurr(const int c)
Increment the current part in the cell.
double Vel[3]
bias velocity
double Casuale()
Random uniform number.
int NCircle
Number of monomers per circle.
void Point2Shape(int iShape)
Point to the shape function.
int NPCh
Number of particle per chain.
int SysType
Contains the definition of the system.
double Pos[3]
initial position
int pNNano()
Number of nanoparticles.
double Pos[4]
xyzr Postion of the chain
int NPCh
particles per chain
double Gaussiano(double Media, double Scarto)
Gaussian random number.
void CreateTube(int *arch, double Thickness, int s)
Soft in a tube shape.
int GetNei(double *Pos, int *NeiList)
Choose among the different neighbouring lists.
int ItCell(const int c)
Iterate in the cell.
bool CreateSoft(int *arch, double Thickness, int s)
Creates an initial system.
int NSolvent
Solvent molecules.
double OffSet
Reference potential.
double pReOverCutOff()
Re/CutOff.
Matematica * Mat
Implementation of all usefull algorythms.
int EndIdx
End particle position.
unsigned long Step
Courrent step.
int HeaderSoft(char *Line)
Header soft.
int pNChain()
Number of chain.
int CLat1
lateral coordinate
Information of every particle.
void AddChains(char *filename, double Thickness)
Add homopolymer chains in the bilayer.
int DefSoft(char *nome2, char *ConfF)
Define and write the system as described in the conf file.
bool ReadConf(char *InFile)
Reads a "configuration file".
void CreateProtein(int nNano, int nStart)
Defines the nanoparticle as a net of monomers.
int NSoft
Number of soft bodies.
int PutPart(int j, int p, int HalfLim, double sigma)
return the number in the chain of the next particle put
void Rescale(double SFactor, int Order)
Rescale entries.
int NPart
Number of particle.
Domain decomposition as pointer to linked particles.
PART * Pm
Particle information of all particle.
double ReOverCutOff
Convertion unit R_e over CutOff.
int NBlock
Number of blocks.
double Size[3]
dimension xyz/rad height
void Set(double Val, int Col)
Set the N column.
void SetCoeff()
Set the virial coefficients from the known values of density coex...
int CNorm
Normal coordinate.
int NHeight
Number of monomers per side.