class GenericPotImpl¶
Overview¶
Server implementation for the Potential RPC interface. More…
class GenericPotImpl: public Potential::Server {
public:
// construction
GenericPotImpl(std::unique_ptr<rgpot::PotentialBase> pot);
GenericPotImpl(std::unique_ptr<rgpot::NWChemPot> pot, rgpot::tools::MpiPefSession* pef = nullptr);
GenericPotImpl(std::unique_ptr<rgpot::CPMDPot> pot, rgpot::tools::MpiPefSession* pef = nullptr);
// methods
kj::Promise<void> getCapabilities(GetCapabilitiesContext context);
kj::Promise<void> calculate(CalculateContext context);
kj::Promise<void> configure(ConfigureContext context);
};
Detailed Documentation¶
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. |
GenericPotImpl(std::unique_ptr<rgpot::NWChemPot> pot, rgpot::tools::MpiPefSession* pef = nullptr)
Constructor retaining an NWChemPot pointer for configure(). Members initialize in declaration order (m_potential then m_nwchem).
Methods¶
kj::Promise<void> getCapabilities(GetCapabilitiesContext context)
Reports what this server speaks, so a client can refuse an incompatible peer before the first calculate call.
kj::Promise<void> calculate(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.