Skip to content

Commit

Permalink
Post-rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodr committed Nov 22, 2023
1 parent a973d01 commit c5eb726
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 68 deletions.
2 changes: 1 addition & 1 deletion src/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ void driver::rsp::calc_properties(const json &json_prop, Molecule &mol, int dir,
* construct all operator which are present in this input. Option to set
* perturbation order of the operators.
*/
void driver::build_fock_operator(const json &json_fock, Molecule &mol, FockBuilder &F, int order) {
void driver::build_fock_operator(const json &json_fock, Molecule &mol, FockBuilder &F, int order, bool is_dynamic) {
auto &nuclei = mol.getNuclei();
auto Phi_p = mol.getOrbitals_p();
auto X_p = mol.getOrbitalsX_p();
Expand Down
2 changes: 1 addition & 1 deletion src/environment/Permittivity.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Permittivity final : public StepFunction {
*/
double evalf(const mrcpp::Coord<3> &r) const override;

void printHeader() const override { detail::print_header("Solvation Cavity", this->formulation, getValueIn(), getValueOut()); }
void printParameters() const override { detail::print_header("Permittivity", this->formulation, getValueIn(), getValueOut()); }

private:
std::string formulation{"exponential"};
Expand Down
64 changes: 1 addition & 63 deletions src/environment/StepFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,74 +36,12 @@ void print_header(const std::string &header, const std::string &formulation, dou
print_utils::text(0, "Formulation", formulation, true);
print_utils::scalar(0, "Value inside Cavity", in_value, "(in)", 6);
print_utils::scalar(0, "Value outside Cavity", out_value, "(out)", 6);
mrcpp::print::separator(0, '=', 2);
}
} // namespace detail

StepFunction::StepFunction(std::shared_ptr<mrchem::Cavity> cavity, double val_in, double val_out)
: in(val_in)
, out(val_out)
, cavity{std::move(cavity)} {}

void StepFunction::printParameters() const {
// Collect relevant quantities
auto c_pin = this->cavity;

auto coords = c_pin->getCoordinates();
auto radii = c_pin->getRadii();
auto radii_0 = c_pin->getOriginalRadii();
auto alphas = c_pin->getRadiiScalings();
auto sigmas = c_pin->getWidths();
auto betas = c_pin->getWidthScalings();

// Set widths
auto w0 = mrcpp::Printer::getWidth() - 1;
auto w1 = 5;
auto w2 = 9;
auto w3 = 6;
auto w4 = 10;
auto w5 = w0 - w1 - w2 - 3 * w3 - 3 * w4;

// Build table column headers
std::stringstream o_head;
o_head << std::setw(w1) << "N";
o_head << std::setw(w2) << "R_0";
o_head << std::setw(w3 + 1) << "Alpha";
o_head << std::setw(w3 - 1) << "Beta";
o_head << std::setw(w3) << "Sigma";
o_head << std::setw(w5) << "Radius";
o_head << std::setw(w4) << "x";
o_head << std::setw(w4) << "y";
o_head << std::setw(w4) << "z";

// Print
printHeader();
mrcpp::print::separator(0, '-');
println(0, o_head.str());
mrcpp::print::separator(0, '-');
for (auto i = 0; i < coords.size(); i++) {
auto coord = coords[i];
auto x = coord[0];
auto y = coord[1];
auto z = coord[2];
auto r = radii[i];
auto r_0 = radii_0[i];
auto alpha = alphas[i];
auto beta = betas[i];
auto sigma = sigmas[i];

std::stringstream o_coord;
o_coord << std::setw(w1) << i;
o_coord << std::setw(w2) << std::setprecision(4) << std::fixed << r_0;
o_coord << std::setw(w3) << std::setprecision(2) << std::fixed << alpha;
o_coord << std::setw(w3) << std::setprecision(2) << std::fixed << beta;
o_coord << std::setw(w3) << std::setprecision(2) << std::fixed << sigma << " ->";
o_coord << std::setw(w5 - 4) << std::setprecision(4) << std::fixed << r;
o_coord << std::setw(w4) << std::setprecision(6) << std::fixed << x;
o_coord << std::setw(w4) << std::setprecision(6) << std::fixed << y;
o_coord << std::setw(w4) << std::setprecision(6) << std::fixed << z;
println(0, o_coord.str());
}
mrcpp::print::separator(0, '=', 2);
}

} // namespace mrchem
4 changes: 1 addition & 3 deletions src/environment/StepFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ class StepFunction : public mrcpp::RepresentableFunction<3> {

std::shared_ptr<Cavity> getCavity() const { return this->cavity; }

void printParameters() const;

virtual void printHeader() const { detail::print_header("Step function of Cavity values", "Standard", getValueIn(), getValueOut()); }
virtual void printParameters() const { detail::print_header("Step function", "Standard", getValueIn(), getValueOut()); }

protected:
double in; //!< Value of the function inside the #cavity.
Expand Down

0 comments on commit c5eb726

Please sign in to comment.