Solving the electrostatic problem requires loading the RHSs in the state object, solving the primal and adjoint linear systems, and possibly computing the energy and forces. We provide a high-level procedure that combines the steps together and returns the energy and, if requested, the solvent contribution to the forces. The subroutine for this step is ddrun in Fortran.