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:

  1. Extracts the ForceInput (fip) from the RPC context.

  2. Validates the size of the atomic number list.

  3. Converts Cap’n Proto lists into native AtomMatrix and std::vector types.

  4. Executes the calculation via the PotentialBase virtual operator.

  5. Populates the PotentialResult with energy and force data.

Parameters:

context

The Cap’n Proto RPC call context.

Returns:

An asynchronous promise for completion.