Allink  v0.1
Forces.h
1 #ifndef FORCES_H
2 #define FORCES_H
3 #include <VarData.h>
4 #include <Cubo.h>
5 #include <SingProc.h>
6 #include <time.h>
7 #ifdef USE_GL
8 #include <GL/glut.h>
9 #endif//USE_GL
10 
11 enum SYS_SHAPE{
13  SYS_1D = 0x0001,
15  SYS_2D = 0x0002,
17  SYS_3D = 0x0004,
19  SYS_LEAVES = 0x0008,
21  SYS_RIGID = 0x0010,
23  SYS_STALK = 0x0020,
25  SYS_MD = 0x0040,
27  SYS_MC = 0x0080,
29  SYS_WIDOM = 0x0100,
31  SYS_TRIAL = 0x0200,
33  SYS_PORE = 0x0400,
35  SYS_ROD = 0x0800,
37  SYS_ELECTRO = 0x1000,
38 };
40 enum CALC_MODE{
42  CALC_NVT = 0x00001,
44  CALC_mVT = 0x00002,
46  CALC_SOLVE = 0x00004,
48  CALC_PAIR = 0x00008,
50  CALC_HARM = 0x00010,
52  CALC_LJ39 = 0x00020,
54  CALC_LJ = 0x00040,
56  CALC_DENS_CH = 0x00080,
58  CALC_NcVT = 0x00100,
60  CALC_mcVT = 0x00200,
62  CALC_3d = 0x00400,
64  CALC_2d = 0x00800,
66  CALC_DENS = 0x01000,
68  CALC_CONF_BIAS = 0x02000,
70  CALC_BIL_BIAS = 0x04000,
72  CALC_SPH_BIAS = 0x08000,
74  CALC_STEP = 0x10000,
76  CALC_ELECTRO = 0x20000,
77 };
79 enum THERM_MODE{
81  THERM_NO = 0x0001,
83  THERM_LANG = 0x0002,
85  THERM_AND = 0x0003,
87  THERM_BERE = 0x0004,
88 };
90 enum FIT_TYPE{
92  FIT_SPLINE3 = 0,
94  FIT_SPLINE4 = 1,
96  FIT_PARAB2 = 2,
98  FIT_CUBIC = 3,
100  FIT_DERIV = -1,
102  FIT_FORTH = 4,
104  FIT_POLY = 5,
106  FIT_BSPLINE = 6,
107 };
109 enum IntMethod{
111  INT_MD = 0,
113  INT_DIFF = 1,
115  INT_MC = 2,
116 };
118 enum ALLOCATED{
120  ALL_FORCES = 0x001,
122  ALL_METR = 0x002,
124  ALL_POT = 0x004,
126  ALL_MC = 0x008,
128  ALL_MD = 0x010,
130  ALL_SPLINE = 0x020,
132  ALL_CYL = 0x040,
134  ALL_FFIELD = 0x080,
136  ALL_TENS = 0x100,
138  ALL_DENS = 0x200,
140  ALL_BIAS = 0x400,
142  ALL_MATRIX = 0x800,
143 };
145 typedef struct{
147  double Lap;
149  double SLap;
151  double El[3];
153  double Ext;
155  double LJ;
157  double Cont;
159  double Elong[3];
161  double LJMin;
163  double LJCutOff;
165  double CutOff2;
167  double BaseLine;
169  double PotThr;
171  double ForThr;
173  double DistThr;
174 } KFORCES;
176 typedef struct{
178  double Dir[3];
179  /* /// Helfrich */
180  /* double Hel[3]; */
182  double Ext[3];
183  /* /// Elastic */
184  /* double El[3]; */
185  /* /// Lennard-Jones */
186  /* double LJ[3]; */
187 } FORCES;
189 typedef struct{
191  int NComp;
193  int NDim;
195  int NSlab;
197  int CalcMode;
199  double **Pre;
201  double **Dens;
203  double PreTot[3];
205  double RefPos[3];
207  double Edge[3];
209  int Wrap[3];
211  double EdgeInv[3];
212 }TENS;
214 //typedef DdDoubleLoop DomDec;
215 typedef DdLinkedList DomDec;
216 //typedef DdFixedSize DomDec;
217 //typedef DdArray DomDec;
223 class Forces : public VarData{
224  private:
226  char ConfFile[60];
228  time_t InitTime;
230  time_t CurrTime;
232  double *Dens2;
234  double *Dens3;
236  double *PTab;
238  double *FTab;
240  double *MTab;
242  double OldNrgSys;
244  double *OldNrgBead;
246  double *OldNrgCh;
248  double **OldPos;
250  double *LocDens2;
252  double *LocDens3;
254  double *FirstBeadDistr;
256  double **BondPosBias;
258  double *CumProbBias;
260  double BorderBias[2];
262  int NBin;
264  int NGrid;
266  int NTrialBias;
268  int BoundCond[6];
270  int PeriodicImage[3];
272  FILE *StatFile1;
274  FILE *StatFile2 ;
276  typedef double(Forces::*CALC_NRG)(int p,double *Pot);
278  CALC_NRG NrgBead;
280  CALC_NRG NrgCh;
282  //static CALC_NRG ChooseCalcMode(int Mode);
283  void ChooseCalcMode(int Mode);
285  typedef double(Forces::*CALC_POT)(double Dist,int t1,int t2,double *Pot);
287  CALC_POT CalcPot;
289  //static CALC_POT ChoosePot(int Mode);
290  void ChoosePot(int Mode);
292  int NTab;
294  int DynFlag;
296  typedef double(Forces::*STEP_CONF)();
298  typedef double(Forces::*STEP_SIM)();
300  STEP_CONF ConfigSys();
302  STEP_SIM CalcUpdate();
304  Matrice *IntMatrix;
305  public:
306  //-----------Forces.cpp---------------------
308  Forces(int argc,char **argv,int NPart,char *ConfFile);
310  Forces(int argc,char **argv,char *ConfFileExt,char *Snapshot);
312  void Shout(const char * s, ...);
314  void AllocMethod();
316  void PrepareSys();
318  void PrepareParallel(int argc,char **argv);
320  ~Forces();
322  void Info();
324  int ReadConfDinamica(char *File);
326  void InitConst();
328  int ReSetNPart(int NewNPart);
330  int ReSetNChain(int NewNChain);
332  void ReSetNPCh(int NewNPCh);
334  void ReOpen(char *FName,int Bf);
336  void FillMatrix();
337  //-----------ForcesIntegration.cpp----------
340  void StudySys();
342  int MinHelfrich();
344  int DynIntegration();
346  void Dynamics();
348  void Solve();
350  void SolveLinks();
352  void SolveLinksSparse();
354  void SolveLinksIterative();
356  void SolveRod();
358  void SolveLeaves();
360  int Update();
362  void VelVerletRigid();
364  void VelVerletRigid2();
366  int IfMetropolis(double ExpArg,double Weight);
368  int InsertBead(int p);
370  void IgnoreCh(int c);
372  void RemChFromSys(int c);
374  void SaveCh(int c);
376  void ReInsertCh(int c);
378  void ConsiderCh(int c);
380  double InsertCh(int c);
382  double InsertRest(int pCurr,int StartPos);
384  double RemoveChBias(int c);
386  double InsertChBias(int c);
388  double WeightSetBond(int p,int t);
390  double CreateSetBond(int p,int t);
392  int MoveBead(int p);
394  int TryInsert();
396  int TryRemove();
398  int TryMove();
400  int TryMoveCh();
402  int TryInsertCh();
404  int TryRemoveCh();
406  int TryInsertChBias();
408  int TryRemoveChBias();
410  void WidomInsert(double *NrgDiff);
412  void WidomRemove(double *NrgDiff,int p);
414  void WidomInsertCh(double *NrgDiff);
416  void WidomRemoveCh(double *NrgDiff,int c);
418  void WidomBiasChIn(double *Weight);
420  void WidomBiasChOut(double *Weight,int c);
422  void VelVerlet1();
424  void LangevinTherm();
426  void AndersenTherm();
428  void BerendsenTherm();
430  void NoTherm(){};
432  void VelVerlet2();
434  //static CALC_NRG ChooseCalcMode(int Mode);
435  void ChooseThermostat(int Mode);
437  typedef void (Forces::*CALC_THERM)();
441  void ApplyTherm(){return (*this.*CalcTherm)();};
442  //-----------ForcesForceField.cpp-----------
444  int ForceFieldLine();
446  int SumSomeForces(int HowMany);
448  int ForceFieldLeaves();
450  int ForceFieldBulk();
452  void ForceFieldRod();
454  void ForceFieldRigid();
456  void CalcForcesDensFunc();
458  void PrintForce();
460  void GetForceField();
462  void TabForceAlloc(int NTabExt);
464  void TabPot();
466  void NanoInteraction();
468  double NanoNrg(int p);
470  double NanoNrg(double *Pos,int t);
472  void DefForceParam();
474  void DefNanoForceParam();
476  double RigidLJ(int nNano,double Dist,double *Pot,double Sign);
478  double RigidHamaker(int n,double Dist,double *Pot,double Sign);
480  double RigidCoulomb(int nNano,double Dist,double *Pot,double Sign);
482  double RigidDistanceRad(int n,int nn,double *dr);
484  double RigidDistanceAxis(int n,int nn,double *dr);
485  // Point to the potential
486  void PointShape(int iShape);
487  /* /// Data type for distance/field functions */
488  /* typedef double(Forces::*NANO_FORCE)(double Dist2,int n,int p); */
489  /* /// Pointer to a distance/field function */
490  /* NANO_FORCE Nano_Force; */
491  /* /// Pointer to a generic function */
492  /* double NanoForce(double Dist2,int n,int p){return (*this.*Nano_Force)(Dist2,n,p);} */
494  double Harmonic(double Dist2,int t1,int t2,double *Pot);
496  double StepPot(double Dist2,int t1,int t2,double *Pot);
498  double ElectroPot(double Dist2,int t1,int t2,double *Pot);
500  double LJ39(double Dist2,int t1,int t2,double *Pot);
502  double LJPot(double Dist2,int t1,int t2,double *Pot);
504  double Potential(double Dist,int t1,int t2,double *Pot){return (*this.*CalcPot)(Dist,t1,t2,Pot);};
505  //-----------ForcesCalcNrg.cpp-----------
507  double CalcTotNrgCh();
509  double CalcTotNrgBead();
511  double CalcNrgBead(int p,double *Pot){return (*this.*NrgBead)(p,Pot);};
513  double CalcNrgCh(int c,double *Pot){return (*this.*NrgCh)(c,Pot);};
515  double NrgChBondDens(int c,double *Pot);
517  double NrgChDens(int c,double *Pot);
519  double CalcPairwise(int p,double *Pot);
521  double CalcPairwiseCh(int c,double *Pot);
523  double CalcBending(int p);
525  double CalcSpring(int p);
527  double CalcBonded(int p,double *Pot);
529  double CalcBendingGhost(double *Pos,int pExt);
531  double CalcBondedCh(int c,double *Pot);
532  /* ///Calculate the spring, bending and non bonded interactions */
533  /* double CalcNrgCh(int c,double *Pot); */
535  void CalcNrgBeadDensFunc();
537  double CalcNrgBeadDensFunc(int p,double *Pot);
539  double CheckDomDec(int p);
541  void CheckPairList();
543  double SumForcesMD();
545  double Wei3(const double r, const double a);
547  double DerWei3(const double r, const double a);
549  double Wei2(const double r, const double b);
551  double DerWei2(const double r, const double b);
553  double DensFuncNrgGhost(double *Pos,int p1,int t1);
555  double DensFuncNrgGhostInternal(double *Pos,int p1,int t1);
557  double DensFuncNrgBead(int p1);
559  double DensFuncNrgCh(int c,double *Pot);
561  double DensFuncNrgChAv(int c);
563  double DensFuncNrgChInternal(int c);
565  double DensFuncNrgSys();
567  void CalcDens(int pInit,int pEnd);
569  void ClearDens();
571  double NrgStep(int p);
573  double NrgStepCh(int c,double *Pot);
575  double NrgElectro(int p);
577  int AddDens(int pInit,int pEnd);
579  int RemDens(int pInit,int pEnd);
583  double SumDens(int pInit,int pEnd);
585  int ListNeiCell(int p,double *Pos,int *NeiList){
586  return Pc->GetNei(Pos,NeiList);
587  //return Pc->GetCell(p,NeiList);
588  };
589  //-----------ForcesBoundary.cpp-------------
591  void PullBead();
593  void PushBead();
595  void SelectBead(int p);
597  void Wave();
599  void AddCircle(int nNano);
601  void AddCylinder(int nNano);
603  void AddPore(int nNano);
605  void AddRigid();
607  double HeightBoundary(double *Pos,int dir);
608  //-----------ForceCreate.cpp----------------
610  void CreateInitial();
612  void Create2d();
614  void Create3d();
616  void CreateLeaves();
618  void CreateStalk();
620  void CreatePore();
622  void Create1d();
624  void CreateRigid();
626  void CreateMC();
628  void CreateMD();
630  void CreateRod();
632  void CreateElectro();
633  //---------ElPolyTens.cpp--------------------------------
635  void AllocTens();
637  void CalcTens();
639  void CalcDens();
641  double TensRefCart(double *Pos1,double *Pos2,double *PosP1,double *PosP2);
643  double TensRefPol(double *Pos1,double *Pos2,double *PosP1,double *PosP2);
645  typedef double(Forces::*TENS_REF)(double *Pos1,double *Pos2,double *PosP1,double *PosP2);
649  double TensRef(double *Pos1,double *Pos2,double *PosP1,double *PosP2){
650  return (*this.*Tens_Ref)(Pos1,Pos2,PosP1,PosP2);
651  };
653  void SumTens(int p1,int p2,double Forces,double *DistRel);
655  void SumTens(int p1,int p2,double *Pre);
657  void SumTens(double *Pos1,double *Pos2,double *Pre);
659  void WriteTens(char *TFile,int Comp,double InvNFile);
661  void WriteTens2d(FILE *FWrite,int Comp,double InvNFile);
662  //---------ForcesLoop.cpp--------------------------------
664  void ExplorePepSize();
666  void ExplorePepSize2d();
668  void ExploreDoubleMin();
670  void CalcTotNrg(char *FName,int nFile);
672  void CalcNrgPep(char *File2Open,int f);
674  void RunDynamics();
676  void RunWidom(char *File2Read,int f);
678  void RunWidomChIn(char *File2Read,int f);
680  void RunWidomChOut(char *File2Read,int f);
682  void RosenIn(FILE *WidomIn);
684  void RosenOut(FILE *WidomIn);
686  void RunWidomBiasChOut(FILE *WidomOut);
688  void ChooseSimMode();
690  void Task();
692  void CalcTens(char **argv,int *FilePos,int NFile);
694  void AvForces(char **argv,int *FilePos,int NFile);
696  void Trial();
698  void MinimalMD();
700  double MinimalNrg();
704  void Sim2d(){VelVerlet1();Wave();VelVerlet2();};
712  void MinimizeSol();
713  //----------------CONSTANTS----------------------------
715  double IncrDist;
717  double Deltat;
719  double NChemPotId;
721  double ChemPotId;
723  double ChemPotEx;
725  double GaussVar;
727  double CutOff;
729  double Dx;
731  double Viscosity;
733  double Time;
735  double NrgPBead;
739  int Old2Move;
741  int IntMax;
743  int nEdge[3];
745  int SysShape;
747  int CalcMode;
751  int SimLimit;
753  int SysAlloc;
755  int IfInterp;
757  int IfLeaves;
759  int IfMove;
761  int IfNano;
765  int IfExit;
769  int NRemoval;
771  int NFile[2];
773  int NUpdate;
775  int NWrite;
777  int NSpline;
788 #ifdef USE_MPI
789  SingProc *Proc;
790 #endif
791 #ifdef __glut_h__
792  int Interp();
795  int Graphics(int argc,char **argv);
797  void keyboard(unsigned char key,int x, int y);
799  void DrawSoil();
801  void DrawCarpet();
803  void DrawParticles();
805  void DrBondLine(int p);
807  void DrawScene();
809  void DrawNano();
811  void DynamicsView();
813  void Menu();
815  GLuint *Cylinder;
817  GLuint Particles;
819  int NShow;
821  int IfMovie;
823  int Frame;
825  int IfExt;
827  int IfSpline;
829  int IfRot;
831  int IfSphere;
833  int BeadType;
835  int menu,submenu;
837  int IfLine;
838 #endif
839 };
841 extern void DynamicsMotion();
842 #endif //ELPOLY_H
double DensFuncNrgBead(int p1)
Calculation of the energy from the density functional Hamiltonian for the particle p1...
int TryMoveCh()
Trial desplacement of a chain.
void LangevinTherm()
Langevin thermostat.
double NChemPotId
Equilibrium number of particles/chains.
Definition: Forces.h:719
void RunDynamics()
Run a step further.
Definition: ForcesLoop.cpp:455
void CalcTens()
Calculate the forces for the tension profile.
Definition: ForcesTens.cpp:85
void WidomBiasChIn(double *Weight)
Widom with Rosenbluth weight.
TENS_REF Tens_Ref
Pointer to a coordinate distance.
Definition: Forces.h:647
double LJMin
Lennard-Jones.
Definition: Forces.h:161
double CheckDomDec(int p)
Check if all the particles are taken in account.
void ExplorePepSize2d()
Find the minimun bilayer thickness for different peptide sizes.
Definition: ForcesLoop.cpp:145
void CreateRod()
Create a initial disposition of particle for a stiff rod.
void keyboard(unsigned char key, int x, int y)
Additional key bindings.
Definition: ForcesDraw.cpp:384
double Ext
External force.
Definition: Forces.h:153
double InsertChBias(int c)
Put a chain in the box.
double InsertRest(int pCurr, int StartPos)
Build the rest of the chain.
void DrawNano()
Draws cylinder or spheres.
Definition: ForcesDraw.cpp:351
void CalcTotNrg(char *FName, int nFile)
Total energy of the system.
Definition: ForcesLoop.cpp:293
double CalcTotNrgCh()
Calculate and sum up the energy of the chains.
void Trial()
Trial loop.
Definition: ForcesLoop.cpp:452
double LJPot(double Dist2, int t1, int t2, double *Pot)
Classical Lennard Jones potential.
void VelVerlet1()
First step of the velocity Verlet.
int NInsertion
Count accepted moves.
Definition: Forces.h:767
int ForceFieldLine()
Helfrich Hamiltonian for a line.
void WriteTens(char *TFile, int Comp, double InvNFile)
Write the pressure and density profile.
Definition: ForcesTens.cpp:324
void ReSetNPCh(int NewNPCh)
Set a new number of particle per chain.
Definition: Forces.cpp:897
double Cont
Contact/Friction.
Definition: Forces.h:157
double RemoveChBias(int c)
Remove a chain in the box.
void Create2d()
Create a plane of connected beads.
double NrgStepCh(int c, double *Pot)
The energy per chain is constant within the cutoff.
double ** Pre
Pressure array.
Definition: Forces.h:199
int TryRemoveChBias()
Trial biased removal of a chain.
void AddRigid()
Add all rigid bodies as a boundary condition.
void DrawCarpet()
Two dimensional surface.
Definition: ForcesDraw.cpp:162
CALC_THERM CalcTherm
Pointer to the energy calculation function.
Definition: Forces.h:439
double CalcPairwiseCh(int c, double *Pot)
Calculate the non bonded interaction energy with the neighbouring particles.
double RigidCoulomb(int nNano, double Dist, double *Pot, double Sign)
Force between to rigid bodies.
void PrepareSys()
Calculate some initial quantities for the succesive calculations.
Definition: Forces.cpp:200
double CalcBendingGhost(double *Pos, int pExt)
Calculate the bending energy for a ghost particle.
void WriteTens2d(FILE *FWrite, int Comp, double InvNFile)
Write the 2d pressure profile.
Definition: ForcesTens.cpp:284
void TabForceAlloc(int NTabExt)
Tabulate the values of the force.
int IntMax
Boh.
Definition: Forces.h:741
void RunWidom(char *File2Read, int f)
Build the widom histograms.
Definition: ForcesLoop.cpp:223
void(Forces::* CALC_THERM)()
Pointer type to the potential function.
Definition: Forces.h:437
double Lap
Prefactor of the Laplacian.
Definition: Forces.h:147
int NDim
of dimensions
Definition: Forces.h:193
void PullBead()
Move a particle.
double CreateSetBond(int p, int t)
Create a set of bonds for the configurational bias.
void CalcNrgBeadDensFunc()
Calculate the spring, bending and non bonded interactions and write it in OldNrgPm.
void CheckPairList()
Check the pair list.
int MinHelfrich()
Minimum of the Helfrich Hamiltonian.
void DrawScene()
Draw the scene.
Definition: ForcesDraw.cpp:51
void CreateMC()
Create a initial disposition of particle for the MC sim.
double RigidLJ(int nNano, double Dist, double *Pot, double Sign)
Force between to rigid bodies.
double CalcBending(int p)
Calculate the bonded interaction energy with the neighbouring particles.
double DensFuncNrgCh(int c, double *Pot)
Calculate the energy from the density functional Hamiltonian for the chain c.
double CalcTotNrgBead()
Calculate and sum up the energy of the part.
int IfMove
Boh.
Definition: Forces.h:759
int ListNeiCell(int p, double *Pos, int *NeiList)
List of the cells close to the particle position.
Definition: Forces.h:585
int MoveBead(int p)
Move a particle in the box.
double Harmonic(double Dist2, int t1, int t2, double *Pot)
Harmonic potential.
double Viscosity
Viscosity of the medium.
Definition: Forces.h:731
double GaussVar
Standard deviation of the gaussian chain.
Definition: Forces.h:725
double HeightBoundary(double *Pos, int dir)
Height of the boundary condition depending on the direction.
void DrBondLine(int p)
Alternative drawing of the particle position.
Definition: ForcesDraw.cpp:319
double DerWei2(const double r, const double b)
Derivative of the quadratic weighting function.
double PotThr
Maximum potential allowed.
Definition: Forces.h:169
void Dynamics()
Sum up all the forces and update the positions.
Definition: ForcesLoop.cpp:20
int TryInsertCh()
Trial insertion of a chain.
void DrawSoil()
Two dimensional soil.
Definition: ForcesDraw.cpp:97
int IfInterp
If interpolates with the splines.
Definition: Forces.h:755
void RunWidomChIn(char *File2Read, int f)
Build the widom histograms.
Definition: ForcesLoop.cpp:263
double NrgChBondDens(int c, double *Pot)
Calculate the bond and the density functional energies.
void FillMatrix()
Fill the entries of the interaction matrix.
Definition: Forces.cpp:270
int IfMetropolis(double ExpArg, double Weight)
Metropolis acceptance criterium.
double SumForcesMD()
Iterate all over the particles and calculate the forces.
int Frame
Current number of frame.
Definition: Forces.h:823
void WidomInsert(double *NrgDiff)
Widom insertion.
int NWrite
How many timesteps before write the snapshot.
Definition: Forces.h:775
double Deltat
Time step.
Definition: Forces.h:717
int RemDens(int pInit, int pEnd)
Substract the densities connected with the particles between pInit and pEnd.
Forces(int argc, char **argv, int NPart, char *ConfFile)
Create an initial system and choose the simulation thecnique.
Definition: Forces.cpp:15
int IfExt
Boh.
Definition: Forces.h:825
~Forces()
Frees the memory.
Definition: Forces.cpp:137
void CalcNrgPep(char *File2Open, int f)
Exchange energy of the protein.
Definition: ForcesLoop.cpp:333
int IfExit
Exit from the loop.
Definition: Forces.h:765
void CreateRigid()
Create rigid bodies.
int NShow
Boh.
Definition: Forces.h:819
void ForceFieldRod()
Bending potential on a rod.
double TensRef(double *Pos1, double *Pos2, double *PosP1, double *PosP2)
Particle positions back folded on the tension reference point.
Definition: Forces.h:649
void SolveLinksIterative()
Solve a system of four oder differential equation of particles connected by links.
void NoTherm()
No thermostat.
Definition: Forces.h:430
void CreatePore()
Create the 1d representation of a pore.
int TryInsertChBias()
Trial biased insertion of a chain.
double CalcSpring(int p)
Calculate the spring interaction energy with the neighbouring particles.
void SolveLinksSparse()
Solve a system of four oder differential equation of particles connected by links.
void WidomInsertCh(double *NrgDiff)
Widom insertion.
int NFile[2]
First and last file of the list.
Definition: Forces.h:771
int SysAlloc
Which arrays are allocated.
Definition: Forces.h:753
void WidomRemoveCh(double *NrgDiff, int c)
Widom removal.
int IfFillMatrix
If the matrix has to be changed.
Definition: Forces.h:763
void CalcForcesDensFunc()
Calculate the forces for the density functional.
int NRemoval
Count accepted moves.
Definition: Forces.h:769
void PrepareParallel(int argc, char **argv)
Create the grid for the parallelisation.
Definition: Forces.cpp:372
double ChemPotEx
Chemical potential of the particles.
Definition: Forces.h:723
double TensRefPol(double *Pos1, double *Pos2, double *PosP1, double *PosP2)
Particle positions back folded on the tension reference point (polar coordinates) ...
Definition: ForcesTens.cpp:207
void CreateInitial()
Create an initial configuration and an appropriate force field.
Definition: ForcesCreate.cpp:2
int SimLimit
Maximum number of time steps.
Definition: Forces.h:751
int IfLeaves
Boh.
Definition: Forces.h:757
void ExploreDoubleMin()
Find the minimum for different interpeptide distances.
Definition: ForcesLoop.cpp:170
int CalcMode
Calculation mode.
Definition: Forces.h:747
void ApplyTherm()
Pointer to the energy function.
Definition: Forces.h:441
void ChooseThermostat(int Mode)
Choose a calculation mode.
void Shout(const char *s,...)
Internal message.
Definition: Forces.cpp:3
double Time
Total time.
Definition: Forces.h:733
double ElectroPot(double Dist2, int t1, int t2, double *Pot)
Potential for the electrical lines.
int IfSpline
Boh.
Definition: Forces.h:827
void Create1d()
Create single line of connected monomers.
void Info()
System&#39;s info.
Definition: Forces.cpp:564
int DynIntegration()
Boh.
void ConsiderCh(int c)
Consider a chain in the system (densities, pairlist)
void NanoInteraction()
Calculate all the interaction with the nano.
void IgnoreCh(int c)
Ignore a chain in the system (densities, pairlist)
void VelVerletRigid()
Velocity Verlet for a rigid body, first step.
void ForceFieldRigid()
Interaction between rigid bodies.
double DistThr
Correspondent radial distance for this force.
Definition: Forces.h:173
int InsertBead(int p)
Insert a particle in the box.
GLuint * Cylinder
List referring the cylinder.
Definition: Forces.h:815
double NrgStep(int p)
The energy is constant within the cutoff.
double Dx
Spatial separation between particles.
Definition: Forces.h:729
void RunWidomBiasChOut(FILE *WidomOut)
Build the widom histograms with Rosenbluth weight.
void PushBead()
Move a particle.
int ReSetNPart(int NewNPart)
Realloc the number of particles.
Definition: Forces.cpp:820
Spatial tensor profile.
Definition: Forces.h:189
void RosenOut(FILE *WidomIn)
Rosenbluth histograms for deletion.
Definition: ForcesLoop.cpp:254
void SumTens(int p1, int p2, double Forces, double *DistRel)
Sum the forces on the line joining the points p1 and p2.
Definition: ForcesTens.cpp:271
void Menu()
Menu.
Definition: ForcesDraw.cpp:374
double NanoNrg(int p)
Exchange energy with the nano.
int TryMove()
Trial movement.
double(Forces::* TENS_REF)(double *Pos1, double *Pos2, double *PosP1, double *PosP2)
Data type for distance/field functions.
Definition: Forces.h:645
void ReOpen(char *FName, int Bf)
Open a new file.
Definition: Forces.cpp:901
void AndersenTherm()
Andersen thermostat.
void TabPot()
Tabulate the values of the potential.
void InitConst()
Read the config file.
Definition: Forces.cpp:505
KFORCES Kf
Prefactor of the forces.
Definition: Forces.h:779
int NUpdate
How many timesteps before redrawing.
Definition: Forces.h:773
void GetForceField()
Calculate the force field summing every single contribution.
double MinimalNrg()
Minmal nrg.
Definition: ForcesLoop.cpp:493
GLuint Particles
List referring the particle.
Definition: Forces.h:817
double IncrDist
Step to move a particle.
Definition: Forces.h:715
void StudySys()
Obtain informations for a better performance in inserting the chains.
int ForceFieldLeaves()
Helfrich Hamiltonian with an elastic coupling.
int TryRemove()
Trial removal.
Basics class to start a MPI grid.
Definition: SingProc.h:6
void CreateElectro()
Create a initial disposition of houses to collect on a line.
void ExplorePepSize()
Find the minimun bilayer thickness for different peptide sizes.
Definition: ForcesLoop.cpp:97
int Old2Move
Old part to move.
Definition: Forces.h:739
Prefactors of the forces.
Definition: Forces.h:145
int SysShape
Shape of system.
Definition: Forces.h:745
double CutOff
Cut off of the interactions.
Definition: Forces.h:727
void PrintForce()
Print the force and the potential.
void RosenIn(FILE *WidomIn)
Rosenbluth weights for insertion.
Definition: ForcesLoop.cpp:245
double DensFuncNrgSys()
Calculation of the energy from the density functional Hamiltonian for the system. ...
void AllocMethod()
Allocated the structures needed for the corresponding simulation method.
Definition: Forces.cpp:386
int SumSomeForces(int HowMany)
Boh.
void RemChFromSys(int c)
Delete a chain in the system.
void RunWidomChOut(char *File2Read, int f)
Build the widom histograms.
Definition: ForcesLoop.cpp:279
Single contribution of the forces.
Definition: Forces.h:176
void MinimalMD()
Minmal md.
Definition: ForcesLoop.cpp:521
void VelVerletRigid2()
Velocity Verlet for a rigid body, second step.
int TryRemoveCh()
Trial removal of a chain.
int nEdge[3]
Number of particle per edge.
Definition: Forces.h:743
void CreateStalk()
Create the 1d representation of a stalk.
int ForceFieldBulk()
Armonic potential on a lattice.
void MinimizeSol()
Iterative process to approach to the solution.
Definition: ForcesLoop.cpp:556
double StepPot(double Dist2, int t1, int t2, double *Pot)
Step potential.
double Potential(double Dist, int t1, int t2, double *Pot)
Pointer to a potential.
Definition: Forces.h:504
Matrice computes the algebric operations on matrices.
void SolveLeaves()
Solve a system of four oder differential equation of particles in a line.
double Wei3(const double r, const double a)
Cubic weighting function.
void AddPore(int nNano)
Add a pore as a boundary condition.
double RigidDistanceRad(int n, int nn, double *dr)
Distance between two bodies.
int CalcMode
Calculation mode.
Definition: Forces.h:197
double ** Dens
Density array.
Definition: Forces.h:201
void ClearDens()
Set the local densities to zero.
double ChemPotId
Chemical potential of the particles.
Definition: Forces.h:721
double DensFuncNrgChAv(int c)
Calculate the average energy from the density functional Hamiltonian for the chain c...
int IfSphere
Visualize spheres or points.
Definition: Forces.h:831
double RigidDistanceAxis(int n, int nn, double *dr)
Distance between two bodies.
void Wave()
Sinusoidal surface wave.
double CalcNrgCh(int c, double *Pot)
Pointer to the chain energy function.
Definition: Forces.h:513
int ReSetNChain(int NewNChain)
Realloc the number of chains.
Definition: Forces.cpp:877
void AllocTens()
Alloc the pressure profile.
Definition: ForcesTens.cpp:2
double LJ
Lennard-Jones.
Definition: Forces.h:155
int IfLine
Boh.
Definition: Forces.h:837
int GetNei(double *Pos, int *NeiList)
Choose among the different neighbouring lists.
Definition: Cubo.h:208
void VelVerlet2()
Second step of the velocity Verlet.
double NrgChDens(int c, double *Pot)
Calculate the density functional energies.
void CreateMD()
Create a initial disposition of particle for the MD sim.
void Sim3d()
Simulation loop for 1d.
Definition: Forces.h:706
void DrawParticles()
Alternative drawing of the particle position.
Definition: ForcesDraw.cpp:233
void Sim2d()
Simulation loop for 2d.
Definition: Forces.h:704
int IfMovie
Produce the images for the video.
Definition: Forces.h:821
int Graphics(int argc, char **argv)
Initialize the scene.
Definition: ForcesDraw.cpp:6
void SimRigid()
Simulation loop for rigid.
Definition: Forces.h:710
This class performs the different steps to solve the equations of motion via molecular dynamics simul...
Definition: Forces.h:223
int NComp
of components
Definition: Forces.h:191
void Task()
Perform a operation every time step.
Definition: ForcesLoop.cpp:421
void SimLeaves()
Simulation loop for leaves.
Definition: Forces.h:708
double DensFuncNrgChInternal(int c)
Calculate the average energy from the density functional Hamiltonian for the chain c...
double CalcBondedCh(int c, double *Pot)
Calculate the bonded and spring interaction in a cell.
void Create3d()
Create a lattice of connected beads.
double DerWei3(const double r, const double a)
Derivative of the cubic weighting function.
int menu
Menu identifier.
Definition: Forces.h:835
double CalcPairwise(int p, double *Pot)
Calculate the non bonded interaction energy with the neighbouring particles.
void AddCylinder(int nNano)
Add a cylinder as a boundary condition.
Information of every particle.
Definition: VarData.h:214
double DensFuncNrgGhost(double *Pos, int p1, int t1)
Calculation of the energy from the density functional Hamiltonian for the ghost particle.
void WidomRemove(double *NrgDiff, int p)
Widom removal.
int Interp()
Show interpolating lines.
Definition: ForcesDraw.cpp:617
void SolveRod()
Solve a system of four oder differential equation of particles connected by links.
double CutOff2
CutOff of the lennard jones.
Definition: Forces.h:165
void BerendsenTherm()
Berendsen thermostat.
double CalcBonded(int p, double *Pot)
Calculate the spring and the bonded interactions with the other monomers in the chain.
void SelectBead(int p)
Select a particle.
double SumDens(int pInit, int pEnd)
Sum the local density for the particles between pInit and pEnd and multiply the factors by the virial...
void ChooseSimMode()
Choose the simulation method.
Definition: ForcesLoop.cpp:3
Reads and elaborates a system of chains.
Definition: VarData.h:521
int ReadConfDinamica(char *File)
Read the config file.
Definition: Forces.cpp:585
int IfRot
Boh.
Definition: Forces.h:829
void ReInsertCh(int c)
Reinsert the chain in the previous position.
void DynamicsView()
Idle function to run the dynamics.
Definition: ForcesDraw.cpp:57
int NSlab
of slabs
Definition: Forces.h:195
void CalcDens()
Calculate the densities.
Definition: ForcesTens.cpp:45
Domain decomposition as pointer to linked particles.
Definition: Cubo.h:162
void Sim1d()
Simulation loop for 1d.
Definition: Forces.h:702
double BaseLine
Baseline of the potential.
Definition: Forces.h:167
double LJCutOff
Lennard-Jones.
Definition: Forces.h:163
void SaveCh(int c)
Save the chain configuration.
double RigidHamaker(int n, double Dist, double *Pot, double Sign)
Hamaker potential.
int AddDens(int pInit, int pEnd)
Add the densities connected with the particles between pInit and pEnd.
void CreateLeaves()
Create two connected sheets and add a protein.
double LJ39(double Dist2, int t1, int t2, double *Pot)
Integrated Lennard Jones potential.
double Wei2(const double r, const double b)
Quadratic weighting function.
int ThermMode
Thermostat mode.
Definition: Forces.h:749
TENS Tens
Structure for the pressure calculation.
Definition: Forces.h:783
PART * Pl
Splines.
Definition: Forces.h:787
int IfNano
Boh.
Definition: Forces.h:761
void AddCircle(int nNano)
Add a circle as a boundary condition.
DomDec * Pc
Pair list.
Definition: Forces.h:785
double NrgPBead
Average energy per particle.
Definition: Forces.h:735
double WeightSetBond(int p, int t)
Weight a set of bonds for the configurational bias.
double InsertCh(int c)
Displace a chain in the box.
double SLap
Prefactor of the square laplacian.
Definition: Forces.h:149
double TensRefCart(double *Pos1, double *Pos2, double *PosP1, double *PosP2)
Particle positions back folded on the tension reference point (Cartesian coordinates) ...
Definition: ForcesTens.cpp:199
void SolveLinks()
Solve a system of four oder differential equation of particles connected by links.
void AvForces(char **argv, int *FilePos, int NFile)
Average of the forces.
Definition: ForcesLoop.cpp:375
void DefNanoForceParam()
Define the parameters for calculating the force.
int Update()
Boh.
double ForThr
Maximum force allowed.
Definition: Forces.h:171
double DensFuncNrgGhostInternal(double *Pos, int p1, int t1)
Calculation of the energy from the density functional Hamiltonian for the ghost particle.
double NrgElectro(int p)
Energy of an electric line.
int TryInsert()
Trial insertion.
FORCES * Fm
Array containing the forces for each particle.
Definition: Forces.h:781
int Bead2Move
Bead to move.
Definition: Forces.h:737
double CalcNrgBead(int p, double *Pot)
Pointer to the energy function.
Definition: Forces.h:511
int BeadType
Boundary condition for a single particle.
Definition: Forces.h:833
void DefForceParam()
Define the parameters for calculating the force.
void WidomBiasChOut(double *Weight, int c)
Widom with Rosenbluth weight.
void Solve()
Solve a system of four oder differential equation.
Definition: ForcesLoop.cpp:9
int NSpline
Total number of points for drawing a spline.
Definition: Forces.h:777