Esempio n. 1
0
char *
eclipsehome(void)
{
    if (!eclipsehome_)
    {
	eclipsehome_ = whereami();
	if (!eclipsehome_)
	{
	    char buf1[MAX_PATH_LEN];
	    int size=MAX_PATH_LEN;
	    if (ec_env_lookup("ECLIPSEDIR", buf1, &size))
	    {
		(void) canonical_filename(buf1, buf);
		if (buf[0] != '/')
		{
		    char buf2[MAX_PATH_LEN];
		    strcpy(buf2, buf);
		    get_cwd(buf, MAX_PATH_LEN);
		    strcat(buf, buf2);
		}
		eclipsehome_ = buf;
	    }
	    else
	    {
#ifdef _WIN32
		eclipsehome_ = "//C/Eclipse";
#else
		eclipsehome_ = "/usr/local/eclipse";
#endif
	    }
	}
    }
    return eclipsehome_;
}
void Reptation_method::read(vector <string> words,
                      unsigned int & pos,
                      Program_options & options)
{

  have_read_options=1;

  if(!readvalue(words, pos=0, nblock, "NBLOCK"))
    error("Need NBLOCK in RETPTATION section");

  if(!readvalue(words, pos=0, nstep, "NSTEP"))
    error("Need NSTEP in REPTATION section");

  if(!readvalue(words, pos=0, timestep, "TIMESTEP"))
    error("Need TIMESTEP in REPTATION section");

  if(!readvalue(words, pos=0, reptile_length, "LENGTH"))
    error("Need LENGTH in REPTATION");

  //------------------optional stuff

  print_pdb=haskeyword(words, pos=0,"PRINT_PDB");

  if(!readvalue(words, pos=0, readconfig, "READCONFIG"))
    readconfig=options.runid+".config";

  vector <string> proptxt;
  if(readsection(words, pos=0, proptxt, "PROPERTIES")) 
    mygather.read(proptxt);
  
  if(!readvalue(words, pos=0, log_label, "LABEL"))
    log_label="rmc";

  if(!readvalue(words, pos=0, storeconfig, "STORECONFIG"))
    storeconfig=options.runid+".config";

  if(readvalue(words, pos=0, center_trace, "CENTER_TRACE"))
    canonical_filename(center_trace);

  if(!readvalue(words, pos=0, trace_wait, "TRACE_WAIT"))
    trace_wait=int(.3/timestep)+1;

    
  vector <string> dynamics_words;
  if(!readsection(words, pos=0, dynamics_words, "DYNAMICS") ) 
    dynamics_words.push_back("SPLIT");

  allocate(dynamics_words, sampler);

  
  vector<string> tmp_dens;
  pos=0;
  while(readsection(words, pos, tmp_dens, "DENSITY")) {
    dens_words.push_back(tmp_dens);
  }
  
  pos=0;
  while(readsection(words, pos, tmp_dens, "AVERAGE")) {
    avg_words.push_back(tmp_dens);
  }
  

  sampler->enforceNodes(1);

  guidewf=new Primary;
}