Commit b305d27b by Francois Gygi

Redesign of constraints.


git-svn-id: http://qboxcode.org/svn/qb/trunk@422 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 3dcc6e96
......@@ -3,7 +3,7 @@
// AngleConstraint.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: AngleConstraint.C,v 1.1 2005-06-27 22:34:46 fgygi Exp $
// $Id: AngleConstraint.C,v 1.2 2005-09-16 23:08:11 fgygi Exp $
#include "AngleConstraint.h"
#include "AtomSet.h"
......@@ -249,15 +249,15 @@ vector<vector<double> > &v0) const
}
////////////////////////////////////////////////////////////////////////////////
double AngleConstraint::projection(const vector<vector<double> > &r0,
const vector<vector<double> > &x) const
void AngleConstraint::compute_force(const vector<vector<double> > &r0,
const vector<vector<double> > &f)
{
const double* pr1 = &r0[is1_][3*ia1_];
const double* pr2 = &r0[is2_][3*ia2_];
const double* pr3 = &r0[is3_][3*ia3_];
const double* px1 = &x[is1_][3*ia1_];
const double* px2 = &x[is2_][3*ia2_];
const double* px3 = &x[is3_][3*ia3_];
const double* pf1 = &f[is1_][3*ia1_];
const double* pf2 = &f[is2_][3*ia2_];
const double* pf3 = &f[is3_][3*ia3_];
D3vector r1(pr1);
D3vector r2(pr2);
......@@ -266,16 +266,40 @@ double AngleConstraint::projection(const vector<vector<double> > &r0,
grad_sigma(r1,r2,r3,g1,g2,g3);
D3vector x1(px1);
D3vector x2(px2);
D3vector x3(px3);
D3vector f1(pf1);
D3vector f2(pf2);
D3vector f3(pf3);
const double norm2 = g1*g1 + g2*g2 + g3*g3;
if ( norm2 == 0.0 )
return 0.0;
{
force_ = 0.0;
return;
}
const double proj = x1*g1 + x2*g2 + x3*g3;
return proj/sqrt(norm2);
const double proj = f1*g1 + f2*g2 + f3*g3;
force_ = -proj/norm2;
// compute weight
const double z = m1_inv_ * g1 * g1 +
m2_inv_ * g2 * g2 +
m3_inv_ * g3 * g3;
assert(z > 0.0);
weight_ = 1.0 / sqrt(z);
#if DEBUG_CONSTRAINTS
// check value of z
const double r12s = norm(r1-r2);
const double r32s = norm(r3-r2);
const double fac = 180.0/M_PI;
const double cos_theta = normalized(r1-r2)*normalized(r3-r2);
const double zcheck = fac*fac *
( m1_inv_ / r12s +
m2_inv_ * ( (r12s+r32s-2*sqrt(r12s*r32s)*cos_theta) /(r12s*r32s) ) +
m3_inv_ / r32s
);
cout << " <!-- AngleConstraint: z=" << z << " zcheck=" << zcheck << " -->"
<< endl;
#endif
}
////////////////////////////////////////////////////////////////////////////////
......@@ -371,14 +395,15 @@ double AngleConstraint::bond_angle(D3vector a, D3vector b, D3vector c) const
ostream& AngleConstraint::print( ostream &os )
{
os.setf(ios::left,ios::adjustfield);
os << " <!-- constraint ";
os << type() << " ";
os << setw(4) << name1_ << " ";
os << setw(4) << name2_ << " ";
os << setw(4) << name3_ << " ";
os << " <constraint name=\"" << name();
os << "\" type=\"" << type();
os << "\" atoms=\"" << name1_ << " ";
os << name2_ << " " << name3_ << "\"\n";
os.setf(ios::fixed,ios::floatfield);
os.setf(ios::right,ios::adjustfield);
os << setw(10) << setprecision(6) << angle_ << " "
<< setw(10) << setprecision(6) << velocity_ << " -->";
os << " value=\"" << setprecision(6) << angle_;
os << "\" velocity=\"" << setprecision(6) << velocity_ << "\"\n";
os << " force=\"" << setprecision(6) << force_;
os << "\" weight=\"" << setprecision(6) << weight_ << "\"/>";
return os;
}
......@@ -3,7 +3,7 @@
// AngleConstraint.h
//
////////////////////////////////////////////////////////////////////////////////
// $Id: AngleConstraint.h,v 1.1 2005-06-27 22:34:46 fgygi Exp $
// $Id: AngleConstraint.h,v 1.2 2005-09-16 23:08:11 fgygi Exp $
#ifndef ANGLECONSTRAINT_H
#define ANGLECONSTRAINT_H
......@@ -18,7 +18,7 @@ class AngleConstraint : public Constraint
string name1_, name2_, name3_;
int ia1_, ia2_, ia3_, is1_, is2_, is3_;
double m1_, m2_, m3_, m1_inv_, m2_inv_, m3_inv_;
double angle_, velocity_, tol_;
double angle_, velocity_, force_, weight_, tol_;
double sigma(D3vector a, D3vector b, D3vector c) const;
void grad_sigma(const D3vector &r1, const D3vector &r2, const D3vector &r3,
D3vector &g1, D3vector &g2,D3vector &g3) const;
......@@ -26,22 +26,27 @@ class AngleConstraint : public Constraint
public:
AngleConstraint(string name1, string name2, string name3,
AngleConstraint(string name, string name1, string name2, string name3,
double angle, double velocity, double tolerance):
name1_(name1), name2_(name2), name3_(name3),
velocity_(velocity),
tol_(tolerance), m1_(0.0), m2_(0.0), m3_(0.0)
{
set_value(angle);
name_ = name;
names_.resize(3);
names_[0] = name1_;
names_[1] = name2_;
names_[2] = name3_;
force_ = 0.0;
weight_ = 1.0;
}
string type(void) const { return "angle"; }
double value(void) const { return angle_; }
double velocity(void) const { return velocity_; }
double force(void) const { return force_; }
double weight(void) const { return weight_; }
double tolerance(void) const { return tol_; }
void set_value(double value)
{
......@@ -60,8 +65,8 @@ class AngleConstraint : public Constraint
vector<vector<double> > &rp) const;
bool enforce_v(const vector<vector<double> > &r0,
vector<vector<double> > &v0) const;
double projection(const vector<vector<double> > &r0,
const vector<vector<double> > &x) const;
void compute_force(const vector<vector<double> > &r0,
const vector<vector<double> > &f);
ostream& print( ostream& os );
};
......
......@@ -3,7 +3,7 @@
// BOSampleStepper.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: BOSampleStepper.C,v 1.24 2005-06-27 22:31:39 fgygi Exp $
// $Id: BOSampleStepper.C,v 1.25 2005-09-16 23:08:11 fgygi Exp $
#include "BOSampleStepper.h"
#include "EnergyFunctional.h"
......@@ -255,20 +255,14 @@ void BOSampleStepper::step(int niter)
if ( compute_forces )
{
#if 0
if ( s_.constraints.size() > 0 )
{
const double projected_force =
s_.constraints.projection(ionic_stepper->r0(), fion);
s_.constraints.compute_forces(ionic_stepper->r0(), fion);
if ( onpe0 )
{
cout << " <constraint_projected_force> "
<< projected_force
<< " </constraint_projected_force>"
<< endl;
s_.constraints.list_constraints(cout);
}
}
#endif
// move atoms to new position: r0 <- r0 + v0*dt + dt2/m * fion
ionic_stepper->compute_r(energy,fion);
ef_.atoms_moved();
......
......@@ -3,7 +3,7 @@
// CPSampleStepper.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: CPSampleStepper.C,v 1.10 2005-06-27 22:30:28 fgygi Exp $
// $Id: CPSampleStepper.C,v 1.11 2005-09-16 23:08:11 fgygi Exp $
#include "CPSampleStepper.h"
#include "SlaterDet.h"
......@@ -190,17 +190,13 @@ void CPSampleStepper::step(int niter)
}
}
}
#if 0
#if 1
if ( s_.constraints.size() > 0 )
{
const double projected_force =
s_.constraints.projection(mdionic_stepper->r0(), fion);
s_.constraints.compute_forces(mdionic_stepper->r0(), fion);
if ( onpe0 )
{
cout << " <constraint_projected_force> "
<< projected_force
<< " </constraint_projected_force>"
<< endl;
s_.constraints.list_constraints(cout);
}
}
#endif
......
......@@ -3,7 +3,7 @@
// Constraint.h
//
////////////////////////////////////////////////////////////////////////////////
// $Id: Constraint.h,v 1.1 2005-06-27 22:34:46 fgygi Exp $
// $Id: Constraint.h,v 1.2 2005-09-16 23:08:11 fgygi Exp $
#ifndef CONSTRAINT_H
#define CONSTRAINT_H
......@@ -19,6 +19,7 @@ class Constraint
{
protected:
string name_; // constraint name
vector<string> names_; // names of atoms involved in the constraint
public:
......@@ -26,6 +27,8 @@ class Constraint
virtual string type(void) const = 0;
virtual double value(void) const = 0;
virtual double velocity(void) const = 0;
virtual double force(void) const = 0;
virtual double weight(void) const = 0;
virtual double tolerance(void) const = 0;
virtual void set_value(double value) = 0;
virtual void set_velocity(double velocity) = 0;
......@@ -33,12 +36,13 @@ class Constraint
vector<vector<double> > &rp) const = 0;
virtual bool enforce_v(const vector<vector<double> > &r0,
vector<vector<double> > &v0) const = 0;
virtual double projection(const vector<vector<double> > &r0,
const vector<vector<double> > &x) const = 0;
virtual void compute_force(const vector<vector<double> > &r0,
const vector<vector<double> > &f) = 0;
virtual void update(double dt) = 0;
virtual void setup(const AtomSet& atoms) = 0;
virtual ostream& print(ostream &os) = 0;
string names(int i)
string name(void) const { return name_; }
string names(int i) const
{
assert( i >= 0 && i < names_.size() );
return names_[i];
......
......@@ -3,7 +3,7 @@
// ConstraintCmd.h:
//
////////////////////////////////////////////////////////////////////////////////
// $Id: ConstraintCmd.h,v 1.1 2005-06-27 22:34:46 fgygi Exp $
// $Id: ConstraintCmd.h,v 1.2 2005-09-16 23:08:11 fgygi Exp $
#ifndef CONSTRAINTCMD_H
#define CONSTRAINTCMD_H
......@@ -25,25 +25,57 @@ class ConstraintCmd : public Cmd
return
"\n constraint\n\n"
" syntax:\n\n"
" constraint distance name1 name2 distance [velocity]\n"
" The constraint command defines a new constraint and adds it to\n"
" the constraint list. Constraints are enforced at each MD step\n"
" if ions are allowed to move. The optional velocity parameter\n"
" must be given in atomic units.\n\n";
" constraint define distance name atom1 atom2 distance [velocity]\n"
" constraint define angle name atom1 atom2 atom3 angle [velocity]\n"
" constraint define torsion name atom1 atom2 atom3 atom4 angle [velocity]\n"
" constraint set name value [velocity]\n"
" constraint delete name\n"
" constraint list\n"
" constraint enforce\n\n"
" Constraints are enforced at each MD step if ions are allowed to move.\n"
" Velocity parameters are optional.\n\n";
//" constraint multidistance weight name1 name2 \n"
//" [weight name1 name2] distance [velocity]\n"
}
int action(int argc, char **argv)
{
const bool onpe0 = s->ctxt_.onpe0();
if ( argc < 2 )
{
if ( onpe0 )
cout << help_msg();
return 1;
}
string subcmd(argv[1]);
if ( subcmd == "distance" || subcmd == "angle" || subcmd == "torsion" )
return s->constraints.set_constraint(s->atoms,argc,argv);
if ( subcmd == "define" )
{
return s->constraints.define_constraint(s->atoms,argc,argv);
}
else if ( subcmd == "set" )
{
return s->constraints.set_constraint(argc,argv);
}
else if ( subcmd == "delete" )
{
return s->constraints.delete_constraint(argc,argv);
}
else if ( subcmd == "enforce" )
{
s->constraints.enforce(s->atoms);
// Note: should catch exception here if constraints could not be enforced
}
else if ( subcmd == "list" )
{
if ( onpe0 )
s->constraints.list_constraints(cout);
}
else
{
if ( onpe0 )
cout << help_msg();
}
return 0;
}
};
......
......@@ -3,7 +3,7 @@
// ConstraintSet.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: ConstraintSet.C,v 1.1 2005-06-27 22:34:46 fgygi Exp $
// $Id: ConstraintSet.C,v 1.2 2005-09-16 23:08:11 fgygi Exp $
#include "ConstraintSet.h"
#include "DistanceConstraint.h"
......@@ -20,7 +20,7 @@ using namespace std;
const int constraints_maxiter = 10;
////////////////////////////////////////////////////////////////////////////////
bool ConstraintSet::set_constraint(AtomSet &atoms, int argc, char **argv)
bool ConstraintSet::define_constraint(AtomSet &atoms, int argc, char **argv)
{
enum constraint_type { unknown, distance_type, multidistance_type,
angle_type, torsion_type }
......@@ -28,104 +28,108 @@ bool ConstraintSet::set_constraint(AtomSet &atoms, int argc, char **argv)
const double distance_tolerance = 1.0e-7;
const double angle_tolerance = 1.0e-4;
const bool onpe0 = ctxt_.onpe0();
// argv[0] == "constraint"
// argv[1] == "define"
// argv[2] == {"distance", "angle", "torsion"}
// argv[3] == constraint name
// argv[4-(5,6,7)] == atom names
// argv[{5,6,7}] == {distance,angle,angle}
// argv[{6,7,8}] == velocity
if ( argc < 2 )
{
if ( onpe0 )
{
cout << " use: constraint distance name1 name2 distance [velocity]"
cout << " <!-- use: constraint define name distance name1 name2 distance [velocity]"
<< endl;
cout << " constraint angle name1 name2 name3 angle [velocity]"
cout << " constraint define name angle name1 name2 name3 angle [velocity]"
<< endl;
cout << " constraint torsion name1 name2 name3 name4 angle"
<< " [velocity]"
cout << " constraint define name torsion name1 name2 name3 name4 angle"
<< " [velocity] -->"
<< endl;
//cout << " constraint multidistance alpha_i name1_i name2_i"
// << " distance [velocity]"
//<< endl;
}
return 1;
return false;
}
if ( !strcmp(argv[1],"distance") )
const string constraint_type = argv[2];
if ( constraint_type == "distance" )
{
type = distance_type;
}
else if ( !strcmp(argv[1],"multidistance") )
{
type = multidistance_type;
if ( onpe0 ) cout << " multidistance constraint not implemented" << endl;
return false;
}
else if ( !strcmp(argv[1],"angle") )
else if ( constraint_type == "angle" )
{
type = angle_type;
}
else if ( !strcmp(argv[1],"torsion") )
else if ( constraint_type == "torsion" )
{
type = torsion_type;
}
else
{
if ( onpe0 ) cout << " Incorrect constraint type" << endl;
if ( onpe0 )
cout << " <!-- Incorrect constraint type " << constraint_type
<< " -->" << endl;
return false;
}
if ( type == distance_type )
{
// constraint distance A B dist
// constraint distance A B dist velocity
// define name distance A B value
// define name distance A B value velocity
if ( argc < 5 || argc > 6 )
if ( argc < 7 || argc > 8 )
{
if ( onpe0 )
cout << " Incorrect number of arguments for distance constraint"
<< endl;
cout << " <!-- Incorrect number of arguments for distance constraint"
<< " -->" << endl;
return false;
}
double distance, velocity=0.0, distance_tolerance=1.e-7;
string name1 = argv[2];
string name2 = argv[3];
string name = argv[3];
string name1 = argv[4];
string name2 = argv[5];
Atom *a1 = atoms.findAtom(name1);
Atom *a2 = atoms.findAtom(name2);
if ( a1 == 0 || a2 == 0 )
{
if ( a1 == 0 )
if ( onpe0 )
cout << " ConstraintSet: could not find atom " << name1 << endl;
if ( a2 == 0 )
if ( onpe0 )
cout << " ConstraintSet: could not find atom " << name2 << endl;
if ( onpe0 )
{
if ( a1 == 0 )
cout << " <!-- ConstraintSet: could not find atom " << name1
<< " -->" << endl;
if ( a2 == 0 )
cout << " <!-- ConstraintSet: could not find atom " << name2
<< " -->" << endl;
if ( onpe0 )
cout << " ConstraintSet: could not define constraint " << endl;
return 1;
cout << " <!-- ConstraintSet: could not define constraint -->" << endl;
}
return false;
}
if ( name1 == name2 )
{
if ( onpe0 )
cout << " ConstraintSet: cannot define distance constraint between "
<< name1 << " and " << name2 << endl;
return 1;
cout << " <!-- ConstraintSet: cannot define distance constraint between "
<< name1 << " and " << name2 << " -->" << endl;
return false;
}
distance = atof(argv[4]);
if ( argc == 6 )
distance = atof(argv[6]);
if ( argc == 8 )
{
velocity = atof(argv[5]);
velocity = atof(argv[7]);
}
if ( distance <= 0.0 )
{
if ( onpe0 )
cout << " ConstraintSet: distance must be positive " << endl
<< " ConstraintSet: could not define constraint " << endl;
return 1;
cout << " <!-- ConstraintSet: distance must be positive -->" << endl
<< " <!-- ConstraintSet: could not define constraint -->" << endl;
return false;
}
// check if equivalent constraint is already defined
// check if constraint is already defined
bool found = false;
Constraint *pc = 0;
for ( int i = 0; i < constraint_list.size(); i++ )
......@@ -137,22 +141,21 @@ bool ConstraintSet::set_constraint(AtomSet &atoms, int argc, char **argv)
( pc->names(0) == name1 && pc->names(1) == name2 ) ||
( pc->names(1) == name1 && pc->names(0) == name2 ) )
found = true;
if ( pc->type() == "distance" && pc->name() == name )
found = true;
}
if ( found )
{
if ( onpe0 )
cout << " <!-- ConstraintSet:set_constraint: distance constraint "
<< name1 << " " << name2
<< " was found" << endl
<< " ConstraintSet: modifying distance constraint -->" << endl;
pc->set_value(distance);
pc->set_velocity(velocity);
cout << " <!-- ConstraintSet: constraint is already defined:\n"
<< " cannot define constraint -->" << endl;
return false;
}
else
{
DistanceConstraint *c =
new DistanceConstraint(name1,name2,distance,
new DistanceConstraint(name,name1,name2,distance,
velocity,distance_tolerance);
constraint_list.push_back(c);
......@@ -160,19 +163,20 @@ bool ConstraintSet::set_constraint(AtomSet &atoms, int argc, char **argv)
}
else if ( type == angle_type )
{
// constraint angle A B C angle
// constraint angle A B C angle velocity
// constraint define name angle A B C value
// constraint define name angle A B C value velocity
if ( argc < 6 || argc > 7 )
if ( argc < 8 || argc > 9 )
{
if ( onpe0 )
cout << " Incorrect number of arguments for angle constraint"
cout << " <!-- Incorrect number of arguments for angle constraint -->"
<< endl;
return false;
}
string name1 = argv[2];
string name2 = argv[3];
string name3 = argv[4];
string name = argv[3];
string name1 = argv[4];
string name2 = argv[5];
string name3 = argv[6];
Atom *a1 = atoms.findAtom(name1);
Atom *a2 = atoms.findAtom(name2);
......@@ -180,41 +184,43 @@ bool ConstraintSet::set_constraint(AtomSet &atoms, int argc, char **argv)
if ( a1 == 0 || a2 == 0 || a3 == 0 )
{
if ( a1 == 0 )
if ( onpe0 )
cout << " ConstraintSet: could not find atom " << name1 << endl;
if ( a2 == 0 )
if ( onpe0 )
cout << " ConstraintSet: could not find atom " << name2 << endl;
if ( a3 == 0 )
if ( onpe0 )
cout << " ConstraintSet: could not find atom " << name3 << endl;
if ( onpe0 )
cout << " ConstraintSet: could not define constraint " << endl;
return 1;
{
if ( a1 == 0 )
cout << " <!-- ConstraintSet: could not find atom " << name1
<< " -->" << endl;
if ( a2 == 0 )
cout << " <!-- ConstraintSet: could not find atom " << name2
<< " -->" << endl;
if ( a3 == 0 )
cout << " <!-- ConstraintSet: could not find atom " << name3
<< " -->" << endl;
cout << " <!-- ConstraintSet: could not define constraint -->" << endl;
}
return false;
}
if ( name1 == name2 || name1 == name3 || name2 == name3)
{
if ( onpe0 )
cout << " ConstraintSet: cannot define angle constraint between "
<< name1 << " " << name2 << " and " << name3 << endl;
return 1;
cout << " <!-- ConstraintSet: cannot define angle constraint between "
<< name1 << " " << name2 << " and " << name3 << " -->" << endl;
return false;
}
const double angle = atof(argv[5]);
double velocity;
if ( argc == 7 )
const double angle = atof(argv[7]);
double velocity = 0.0;
if ( argc == 9 )
{
velocity = atof(argv[6]);
velocity = atof(argv[8]);
}
if ( angle < 0.0 || angle > 180.0 )
{
if ( onpe0 )
cout << " ConstraintSet: angle must be in [0,180]" << endl
<< " ConstraintSet: could not define constraint " << endl;
return 1;
cout << " <!-- ConstraintSet: angle must be in [0,180] -->" << endl
<< " <!-- ConstraintSet: could not define constraint -->" << endl;
return false;
}
// check if equivalent constraint is already defined
......@@ -242,33 +248,34 @@ bool ConstraintSet::set_constraint(AtomSet &atoms, int argc, char **argv)
cout << " <!-- ConstraintSet:set_constraint: an angle constraint "
<< name1 << " " << name2 << " " << name3
<< " was found" << endl
<< " ConstraintSet: modifying angle constraint -->" << endl;
pc->set_value(angle);
pc->set_velocity(velocity);
<< " ConstraintSet: cannot define constraint -->" << endl;
return false;
}
else
{
AngleConstraint *c =
new AngleConstraint(name1,name2,name3,angle,velocity,angle_tolerance);
new AngleConstraint(name, name1,name2,name3,angle,
velocity,angle_tolerance);
constraint_list.push_back(c);
}
}
else if ( type == torsion_type )
{
// constraint torsion A B C D angle
// constraint torsion A B C D angle velocity
// constraint define name torsion A B C D angle
// constraint define name torsion A B C D angle velocity
if ( argc < 7 || argc > 8 )
if ( argc < 9 || argc > 10 )
{
if ( onpe0 )
cout << " Incorrect number of arguments for angle constraint"
cout << " <!-- Incorrect number of arguments for torsion constraint -->"
<< endl;
return false;
}
string name1 = argv[2];
string name2 = argv[3];
string name3 = argv[4];
string name4 = argv[5];
string name = argv[3];
string name1 = argv[4];
string name2 = argv[5];
string name3 = argv[6];
string name4 = argv[7];
Atom *a1 = atoms.findAtom(name1);
Atom *a2 = atoms.findAtom(name2);
......@@ -277,42 +284,45 @@ bool ConstraintSet::set_constraint(AtomSet &atoms, int argc, char **argv)
if ( a1 == 0 || a2 == 0 || a3 == 0 || a4 == 0 )
{
if ( a1 == 0 )
if ( onpe0 )
cout << " ConstraintSet: could not find atom " << name1 << endl;
if ( a2 == 0 )
if ( onpe0 )
cout << " ConstraintSet: could not find atom " << name2 << endl;
if ( a3 == 0 )
if ( onpe0 )
cout << " ConstraintSet: could not find atom " << name3 << endl;
if ( a4 == 0 )
if ( onpe0 )
cout << " ConstraintSet: could not find atom " << name4 << endl;
if ( onpe0 )
{
if ( a1 == 0 )
cout << " <!-- ConstraintSet: could not find atom " << name1
<< " -->" << endl;
if ( a2 == 0 )
cout << " <!-- ConstraintSet: could not find atom " << name2
<< " -->" << endl;
if ( a3 == 0 )
cout << " <!-- ConstraintSet: could not find atom " << name3
<< " -->" << endl;
if ( a4 == 0 )
cout << " <!-- ConstraintSet: could not find atom " << name4
<< " -->" << endl;
if ( onpe0 )
cout << " ConstraintSet: could not define constraint " << endl;
return 1;
cout << " <!-- ConstraintSet: could not define constraint -->" << endl;
}
return false;
}
if ( name1 == name2 || name1 == name3 || name1 == name4 ||
name2 == name3 || name2 == name4 || name3 == name4 )
{
if ( onpe0 )
cout << " ConstraintSet: cannot define torsion constraint using "
<< name1 << " " << name2 << " " << name3 << " " << name4 << endl;
return 1;