24 #include "tools/Exception.h"
25 #include "tools/Communicator.h"
26 #include "tools/Log.h"
49 parameters(da.parameters)
54 plumed_assert( keys.
size()==0 );
61 keywords(da.keywords),
63 comm(da.action->comm),
85 std::string fullstring;
86 for(
unsigned i=0;i<
line.size();++i){
87 fullstring = fullstring +
" " +
line[i];
95 plumed_massert(
keywords.
exists(key),
"keyword " + key +
" has not been registered");
98 plumed_massert(
keywords.
style(key,
"flag"),
"keyword " + key +
" is not a flag");
106 plumed_merror(
"there is a flag with no logical default in a vessel - weird");
113 std::string msg=
"cannot understand the following words from input : ";
114 for(
unsigned i=0;i<
line.size();i++) msg = msg +
line[i] +
", ";
119 if( describe.length()>0 )
log.
printf(
" %s\n", describe.c_str() );
void setBufferFromStash()
Add the contents of the stash to the buffer.
void stashBuffers()
Store everything that is the buffers.
std::string parameters
The parameters that are read into the function.
Log & log
Reference to the log stream.
void addToBufferElement(const unsigned &i, const double &val)
Add something to the ith element in the buffer.
virtual std::string description()=0
Return a description of the vessel contents.
static void registerKeywords(Keywords &keys)
Reserve any keywords for this particular vessel.
Communicator & comm
A copy of the communicator.
double getBufferElement(const unsigned &i) const
Get the value in the ith element of the buffer.
const std::string & getLabel() const
Returns the label.
static Keywords emptyKeys
std::string getLabel() const
Return the label.
bool finished_read
This just checks we have done checkRead.
std::vector< double > stash
Something to store the buffer if this is required.
This class holds the keywords and their documentation.
void parseFlag(const std::string &key, bool &t)
Parse one keyword as boolean flag.
int Get_rank() const
Obtain the rank of the present process.
std::string mylabel
The label for the vessel for referencing.
VesselOptions(const std::string &thisname, const std::string &thislab, const unsigned &nlab, const std::string ¶ms, ActionWithVessel *aa)
The constructor.
void print(Log &log) const
Print the documentation to the log file (used by PLMD::Action::error)
int printf(const char *fmt,...)
Formatted output with explicit format - a la printf.
const std::string & getName() const
Returns the name.
std::string getName() const
Return the name.
unsigned bufsize
The number of elements in this vessel's buffered data.
ActionWithVessel * action
The action that this vessel is created within.
Vessel(const VesselOptions &da)
The constructor.
bool style(const std::string &k, const std::string &t) const
Check if the keyword with name k has style t.
void error(const std::string &errmsg)
Report an error.
std::string mylabel
The label for this particular vessel;.
This class is used to pass the input to Vessels.
std::vector< std::string > line
Directive line.
const PLMD::Keywords & keywords
The keywords.
bool exists(const std::string &k) const
Check if there is a keyword with name k.
std::string myname
The keyword for the vessel in the input file.
void checkRead()
Check that readin was fine.
Log & log
Reference to the log on which to output details.
int Get_size() const
Obtain the number of processes.
bool getLogicalDefault(std::string key, bool &def) const
find out whether flag key is on or off by default.
std::string getAllInput()
This returns the whole input line (it is used for less_than/more_than/between)
const int numlab
The numerical label for this object.
unsigned size() const
Return the number of defined keywords.
This is used to create PLMD::Action objects that are computed by calculating the same function multip...