namespace rgpot::types::adapt::capnp¶
Overview¶
namespace capnp {
// global functions
AtomMatrix convertPositionsFromCapnp(const ::capnp::List<double>::Reader& capnpPos, size_t numAtoms);
std::vector<int> convertAtomNumbersFromCapnp(const ::capnp::List<int>::Reader& capnpAtmnrs);
std::array<std::array<double, 3>, 3> convertBoxMatrixFromCapnp(const ::capnp::List<double>::Reader& capnpBox);
void populatePositionsToCapnp(::capnp::List<double>::Builder& capnpPos, const AtomMatrix& positions);
void populateForcesToCapnp(::capnp::List<double>::Builder& capnpForces, const AtomMatrix& forces);
void populateAtomNumbersToCapnp(::capnp::List<int>::Builder& capnpAtmnrs, const std::vector<int>& atomNumbers);
void populateBoxMatrixToCapnp(::capnp::List<double>::Builder& capnpBox, const std::array<std::array<double, 3>, 3>& boxMatrix);
} // namespace capnp
Detailed Documentation¶
Global Functions¶
AtomMatrix convertPositionsFromCapnp(const ::capnp::List<double>::Reader& capnpPos, size_t numAtoms)
Converts Cap’n Proto position list to an AtomMatrix.
Parameters:
capnpPos |
The reader for the position list. |
numAtoms |
The number of atoms in the system. |
Returns:
An AtomMatrix containing the positions.
std::vector<int> convertAtomNumbersFromCapnp(const ::capnp::List<int>::Reader& capnpAtmnrs)
Converts Cap’n Proto atomic number list to an STL vector.
Parameters:
capnpAtmnrs |
The reader for the atomic numbers list. |
Returns:
A std::vector<int> containing the atomic numbers.
std::array<std::array<double, 3>, 3> convertBoxMatrixFromCapnp(const ::capnp::List<double>::Reader& capnpBox)
Converts Cap’n Proto box list to a native 3x3 array.
Parameters:
capnpBox |
The reader for the box matrix list. |
Returns:
A nested std::array of doubles representing the cell.
void populatePositionsToCapnp(::capnp::List<double>::Builder& capnpPos, const AtomMatrix& positions)
Serializes an AtomMatrix of positions to a Cap’n Proto builder.
Parameters:
capnpPos |
The builder for the position list. |
positions |
The source |
Returns:
Void.
void populateForcesToCapnp(::capnp::List<double>::Builder& capnpForces, const AtomMatrix& forces)
Serializes an AtomMatrix of forces to a Cap’n Proto builder.
Parameters:
capnpForces |
The builder for the force list. |
forces |
The source |
Returns:
Void.
void populateAtomNumbersToCapnp(::capnp::List<int>::Builder& capnpAtmnrs, const std::vector<int>& atomNumbers)
Serializes an STL vector of atomic numbers to a Cap’n Proto builder.
Parameters:
capnpAtmnrs |
The builder for the atomic numbers list. |
atomNumbers |
The source |
Returns:
Void.
void populateBoxMatrixToCapnp(::capnp::List<double>::Builder& capnpBox, const std::array<std::array<double, 3>, 3>& boxMatrix)
Serializes a native 3x3 box matrix to a Cap’n Proto builder.
Parameters:
capnpBox |
The builder for the box matrix list. |
boxMatrix |
The source nested |
Returns:
Void.