Commit 35f2374d by Francois Gygi

changed output format of constraint value, force

parent e85f85d4
......@@ -407,9 +407,10 @@ ostream& AngleConstraint::print( ostream &os )
os << name2_ << " " << name3_ << "\"\n";
os.setf(ios::fixed,ios::floatfield);
os.setf(ios::right,ios::adjustfield);
os << " value=\"" << setprecision(6) << angle_;
os << "\" velocity=\"" << setprecision(6) << velocity_ << "\"\n";
os << " force=\"" << setprecision(6) << force_;
os << "\" weight=\"" << setprecision(6) << weight_ << "\"/>";
os << " velocity=\"" << setprecision(6) << velocity_ << "\"";
os << " weight=\"" << setprecision(6) << weight_ << "\">\n";
os << " <value> " << setprecision(6) << angle_ << " </value>";
os << " <force> " << setprecision(6) << force_ << " </force>\n";
os << " </constraint>";
return os;
}
......@@ -228,11 +228,10 @@ ostream& DistanceConstraint::print( ostream &os )
os << "\" atoms=\"" << name1_ << " " << name2_ << "\"\n";
os.setf(ios::fixed,ios::floatfield);
os.setf(ios::right,ios::adjustfield);
os << " value=\"" << setprecision(6) << distance_;
os << "\" velocity=\"" << setprecision(6) << velocity_ << "\"\n";
os << " force=\"" << setprecision(6) << force_;
os << "\" weight=\"" << setprecision(6) << weight_ << "\"/>";
os << " velocity=\"" << setprecision(6) << velocity_ << "\"";
os << " weight=\"" << setprecision(6) << weight_ << "\">\n";
os << " <value> " << setprecision(6) << distance_ << " </value>";
os << " <force> " << setprecision(6) << force_ << " </force>\n";
os << " </constraint>";
return os;
}
......@@ -102,9 +102,10 @@ ostream& PositionConstraint::print( ostream &os )
os << "\" atoms=\"" << name1_ << "\"\n";
os.setf(ios::fixed,ios::floatfield);
os.setf(ios::right,ios::adjustfield);
os << " value=\"" << setprecision(6) << 0;
os << "\" velocity=\"" << setprecision(6) << 0 << "\"\n";
os << " force=\"" << setprecision(6) << force_;
os << "\" weight=\"" << setprecision(6) << weight_ << "\"/>";
os << " velocity=\"" << setprecision(6) << 0 << "\"";
os << " weight=\"" << setprecision(6) << weight_ << "\">\n";
os << " <value> " << setprecision(6) << 0 << " </value>";
os << " <force> " << setprecision(6) << force_ << " </force>\n";
os << " </constraint>";
return os;
}
......@@ -326,22 +326,6 @@ void TorsionConstraint::compute_force(const vector<vector<double> > &r0,
weight_ = 1.0 / sqrt(z);
}
////////////////////////////////////////////////////////////////////////////////
ostream& TorsionConstraint::print( ostream &os )
{
os.setf(ios::left,ios::adjustfield);
os << " <constraint name=\"" << name();
os << "\" type=\"" << type();
os << "\" atoms=\"" << name1_ << " ";
os << name2_ << " " << name3_ << " " << name4_ << "\"\n";
os.setf(ios::fixed,ios::floatfield);
os.setf(ios::right,ios::adjustfield);
os << " value=\"" << setprecision(6) << angle_;
os << "\" velocity=\"" << setprecision(6) << velocity_ << "\"\n";
os << " force=\"" << setprecision(6) << force_;
os << "\" weight=\"" << setprecision(6) << weight_ << "\"/>";
return os;
}
////////////////////////////////////////////////////////////////////////////////
double TorsionConstraint::sigma(D3vector a, D3vector b,
......@@ -406,3 +390,21 @@ double TorsionConstraint::torsion_angle(D3vector a, D3vector b,
}
return an;
}
////////////////////////////////////////////////////////////////////////////////
ostream& TorsionConstraint::print( ostream &os )
{
os.setf(ios::left,ios::adjustfield);
os << " <constraint name=\"" << name();
os << "\" type=\"" << type();
os << "\" atoms=\"" << name1_ << " ";
os << name2_ << " " << name3_ << " " << name4_ << "\"\n";
os.setf(ios::fixed,ios::floatfield);
os.setf(ios::right,ios::adjustfield);
os << " velocity=\"" << setprecision(6) << velocity_ << "\"";
os << " weight=\"" << setprecision(6) << weight_ << "\">\n";
os << " <value> " << setprecision(6) << angle_ << " </value>";
os << " <force> " << setprecision(6) << force_ << " </force>\n";
os << " </constraint>";
return os;
}
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