Skip to content

Commit 93b574e

Browse files
author
Daniel R. Roe
committed
1 parent e8598ee commit 93b574e

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/Parm_Amber.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ int Parm_Amber::ReadLJC(Topology& TopIn, FortranData const& FMT) {
890890
if (SetupBuffer(F_LJ_C, numLJparm_, FMT)) return 1;
891891
for (int idx = 0; idx != numLJparm_; idx++)
892892
{
893-
TopIn.SetNonbond().SetLJC( idx, FileBufferToDouble(F_LJ_C, idx, numLJparm_) );
893+
TopIn.SetNonbond().AddLJC( FileBufferToDouble(F_LJ_C, idx, numLJparm_) );
894894
if (atProblemFlag_) break;
895895
}
896896
return 0;
@@ -2094,7 +2094,6 @@ int Parm_Amber::WriteParm(FileName const& fname, Topology const& TopOut) {
20942094

20952095
// LJ A and B terms
20962096
if (WriteLJ(F_LJ_A, F_LJ_B, TopOut.Nonbond().NBarray())) return 1;
2097-
20982097

20992098
// CHAMBER only - LJ 1-4 terms
21002099
if (ptype_ == CHAMBER) {
@@ -2481,10 +2480,10 @@ int Parm_Amber::WriteParm(FileName const& fname, Topology const& TopOut) {
24812480
// LJ C terms.
24822481
// NOTE: I put this at the very end to match behavior of parmed add_12_6_4
24832482
if (TopOut.Nonbond().Has_C_Coeff()) {
2484-
if (BufferAlloc(F_LJ_C, TopOut.Nonbond().NBarray().size())) return 1;
2485-
for (NonbondArray::const_iterator it = TopOut.Nonbond().NBarray().begin();
2486-
it != TopOut.Nonbond().NBarray().end(); ++it)
2487-
file_.DblToBuffer( it->C() );
2483+
std::vector<double> const& ccoef = TopOut.Nonbond().LJC_Array();
2484+
if (BufferAlloc(F_LJ_C, ccoef.size())) return 1;
2485+
for (std::vector<double>::const_iterator it = ccoef.begin(); it != ccoef.end(); ++it)
2486+
file_.DblToBuffer( *it );
24882487
file_.FlushBuffer();
24892488
}
24902489

0 commit comments

Comments
 (0)