O P A R - Open Architecture Particle in Cell Simulation - Version 3.0
Plasma simulations with dust particles
 All Classes Files Functions Variables Friends Macros Groups Pages
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
Species Class Reference

This class implements an individual particle species. A Species class contains all the positions and velocities of a particle species. It also contains direct links to a Wall Object and a grid containing the particle density. Normally a species will contain at least a Movement sub-Task and either a Generation sub-Task or some Task that will create particles during run time. More...

#include <species.h>

Inheritance diagram for Species:
SpeciesBase Task

List of all members.

Public Member Functions

 Species ()
 Default constructor.
virtual ~Species ()
 Destructor.
virtual void Init ()
 Get the pointer to the Wall and Geometry and un-normalize all the parameters. Initialize the particle density grid.
virtual bool Execute ()
 Executes the Task. This is the place where the algorithm for executing a Task it placed. The return value specifies, if the task is finished and can be removed. The basic Execute method executes all its sub-Tasks. The derived classes should call this member function, whenever there are subtasks to be executed.
void MakeRho ()
 Weight all the particles onto the density grid. Only needs to be executed when particles have moved.
double GetSize () const
 Return the size of the superparticles.
double GetSize0 () const
 Return the initial size of the superparticles.
double GetCharge () const
 Return the Charge.
double GetMass () const
 Return the Mass.
double Getdt () const
 Return the time step.
grid< double > & Rho ()
 Return a reference to the density grid.
double Vabs (int p) const
 Return the absolute velocity of particle number p.
void SetV (int p, const Velocity &_V)
 Set the velocity of particle p to _V.
Position GetRx (int nParticle) const
 Returns the position of particle nParticle.
void SetMovedFlag ()
 Set the Moved flag to true.
void ClearMovedFlag ()
 Set the Moved flag to false.
bool HasMoved () const
 Return if particles have moved.
int Generate (Position aX, Velocity aV)
void Remove (int nP)
void Swap (int i1, int i2)
void ModifySize (double densityContribution)
 Modify the size of the particles. This modifies the size of the simulation particles given the contribution of a particle creator and the total number of particles. This can be called more than once. The density contributions are summed up and after the last call the particle size reflects the valid size of the superparticles. This method is particularly important in electrostatic simulations to prevent an overall charge density in the system.
- Public Member Functions inherited from SpeciesBase
virtual std::string GetClassName () const
 returns the name of the class, here "Species".
- Public Member Functions inherited from Task
 Task ()
 Default constructor sets the running number nNr of the Task.
virtual ~Task ()
 When destructing a Task is has to be detatched from the parents Task list.
int GetStep () const
 Return the interval between execution in timesteps.
int GetEnd () const
 Return the timestep when the Task ends execution.
bool DoNow ()
 Returns true if the Task is to be executed now.
std::string GetName () const
 Returns the name given to the Task object.
virtual bool IsInteractive () const
 If not specified otherwise, a Task is not interactive.
void AttachTask (Task *pTask)
 Insert Task into Task list and registers it with the Process.
void DetachTask (Task *pTask)
 DetachTask from Task list.
virtual std::string Rebuild (std::istream &in)
 Rebuilds the task from the setup. This normally does not need to be overwritten. Rebuild always returns the next token that does not belong to the object setup.
virtual void DumpTaskList (std::ostream &o, int nDepth=0)
 Recursively dumps the complete Task list into a stream.

Public Attributes

std::valarray< PositionX
 All the positions of the particles.
std::valarray< VelocityV
 All the velocities of the particles.
int Count
 Current number of particles.

Protected Member Functions

virtual PARAMETERMAP * MakeParamMap (PARAMETERMAP *pm=NULL)
 Register the parameters needed for the Task. A derived class should overwrite this whenever it needs additional parameters from the setup file. It should then ALWAYS call the MakeParamMap of its superclass.

Protected Attributes

GeometrypGeom
 Pointer to the Geometry.
WallpWall
 Pointer to the reference Wall.
grid< double > gRho
 Contains the particle density.
grid< double > gRho1
grid< double > gRho2
grid< double > gRho3
grid< double > gRho4
grid< double > gRho5
grid< double > gRho6
grid< double > gRho7
grid< double > gRho8
int MaxCount
 The maximum number of particles.
double Size
 The size of the superparticles.
double Size0
 Initial size of the superparticles.
double Charge
 The Charge of the particles.
double Mass
 The Mass of the particles.
double dt
 The timestep (in s)

Detailed Description

This class implements an individual particle species. A Species class contains all the positions and velocities of a particle species. It also contains direct links to a Wall Object and a grid containing the particle density. Normally a species will contain at least a Movement sub-Task and either a Generation sub-Task or some Task that will create particles during run time.

Parameters:
dtThe normalized timestep
massThe normalized mass of the particle
chargeThe normalized charge of the particle
sizeThe size of the superparticles
maxnThe maximum number of super particles
densityName of the referenced Density
wallName of the reference Wall
movementAllows creation of sub-Task Movement
ed_movementAllows creation of sub-Task RelEDMovement
ionizationAllows creation of sub-Task Ionization
homogen_setupAllows creation of sub-Task StartHomogen
two_stream_setupAllows creation of sub-Task StartTwoStream
shock_setupAllows creation of sub-Task StartUniformShock
file_setupAllows creation of sub-Task StartFile
phasespaceAllows creation of diagnostic sub-Task PhaseSpace
particlecountAllows creation of diagnostic sub-Task plotting the number of particles
geometryName of the reference Geometry

The documentation for this class was generated from the following files: