class GenericPotImpl¶
Overview¶
Implementation of the standalone Cap’n Proto potential server. More…
class GenericPotImpl: public Potential::Server {
public:
// construction
GenericPotImpl(std::unique_ptr<rgpot::PotentialBase> pot);
// methods
kj::Promise calculate(CalculateContext context);
};
Detailed Documentation¶
Implementation of the standalone Cap’n Proto potential server.
This file implements a basic RPC server which exposes toy potentials over a network interface. It utilizes the EzRpcServer for handling requests.
Server implementation for the Potential RPC interface.
This class wraps a polymorphic PotentialBase instance and dispatches RPC calculate requests to the underlying physics engine.
Construction¶
GenericPotImpl(std::unique_ptr<rgpot::PotentialBase> pot)
Constructor for GenericPotImpl.
Parameters:
pot |
Ownership of a PotentialBase derived object. |
Methods¶
kj::Promisecalculate(CalculateContext context)
This method performs the following translation steps:
Extracts the
ForceInput(fip) from the RPC context.Validates the size of the atomic number list.
Converts Cap’n Proto lists into native
AtomMatrixandstd::vectortypes.Executes the calculation via the
PotentialBasevirtual operator.Populates the
PotentialResultwith energy and force data.
Parameters:
context |
The Cap’n Proto RPC call context. |
Returns:
An asynchronous promise for completion.