All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
PLMD::vesselbase::Vessel Class Referenceabstract

#include <Vessel.h>

Inheritance diagram for PLMD::vesselbase::Vessel:
Inheritance graph
[legend]

Public Member Functions

 Vessel (const VesselOptions &da)
 The constructor. More...
 
virtual ~Vessel ()
 Virtual destructor needed for proper inheritance. More...
 
std::string getName () const
 Return the name. More...
 
std::string getLabel () const
 Return the label. More...
 
void checkRead ()
 Check that readin was fine. More...
 
void zero ()
 Set all the buffer elements to zero. More...
 
void addToBufferElement (const unsigned &i, const double &val)
 Add something to the ith element in the buffer. More...
 
virtual std::string description ()=0
 Return a description of the vessel contents. More...
 
virtual void prepare ()
 Do something before the loop. More...
 
virtual bool calculate ()=0
 Calculate the part of the vessel that is done in the loop. More...
 
virtual void finish ()=0
 Complete the calculation once the loop is finished. More...
 
virtual void resize ()=0
 Reset the size of the buffers. More...
 
virtual bool applyForce (std::vector< double > &forces)=0
 Retrieve the forces on the quantities in the vessel. More...
 
virtual unsigned getNumberOfTerms ()=0
 Retrieve the number of terms we need to accumulate. More...
 

Static Public Member Functions

static void registerKeywords (Keywords &keys)
 Reserve any keywords for this particular vessel. More...
 

Public Attributes

Loglog
 Reference to the log on which to output details. More...
 

Protected Member Functions

int getNumericalLabel () const
 Return the numerical label. More...
 
void error (const std::string &errmsg)
 Report an error. More...
 
template<class T >
void parse (const std::string &key, T &t)
 Parse something from the input. More...
 
template<class T >
void parseVector (const std::string &key, std::vector< T > &t)
 Parse one keyword as std::vector. More...
 
void parseFlag (const std::string &key, bool &t)
 Parse one keyword as boolean flag. More...
 
std::string getAllInput ()
 This returns the whole input line (it is used for less_than/more_than/between) More...
 
ActionWithVesselgetAction ()
 Return a pointer to the action we are working in. More...
 
double getTolerance () const
 Return the value of the tolerance. More...
 
double getNLTolerance () const
 Return the value of the neighbor list tolerance. More...
 
void resizeBuffer (const unsigned &n)
 Set the size of the data buffer. More...
 
void setBufferElement (const unsigned &i, const double &val)
 Set the value of the ith element in the buffer. More...
 
double getBufferElement (const unsigned &i) const
 Get the value in the ith element of the buffer. More...
 
void stashBuffers ()
 Store everything that is the buffers. More...
 
void setBufferFromStash ()
 Add the contents of the stash to the buffer. More...
 

Protected Attributes

Communicatorcomm
 A copy of the communicator. More...
 

Private Attributes

std::string myname
 The keyword for the vessel in the input file. More...
 
std::string mylabel
 The label for the vessel for referencing. More...
 
const int numlab
 The numerical label for this object. More...
 
ActionWithVesselaction
 The action that this vessel is created within. More...
 
std::vector< double > stash
 Something to store the buffer if this is required. More...
 
unsigned bufstart
 The start of this Vessel's buffer in buffer in the underlying ActionWithVessel. More...
 
unsigned bufsize
 The number of elements in this vessel's buffered data. More...
 
std::vector< std::string > line
 Directive line. More...
 
const PLMD::Keywordskeywords
 The keywords. More...
 
bool finished_read
 This just checks we have done checkRead. More...
 

Friends

class ActionWithVessel
 

Detailed Description

Definition at line 75 of file Vessel.h.

Constructor & Destructor Documentation

PLMD::vesselbase::Vessel::Vessel ( const VesselOptions da)

The constructor.

Definition at line 57 of file Vessel.cpp.

virtual PLMD::vesselbase::Vessel::~Vessel ( )
inlinevirtual

Virtual destructor needed for proper inheritance.

Definition at line 141 of file Vessel.h.

Member Function Documentation

void PLMD::vesselbase::Vessel::addToBufferElement ( const unsigned &  i,
const double &  val 
)
inline

Add something to the ith element in the buffer.

Definition at line 252 of file Vessel.h.

virtual bool PLMD::vesselbase::Vessel::applyForce ( std::vector< double > &  forces)
pure virtual
virtual bool PLMD::vesselbase::Vessel::calculate ( )
pure virtual
void PLMD::vesselbase::Vessel::checkRead ( )

Check that readin was fine.

Definition at line 111 of file Vessel.cpp.

virtual std::string PLMD::vesselbase::Vessel::description ( )
pure virtual
void PLMD::vesselbase::Vessel::error ( const std::string &  errmsg)
protected

Report an error.

Definition at line 122 of file Vessel.cpp.

virtual void PLMD::vesselbase::Vessel::finish ( )
pure virtual
ActionWithVessel * PLMD::vesselbase::Vessel::getAction ( )
inlineprotected

Return a pointer to the action we are working in.

Definition at line 236 of file Vessel.h.

std::string PLMD::vesselbase::Vessel::getAllInput ( )
protected

This returns the whole input line (it is used for less_than/more_than/between)

Definition at line 84 of file Vessel.cpp.

double PLMD::vesselbase::Vessel::getBufferElement ( const unsigned &  i) const
inlineprotected

Get the value in the ith element of the buffer.

Definition at line 258 of file Vessel.h.

std::string PLMD::vesselbase::Vessel::getLabel ( ) const

Return the label.

Definition at line 80 of file Vessel.cpp.

std::string PLMD::vesselbase::Vessel::getName ( ) const

Return the name.

Definition at line 76 of file Vessel.cpp.

double PLMD::vesselbase::Vessel::getNLTolerance ( ) const
inlineprotected

Return the value of the neighbor list tolerance.

Definition at line 231 of file Vessel.h.

virtual unsigned PLMD::vesselbase::Vessel::getNumberOfTerms ( )
pure virtual
int PLMD::vesselbase::Vessel::getNumericalLabel ( ) const
inlineprotected

Return the numerical label.

Definition at line 216 of file Vessel.h.

double PLMD::vesselbase::Vessel::getTolerance ( ) const
inlineprotected

Return the value of the tolerance.

Definition at line 226 of file Vessel.h.

template<class T >
void PLMD::vesselbase::Vessel::parse ( const std::string &  key,
T &  t 
)
protected

Parse something from the input.

Definition at line 169 of file Vessel.h.

void PLMD::vesselbase::Vessel::parseFlag ( const std::string &  key,
bool &  t 
)
protected

Parse one keyword as boolean flag.

Definition at line 93 of file Vessel.cpp.

template<class T >
void PLMD::vesselbase::Vessel::parseVector ( const std::string &  key,
std::vector< T > &  t 
)
protected

Parse one keyword as std::vector.

Definition at line 184 of file Vessel.h.

virtual void PLMD::vesselbase::Vessel::prepare ( )
inlinevirtual

Do something before the loop.

Reimplemented in PLMD::vesselbase::BridgeVessel.

Definition at line 155 of file Vessel.h.

void PLMD::vesselbase::Vessel::registerKeywords ( Keywords keys)
static

Reserve any keywords for this particular vessel.

Definition at line 53 of file Vessel.cpp.

virtual void PLMD::vesselbase::Vessel::resize ( )
pure virtual
void PLMD::vesselbase::Vessel::resizeBuffer ( const unsigned &  n)
inlineprotected

Set the size of the data buffer.

Definition at line 221 of file Vessel.h.

void PLMD::vesselbase::Vessel::setBufferElement ( const unsigned &  i,
const double &  val 
)
inlineprotected

Set the value of the ith element in the buffer.

Definition at line 246 of file Vessel.h.

void PLMD::vesselbase::Vessel::setBufferFromStash ( )
protected

Add the contents of the stash to the buffer.

Definition at line 133 of file Vessel.cpp.

void PLMD::vesselbase::Vessel::stashBuffers ( )
protected

Store everything that is the buffers.

Definition at line 128 of file Vessel.cpp.

void PLMD::vesselbase::Vessel::zero ( )
inline

Set all the buffer elements to zero.

Definition at line 241 of file Vessel.h.

Friends And Related Function Documentation

friend class ActionWithVessel
friend

Definition at line 76 of file Vessel.h.

Member Data Documentation

ActionWithVessel* PLMD::vesselbase::Vessel::action
private

The action that this vessel is created within.

Definition at line 85 of file Vessel.h.

unsigned PLMD::vesselbase::Vessel::bufsize
private

The number of elements in this vessel's buffered data.

Definition at line 91 of file Vessel.h.

unsigned PLMD::vesselbase::Vessel::bufstart
private

The start of this Vessel's buffer in buffer in the underlying ActionWithVessel.

Definition at line 89 of file Vessel.h.

Communicator& PLMD::vesselbase::Vessel::comm
protected

A copy of the communicator.

Definition at line 102 of file Vessel.h.

bool PLMD::vesselbase::Vessel::finished_read
private

This just checks we have done checkRead.

Definition at line 99 of file Vessel.h.

const PLMD::Keywords& PLMD::vesselbase::Vessel::keywords
private

The keywords.

Definition at line 97 of file Vessel.h.

std::vector<std::string> PLMD::vesselbase::Vessel::line
private

Directive line.

This line is progressively erased during vessel construction so as to check if all the present keywords are correct.

Definition at line 95 of file Vessel.h.

Log& PLMD::vesselbase::Vessel::log

Reference to the log on which to output details.

Definition at line 135 of file Vessel.h.

std::string PLMD::vesselbase::Vessel::mylabel
private

The label for the vessel for referencing.

Definition at line 81 of file Vessel.h.

std::string PLMD::vesselbase::Vessel::myname
private

The keyword for the vessel in the input file.

Definition at line 79 of file Vessel.h.

const int PLMD::vesselbase::Vessel::numlab
private

The numerical label for this object.

Definition at line 83 of file Vessel.h.

std::vector<double> PLMD::vesselbase::Vessel::stash
private

Something to store the buffer if this is required.

Definition at line 87 of file Vessel.h.


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