1 |
< |
/* |
1 |
> |
/* |
2 |
|
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
3 |
|
* |
4 |
|
* The University of Notre Dame grants you ("Licensee") a |
53 |
|
|
54 |
|
namespace oopse { |
55 |
|
|
56 |
< |
Restraints::Restraints(SimInfo* info, double lambdaVal, double lambdaExp){ |
56 |
> |
Restraints::Restraints(SimInfo* info, RealType lambdaVal, RealType lambdaExp){ |
57 |
|
info_ = info; |
58 |
|
Globals* simParam = info_->getSimParams(); |
59 |
|
|
61 |
|
lambdaK = lambdaExp; |
62 |
|
|
63 |
|
if (simParam->getUseSolidThermInt()) { |
64 |
< |
if (simParam->haveDistSpringConst()) { |
65 |
< |
kDist = simParam->getDistSpringConst(); |
64 |
> |
if (simParam->haveThermIntDistSpringConst()) { |
65 |
> |
kDist = simParam->getThermIntDistSpringConst(); |
66 |
|
} |
67 |
|
else{ |
68 |
< |
kDist = 6.0; |
68 |
> |
kDist = simParam->getThermIntDistSpringConst(); |
69 |
|
sprintf(painCave.errMsg, |
70 |
|
"ThermoIntegration Warning: the spring constant for the\n" |
71 |
|
"\ttranslational restraint was not specified. OOPSE will use\n" |
75 |
|
painCave.isFatal = 0; |
76 |
|
simError(); |
77 |
|
} |
78 |
< |
if (simParam->haveThetaSpringConst()) { |
79 |
< |
kTheta = simParam->getThetaSpringConst(); |
78 |
> |
if (simParam->haveThermIntThetaSpringConst()) { |
79 |
> |
kTheta = simParam->getThermIntThetaSpringConst(); |
80 |
|
} |
81 |
|
else{ |
82 |
< |
kTheta = 7.5; |
82 |
> |
kTheta = simParam->getThermIntThetaSpringConst(); |
83 |
|
sprintf(painCave.errMsg, |
84 |
|
"ThermoIntegration Warning: the spring constant for the\n" |
85 |
|
"\tdeflection orientational restraint was not specified.\n" |
89 |
|
painCave.isFatal = 0; |
90 |
|
simError(); |
91 |
|
} |
92 |
< |
if (simParam->haveOmegaSpringConst()) { |
93 |
< |
kOmega = simParam->getOmegaSpringConst(); |
92 |
> |
if (simParam->haveThermIntOmegaSpringConst()) { |
93 |
> |
kOmega = simParam->getThermIntOmegaSpringConst(); |
94 |
|
} |
95 |
|
else{ |
96 |
< |
kOmega = 13.5; |
96 |
> |
kOmega = simParam->getThermIntOmegaSpringConst(); |
97 |
|
sprintf(painCave.errMsg, |
98 |
|
"ThermoIntegration Warning: the spring constant for the\n" |
99 |
|
"\tspin orientational restraint was not specified. OOPSE\n" |
106 |
|
} |
107 |
|
|
108 |
|
// build a RestReader and read in important information |
109 |
+ |
|
110 |
|
restRead_ = new RestReader(info_); |
111 |
|
restRead_->readIdealCrystal(); |
112 |
|
restRead_->readZangle(); |
119 |
|
Restraints::~Restraints(){ |
120 |
|
} |
121 |
|
|
122 |
< |
void Restraints::Calc_rVal(Vector3d &position, double refPosition[3]){ |
122 |
> |
void Restraints::Calc_rVal(Vector3d &position, RealType refPosition[3]){ |
123 |
|
delRx = position.x() - refPosition[0]; |
124 |
|
delRy = position.y() - refPosition[1]; |
125 |
|
delRz = position.z() - refPosition[2]; |
127 |
|
return; |
128 |
|
} |
129 |
|
|
130 |
< |
void Restraints::Calc_body_thetaVal(RotMat3x3d &matrix, double refUnit[3]){ |
130 |
> |
void Restraints::Calc_body_thetaVal(RotMat3x3d &matrix, RealType refUnit[3]){ |
131 |
|
ub0x = matrix(0,0)*refUnit[0] + matrix(0,1)*refUnit[1] |
132 |
< |
+ matrix(0,2)*refUnit[2]; |
132 |
> |
+ matrix(0,2)*refUnit[2]; |
133 |
|
ub0y = matrix(1,0)*refUnit[0] + matrix(1,1)*refUnit[1] |
134 |
|
+ matrix(1,2)*refUnit[2]; |
135 |
|
ub0z = matrix(2,0)*refUnit[0] + matrix(2,1)*refUnit[1] |
146 |
|
return; |
147 |
|
} |
148 |
|
|
149 |
< |
void Restraints::Calc_body_omegaVal(double zAngle){ |
150 |
< |
double zRotator[3][3]; |
151 |
< |
double tempOmega; |
152 |
< |
double wholeTwoPis; |
149 |
> |
void Restraints::Calc_body_omegaVal(RealType zAngle){ |
150 |
> |
RealType zRotator[3][3]; |
151 |
> |
RealType tempOmega; |
152 |
> |
RealType wholeTwoPis; |
153 |
|
// Use the omega accumulated from the rotation propagation |
154 |
|
omega = zAngle; |
155 |
|
|
185 |
|
return; |
186 |
|
} |
187 |
|
|
188 |
< |
double Restraints::Calc_Restraint_Forces(){ |
188 |
> |
RealType Restraints::Calc_Restraint_Forces(){ |
189 |
|
SimInfo::MoleculeIterator mi; |
190 |
|
Molecule* mol; |
191 |
|
Molecule::IntegrableObjectIterator ii; |
192 |
|
StuntDouble* integrableObject; |
193 |
|
Vector3d pos; |
194 |
|
RotMat3x3d A; |
195 |
< |
double refPos[3]; |
196 |
< |
double refVec[3]; |
197 |
< |
double tolerance; |
198 |
< |
double tempPotent; |
199 |
< |
double factor; |
200 |
< |
double spaceTrq[3]; |
201 |
< |
double omegaPass; |
195 |
> |
RealType refPos[3]; |
196 |
> |
RealType refVec[3]; |
197 |
> |
RealType tolerance; |
198 |
> |
RealType tempPotent; |
199 |
> |
RealType factor; |
200 |
> |
RealType spaceTrq[3]; |
201 |
> |
RealType omegaPass; |
202 |
|
GenericData* data; |
203 |
|
DoubleGenericData* doubleData; |
204 |
|
|