From: Philipp Schön (phschoen_at_web.de)
Date: Fri Aug 03 2007 - 02:36:19 CDT
Dear Users
I changed the source code in order to apply a constant temperature gradient across a surface. In doing so I add an additional part (=> see /* THIS PART IS NEW */ below) to the subroutine langevinVelocities for all atoms with i < 1000.
However, there is no effect on the simulation, i.e. on the temperature profile! At least something should change to all atoms between 0 and 1000 when running these lines? Do the atom counter ( int i = 0; i < numAtoms; ++i ) coincide with the integer given in the pdb file or can it change during run time? If it changes how can I assign a certain temperature to certain atoms?
Thanks for any help.
Regards
Philipp
void Sequencer::langevinVelocities(BigReal dt_fs)
{
if ( simParams->langevinOn )
{
FullAtom *a = patch->atom.begin();
int numAtoms = patch->numAtoms;
Molecule *molecule = Node::Object()->molecule;
BigReal dt = dt_fs * 0.001; // convert to ps
BigReal kbT = BOLTZMAN*(simParams->langevinTemp);
int lesReduceTemp = simParams->lesOn && simParams->lesReduceTemp;
BigReal tempFactor = lesReduceTemp ? 1.0 / simParams->lesFactor : 1.0;
for ( int i = 0; i < numAtoms; ++i )
{
int aid = a[i].id;
BigReal f1 = exp( -1. * dt * molecule->langevin_param(aid) );
BigReal f2 = sqrt( ( 1. - f1*f1 ) * kbT *
( a[i].partition ? tempFactor : 1.0 ) / a[i].mass );
a[i].velocity *= f1;
a[i].velocity += f2 * random->gaussian_vector();
/* THIS PART IS NEW */
if (i < 1000)
{
int aid = a[i].id;
BigReal f1 = exp( -1. * dt * molecule->langevin_param(aid) );
BigReal f2 = sqrt( ( 1. - f1*f1 ) * (BOLTZMAN * 1000.0) *
( a[i].partition ? tempFactor : 1.0 ) / a[i].mass );
a[i].velocity *= f1;
a[i].velocity += f2 * random->gaussian_vector();
}
/* IBLATH_2 => END */
}
}
}
_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220
This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:45:02 CST