56 CALC_DENS_CH = 0x00080,
68 CALC_CONF_BIAS = 0x02000,
70 CALC_BIL_BIAS = 0x04000,
72 CALC_SPH_BIAS = 0x08000,
76 CALC_ELECTRO = 0x20000,
254 double *FirstBeadDistr;
256 double **BondPosBias;
260 double BorderBias[2];
270 int PeriodicImage[3];
276 typedef double(
Forces::*CALC_NRG)(
int p,
double *Pot);
283 void ChooseCalcMode(
int Mode);
285 typedef double(
Forces::*CALC_POT)(
double Dist,
int t1,
int t2,
double *Pot);
290 void ChoosePot(
int Mode);
296 typedef double(
Forces::*STEP_CONF)();
298 typedef double(
Forces::*STEP_SIM)();
300 STEP_CONF ConfigSys();
302 STEP_SIM CalcUpdate();
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, ...);
334 void ReOpen(
char *FName,
int Bf);
470 double NanoNrg(
double *Pos,
int t);
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);
486 void PointShape(
int iShape);
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);};
511 double CalcNrgBead(
int p,
double *Pot){
return (*this.*NrgBead)(p,Pot);};
513 double CalcNrgCh(
int c,
double *Pot){
return (*this.*NrgCh)(c,Pot);};
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);
577 int AddDens(
int pInit,
int pEnd);
579 int RemDens(
int pInit,
int pEnd);
583 double SumDens(
int pInit,
int pEnd);
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);
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);
676 void RunWidom(
char *File2Read,
int f);
694 void AvForces(
char **argv,
int *FilePos,
int NFile);
797 void keyboard(
unsigned char key,
int x,
int y);
841 extern void DynamicsMotion();
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.
void RunDynamics()
Run a step further.
void CalcTens()
Calculate the forces for the tension profile.
void WidomBiasChIn(double *Weight)
Widom with Rosenbluth weight.
TENS_REF Tens_Ref
Pointer to a coordinate distance.
double LJMin
Lennard-Jones.
double CheckDomDec(int p)
Check if all the particles are taken in account.
void ExplorePepSize2d()
Find the minimun bilayer thickness for different peptide sizes.
void CreateRod()
Create a initial disposition of particle for a stiff rod.
void keyboard(unsigned char key, int x, int y)
Additional key bindings.
double Ext
External force.
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.
void CalcTotNrg(char *FName, int nFile)
Total energy of the system.
double CalcTotNrgCh()
Calculate and sum up the energy of the chains.
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.
int ForceFieldLine()
Helfrich Hamiltonian for a line.
void WriteTens(char *TFile, int Comp, double InvNFile)
Write the pressure and density profile.
void ReSetNPCh(int NewNPCh)
Set a new number of particle per chain.
double Cont
Contact/Friction.
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.
int TryRemoveChBias()
Trial biased removal of a chain.
void AddRigid()
Add all rigid bodies as a boundary condition.
void DrawCarpet()
Two dimensional surface.
CALC_THERM CalcTherm
Pointer to the energy calculation function.
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.
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.
void TabForceAlloc(int NTabExt)
Tabulate the values of the force.
void RunWidom(char *File2Read, int f)
Build the widom histograms.
void(Forces::* CALC_THERM)()
Pointer type to the potential function.
double Lap
Prefactor of the Laplacian.
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.
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 ListNeiCell(int p, double *Pos, int *NeiList)
List of the cells close to the particle position.
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.
double GaussVar
Standard deviation of the gaussian chain.
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.
double DerWei2(const double r, const double b)
Derivative of the quadratic weighting function.
double PotThr
Maximum potential allowed.
void Dynamics()
Sum up all the forces and update the positions.
int TryInsertCh()
Trial insertion of a chain.
void DrawSoil()
Two dimensional soil.
int IfInterp
If interpolates with the splines.
void RunWidomChIn(char *File2Read, int f)
Build the widom histograms.
double NrgChBondDens(int c, double *Pot)
Calculate the bond and the density functional energies.
void FillMatrix()
Fill the entries of the interaction matrix.
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.
void WidomInsert(double *NrgDiff)
Widom insertion.
int NWrite
How many timesteps before write the snapshot.
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.
~Forces()
Frees the memory.
void CalcNrgPep(char *File2Open, int f)
Exchange energy of the protein.
int IfExit
Exit from the loop.
void CreateRigid()
Create rigid bodies.
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.
void SolveLinksIterative()
Solve a system of four oder differential equation of particles connected by links.
void NoTherm()
No thermostat.
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.
int SysAlloc
Which arrays are allocated.
void WidomRemoveCh(double *NrgDiff, int c)
Widom removal.
int IfFillMatrix
If the matrix has to be changed.
void CalcForcesDensFunc()
Calculate the forces for the density functional.
int NRemoval
Count accepted moves.
void PrepareParallel(int argc, char **argv)
Create the grid for the parallelisation.
double ChemPotEx
Chemical potential of the particles.
double TensRefPol(double *Pos1, double *Pos2, double *PosP1, double *PosP2)
Particle positions back folded on the tension reference point (polar coordinates) ...
void CreateInitial()
Create an initial configuration and an appropriate force field.
int SimLimit
Maximum number of time steps.
void ExploreDoubleMin()
Find the minimum for different interpeptide distances.
int CalcMode
Calculation mode.
void ApplyTherm()
Pointer to the energy function.
void ChooseThermostat(int Mode)
Choose a calculation mode.
void Shout(const char *s,...)
Internal message.
double ElectroPot(double Dist2, int t1, int t2, double *Pot)
Potential for the electrical lines.
void Create1d()
Create single line of connected monomers.
void Info()
System's info.
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.
int InsertBead(int p)
Insert a particle in the box.
GLuint * Cylinder
List referring the cylinder.
double NrgStep(int p)
The energy is constant within the cutoff.
double Dx
Spatial separation between particles.
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.
void RosenOut(FILE *WidomIn)
Rosenbluth histograms for deletion.
void SumTens(int p1, int p2, double Forces, double *DistRel)
Sum the forces on the line joining the points p1 and p2.
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.
void ReOpen(char *FName, int Bf)
Open a new file.
void AndersenTherm()
Andersen thermostat.
void TabPot()
Tabulate the values of the potential.
void InitConst()
Read the config file.
KFORCES Kf
Prefactor of the forces.
int NUpdate
How many timesteps before redrawing.
void GetForceField()
Calculate the force field summing every single contribution.
double MinimalNrg()
Minmal nrg.
GLuint Particles
List referring the particle.
double IncrDist
Step to move a particle.
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.
void CreateElectro()
Create a initial disposition of houses to collect on a line.
void ExplorePepSize()
Find the minimun bilayer thickness for different peptide sizes.
int Old2Move
Old part to move.
Prefactors of the forces.
int SysShape
Shape of system.
double CutOff
Cut off of the interactions.
void PrintForce()
Print the force and the potential.
void RosenIn(FILE *WidomIn)
Rosenbluth weights for insertion.
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.
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.
Single contribution of the forces.
void MinimalMD()
Minmal md.
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.
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.
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.
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.
double ** Dens
Density array.
void ClearDens()
Set the local densities to zero.
double ChemPotId
Chemical potential of the particles.
double DensFuncNrgChAv(int c)
Calculate the average energy from the density functional Hamiltonian for the chain c...
int IfSphere
Visualize spheres or points.
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.
int ReSetNChain(int NewNChain)
Realloc the number of chains.
void AllocTens()
Alloc the pressure profile.
int GetNei(double *Pos, int *NeiList)
Choose among the different neighbouring lists.
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.
void DrawParticles()
Alternative drawing of the particle position.
void Sim2d()
Simulation loop for 2d.
int IfMovie
Produce the images for the video.
int Graphics(int argc, char **argv)
Initialize the scene.
void SimRigid()
Simulation loop for rigid.
This class performs the different steps to solve the equations of motion via molecular dynamics simul...
void Task()
Perform a operation every time step.
void SimLeaves()
Simulation loop for leaves.
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.
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.
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.
void SolveRod()
Solve a system of four oder differential equation of particles connected by links.
double CutOff2
CutOff of the lennard jones.
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.
Reads and elaborates a system of chains.
int ReadConfDinamica(char *File)
Read the config file.
void ReInsertCh(int c)
Reinsert the chain in the previous position.
void DynamicsView()
Idle function to run the dynamics.
void CalcDens()
Calculate the densities.
Domain decomposition as pointer to linked particles.
void Sim1d()
Simulation loop for 1d.
double BaseLine
Baseline of the potential.
double LJCutOff
Lennard-Jones.
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.
TENS Tens
Structure for the pressure calculation.
void AddCircle(int nNano)
Add a circle as a boundary condition.
double NrgPBead
Average energy per particle.
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.
double TensRefCart(double *Pos1, double *Pos2, double *PosP1, double *PosP2)
Particle positions back folded on the tension reference point (Cartesian coordinates) ...
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.
void DefNanoForceParam()
Define the parameters for calculating the force.
double ForThr
Maximum force allowed.
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.
int Bead2Move
Bead to move.
double CalcNrgBead(int p, double *Pot)
Pointer to the energy function.
int BeadType
Boundary condition for a single particle.
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.
int NSpline
Total number of points for drawing a spline.