namespace gmx
{
-TopologyInformation::TopologyInformation()
- : hasLoadedMtop_(false),
- expandedTopology_(nullptr),
- atoms_ (nullptr),
- bTop_(false), ePBC_(-1)
+TopologyInformation::TopologyInformation() :
+ hasLoadedMtop_(false),
+ expandedTopology_(nullptr),
+ atoms_(nullptr),
+ bTop_(false),
+ ePBC_(-1)
{
}
-TopologyInformation::~TopologyInformation()
-{
-}
+TopologyInformation::~TopologyInformation() {}
-void TopologyInformation::fillFromInputFile(const std::string &filename)
+void TopologyInformation::fillFromInputFile(const std::string& filename)
{
mtop_ = std::make_unique<gmx_mtop_t>();
// TODO When filename is not a .tpr, then using readConfAndAtoms
// TODO Once there are fewer callers of the file-reading
// functionality, make them read directly into std::vector.
rvec *x, *v;
- readConfAndTopology(filename.c_str(), &bTop_, mtop_.get(),
- &ePBC_, &x, &v,
- boxtop_);
+ readConfAndTopology(filename.c_str(), &bTop_, mtop_.get(), &ePBC_, &x, &v, boxtop_);
xtop_.assign(x, x + mtop_->natoms);
vtop_.assign(v, v + mtop_->natoms);
sfree(x);
hasLoadedMtop_ = true;
// TODO: Only load this here if the tool actually needs it; selections
// take care of themselves.
- for (gmx_moltype_t &moltype : mtop_->moltype)
+ for (gmx_moltype_t& moltype : mtop_->moltype)
{
if (!moltype.atoms.haveMass)
{
}
}
-const gmx_localtop_t *TopologyInformation::expandedTopology() const
+const gmx_localtop_t* TopologyInformation::expandedTopology() const
{
// Do lazy initialization
if (expandedTopology_ == nullptr && hasTopology())
{
//! Helps implement lazy initialization.
-AtomsDataPtr makeAtoms(const TopologyInformation &top_)
+AtomsDataPtr makeAtoms(const TopologyInformation& top_)
{
AtomsDataPtr atoms(new t_atoms);
if (top_.hasTopology())
return atoms;
}
-} // namespace
+} // namespace
-const t_atoms *TopologyInformation::atoms() const
+const t_atoms* TopologyInformation::atoms() const
{
// Do lazy initialization
if (atoms_ == nullptr)
return makeAtoms(*this);
}
-ArrayRef<const RVec>
-TopologyInformation::x() const
+ArrayRef<const RVec> TopologyInformation::x() const
{
if (xtop_.empty())
{
return xtop_;
}
-ArrayRef<const RVec>
-TopologyInformation::v() const
+ArrayRef<const RVec> TopologyInformation::v() const
{
if (vtop_.empty())
{
return vtop_;
}
-void
-TopologyInformation::getBox(matrix box) const
+void TopologyInformation::getBox(matrix box) const
{
GMX_RELEASE_ASSERT(box != nullptr, "Must have valid box to fill");
- copy_mat(const_cast<rvec *>(boxtop_), box);
+ copy_mat(const_cast<rvec*>(boxtop_), box);
}
-const char *
-TopologyInformation::name() const
+const char* TopologyInformation::name() const
{
if (hasTopology() && mtop_->name)
{
return nullptr;
}
-gmx_rmpbc_t gmx_rmpbc_init(const gmx::TopologyInformation &topInfo)
+gmx_rmpbc_t gmx_rmpbc_init(const gmx::TopologyInformation& topInfo)
{
GMX_RELEASE_ASSERT(topInfo.hasTopology(), "Cannot remove PBC without a topology");