Skip to content

Commit

Permalink
Reformatted files via clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
LSchwiebert committed Jul 29, 2024
1 parent 0a19327 commit e644a52
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 39 deletions.
8 changes: 4 additions & 4 deletions src/BlockOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ struct BlockAverages : OutputableBase {
stepsPerOut = event.frequency;
invSteps = 1.0 / stepsPerOut;
firstInvSteps = invSteps;
//Handle the case where we are restarting from a checkpoint and the first
//interval is smaller than expected because we create a checkpoint more
//often than the Block output frequency.
// Handle the case where we are restarting from a checkpoint and the first
// interval is smaller than expected because we create a checkpoint more
// often than the Block output frequency.
if (startStep != 0 && (startStep % stepsPerOut) != 0) {
ulong diff;
diff = stepsPerOut - (startStep % stepsPerOut);
firstInvSteps = 1.0/diff;
firstInvSteps = 1.0 / diff;
}
enableOut = event.enable;
}
Expand Down
59 changes: 33 additions & 26 deletions src/ConfigSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1897,15 +1897,13 @@ void ConfigSetup::verifyInputs(void) {
std::cout << "ERROR: Impulse Pressure Correction cannot be "
<< "used with LJ long-range corrections." << std::endl;
exit(EXIT_FAILURE);

}
if (((sys.ff.VDW_KIND == sys.ff.VDW_SHIFT_KIND) ||
(sys.ff.VDW_KIND == sys.ff.VDW_SWITCH_KIND)) &&
sys.ff.doImpulsePressureCorr) {
std::cout << "ERROR: Impulse Pressure Correction is not supported "
<< "for SWITCH or SHIFT potentials." << std::endl;
exit(EXIT_FAILURE);

}
if (sys.ff.doImpulsePressureCorr && sys.ff.doTailCorr) {
std::cout << "ERROR: Both LRC (Long Range Correction) and "
Expand Down Expand Up @@ -2104,9 +2102,10 @@ void ConfigSetup::verifyInputs(void) {
if (in.restart.restartFromBinaryCoorFile) {
for (i = 0; i < BOX_TOTAL; i++) {
if (!in.files.binaryCoorInput.defined[i]) {
std::cout << "ERROR: Binary coordinate file was not specified for box "
"number "
<< i << "!" << std::endl;
std::cout
<< "ERROR: Binary coordinate file was not specified for box "
"number "
<< i << "!" << std::endl;
exit(EXIT_FAILURE);
}
}
Expand Down Expand Up @@ -2174,25 +2173,30 @@ void ConfigSetup::verifyInputs(void) {
if ((sys.memcVal.MEMC1 && sys.memcVal.MEMC2) ||
(sys.memcVal.MEMC1 && sys.memcVal.MEMC3) ||
(sys.memcVal.MEMC2 && sys.memcVal.MEMC3)) {
std::cout << "ERROR: Multiple MEMC methods were specified, but only one is allowed!\n";
std::cout << "ERROR: Multiple MEMC methods were specified, but only one "
"is allowed!\n";
exit(EXIT_FAILURE);
}
if ((sys.intraMemcVal.MEMC1 && sys.intraMemcVal.MEMC2) ||
(sys.intraMemcVal.MEMC1 && sys.intraMemcVal.MEMC3) ||
(sys.intraMemcVal.MEMC2 && sys.intraMemcVal.MEMC3)) {
std::cout << "ERROR: Multiple Intra-MEMC methods are specified, but only one is allowed!\n";
std::cout << "ERROR: Multiple Intra-MEMC methods are specified, but only "
"one is allowed!\n";
exit(EXIT_FAILURE);
}
if (!sys.memcVal.readVol || !sys.intraMemcVal.readVol) {
std::cout << "ERROR: In the MEMC method, the Sub-Volume was not specified!\n";
std::cout
<< "ERROR: In the MEMC method, the Sub-Volume was not specified!\n";
exit(EXIT_FAILURE);
}
if (!sys.memcVal.readRatio || !sys.intraMemcVal.readRatio) {
std::cout << "ERROR: In the MEMC method, Exchange Ratio was not specified!\n";
std::cout
<< "ERROR: In the MEMC method, Exchange Ratio was not specified!\n";
exit(EXIT_FAILURE);
}
if (sys.memcVal.largeKind.size() != sys.memcVal.exchangeRatio.size()) {
std::cout << "ERROR: In the MEMC method, the specified number of Large Kinds was "
std::cout << "ERROR: In the MEMC method, the specified number of Large "
"Kinds was "
<< sys.memcVal.largeKind.size() << ", but "
<< sys.memcVal.exchangeRatio.size()
<< " exchange ratio was specified!\n";
Expand All @@ -2209,49 +2213,52 @@ void ConfigSetup::verifyInputs(void) {
if ((sys.memcVal.largeKind.size() != sys.memcVal.smallKind.size()) ||
(sys.intraMemcVal.largeKind.size() !=
sys.intraMemcVal.smallKind.size())) {
std::cout
<< "ERROR: In the MEMC method, the specified number of Large Kinds is not "
<< " equal as specified number of Small Kinds!\n";
std::cout << "ERROR: In the MEMC method, the specified number of Large "
"Kinds is not "
<< " equal as specified number of Small Kinds!\n";
exit(EXIT_FAILURE);
}
if (!sys.memcVal.readLargeBB || !sys.intraMemcVal.readLargeBB) {
std::cout
<< "ERROR: In the MEMC method, Large Kind BackBone was not specified!\n";
std::cout << "ERROR: In the MEMC method, Large Kind BackBone was not "
"specified!\n";
exit(EXIT_FAILURE);
}
if (sys.memcVal.largeKind.size() != sys.memcVal.largeBBAtom1.size()) {
std::cout << "ERROR: In the MEMC method, the specified number of Large Kinds was "
std::cout << "ERROR: In the MEMC method, the specified number of Large "
"Kinds was "
<< sys.memcVal.largeKind.size() << ", but "
<< sys.memcVal.largeBBAtom1.size()
<< " sets of Large Molecule BackBone was specified!\n";
exit(EXIT_FAILURE);
}
if (sys.memcVal.MEMC2 && !sys.memcVal.readSmallBB) {
std::cout
<< "ERROR: In the MEMC-2 method, Small Kind BackBone was not specified!\n";
std::cout << "ERROR: In the MEMC-2 method, Small Kind BackBone was not "
"specified!\n";
exit(EXIT_FAILURE);
}

if (sys.memcVal.MEMC2 &&
(sys.memcVal.smallKind.size() != sys.memcVal.smallBBAtom1.size())) {
std::cout
<< "ERROR: In the MEMC-2 method, the specified number of Small Kinds was "
<< sys.memcVal.smallKind.size() << ", but "
<< sys.memcVal.smallBBAtom1.size()
<< " sets of Small Molecule BackBone was specified!\n";
std::cout << "ERROR: In the MEMC-2 method, the specified number of Small "
"Kinds was "
<< sys.memcVal.smallKind.size() << ", but "
<< sys.memcVal.smallBBAtom1.size()
<< " sets of Small Molecule BackBone was specified!\n";
exit(EXIT_FAILURE);
}

if (sys.intraMemcVal.MEMC2 && !sys.intraMemcVal.readSmallBB) {
std::cout << "ERROR: In the Intra-MEMC-2 method, Small Kind BackBone was not "
"specified!\n";
std::cout
<< "ERROR: In the Intra-MEMC-2 method, Small Kind BackBone was not "
"specified!\n";
exit(EXIT_FAILURE);
}
if (sys.memcVal.enable && sys.intraMemcVal.enable) {
if ((sys.memcVal.MEMC1 && !sys.intraMemcVal.MEMC1) ||
(sys.memcVal.MEMC2 && !sys.intraMemcVal.MEMC2) ||
(sys.memcVal.MEMC3 && !sys.intraMemcVal.MEMC3)) {
std::cout << "ERROR: The selected intra-MEMC method was not same as the inter-MEMC method!\n";
std::cout << "ERROR: The selected intra-MEMC method was not same as "
"the inter-MEMC method!\n";
exit(EXIT_FAILURE);
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/FFSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@ void Dihedral::Read(Reader &param, std::string const &firstVar) {
if (index == 0) {
// set phase shift for n=0 to 90 degree
// We will have C0 = Kchi (1 + cos(0 * phi + 90)) = Kchi
//this avoids double counting the C0 (constant offset) term, which is used force fields like TraPPE
// this avoids double counting the C0 (constant offset) term, which is used
// force fields like TraPPE
def = 90.00;
}
Add(merged, coeff, index, def);
Expand Down
2 changes: 1 addition & 1 deletion src/moves/CrankShaft.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ inline void CrankShaft::Accept(const uint rejectState, const ulong step) {
// Add rest of energy.
sysPotRef.boxEnergy[sourceBox] -= oldMol.GetEnergy();
sysPotRef.boxEnergy[destBox] += newMol.GetEnergy();
//Add Reciprocal energy difference
// Add Reciprocal energy difference
sysPotRef.boxEnergy[destBox].recip += recipDiff.energy;
// Add correction energy
sysPotRef.boxEnergy[sourceBox].correction -= correct_old;
Expand Down
2 changes: 1 addition & 1 deletion src/moves/MoleculeTransfer.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ inline void MoleculeTransfer::Accept(const uint rejectState, const ulong step) {
// Add rest of energy.
sysPotRef.boxEnergy[sourceBox] -= oldMol.GetEnergy();
sysPotRef.boxEnergy[destBox] += newMol.GetEnergy();
//Add Reciprocal energy
// Add Reciprocal energy
sysPotRef.boxEnergy[sourceBox].recip += recipLose.energy;
sysPotRef.boxEnergy[destBox].recip += recipGain.energy;
// Add correction energy
Expand Down
4 changes: 2 additions & 2 deletions src/moves/MultiParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ inline uint MultiParticle::ChooseBox() {
}
}
if (multiParticleLiquid)
return maxB;
return maxB;
else
return minB;
return minB;
}

inline uint MultiParticle::Transform() {
Expand Down
4 changes: 2 additions & 2 deletions src/moves/MultiParticleBrownianMotion.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ inline uint MultiParticleBrownian::ChooseBox() {
}
}
if (multiParticleLiquid)
return maxB;
return maxB;
else
return minB;
return minB;
}

inline uint MultiParticleBrownian::Transform() {
Expand Down
5 changes: 3 additions & 2 deletions src/moves/TargetedSwap.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ inline uint TargetedSwap::GetBoxPairAndMol(const double subDraw,
state = PickMolInSubVolume();

#if ENSEMBLE == GCMC
if (state == mv::fail_state::NO_MOL_OF_KIND_IN_BOX && sourceBox == mv::BOX1 && hasSubVolume[sourceBox]) {
if (state == mv::fail_state::NO_MOL_OF_KIND_IN_BOX && sourceBox == mv::BOX1 &&
hasSubVolume[sourceBox]) {
std::cout << "Error: There are no molecules of kind "
<< molRef.kinds[kindIndex].name << " left in reservoir.\n";
exit(EXIT_FAILURE);
Expand Down Expand Up @@ -709,7 +710,7 @@ inline void TargetedSwap::Accept(const uint rejectState, const ulong step) {
// Add rest of energy.
sysPotRef.boxEnergy[sourceBox] -= oldMol.GetEnergy();
sysPotRef.boxEnergy[destBox] += newMol.GetEnergy();
//Add Reciprocal energy
// Add Reciprocal energy
sysPotRef.boxEnergy[sourceBox].recip += recipLose.energy;
sysPotRef.boxEnergy[destBox].recip += recipGain.energy;
// Add correction energy
Expand Down

0 comments on commit e644a52

Please sign in to comment.