~esys-p-dev/esys-particle/trunk

« back to all changes in this revision

Viewing changes to Model/Particle.cpp

  • Committer: steffen
  • Date: 2007-12-04 08:40:31 UTC
  • Revision ID: svn-v4:1ddc92f8-1f06-0410-a909-b11019f1b28a:lsm/branches/Dublin2005-11-22:999
- added setParticleDensity (only NRot so far)
- added elastic interactions with 2DLattice

Show diffs side-by-side

added added

removed removed

Lines of Context:
179
179
}
180
180
 
181
181
/*!
 
182
  set the density of the particle
 
183
*/
 
184
void CParticle::setDensity(double rho)
 
185
{
 
186
  const double pi=3.141592654;
 
187
  
 
188
  if(getDo2dCalculations()){
 
189
    m_mass=rho*pi*m_rad*m_rad;
 
190
  } else {
 
191
    m_mass=(4.0/3.0)*rho*pi*m_rad*m_rad*m_rad;
 
192
  }
 
193
  if(m_mass!=0.0){
 
194
    m_div_mass=1.0/m_mass;
 
195
  } else {
 
196
    m_div_mass=0.0;
 
197
  }
 
198
}
 
199
 
 
200
/*!
182
201
  Get the particle member function which returns a scalar field of a given name.
183
202
 
184
203
  \param name the name of the field