Commit ead74201 authored by Sikandar Y. Mashayak's avatar Sikandar Y. Mashayak

RE_potentialfunction: removing o flag in the output potential table to avoid extrapolation

parent a427ec5f
......@@ -79,25 +79,25 @@ void PotentialFunction::SavePotTab(const string& filename,
double r_init;
int i;
char flag;
char flag = 'i';
for (r_init = rmin, i = 0; i < ngrid - 1; r_init += step) {
// put point, result, flag at point out_x into the table
if( r_init < _min || r_init > _cut_off )
flag = 'o';
else
flag = 'i';
//if( r_init < _min || r_init > _cut_off )
//flag = 'o';
//else
//flag = 'i';
pot_tab.set(i++, r_init, CalculateF(r_init), flag);
}
if( rcut < _min || rcut > _cut_off )
flag = 'o';
else
flag = 'i';
// if( rcut < _min || rcut > _cut_off )
// flag = 'o';
// else
// flag = 'i';
pot_tab.set(i, rcut, CalculateF(rcut), flag);
......
......@@ -693,27 +693,35 @@ PotentialInfo::PotentialInfo(int index, bool bonded_, int vec_pos_,
string core = _options->get("re.cbspl.core").as<string>();
/*
// determine minimum for B-spline from CG-MD rdf
double new_min = 0.0;
Table dist;
string filename = potentialName + ".dist.new";
dist.Load(filename);
double new_min;
for( int i = 0; i < dist.size(); i++){
try{
dist.Load(filename);
for( int i = 0; i < dist.size(); i++){
if(dist.y(i) > 1.0e-3){
if(dist.y(i) > 1.0e-3){
new_min = dist.x(i);
break;
new_min = dist.x(i);
break;
}
}
}
if(new_min > rmin)
rmin = new_min;
}catch(std::runtime_error){
if(new_min > rmin)
rmin = new_min;
*/
cout << "Missing file for CG rdf for the interaction " << potentialName << endl;
cout << "Hence, using user specified rmin = " << rmin << endl;
}
ucg = new PotentialFunctionCBSPL(potentialName, nlam, core, rmin, rcut);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment