void ActionWithVessel::readVesselKeywords(){
  // Set maxderivatives if it is too big
  if( maxderivatives>getNumberOfDerivatives() ) maxderivatives=getNumberOfDerivatives();

  // Loop over all keywords find the vessels and create appropriate functions
  for(unsigned i=0;i<keywords.size();++i){
      std::string thiskey,input; thiskey=keywords.getKeyword(i);
      // Check if this is a key for a vessel
      if( vesselRegister().check(thiskey) ){
          plumed_assert( keywords.style(thiskey,"vessel") );
          bool dothis=false; parseFlag(thiskey,dothis);
          if(dothis) addVessel( thiskey, input );

          parse(thiskey,input);
          if(input.size()!=0){ 
                addVessel( thiskey, input );
          } else {
             for(unsigned i=1;;++i){
                if( !parseNumbered(thiskey,i,input) ) break;
                std::string ss; Tools::convert(i,ss);
                addVessel( thiskey, input, i ); 
                input.clear();
             } 
          }
      }
  }

  // Make sure all vessels have had been resized at start
  if( functions.size()>0 ) resizeFunctions();
}
void ActionWithVessel::addVessel( const std::string& name, const std::string& input, const int numlab ){
  VesselOptions da(name,"",numlab,input,this);
  Vessel* vv=vesselRegister().create(name,da);
  FunctionVessel* fv=dynamic_cast<FunctionVessel*>(vv);
  if( fv ){
      std::string mylabel=Vessel::transformName( name );
      plumed_massert( keywords.outputComponentExists(mylabel,false), "a description of the value calculated by vessel " + name + " has not been added to the manual"); 
  } 
  addVessel(vv);
}
Beispiel #3
0
void ActionWithVessel::registerKeywords(Keywords& keys){
  keys.add("optional","TOL","this keyword can be used to speed up your calculation. When accumulating sums in which the individual "
                            "terms are numbers inbetween zero and one it is assumed that terms less than a certain tolerance "
                            "make only a small contribution to the sum.  They can thus be safely ignored as can the the derivatives "
                            "wrt these small quantities.");
  keys.reserve("hidden","NL_TOL","this keyword can be used to speed up your calculation.  It must be used in conjuction with the TOL "
                                   "keyword and the value for NL_TOL must be set less than the value for TOL.  This keyword ensures that "
                                   "quantities, which are much less than TOL and which will thus not added to the sums being accumulated "
                                   "are not calculated at every step. They are only calculated when the neighbor list is updated.");
  keys.add("hidden","MAXDERIVATIVES","The maximum number of derivatives that can be used when storing data.  This controls when "
                                     "we have to start using lowmem");
  keys.addFlag("SERIAL",false,"do the calculation in serial.  Do not parallelize");
  keys.addFlag("LOWMEM",false,"lower the memory requirements");
  keys.add( vesselRegister().getKeywords() );
}
Beispiel #4
0
void ActionWithVessel::addVessel( const std::string& name, const std::string& input, const int numlab, const std::string thislab ){
  VesselOptions da(name,thislab,numlab,input,this);
  Vessel* vv=vesselRegister().create(name,da); vv->checkRead();
  addVessel(vv);
}