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
DiagPort Class Reference

Abstract class for directing diagnostics to some output. The DiagPort defines an abstract interface for directing diagnostic data to some output. At the moment only the File class implements this interface. More...

#include <diagnostic.h>

Inheritance diagram for DiagPort:
Task File

List of all members.

Public Member Functions

 DiagPort ()
 Default constructur.
virtual ~DiagPort ()
 Destructor.
std::string GetClassName () const
 Returns the name of the class, here "DiagPort".
void Init ()
bool Execute ()
virtual void BeginStep (const std::string &strType="", const std::string &strName="")=0
virtual void EndStep ()=0
virtual void Out (const double d)=0
virtual void Out (const Position &pos)=0
virtual void Out (const DOUBLEVEC &vec)=0
virtual void Out (const Velocity &V, double dF=1.0)=0
virtual void Out (const grid< double > &g, double dF=1.0)=0
virtual void Out (const grid< Position > &g, double dF=1.0)=0
virtual void Out (const grid< Velocity > &g, double dF=1.0)=0
- 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)
 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

bool Series
 Every timestep produces a new output.
SimulationSim
 A pointer to the overall simulation object.
- 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

Abstract class for directing diagnostics to some output. The DiagPort defines an abstract interface for directing diagnostic data to some output. At the moment only the File class implements this interface.

Parameters:
seriesThis can be either 0 or 1. If series==1 the output should produce a time series, otherwise it should create a new output for ever time diagnostic data is produced. The implementation of this option is left to the derived classes. The default is true (1).

Member Function Documentation

bool DiagPort::Execute ( )
inlinevirtual

Doesn't do anything but causes the DiagPort to be removed from the task list.

Reimplemented from Task.

void DiagPort::Init ( )
virtual

Initialization sets the Sim pointer from the pProcess member which is part of every Task object.

Todo:
Create a safe typecast

Reimplemented from Task.

Reimplemented in File.

virtual void DiagPort::Out ( const grid< Velocity > &  g,
double  dF = 1.0 
)
pure virtual

These methods are called by a Diagnostic object whenever output is created. BeginStep is called at the beginning of the diagnostics output to initialize the port (eg open a file). EndStep is called at the end of the output to finalize the port (eg close the file). The port supplies a number of Out-methods for producing diagnostics of different types (vector of double, Velocity and grid of double, Position or Velocity). Most of these include an optional scaling factor dF.

Todo:
The methods taking a grid could be a bit more versatile: They could just write out a subset of the grid, may or may not write out the grid index, write out only part of the data structure (ie only the x-componentent of the Velocity, and allow specification of the field seperator.

Implemented in File.


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