Skip to content

Commit 3a613ab

Browse files
author
Roberto Di Remigio
committed
Remove BlockDiagonalMatrix: it has never been used in the code
1 parent d463817 commit 3a613ab

File tree

10 files changed

+32
-496
lines changed

10 files changed

+32
-496
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ project(PCMSolver CXX C Fortran)
1616
option(ENABLE_MPI "Enable MPI parallelization" OFF)
1717
option(ENABLE_OPENMP "Enable OpenMP parallelization" OFF)
1818
option(ENABLE_VECTORIZATION "Enable vectorization" OFF)
19-
option(ENABLE_TESTS "Enable compilation of unit tests" OFF)
19+
option(ENABLE_TESTS "Enable compilation of unit tests" ON)
2020
option(ENABLE_CODE_COVERAGE "Enable code coverage" OFF)
2121
option(DISABLE_EIGEN_OWN "Do not use Eigen3 headers shipped with the module" OFF)
2222
option(ENABLE_EIGEN_MKL "Enable Eigen3 automatic fallback to some of Intel MKL algorithms" OFF)
@@ -164,6 +164,10 @@ include_directories(${CMAKE_SOURCE_DIR}
164164
${CMAKE_BINARY_DIR}/include
165165
${CMAKE_Fortran_MODULE_DIRECTORY})
166166

167+
if(ENABLE_TESTS)
168+
# Build also standalone executables in src/bin
169+
set(BUILD_STANDALONE TRUE)
170+
endif()
167171
add_subdirectory(src)
168172
include_directories(${header_dir_list})
169173

setup

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def parse_input():
143143
help='link statically [default: %(default)s]')
144144
group.add_argument('--tests',
145145
action='store_true',
146-
default=False,
146+
default=True,
147147
help='build unit test suite [default: %(default)s]')
148148
group.add_argument('--vectorization',
149149
action='store_true',
@@ -317,13 +317,13 @@ def gen_cmake_command(args):
317317
# remove leading and trailing whitespace
318318
# otherwise CMake complains
319319
command += ' -DEXPLICIT_LIBS="%s"' % args.explicit_libs.strip()
320-
320+
321321
if args.boost_headers:
322322
command += ' -DBOOST_INCLUDEDIR={0}'.format(args.boost_headers)
323-
323+
324324
if args.boost_libs:
325325
command += ' -DBOOST_LIBRARYDIR={0}'.format(args.boost_libs)
326-
326+
327327
if args.python:
328328
command += ' -DPYTHON_INTERPRETER={0}'.format(args.python)
329329

src/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ add_subdirectory(pedra)
2121
add_subdirectory(solver)
2222
add_subdirectory(utils)
2323
# This directory contains source file for executables
24-
add_subdirectory(bin)
24+
if(BUILD_STANDALONE)
25+
add_subdirectory(bin)
26+
endif()
2527

2628
# We need to export header_dir_list one level up
2729
set(header_dir_list ${header_dir_list} PARENT_SCOPE)

src/solver/CPCMSolver.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
/*
33
* PCMSolver, an API for the Polarizable Continuum Model
44
* Copyright (C) 2013 Roberto Di Remigio, Luca Frediani and contributors
5-
*
5+
*
66
* This file is part of PCMSolver.
7-
*
8-
* PCMSolver is free software: you can redistribute it and/or modify
7+
*
8+
* PCMSolver is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU Lesser General Public License as published by
1010
* the Free Software Foundation, either version 3 of the License, or
1111
* (at your option) any later version.
12-
*
12+
*
1313
* PCMSolver is distributed in the hope that it will be useful,
1414
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1515
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616
* GNU Lesser General Public License for more details.
17-
*
17+
*
1818
* You should have received a copy of the GNU Lesser General Public License
1919
* along with PCMSolver. If not, see <http://www.gnu.org/licenses/>.
20-
*
20+
*
2121
* For information on the complete list of contributors to the
2222
* PCMSolver API, see: <http://pcmsolver.github.io/pcmsolver-doc>
2323
*/
@@ -107,9 +107,8 @@ void CPCMSolver::buildIsotropicMatrix(const Cavity & cav)
107107
matrixOut << "List of Eigenvalues:\n" << solver.eigenvalues() << std::endl;
108108
matrixOut.close();
109109
*/
110-
// Pack into a BlockDiagonalMatrix
111-
// For the moment just packs into a std::vector<Eigen::MatrixXd> without the syntactic
112-
// sugar of the BlockDiagonalMatrix class...
110+
// Pack into a block diagonal matrix
111+
// For the moment just packs into a std::vector<Eigen::MatrixXd>
113112
symmetryPacking(blockPCMMatrix, fullPCMMatrix, dimBlock, nrBlocks);
114113

115114
builtIsotropicMatrix = true;
@@ -128,7 +127,6 @@ void CPCMSolver::computeCharge(const Eigen::VectorXd &potential,
128127
if (builtIsotropicMatrix) {
129128
charge.segment(irrep*irrDim,
130129
irrDim)= - blockPCMMatrix[irrep] * potential.segment(irrep*irrDim, irrDim);
131-
// charge = - fullPCMMatrix * potential;
132130
} else {
133131
throw std::runtime_error("PCM matrix not initialized!");
134132
}

src/solver/IEFSolver.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
/*
33
* PCMSolver, an API for the Polarizable Continuum Model
44
* Copyright (C) 2013 Roberto Di Remigio, Luca Frediani and contributors
5-
*
5+
*
66
* This file is part of PCMSolver.
7-
*
8-
* PCMSolver is free software: you can redistribute it and/or modify
7+
*
8+
* PCMSolver is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU Lesser General Public License as published by
1010
* the Free Software Foundation, either version 3 of the License, or
1111
* (at your option) any later version.
12-
*
12+
*
1313
* PCMSolver is distributed in the hope that it will be useful,
1414
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1515
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616
* GNU Lesser General Public License for more details.
17-
*
17+
*
1818
* You should have received a copy of the GNU Lesser General Public License
1919
* along with PCMSolver. If not, see <http://www.gnu.org/licenses/>.
20-
*
20+
*
2121
* For information on the complete list of contributors to the
2222
* PCMSolver API, see: <http://pcmsolver.github.io/pcmsolver-doc>
2323
*/
@@ -65,7 +65,7 @@ void IEFSolver::buildAnisotropicMatrix(const Cavity & cav)
6565

6666
// This is the very core of PCMSolver
6767
throw std::runtime_error("Calculation of anisotropic matrix elements not yet implemented.");
68-
/*
68+
/*
6969
greenInside_->compOffDiagonal(cav.elementCenter(), cav.elementNormal(), SI, DI);
7070
greenInside_->compDiagonal(cav.elementArea(), cav.elementRadius(), SI, DI);
7171
greenOutside_->compOffDiagonal(cav.elementCenter(), cav.elementNormal(), SE, DE);
@@ -100,9 +100,8 @@ void IEFSolver::buildAnisotropicMatrix(const Cavity & cav)
100100
if (hermitivitize_) {
101101
hermitivitize(fullPCMMatrix);
102102
}
103-
// Pack into a BlockDiagonalMatrix
104-
// For the moment just packs into a std::vector<Eigen::MatrixXd> without the syntactic
105-
// sugar of the BlockDiagonalMatrix class...
103+
// Pack into a block diagonal matrix
104+
// For the moment just packs into a std::vector<Eigen::MatrixXd>
106105
symmetryPacking(blockPCMMatrix, fullPCMMatrix, dimBlock, nrBlocks);
107106
std::ofstream matrixOut("PCM_matrix");
108107
matrixOut << "fullPCMMatrix" << std::endl;
@@ -193,9 +192,8 @@ void IEFSolver::buildIsotropicMatrix(const Cavity & cav)
193192
matrixOut << "List of Eigenvalues:\n" << solver.eigenvalues() << std::endl;
194193
matrixOut.close();
195194
*/
196-
// Pack into a BlockDiagonalMatrix
197-
// For the moment just packs into a std::vector<Eigen::MatrixXd> without the syntactic
198-
// sugar of the BlockDiagonalMatrix class...
195+
// Pack into a block diagonal matrix
196+
// For the moment just packs into a std::vector<Eigen::MatrixXd>
199197
symmetryPacking(blockPCMMatrix, fullPCMMatrix, dimBlock, nrBlocks);
200198
std::ofstream matrixOut("PCM_matrix");
201199
matrixOut << "fullPCMMatrix" << std::endl;
@@ -221,7 +219,6 @@ void IEFSolver::computeCharge(const Eigen::VectorXd &potential,
221219
if (builtIsotropicMatrix or builtAnisotropicMatrix) {
222220
charge.segment(irrep*irrDim,
223221
irrDim)= - blockPCMMatrix[irrep] * potential.segment(irrep*irrDim, irrDim);
224-
// charge = - fullPCMMatrix * potential;
225222
} else {
226223
throw std::runtime_error("PCM matrix not initialized!");
227224
}

src/utils/BlockDiagonalMatrix.hpp

Lines changed: 0 additions & 220 deletions
This file was deleted.

0 commit comments

Comments
 (0)