Skip to content

Commit b354dd8

Browse files
author
Roberto Di Remigio
committed
Add a Getkw data member in Input class. Include only those headers from Eigen that are actually used
1 parent f8e7974 commit b354dd8

File tree

15 files changed

+28
-30
lines changed

15 files changed

+28
-30
lines changed

src/utils/Atom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#include "Config.hpp"
3131

32-
#include <Eigen/Dense>
32+
#include <Eigen/Core>
3333

3434
std::vector<Atom> & Atom::initBondi()
3535
{

src/utils/Atom.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#include "Config.hpp"
3333

34-
#include <Eigen/Dense>
34+
#include <Eigen/Core>
3535

3636
/*! \file Atom.hpp
3737
* \class Atom

src/utils/GreenData.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#include "Config.hpp"
3232

33-
#include <Eigen/Dense>
33+
#include <Eigen/Core>
3434

3535
/*! @struct greenData
3636
* @brief Contains all data defined from user input in the green section.

src/utils/Input.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#include "Config.hpp"
3535

36-
#include <Eigen/Dense>
36+
#include <Eigen/Core>
3737
#include "Getkw.h"
3838

3939
#include <boost/algorithm/string.hpp>
@@ -49,28 +49,25 @@
4949

5050
using boost::algorithm::to_upper_copy;
5151

52-
Input::Input(const std::string & filename)
52+
Input::Input(const std::string & filename) : input_(Getkw(filename, false, true))
5353
{
54-
reader(filename.c_str());
54+
reader();
5555
semanticCheck();
5656
}
5757

5858
Input::Input(const cavityInput & cav, const solverInput & solv,
59-
const greenInput & green)
59+
const greenInput & green) : input_(Getkw())
6060
{
6161
reader(cav, solv, green);
6262
semanticCheck();
6363
}
6464

65-
void Input::reader(const char * pythonParsed)
65+
void Input::reader()
6666
{
67-
// Create a Getkw object from input file.
68-
Getkw input = Getkw(pythonParsed, false, true);
67+
units_ = input_.getStr("UNITS");
68+
CODATAyear_ = input_.getInt("CODATA");
6969

70-
units_ = input.getStr("UNITS");
71-
CODATAyear_ = input.getInt("CODATA");
72-
73-
const Section & cavity = input.getSect("CAVITY");
70+
const Section & cavity = input_.getSect("CAVITY");
7471

7572
type_ = cavity.getStr("TYPE");
7673
area_ = cavity.getDbl("AREA");
@@ -105,7 +102,7 @@ void Input::reader(const char * pythonParsed)
105102
}
106103

107104
// Get the contents of the Medium section
108-
const Section & medium = input.getSect("MEDIUM");
105+
const Section & medium = input_.getSect("MEDIUM");
109106
// Get the name of the solvent
110107
std::string name = medium.getStr("SOLVENT");
111108
if (name == "EXPLICIT" || name == "E") {

src/utils/Input.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ class Input
120120
friend std::ostream & operator<<(std::ostream &os, const Input &input);
121121
/// @}
122122
private:
123-
/*! Read Python-parsed input (API-side syntactic input parsing) into Input object
124-
*/
125-
void reader(const char * pythonParsed);
123+
/*! Contains all input information (API-side syntactic input parsing) */
124+
Getkw input_;
125+
void reader();
126126
/*! Read host data structures (host-side syntactic input parsing) into Input object.
127127
* It provides access to a **limited** number of options only, basically the ones
128128
* that can be filled into the cavityInput, solverInput and greenInput data structures.
@@ -138,8 +138,7 @@ class Input
138138
*/
139139
void reader(const cavityInput & cav, const solverInput & solv,
140140
const greenInput & green);
141-
/*! Perform semantic input parsing aka sanity check
142-
*/
141+
/*! Perform semantic input parsing aka sanity check */
143142
void semanticCheck();
144143

145144
/// Units of measure

src/utils/MathUtils.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "Config.hpp"
3838

3939
#include <Eigen/Core>
40+
#include <Eigen/Geometry>
4041

4142
#include "SplineFunction.hpp"
4243
#include "Symmetry.hpp"
@@ -306,7 +307,7 @@ inline double splineInterpolation(const double point, const std::vector<double>
306307
size_t index = std::distance(grid.begin(), std::lower_bound(grid.begin(), grid.end(), point)) - 1;
307308

308309
// Parameters for the interpolating spline
309-
Eigen::Vector3d x, y;
310+
Eigen::Vector3d x, y;
310311
x << grid[index-1], grid[index], grid[index+1];
311312
y << function[index-1], function[index], function[index+1];
312313
SplineFunction s(x, y);

src/utils/Molecule.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333

3434
#include "Config.hpp"
3535

36-
#include <Eigen/Dense>
36+
#include <Eigen/Core>
37+
#include <Eigen/Eigenvalues>
3738

3839
#include "Atom.hpp"
3940
#include "MathUtils.hpp"

src/utils/Molecule.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#include "Config.hpp"
3434

35-
#include <Eigen/Dense>
35+
#include <Eigen/Core>
3636

3737
#include "Atom.hpp"
3838
#include "Sphere.hpp"

src/utils/Sphere.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#include "Config.hpp"
3333

34-
#include <Eigen/Dense>
34+
#include <Eigen/Core>
3535

3636
#include "Exception.hpp"
3737

src/utils/Sphere.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#include "Config.hpp"
3434

35-
#include <Eigen/Dense>
35+
#include <Eigen/Core>
3636

3737
/*! \file Sphere.hpp
3838
* \class Sphere

0 commit comments

Comments
 (0)