My favorites | Sign in
Project Logo
                
Search
for
Updated Jul 03, 2007 by rosandi
SimSystem  

SimSystem class performs Molecular Dynamic simulation. It manages the simulation systems. This class must be inherited by the main class in the main simulation program. This class is the container for simulation system atoms. Any other classes will reffer and use atom data from this class. The main simulation class must implements at least two functions, CreateSystem() and InitSystem(). CreateSystem() function is used to create the simulation system by adding atoms, crystals, conditioners, detectors and setting integrator. InitSystem is used to do initialization before running the simulation, such as setting the boundary defining boundary condition, and other needed initialization. Another important functions are BeforeRun() and AfterRun(). These functions are called exactly before and and after running simulation.

Header file: simsystem.h

Variables:

All the variables, if not stated explicitly, are public.

  • IsReady |bool, private|, indicates that the system is ready.
  • Restored |bool, private|, indicates that the system is restored from a restore/restart file.
  • TimeStepAdaptionPeriod |integer, private|, the period to adapt time step. SimSystem will adjust TimeStep according to the maximum velocity of the atoms every this period.
  • ExternalInterupt |pointer to integer, private|. This variable points to an integer variable outside the class. A non-zero value of that variable will be consider as an interrupt to the system. When the system recieves interrupt, it will quit the main loop and call Interruption() function.
  • DynamicTimeStep |bool, protected|, indicates that the simulation uses dynamic time step. If this variable is false, then SimSystem will not adjust TimeStep every TimeStepAdaptionPeriod.
  • HasInline |bool, protected|, indicates that the simulation has an inline function. When it is true, then the InlineFunction() will be called in every step.
  • Forces |pointer to Integrator|, keeps the force kernels and do integration using those forces.
  • Conditioners |vector of Conditioner|, keeps the Conditioners used by simulation. A Conditioner can be accesed using its index, as Conditionersindex. The index is the sequence of conditioner insertion to the system, starting with 0.
  • Detectors |vector of Detector|, keeps the Detectors used by simulation. Accesing a detector is the same like conditioner.
  • AtomContainers |vector od AtomContainer|, keeps the AtomContainers in the simulations. Accesing atom container is the same like conditioner.
  • SimBeginTime, SimEndTime |time_t|, keeps the information about starting and ending of simulation, in real time.
  • Step |integer|, the simulation step counter.
  • PBoundary |integer|, keeps the boundary conditions of the simulation. The predifined conditions are: PERIODIC_X, PERIODIC_Y, PERIODIC_Z, PERIODIC, and NOPERIODIC.
  • Energy |double|, systems total energy.
  • Kinetic |double|, systems kinetic energy.
  • Virial |double|, systems virial.
  • Potential |double|, system potential energy.
  • BasePotential |double|, the base potential of the system, calculated before running simulation. At runtime, the potential shown is after subtraction by this value.
  • TimeStep |double|, the time step.
  • ElapsedTime |double|, simulations elapsed time.
  • MaxTime |double|, maximum simulation time. The simulation stops after ElapsedTime reaches this time.
  • MaxPath |double|, maximum path distance of the atoms in every step. For platinum crystal is 0.0981.
  • SqrMaxVelocity, the square of maximum atom velocity.
  • Box |structure of 9 doubles|. This structure keeps the boundary box of the simulation system. Fields: x0, x1, y0, y1, z0, z1, are the vertices of the box, and lx, ly, lz are the length of the sides.

Functions:

All the functions, if not stated explicitly, are public functions and does not return anything.


Sign in to add a comment
Hosted by Google Code