Skip to content

Commit 58d9235

Browse files
committed
Format sources using clang-format and YAPF
1 parent 7ca96a6 commit 58d9235

File tree

75 files changed

+3496
-3144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3496
-3144
lines changed

include/Config.hpp.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
#endif
4141

4242
#ifdef __GNUC__
43-
# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
43+
#define UNUSED(x) UNUSED_##x __attribute__((__unused__))
4444
#else
45-
# define UNUSED(x) UNUSED_ ## x
45+
#define UNUSED(x) UNUSED_##x
4646
#endif
4747

4848
#ifdef __GNUC__
49-
# define UNUSED_FUNCTION(x) __attribute__((__unused__)) UNUSED_ ## x
49+
#define UNUSED_FUNCTION(x) __attribute__((__unused__)) UNUSED_##x
5050
#else
51-
# define UNUSED_FUNCTION(x) UNUSED_ ## x
51+
#define UNUSED_FUNCTION(x) UNUSED_##x
5252
#endif
5353

5454
// Inspired from Eigen EIGEN_DEFAULT_DENSE_INDEX_TYPE

src/bin/debug_wavcav.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
* PCMSolver API, see: <http://pcmsolver.readthedocs.io/>
2222
*/
2323

24-
#include <iostream>
2524
#include <fstream>
25+
#include <iostream>
2626
#include <string>
2727

2828
#include <Eigen/Core>
2929

3030
#include "PWCSolver.hpp"
31-
#include "Vacuum.hpp"
3231
#include "UniformDielectric.hpp"
32+
#include "Vacuum.hpp"
3333
#include "WaveletCavity.hpp"
3434

3535
int main(int argc, char ** argv) {

src/bin/run_pcm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
* PCMSolver API, see: <http://pcmsolver.readthedocs.io/>
2222
*/
2323

24-
#include <cstdlib>
2524
#include <cmath>
25+
#include <cstdlib>
2626
#include <cstring>
2727
#include <iostream>
2828
#include <map>
@@ -40,8 +40,8 @@
4040

4141
#include "interface/Input.hpp"
4242
#include "interface/Meddle.hpp"
43-
#include "utils/Molecule.hpp"
4443
#include "utils/ChargeDistribution.hpp"
44+
#include "utils/Molecule.hpp"
4545

4646
std::ofstream pcmsolver_out;
4747

src/cavity/Element.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ void Element::spherical_polygon(Eigen::Vector3d & t_,
106106
}
107107
numb[i] = i;
108108
phinumb[i] = phi[i];
109-
jump:
110-
; // Do nothing...
109+
jump:; // Do nothing...
111110
}
112111
numb[nVertices_] = numb[0];
113112
phinumb[nVertices_] = 2 * M_PI;

src/green/SphericalDiffuse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
#include "GreenData.hpp"
4040
#include "GreensFunction.hpp"
4141
#include "cavity/Element.hpp"
42-
#include "utils/MathUtils.hpp"
4342
#include "dielectric_profile/ProfileTypes.hpp"
4443
#include "utils/ForId.hpp"
44+
#include "utils/MathUtils.hpp"
4545

4646
namespace pcm {
4747
namespace green {

src/green/Vacuum.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ using cavity::Element;
4141
using dielectric_profile::Uniform;
4242
namespace green {
4343
template <typename DerivativeTraits>
44-
Vacuum<DerivativeTraits>::Vacuum()
45-
: GreensFunction<DerivativeTraits, Uniform>() {
44+
Vacuum<DerivativeTraits>::Vacuum() : GreensFunction<DerivativeTraits, Uniform>() {
4645
this->profile_ = Uniform(1.0);
4746
}
4847

src/interface/Input.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525

2626
#include <iostream>
2727
#include <map>
28-
#include <vector>
2928
#include <string>
29+
#include <vector>
3030

3131
#include "Config.hpp"
3232

33-
#include <Eigen/Core>
3433
#include "utils/getkw/Getkw.h"
34+
#include <Eigen/Core>
3535

3636
#include <boost/algorithm/string.hpp>
3737

38+
#include "PCMInput.h"
3839
#include "bi_operators/BIOperatorData.hpp"
3940
#include "cavity/CavityData.hpp"
4041
#include "green/GreenData.hpp"
4142
#include "solver/SolverData.hpp"
42-
#include "PCMInput.h"
4343
#include "utils/Factory.hpp"
4444
#include "utils/Solvent.hpp"
4545
#include "utils/Sphere.hpp"
@@ -94,7 +94,8 @@ void Input::reader(const std::string & filename) {
9494
Eigen::Vector3d center;
9595
center = (Eigen::Vector3d() << spheresInput[j],
9696
spheresInput[j + 1],
97-
spheresInput[j + 2]).finished();
97+
spheresInput[j + 2])
98+
.finished();
9899
Sphere sph(center, spheresInput[j + 3]);
99100
spheres_.push_back(sph);
100101
j += 4;

src/interface/Meddle.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
* PCMSolver API, see: <http://pcmsolver.readthedocs.io/>
2222
*/
2323

24-
#include "pcmsolver.h"
25-
#include "PCMInput.h"
2624
#include "Meddle.hpp"
25+
#include "PCMInput.h"
26+
#include "pcmsolver.h"
2727

2828
#include <string>
2929
#include <vector>
@@ -36,19 +36,19 @@
3636

3737
#include "bi_operators/BIOperatorData.hpp"
3838
#include "bi_operators/BoundaryIntegralOperator.hpp"
39-
#include "cavity/CavityData.hpp"
4039
#include "cavity/Cavity.hpp"
41-
#include "green/GreenData.hpp"
40+
#include "cavity/CavityData.hpp"
4241
#include "green/Green.hpp"
43-
#include "solver/SolverData.hpp"
42+
#include "green/GreenData.hpp"
4443
#include "solver/Solver.hpp"
44+
#include "solver/SolverData.hpp"
4545

46-
#include "utils/Atom.hpp"
4746
#include "Citation.hpp"
48-
#include "utils/cnpy.hpp"
47+
#include "utils/Atom.hpp"
4948
#include "utils/Factory.hpp"
5049
#include "utils/Solvent.hpp"
5150
#include "utils/Sphere.hpp"
51+
#include "utils/cnpy.hpp"
5252

5353
#ifndef AS_TYPE
5454
#define AS_TYPE(Type, Obj) reinterpret_cast<Type *>(Obj)

src/make_cmake_files.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/python
22

3-
43
#
54
# PCMSolver, an API for the Polarizable Continuum Model
65
# Copyright (C) 2017 Roberto Di Remigio, Luca Frediani and collaborators.
@@ -49,6 +48,7 @@
4948
-h --help Show this screen.
5049
"""
5150

51+
5252
def glob_sources_cxx(dir_name):
5353
"""Create a list of C++ headers and sources to be used in a CMakeLists.txt file."""
5454
headers = 'list(APPEND headers_list '
@@ -63,6 +63,7 @@ def glob_sources_cxx(dir_name):
6363
+ '# List of sources\n' + sources
6464
return message
6565

66+
6667
def glob_sources_c(dir_name):
6768
"""Create a list of C headers and sources to be used in a CMakeLists.txt file."""
6869
headers = 'list(APPEND headers_list '
@@ -77,6 +78,7 @@ def glob_sources_c(dir_name):
7778
+ '# List of sources\n' + sources
7879
return message
7980

81+
8082
def glob_sources_fortran(dir_name):
8183
"""Create a list of Fortran sources to be used in a CMakeLists.txt file."""
8284
types = ('*.f', '*.F', '*.f77', '*.F77', '*.f90', '*.F90')
@@ -90,6 +92,7 @@ def glob_sources_fortran(dir_name):
9092
message = '# List of sources\n' + sources
9193
return message
9294

95+
9396
try:
9497
arguments = docopt.docopt(options, argv=None)
9598
except docopt.DocoptExit:
@@ -99,7 +102,7 @@ def glob_sources_fortran(dir_name):
99102

100103
# Grab command-line arguments
101104
libname = arguments['--libname']
102-
lang = arguments['--lang']
105+
lang = arguments['--lang']
103106

104107
root_directory = os.getcwd()
105108
dname = os.path.join(root_directory, libname)

src/solver/CPCMSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434

3535
#include "SolverData.hpp"
3636
#include "bi_operators/IBoundaryIntegralOperator.hpp"
37-
#include "cavity/ICavity.hpp"
3837
#include "cavity/Element.hpp"
38+
#include "cavity/ICavity.hpp"
3939
#include "green/IGreensFunction.hpp"
4040
#include "utils/MathUtils.hpp"
4141

0 commit comments

Comments
 (0)