3 |
|
OOPSEMinimizerBase::OOPSEMinimizerBase(SimInfo* theInfo, ForceFields* the_ff) |
4 |
|
: RealIntegrator( theInfo, the_ff ){ |
5 |
|
tStats = new Thermo(info); |
6 |
+ |
dumpOut = new DumpWriter(info); |
7 |
+ |
calcDim(); |
8 |
|
} |
9 |
|
|
10 |
|
OOPSEMinimizerBase::~OOPSEMinimizerBase(){ |
11 |
|
delete tStats; |
12 |
+ |
delete dumpOut; |
13 |
|
} |
14 |
|
|
15 |
|
/** |
98 |
|
/** |
99 |
|
* |
100 |
|
*/ |
101 |
< |
void OOPSEMinimizerBase::getOptCoor(vector<double>& x){ |
101 |
> |
vector<double> OOPSEMinimizerBase::getOptCoor(){ |
102 |
|
Atom** atoms; |
103 |
|
DirectionalAtom* dAtom; |
104 |
|
int index; |
105 |
|
double position[3]; |
106 |
|
double eulerAngle[3]; |
107 |
+ |
vector<double> x; |
108 |
|
|
109 |
+ |
x.resize(getDim()); |
110 |
|
atoms = this->atoms; |
111 |
|
index = 0; |
112 |
|
|
129 |
|
|
130 |
|
} |
131 |
|
|
132 |
+ |
return x; |
133 |
+ |
|
134 |
|
} |
135 |
|
|
136 |
+ |
void OOPSEMinimizerBase::calcDim(){ |
137 |
+ |
Atom** atoms; |
138 |
+ |
DirectionalAtom* dAtom; |
139 |
+ |
int dim; |
140 |
|
|
141 |
+ |
dim = 0; |
142 |
+ |
|
143 |
+ |
atoms = this->atoms; |
144 |
+ |
|
145 |
+ |
for(int i = 0; i < nAtoms; i++){ |
146 |
+ |
dim += 3; |
147 |
+ |
if (atoms[i]->isDirectional()) |
148 |
+ |
dim += 3; |
149 |
+ |
} |
150 |
+ |
|
151 |
+ |
} |
152 |
+ |
|
153 |
+ |
void OOPSEMinimizerBase::output(vector<double>& x, int iteration){ |
154 |
+ |
setOptCoor(x); |
155 |
+ |
dumpOut->writeDump(iteration); |
156 |
+ |
} |