Skip to content

Commit 173ff86

Browse files
committed
Update ExchangeVolume with the same enhanced warning message
1 parent 66e603a commit 173ff86

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

src/BoxDimensions.cpp

+11-7
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ uint BoxDimensions::ShiftVolume(BoxDimensions &newDim, XYZ &scale, const uint b,
111111
if ((newDim.halfAx.x[b] < rCut[b] || newDim.halfAx.y[b] < rCut[b] ||
112112
newDim.halfAx.z[b] < rCut[b] || newVolume < minVol[b])) {
113113
std::cout << "WARNING!!! Box " << b
114-
<< " shrunk below 2*Rcut! Auto-rejecting!" << std::endl;
114+
<< " shrunk below 2*Rcut! Auto-rejecting!\n";
115115
std::cout << "Volume was reduced from " << volume[b] << " to " << newVolume
116-
<< std::endl;
117-
std::cout << "Old Axis Dimensions: " << axis.Get(b) << std::endl;
118-
std::cout << "New Axis Dimensions: " << newDim.GetAxis(b) << std::endl;
119-
std::cout << "Exiting!" << std::endl;
116+
<< "\n";
117+
std::cout << "Old Axis Dimensions: " << axis.Get(b) << "\n";
118+
std::cout << "New Axis Dimensions: " << newDim.GetAxis(b) << "\n";
119+
std::cout << "Exiting!\n";
120120
exit(EXIT_FAILURE);
121121
}
122122
scale = newDim.axis.Get(b) / axis.Get(b);
@@ -140,8 +140,12 @@ uint BoxDimensions::ExchangeVolume(BoxDimensions &newDim, XYZ *scale,
140140
scale[b] = newDim.axis.Get(b) / axis.Get(b);
141141
if ((newDim.halfAx.x[b] < rCut[b] || newDim.halfAx.y[b] < rCut[b] ||
142142
newDim.halfAx.z[b] < rCut[b] || newDim.volume[b] < minVol[b])) {
143-
std::cout << "WARNING!!! box shrunk below 2*Rcut! Auto-rejecting!\n";
144-
std::cout << "AxisDimensions: " << newDim.GetAxis(b) << std::endl;
143+
std::cout << "WARNING!!! Box " << b
144+
<< " shrunk below 2*Rcut! Auto-rejecting!\n";
145+
std::cout << "Volume was reduced from " << volume[b] << " to "
146+
<< newDim.volume[b] << "\n";
147+
std::cout << "Old Axis Dimensions: " << axis.Get(b) << "\n";
148+
std::cout << "New Axis Dimensions: " << newDim.GetAxis(b) << "\n";
145149
std::cout << "Exiting!\n";
146150
exit(EXIT_FAILURE);
147151
}

src/BoxDimensionsNonOrth.cpp

+11-7
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ uint BoxDimensionsNonOrth::ShiftVolume(BoxDimensionsNonOrth &newDim, XYZ &scale,
179179
if ((newDim.halfAx.x[b] < rCut[b] || newDim.halfAx.y[b] < rCut[b] ||
180180
newDim.halfAx.z[b] < rCut[b] || newVolume < minVol[b])) {
181181
std::cout << "WARNING!!! Box " << b
182-
<< " shrunk below 2*Rcut! Auto-rejecting!" << std::endl;
182+
<< " shrunk below 2*Rcut! Auto-rejecting!\n";
183183
std::cout << "Volume was reduced from " << volume[b] << " to " << newVolume
184-
<< std::endl;
185-
std::cout << "Old Axis Dimensions: " << axis.Get(b) << std::endl;
186-
std::cout << "New Axis Dimensions: " << newDim.GetAxis(b) << std::endl;
187-
std::cout << "Exiting!" << std::endl;
184+
<< "\n";
185+
std::cout << "Old Axis Dimensions: " << axis.Get(b) << "\n";
186+
std::cout << "New Axis Dimensions: " << newDim.GetAxis(b) << "\n";
187+
std::cout << "Exiting!\n";
188188
exit(EXIT_FAILURE);
189189
}
190190
scale = newDim.axis.Get(b) / axis.Get(b);
@@ -209,8 +209,12 @@ uint BoxDimensionsNonOrth::ExchangeVolume(BoxDimensionsNonOrth &newDim,
209209
scale[b] = newDim.axis.Get(b) / axis.Get(b);
210210
if ((newDim.halfAx.x[b] < rCut[b] || newDim.halfAx.y[b] < rCut[b] ||
211211
newDim.halfAx.z[b] < rCut[b] || newDim.volume[b] < minVol[b])) {
212-
std::cout << "WARNING!!! box shrunk below 2*Rcut! Auto-rejecting!\n";
213-
std::cout << "AxisDimensions: " << newDim.GetAxis(b) << std::endl;
212+
std::cout << "WARNING!!! Box " << b
213+
<< " shrunk below 2*Rcut! Auto-rejecting!\n";
214+
std::cout << "Volume was reduced from " << volume[b] << " to "
215+
<< newDim.volume[b] << "\n";
216+
std::cout << "Old Axis Dimensions: " << axis.Get(b) << "\n";
217+
std::cout << "New Axis Dimensions: " << newDim.GetAxis(b) << "\n";
214218
std::cout << "Exiting!\n";
215219
exit(EXIT_FAILURE);
216220
}

0 commit comments

Comments
 (0)