namespace rgpot::types::adapt::capnp

Overview

namespace capnp {

// global functions

AtomMatrix convertPositionsFromCapnp(const ::capnp::List::Reader& capnpPos, size_t numAtoms);
std::vector convertAtomNumbersFromCapnp(const ::capnp::List::Reader& capnpAtmnrs);
std::array, 3> convertBoxMatrixFromCapnp(const ::capnp::List::Reader& capnpBox);
void populatePositionsToCapnp(::capnp::List::Builder& capnpPos, const AtomMatrix& positions);
void populateForcesToCapnp(::capnp::List::Builder& capnpForces, const AtomMatrix& forces);
void populateAtomNumbersToCapnp(::capnp::List::Builder& capnpAtmnrs, const std::vector& atomNumbers);
void populateBoxMatrixToCapnp(::capnp::List::Builder& capnpBox, const std::array, 3>& boxMatrix);

} // namespace capnp

Detailed Documentation

Global Functions

AtomMatrix convertPositionsFromCapnp(const ::capnp::List::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 convertAtomNumbersFromCapnp(const ::capnp::List::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, 3> convertBoxMatrixFromCapnp(const ::capnp::List::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::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 AtomMatrix.

Returns:

Void.

void populateForcesToCapnp(::capnp::List::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 AtomMatrix.

Returns:

Void.

void populateAtomNumbersToCapnp(::capnp::List::Builder& capnpAtmnrs, const std::vector& 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 std::vector.

Returns:

Void.

void populateBoxMatrixToCapnp(::capnp::List::Builder& capnpBox, const std::array, 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 std::array.

Returns:

Void.