Skip to content

Commit 86d29ac

Browse files
committed
Print information about FQ force field sizes
1 parent 3b487d4 commit 86d29ac

File tree

6 files changed

+50
-19
lines changed

6 files changed

+50
-19
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ target_include_directories(pcm-objlib
2424
${CMAKE_CURRENT_LIST_DIR}/utils/getkw
2525
)
2626

27+
add_subdirectory(bi_operators)
2728
add_subdirectory(cavity)
2829
add_subdirectory(green)
2930
add_subdirectory(interface)
3031
add_subdirectory(metal)
31-
add_subdirectory(bi_operators)
32+
add_subdirectory(mmfq)
3233
add_subdirectory(pedra)
3334
add_subdirectory(solver)
3435
add_subdirectory(utils)

src/interface/Meddle.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "cavity/CavityData.hpp"
3939
#include "green/Green.hpp"
4040
#include "green/GreenData.hpp"
41+
#include "mmfq/FQOhno.hpp"
4142
#include "solver/Solver.hpp"
4243
#include "solver/SolverData.hpp"
4344

@@ -89,7 +90,7 @@ pcmsolver_context_t * pcmsolver_new_v1112(pcmsolver_reader_t input_reading,
8990
new pcm::Meddle(
9091
nr_nuclei, charges, coordinates, symmetry_info, *host_input, writer));
9192
} else {
92-
// Use parsed the PCMSolver input file parsed_fname, as found on disk
93+
// Use the parsed PCMSolver input file parsed_fname, as found on disk
9394
return AS_TYPE(
9495
pcmsolver_context_t,
9596
new pcm::Meddle(
@@ -757,6 +758,16 @@ void Meddle::initDynamicSolver() {
757758
delete gf_i;
758759
}
759760

761+
void Meddle::initMMFQ() {
762+
FQ_ = new mmfq::FQOhno(input_.fragments());
763+
size_ = pcm::make_tuple(input_.fragments().sites.cols(),
764+
input_.fragments().sites.cols());
765+
hasFQ_ = true;
766+
767+
infoStream_ << "========== MMFQ solver " << std::endl;
768+
infoStream_ << *FQ_ << std::endl;
769+
}
770+
760771
void Meddle::mediumInfo(IGreensFunction * gf_i, IGreensFunction * gf_o) {
761772
using utils::Solvent;
762773
infoStream_ << "============ Medium " << std::endl;

src/mmfq/CMakeLists.txt

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
# List of headers
2-
list(APPEND headers_list FQOhno.hpp)
2+
list(APPEND headers_list
3+
FQOhno.hpp
4+
)
35

46
# List of sources
5-
list(APPEND sources_list FQOhno.cpp)
7+
list(APPEND sources_list
8+
FQOhno.cpp
9+
)
610

711
add_library(mmfq OBJECT ${sources_list} ${headers_list})
8-
set_target_properties(mmfq PROPERTIES POSITION_INDEPENDENT_CODE 1 )
12+
set_target_properties(mmfq
13+
PROPERTIES
14+
POSITION_INDEPENDENT_CODE 1
15+
CXX_VISIBILITY_PRESET hidden
16+
VISIBILITY_INLINES_HIDDEN 1
17+
)
18+
target_compile_definitions(mmfq
19+
PUBLIC
20+
PCMSolver_EXPORTS
21+
)
22+
if(BUILD_CUSTOM_BOOST)
23+
add_dependencies(mmfq custom_boost)
24+
endif()
925
add_dependencies(mmfq generate-config-hpp)
10-
target_compile_options(mmfq PRIVATE "$<$<CONFIG:DEBUG>:${EXDIAG_CXX_FLAGS}>")
26+
target_compile_options(mmfq
27+
PRIVATE
28+
"$<$<CONFIG:DEBUG>:${EXDIAG_CXX_FLAGS}>"
29+
)
30+
1131
# Sets install directory for all the headers in the list
1232
foreach(_header ${headers_list})
1333
install(FILES ${_header} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/mmfq)

src/mmfq/FQOhno.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ Eigen::VectorXd FQOhno::computeCharge_impl(const Eigen::VectorXd & potential,
7979
}
8080

8181
std::ostream & FQOhno::printSolver(std::ostream & os) {
82-
os << "Fluctuating charge solver type: Ohno";
82+
os << "Fluctuating charge solver type: Ohno" << std::endl;
83+
os << "Number of fragments = " << mmfq_.nFragments << std::endl;
84+
os << "Number of sites per fragment = " << mmfq_.nSitesPerFragment << std::endl;
85+
os << "Number of sites = " << mmfq_.nFragments * mmfq_.nSitesPerFragment;
8386
return os;
8487
}
8588
} // namespace mmfq

src/mmfq/FQOhno.hpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*
22
* PCMSolver, an API for the Polarizable Continuum Model
33
* Copyright (C) 2017 Roberto Di Remigio, Luca Frediani and collaborators.
44
*
@@ -21,8 +21,7 @@
2121
* PCMSolver API, see: <http://pcmsolver.readthedocs.io/>
2222
*/
2323

24-
#ifndef FQOHNO_HPP
25-
#define FQOHNO_HPP
24+
#pragma once
2625

2726
#include <iosfwd>
2827

@@ -32,8 +31,10 @@
3231

3332
#include "utils/MMFQ.hpp"
3433

35-
/*! \file FQOhno.hpp
36-
* \class FQOhno
34+
/*! \file FQOhno.hpp */
35+
namespace pcm {
36+
namespace mmfq {
37+
/*! \class FQOhno
3738
* \brief Solver for MMFQ with Ohno interaction kernel
3839
* \author Roberto Di Remigio
3940
* \date 2017
@@ -42,14 +43,11 @@
4243
* to solve for the charges.
4344
* This avoids computing and storing the inverse explicitly.
4445
*/
45-
46-
namespace pcm {
47-
namespace mmfq {
4846
class FQOhno __final {
4947
public:
5048
FQOhno() {}
5149
/*! \brief Construct solver
52-
* \param[in] the fluctuating charges force field
50+
* \param[in] ff the fluctuating charges force field
5351
*/
5452
FQOhno(const utils::MMFQ & ff);
5553

@@ -77,5 +75,3 @@ class FQOhno __final {
7775
};
7876
} // namespace mmfq
7977
} // namespace pcm
80-
81-
#endif // FQOHNO_HPP

src/utils/MMFQ.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* PCMSolver, an API for the Polarizable Continuum Model
3-
* Copyright (C) 2017 Roberto Di Remigio, Luca Frediani and collaborators.
3+
* Copyright (C) 2018 Roberto Di Remigio, Luca Frediani and contributors.
44
*
55
* This file is part of PCMSolver.
66
*

0 commit comments

Comments
 (0)