fr->v = nullptr;
fr->f = nullptr;
clear_mat(fr->box);
- fr->bPBC = FALSE;
- fr->ePBC = -1;
+ fr->bPBC = FALSE;
+ fr->pbcType = PbcType::Unset;
}
}
-void set_trxframe_ePBC(t_trxframe* fr, int ePBC)
+void setTrxFramePbcType(t_trxframe* fr, PbcType pbcType)
{
- fr->bPBC = (ePBC == -1);
- fr->ePBC = ePBC;
+ fr->bPBC = (pbcType == PbcType::Unset);
+ fr->pbcType = pbcType;
}
int write_trxframe_indexed(t_trxstatus* status, const t_trxframe* fr, int nind, const int* ind, gmx_conect gc)
}
else
{
- write_pdbfile_indexed(gmx_fio_getfp(status->fio), title, fr->atoms, fr->x, -1,
- fr->box, ' ', fr->step, nind, ind, gc, FALSE);
+ write_pdbfile_indexed(gmx_fio_getfp(status->fio), title, fr->atoms, fr->x,
+ PbcType::Unset, fr->box, ' ', fr->step, nind, ind, gc, FALSE);
}
break;
case efG96:
else
{
write_pdbfile(gmx_fio_getfp(status->fio), title, fr->atoms, fr->x,
- fr->bPBC ? fr->ePBC : -1, fr->box, ' ', fr->step, gc);
+ fr->bPBC ? fr->pbcType : PbcType::Unset, fr->box, ' ', fr->step, gc);
}
break;
case efG96: write_g96_conf(gmx_fio_getfp(status->fio), title, fr, -1, nullptr); break;
// Initiate model_nr to -1 rather than NOTSET.
// It is not worthwhile introducing extra variables in the
// read_pdbfile call to verify that a model_nr was read.
- int ePBC, model_nr = -1, na;
- char title[STRLEN], *time, *step;
- double dbl;
+ PbcType pbcType;
+ int model_nr = -1, na;
+ char title[STRLEN], *time, *step;
+ double dbl;
atoms.nr = fr->natoms;
atoms.atom = nullptr;
/* the other pointers in atoms should not be accessed if these are NULL */
snew(symtab, 1);
open_symtab(symtab);
- na = read_pdbfile(fp, title, &model_nr, &atoms, symtab, fr->x, &ePBC, boxpdb, TRUE, nullptr);
+ na = read_pdbfile(fp, title, &model_nr, &atoms, symtab, fr->x, &pbcType, boxpdb, TRUE, nullptr);
free_symtab(symtab);
sfree(symtab);
- set_trxframe_ePBC(fr, ePBC);
+ setTrxFramePbcType(fr, pbcType);
if (nframes_read(status) == 0)
{
fprintf(stderr, " '%s', %d atoms\n", title, fr->natoms);
/***** T O P O L O G Y S T U F F ******/
-t_topology* read_top(const char* fn, int* ePBC)
+t_topology* read_top(const char* fn, PbcType* pbcType)
{
- int epbc, natoms;
+ int natoms;
+ PbcType pbcTypeFile;
t_topology* top;
snew(top, 1);
- epbc = read_tpx_top(fn, nullptr, nullptr, &natoms, nullptr, nullptr, top);
- if (ePBC)
+ pbcTypeFile = read_tpx_top(fn, nullptr, nullptr, &natoms, nullptr, nullptr, top);
+ if (pbcType)
{
- *ePBC = epbc;
+ *pbcType = pbcTypeFile;
}
return top;