1 /*
2 * PCMSolver, an API for the Polarizable Continuum Model
3 * Copyright (C) 2020 Roberto Di Remigio, Luca Frediani and contributors.
4 *
5 * This file is part of PCMSolver.
6 *
7 * PCMSolver is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * PCMSolver is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with PCMSolver. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * For information on the complete list of contributors to the
21 * PCMSolver API, see: <http://pcmsolver.readthedocs.io/>
22 */
23
24 #include "Sphere.hpp"
25
26 #include <ostream>
27 #include <vector>
28
29 #include "Config.hpp"
30
31 #include <Eigen/Core>
32
33 namespace pcm {
34 using utils::Sphere;
35
transfer_spheres(const std::vector<Sphere> & spheres,Eigen::Matrix3Xd & sphereCenter,Eigen::VectorXd & sphereRadius)36 void transfer_spheres(const std::vector<Sphere> & spheres,
37 Eigen::Matrix3Xd & sphereCenter,
38 Eigen::VectorXd & sphereRadius) {
39 size_t nSpheres = spheres.size();
40 sphereCenter.resize(Eigen::NoChange, nSpheres);
41 sphereRadius.resize(nSpheres);
42 for (size_t i = 0; i < nSpheres; ++i) {
43 sphereCenter.col(i) = spheres[i].center;
44 sphereRadius(i) = spheres[i].radius;
45 }
46 }
47 } // namespace pcm
48