Exemple #1
0
void Action::registerKeywords( Keywords& keys ) {
  plumed_assert( keys.size()==0 );
  keys.add( "hidden", "LABEL", "a label for the action so that its output can be referenced in the input to other actions.  Actions with scalar output are referenced using their label only.  Actions with vector output must have a separate label for every component.  Individual componets are then refered to using label.component" );
  keys.reserve("optional","UPDATE_FROM","Only update this action from this time");
  keys.reserve("optional","UPDATE_UNTIL","Only update this action until this time");
  keys.reserve("optional","RESTART","allows per-action setting of restart (YES/NO/AUTO)");
}
Exemple #2
0
void shade::FileAccumulator::add_file(const std::string& file)
{
  if (file.empty())
    return;

  if (m_seen_files.find(file) == m_seen_files.end())
  {
    std::string content = m_resolver.load(file);
    m_seen_files.insert(file);

    typedef std::map<std::string, std::string> Keywords;
    Keywords keywords;
    std::istringstream input(content);
    m_content += io::parse_input(input, keywords);

    Keywords::const_iterator glsl_version = keywords.find("glsl_version");
    if (glsl_version != keywords.end())
    {
      m_glsl_version = std::max(m_glsl_version, boost::lexical_cast<int>(glsl_version->second));
    }

    Keywords::const_iterator gpu_shader4_ext = keywords.find("GL_EXT_gpu_shader4");
    if (gpu_shader4_ext != keywords.end())
    {
      if (gpu_shader4_ext->second == "require")
        m_requires_gpu_shader4_ext = true;
    }
  }
}
Exemple #3
0
void PrintExpression(string &infix)
{
	try
	{
	Keywords keywords;
	double results = 0;
	keywords.ResolveKeywords(infix);

	Expression *exp = PkParser::Solve(infix);

	cout <<"Equation: " << exp->toString(0) <<endl;

	results = exp->Solve();

	cout << results <<endl;

	delete exp;
	}
	catch(PkException *exp)
	{
		cout << "Exception:" << exp->toString() <<endl;
	}
	catch(...)
	{
		cout << "Unknown Error"<<endl;
	}
}
Exemple #4
0
void PathMSDBase::registerKeywords(Keywords& keys){
  Colvar::registerKeywords(keys);
  keys.add("compulsory","LAMBDA","the lambda parameter is needed for smoothing, is in the units of plumed");
  keys.add("compulsory","REFERENCE","the pdb is needed to provide the various milestones");
  keys.add("optional","NEIGH_SIZE","size of the neighbor list");
  keys.add("optional","NEIGH_STRIDE","how often the neighbor list needs to be calculated in time units");
}
Exemple #5
0
void ActionWithGrid::registerKeywords( Keywords& keys ){
  vesselbase::ActionWithAveraging::registerKeywords( keys );
  keys.add("compulsory","BANDWIDTH","the bandwidths for kernel density esimtation");
  keys.add("compulsory","KERNEL","gaussian","the kernel function you are using.  More details on  the kernels available "
                                            "in plumed plumed can be found in \\ref kernelfunctions.");
  keys.add("optional","CONCENTRATION","the concentration parameter for Von Mises-Fisher distributions");
}
void GridPrintingBase::registerKeywords( Keywords& keys ){
  Action::registerKeywords( keys ); ActionPilot::registerKeywords( keys );
  keys.add("compulsory","GRID","the action that creates the grid you would like to output");
  keys.add("compulsory","STRIDE","0","the frequency with which the grid should be output to the file.  The default "
                                     "value of 0 ensures that the grid is only output at the end of the trajectory");
  keys.add("compulsory","FILE","density","the file on which to write the grid.");
  keys.add("optional","FMT","the format that should be used to output real numbers");
}
Exemple #7
0
void ActionWithValue::registerKeywords(Keywords& keys) {
  keys.setComponentsIntroduction("By default the value of the calculated quantity can be referenced elsewhere in the "
                                 "input file by using the label of the action.  Alternatively this Action can be used "
                                 "to be used to calculate the following quantities by employing the keywords listed "
                                 "below.  These quanties can be referenced elsewhere in the input by using this Action's "
                                 "label followed by a dot and the name of the quantity required from the list below.");
  keys.addFlag("NUMERICAL_DERIVATIVES", false, "calculate the derivatives for these quantities numerically");
}
void SetupMolInfo::registerKeywords( Keywords& keys ) {
  ActionSetup::registerKeywords(keys);
  keys.add("compulsory","STRUCTURE","a file in pdb format containing a reference structure. "
           "This is used to defines the atoms in the various residues, chains, etc . "
           "For more details on the PDB file format visit http://www.wwpdb.org/docs.html");
  keys.add("compulsory","MOLTYPE","protein","what kind of molecule is contained in the pdb file - usually not needed since protein/RNA/DNA are compatible");
  keys.add("atoms","CHAIN","(for masochists ( mostly Davide Branduardi ) ) The atoms involved in each of the chains of interest in the structure.");
}
Exemple #9
0
void ActionVolume::registerKeywords( Keywords& keys ){
  VolumeGradientBase::registerKeywords( keys );
  if( keys.reserved("VMEAN") ) keys.use("VMEAN");
  keys.use("MEAN"); keys.use("LESS_THAN"); keys.use("MORE_THAN");
  keys.use("BETWEEN"); keys.use("HISTOGRAM");
  keys.add("compulsory","SIGMA","the width of the function to be used for kernel density estimation");
  keys.add("compulsory","KERNEL","gaussian","the type of kernel function to be used");
  keys.addFlag("OUTSIDE",false,"calculate quantities for colvars that are on atoms outside the region of interest");
}
void ActionWithAveraging::registerKeywords( Keywords& keys ) {
  Action::registerKeywords( keys ); ActionPilot::registerKeywords( keys ); ActionAtomistic::registerKeywords( keys );
  ActionWithArguments::registerKeywords( keys ); ActionWithValue::registerKeywords( keys ); ActionWithVessel::registerKeywords( keys );
  keys.add("compulsory","STRIDE","1","the frequency with which the data should be collected and added to the quantity being averaged");
  keys.add("compulsory","CLEAR","0","the frequency with which to clear all the accumulated data.  The default value "
           "of 0 implies that all the data will be used and that the grid will never be cleared");
  keys.add("optional","LOGWEIGHTS","list of actions that calculates log weights that should be used to weight configurations when calculating averages");
  keys.addFlag("UNORMALIZED",false,"output the unaveraged quantity/quantities."); keys.remove("NUMERICAL_DERIVATIVES");
}
Exemple #11
0
void Bias::registerKeywords( Keywords& keys ) {
  Action::registerKeywords(keys);
  ActionPilot::registerKeywords(keys);
  ActionWithValue::registerKeywords(keys);
  ActionWithArguments::registerKeywords(keys);
  keys.add("hidden","STRIDE","the frequency with which the forces due to the bias should be calculated.  This can be used to correctly set up multistep algorithms");
  componentsAreNotOptional(keys);
  keys.addOutputComponent("bias","default","the instantaneous value of the bias potential");
}
Exemple #12
0
bool ActionRegister::printManual( const std::string& action ){
  if ( check(action) ){
     Keywords keys; mk[action](keys); 
     keys.print_html(true); keys.destroyData();
     return true;
  } else {
     return false;
  } 
}
Exemple #13
0
bool ActionRegister::printTemplate( const std::string& action, bool include_optional ){
  if( check(action) ){
     Keywords keys; mk[action](keys);
     keys.print_template(action, include_optional); keys.destroyData(); 
     return true;
  } else {
     return false;
  }
}
void ManyRestraintsBase::registerKeywords( Keywords& keys ) {
    Action::registerKeywords( keys );
    ActionWithValue::registerKeywords( keys );
    ActionWithVessel::registerKeywords( keys );
    ActionWithInputVessel::registerKeywords( keys );
    ActionPilot::registerKeywords( keys );
    keys.add("hidden","STRIDE","the frequency with which the forces due to the bias should be calculated.  This can be used to correctly set up multistep algorithms");
    keys.remove("TOL");
    keys.addOutputComponent("bias","default","the instantaneous value of the bias potentials");
}
Exemple #15
0
Vessel* VesselRegister::create(std::string keyword, const VesselOptions&da){
  Vessel* df;
  if(check(keyword)){
      Keywords keys; mk[keyword](keys);
      VesselOptions nda( da,keys );
      df=m[keyword](nda);
      keys.destroyData();
  }
  else df=NULL;
  return df;
}
Exemple #16
0
void Mapping::registerKeywords( Keywords& keys ){
  Action::registerKeywords( keys ); 
  ActionWithValue::registerKeywords( keys );
  ActionWithArguments::registerKeywords( keys ); 
  ActionAtomistic::registerKeywords( keys ); 
  vesselbase::ActionWithVessel::registerKeywords( keys );
  keys.add("compulsory","REFERENCE","a pdb file containing the set of reference configurations");
  keys.add("compulsory","PROPERTY","the property to be used in the index. This should be in the REMARK of the reference");
  keys.add("compulsory","TYPE","OPTIMAL","the manner in which distances are calculated");
  keys.addFlag("DISABLE_CHECKS",false,"disable checks on reference input structures.");
}
Exemple #17
0
NitLexer::NitLexer()
{
	static Keywords keywords;

	if (keywords.empty())
	{
		keywords["base"]			= TK_BASE;
		keywords["switch"]			= TK_SWITCH;
		keywords["if"]				= TK_IF;
		keywords["else"]			= TK_ELSE;
		keywords["while"]			= TK_WHILE;
		keywords["break"]			= TK_BREAK;
		keywords["for"]				= TK_FOR;
		keywords["do"]				= TK_DO;
		keywords["null"]			= TK_NULL;
		keywords["foreach"] 		= TK_FOREACH;
		keywords["in"] 				= TK_IN;
		keywords["clone"] 			= TK_CLONE;
		keywords["function"] 		= TK_FUNCTION;
		keywords["return"] 			= TK_RETURN;
		keywords["typeof"] 			= TK_TYPEOF;
		keywords["continue"] 		= TK_CONTINUE;
		keywords["yield"] 			= TK_YIELD;
		keywords["try"] 			= TK_TRY;
		keywords["catch"] 			= TK_CATCH;
		keywords["throw"] 			= TK_THROW;
		keywords["resume"] 			= TK_RESUME;
		keywords["case"] 			= TK_CASE;
		keywords["default"] 		= TK_DEFAULT;
		keywords["this"] 			= TK_THIS;
		keywords["class"] 			= TK_CLASS;
		keywords["constructor"] 	= TK_CONSTRUCTOR;
		keywords["is"] 				= TK_IS;
		keywords["true"] 			= TK_TRUE;
		keywords["false"] 			= TK_FALSE;
		keywords["static"] 			= TK_STATIC;
		keywords["enum"] 			= TK_ENUM;
		keywords["const"] 			= TK_CONST;
		keywords["property"] 		= TK_PROPERTY;
		keywords["require"] 		= TK_REQUIRE;
		keywords["div"] 			= TK_INTDIV;
		keywords["mod"] 			= TK_INTMOD;
		keywords["destructor"] 		= TK_DESTRUCTOR;
		keywords["var"] 			= TK_VAR;
		keywords["with"] 			= TK_WITH;
		keywords["finally"] 		= TK_FINALLY;
		keywords["import"] 			= TK_IMPORT;
		keywords["by"] 				= TK_BY;
	}

	setKeywords(&keywords);
}
Exemple #18
0
std::string FormatFunctionBlock(const Parser *p, const ParserDefinition *pd, const char *text)
{
	Keywords kw;

	if(!p->external)
	{
		kw = p->parse(pd, text);
		if(kw.size() == 0) return std::string("");
	}

	FillExtraKeywords(kw);

	return FormatBlock(pd, kw, pd->function_format);
}
Exemple #19
0
bool ActionRegister::printManual( const std::string& action, const bool& vimout ) {
  if ( check(action) ) {
    Keywords keys; mk[action](keys);
    if( vimout ) {
      printf("%s",action.c_str()); keys.print_vim(); printf("\n");
    } else {
      keys.print_html();
    }
    keys.destroyData();
    return true;
  } else {
    return false;
  }
}
Exemple #20
0
std::string FormatFunctionBlock(const Parser *p, const ParserSettings *ps, const char *text)
{
	Keywords kw;

	if(!p->external)
	{
		kw = p->strategy(ps, text);
		if(kw.size() == 0) return std::string("");
	}

	FillExtraKeywords(kw);

	return FormatBlock(ps, kw, ps->function_format);
}
void MatrixSummationBase::registerKeywords( Keywords& keys ) {
    multicolvar::MultiColvarBase::registerKeywords( keys );
    keys.add("compulsory","MATRIX","the action that calcualtes the adjacency matrix vessel we would like to analyse");
    keys.use("ALT_MIN");
    keys.use("LOWEST");
    keys.use("HIGHEST");
    keys.use("MEAN");
    keys.use("MEAN");
    keys.use("MIN");
    keys.use("MAX");
    keys.use("LESS_THAN");
    keys.use("MORE_THAN");
    keys.use("BETWEEN");
    keys.use("HISTOGRAM");
    keys.use("MOMENTS");
}
Exemple #22
0
void Bias::registerKeywords( Keywords& keys ){
  Action::registerKeywords(keys);
  ActionPilot::registerKeywords(keys);
  ActionWithValue::registerKeywords(keys);
  ActionWithArguments::registerKeywords(keys);
  keys.add("hidden","STRIDE","the frequency with which the forces due to the bias should be calculated.  This can be used to correctly set up multistep algorithms");
}
Exemple #23
0
Action* ActionRegister::create(const ActionOptions&ao){
  if(ao.line.size()<1)return NULL;
  // Create a copy of the manual locally. The manual is 
  // then added to the ActionOptions. This allows us to 
  // ensure during construction that all the keywords for
  // the action have been documented. In addition, we can
  // generate the documentation when the user makes an error
  // in the input.
  Action* action;
  if( check(ao.line[0]) ){
      Keywords keys; mk[ao.line[0]](keys);
      ActionOptions nao( ao,keys );
      action=m[ao.line[0]](nao);
      keys.destroyData();
  } else action=NULL;
  return action;
}
Exemple #24
0
 object make_function_dispatch(F f, CallPolicies const& policies, Keywords const& kw, mpl::true_)
 {
     return detail::make_function_aux(
         f
       , policies
       , detail::get_signature(f)
       , kw.range()
       , mpl::int_<Keywords::size>()
     );
 }
 object make_function_dispatch(F f, CallPolicies const& policies, Keywords const& kw, mpl::true_)
 {
     log_trace("%s", __PRETTY_FUNCTION__);
     return detail::make_function_aux(
         f
       , policies
       , typename detail::get_signature<F>::type()
       , kw.range()
       , mpl::int_<Keywords::size>()
     );
 }
void CoordinationBase::registerKeywords( Keywords& keys ) {
  Colvar::registerKeywords(keys);
  keys.addFlag("SERIAL",false,"Perform the calculation in serial - for debug purpose");
  keys.addFlag("PAIR",false,"Pair only 1st element of the 1st group with 1st element in the second, etc");
  keys.addFlag("NLIST",false,"Use a neighbour list to speed up the calculation");
  keys.add("optional","NL_CUTOFF","The cutoff for the neighbour list");
  keys.add("optional","NL_STRIDE","The frequency with which we are updating the atoms in the neighbour list");
  keys.add("atoms","GROUPA","First list of atoms");
  keys.add("atoms","GROUPB","Second list of atoms (if empty, N*(N-1)/2 pairs in GROUPA are counted)");
}
void ContourFindingBase::registerKeywords( Keywords& keys ){
  ActionWithInputGrid::registerKeywords( keys );
  keys.add("compulsory","CONTOUR","the value we would like to draw the contour at in the space");
  keys.add("compulsory","FILE","file on which to output coordinates");
  keys.add("compulsory","UNITS","PLUMED","the units in which to print out the coordinates. PLUMED means internal PLUMED units");
  keys.add("optional", "PRECISION","The number of digits in trajectory file");
  keys.remove("KERNEL"); keys.remove("BANDWIDTH");
}
Exemple #28
0
void MultiColvarBase::registerKeywords( Keywords& keys ){
  Action::registerKeywords( keys );
  ActionWithValue::registerKeywords( keys );
  ActionAtomistic::registerKeywords( keys );
  keys.addFlag("NOPBC",false,"ignore the periodic boundary conditions when calculating distances");
  ActionWithVessel::registerKeywords( keys );
  keys.use("NL_TOL");
  keys.add("hidden","NL_STRIDE","the frequency with which the neighbor list should be updated. Between neighbour list update steps all quantities "
                                "that contributed less than TOL at the previous neighbor list update step are ignored.");
  keys.setComponentsIntroduction("When the label of this action is used as the input for a second you are not referring to a scalar quantity as you are in "
                                 "regular collective variables.  The label is used to reference the full set of quantities calculated by "
                                 "the action.  This is usual when using \\ref multicolvarfunction. Generally when doing this the previously calculated "
                                 "multicolvar will be referenced using the DATA keyword rather than ARG.\n\n"
                                 "This Action can be used to calculate the following scalar quantities directly.  These quantities are calculated by "
                                 "employing the keywords listed below. "
                                 "These quantities can then be referenced elsewhere in the input file by using this Action's label "
                                 "followed by a dot and the name of the quantity. Some amongst them can be calculated multiple times "
                                 "with different parameters.  In this case the quantities calculated can be referenced elsewhere in the "
                                 "input by using the name of the quantity followed by a numerical identifier "
                                 "e.g. <em>label</em>.lessthan-1, <em>label</em>.lessthan-2 etc.  When doing this and, for clarity we have "
                                 "made the label of the components customizable. As such by using the LABEL keyword in the description of the keyword "
                                 "input you can customize the component name");
} 
void SwitchingFunction::registerKeywords( Keywords& keys ){
  keys.add("compulsory","R_0","the value of R_0 in the switching function");
  keys.add("compulsory","D_0","0.0","the value of D_0 in the switching function");
  keys.add("optional","D_MAX","the value at which the switching function can be assumed equal to zero");
  keys.add("compulsory","NN","6","the value of n in the switching function (only needed for TYPE=RATIONAL)");
  keys.add("compulsory","MM","12","the value of m in the switching function (only needed for TYPE=RATIONAL)");
  keys.add("compulsory","A","the value of a in the switching funciton (only needed for TYPE=SMAP)");
  keys.add("compulsory","B","the value of b in the switching funciton (only needed for TYPE=SMAP)"); 
}
void ActionWithVessel::registerKeywords(Keywords& keys){
  keys.add("hidden","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.addFlag("TIMINGS",false,"output information on the timings of the various parts of the calculation");
  keys.reserveFlag("HIGHMEM",false,"use a more memory intensive version of this collective variable");
  keys.add( vesselRegister().getKeywords() );
}