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 | Protected Member Functions | Protected Attributes
Density Class Reference

Calculates and stores the charge density on the grid points in the simulation box. The calculation is done by requesting from all the Species to calculate their particle density and then adding up the results. More...

#include <density.h>

Inheritance diagram for Density:
Task

List of all members.

Public Member Functions

 Density ()
 Default constructor.
virtual ~Density ()
 Default destructor.
std::string GetClassName () const
 Returns the name of the class, here "density".
void Init ()
 Initialization of the charge density. Retrieves the references for the Geometry and the Wall object. The Wall object is only needed here to tell the Task list that Density has to be executed after Wall. It sets Nx, dx and dV from the Geometry and then resizes the grid den to the size given in Geometry.
bool Execute ()
 Iterate through the Species and add up the density. Every Species object is requested to create the particle density. This particle density is then multiplied with the Species superparticle charge and added to the grid den. Finally the Geometry is asked to correct the boundary values of the density for cells with non unit volume.
void AddSpecies (SpeciesBase *pS)
 Adds a species to the species vector.
virtual grid< double > * GetGrid ()
 Return a reference to the grid.
virtual const GridPositionGetNx () const
 Returns the grid size.
double & operator[] (GridPosition i)
 Returns the charge density $\rho({\bf x}_i)$ at a grid position.
- 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.

Protected Member Functions

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 Member Functions inherited from Task
void AddPredecessor (const std::string &strPred)
 Add the name of a predecessor that has to be executed before this Task.

Protected Attributes

GeometrypGeom
 Reference to the Geometry and Wall objects.
GridPosition NG
 Size of the density grid.
double dx
 Grid spacing.
double dC
 Super particle charge.
double dV
 Physical volume of a grid cell in $\text{m}^3$.
grid< double > den
 Contains the charge density values $\rho({\bf x})$.
std::vector< WSpeciesBasespecies
 Container of all the species that contribute to the charge density.
- Protected Attributes inherited from Task
int nNr
 The running number of this Task.
std::string strName
 The name of this Task.
TaskpParent
 The parent Task to which this Task belongs.
ProcesspProcess
 The Process to which this Task belongs.
std::string strNorm
 The name of the referenced Normalization object.
NormalizationNorm
 The pointer to the referenced Normalization object.
TASKLIST plTasks
 A list of sub-Tasks.
int nStart
int nEnd
int nStep

Detailed Description

Calculates and stores the charge density on the grid points in the simulation box. The calculation is done by requesting from all the Species to calculate their particle density and then adding up the results.

Parameters:
geometry,wallName of referenced Geometry and Wall objects
diagnosticAllows the density to be written

Member Function Documentation

bool Density::Execute ( )
virtual

Iterate through the Species and add up the density. Every Species object is requested to create the particle density. This particle density is then multiplied with the Species superparticle charge and added to the grid den. Finally the Geometry is asked to correct the boundary values of the density for cells with non unit volume.

See also:
Species::MakeRho
Geometry::DivByVolume

Reimplemented from Task.


Member Data Documentation

Geometry* Density::pGeom
protected

Reference to the Geometry and Wall objects.

Pointer to the geometry object


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