@@ -155,16 +155,16 @@ void Meddle::CTORBody() {
155155 TIMER_ON (" Meddle::initCavity" );
156156 initCavity ();
157157 TIMER_OFF (" Meddle::initCavity" );
158+ }
158159
159- TIMER_ON (" Meddle::initStaticSolver" );
160- initStaticSolver ();
161- TIMER_OFF (" Meddle::initStaticSolver" );
160+ TIMER_ON (" Meddle::initStaticSolver" );
161+ initStaticSolver ();
162+ TIMER_OFF (" Meddle::initStaticSolver" );
162163
163- if (input_.isDynamic ()) {
164- TIMER_ON (" Meddle::initDynamicSolver" );
165- initDynamicSolver ();
166- TIMER_OFF (" Meddle::initDynamicSolver" );
167- }
164+ if (input_.isDynamic ()) {
165+ TIMER_ON (" Meddle::initDynamicSolver" );
166+ initDynamicSolver ();
167+ TIMER_OFF (" Meddle::initDynamicSolver" );
168168 }
169169}
170170
@@ -335,10 +335,12 @@ double pcm::Meddle::computePolarizationEnergy(const std::string & mep_name,
335335 // Dot product of MEP + Electronegativities times Fluctuating charges
336336 energy = (functions_.at (mep_name) + input_.fragments ().chi )
337337 .dot (functions_.at (asc_name));
338+ if (input_.isNonPolarizable ()) { /* HACK Nonpolarizable doesn't need 1/2 */
339+ energy *= 2.0 ;
340+ }
338341 } else { /* Pure PCM calculation */
339342 // Dot product of MEP and ASC surface function
340- energy =
341- functions_.at (mep_name).dot (functions_.at (asc_name));
343+ energy = functions_.at (mep_name).dot (functions_.at (asc_name));
342344 }
343345 return (energy / 2.0 );
344346}
@@ -372,8 +374,13 @@ void pcm::Meddle::computeASC(const std::string & mep_name,
372374 // Get the proper iterators
373375 SurfaceFunctionMapConstIter iter_pot = functions_.find (mep_name);
374376 Eigen::VectorXd asc = Eigen::VectorXd::Zero (iter_pot->second .size ());
375- if (hasFQ_) { /* MMFQ calculation */
376- asc = FQ_->computeCharge (iter_pot->second );
377+ if (hasFQ_) { /* MMFQ calculation */
378+ if (input_.isNonPolarizable ()) { /* HACK We store point charges in the eta vector
379+ */
380+ asc = input_.fragments ().eta ;
381+ } else {
382+ asc = FQ_->computeCharge (iter_pot->second );
383+ }
377384 } else { /* Pure PCM calculation */
378385 asc = K_0_->computeCharge (iter_pot->second , irrep);
379386 // Renormalize
@@ -402,9 +409,11 @@ void pcm::Meddle::computeResponseASC(const std::string & mep_name,
402409 // Get the proper iterators
403410 SurfaceFunctionMapConstIter iter_pot = functions_.find (mep_name);
404411 Eigen::VectorXd asc = Eigen::VectorXd::Zero (iter_pot->second .size ());
405- if (hasFQ_) { /* MMFQ calculation */
406- // Do NOT add classical (electronegativities) contributions to RHS
407- asc = FQ_->computeCharge (iter_pot->second , false );
412+ if (hasFQ_) { /* MMFQ calculation */
413+ if (!input_.isNonPolarizable ()) { /* HACK Can we do it more cleanly/clearly? */
414+ // Do NOT add classical (electronegativities) contributions to RHS
415+ asc = FQ_->computeCharge (iter_pot->second , false );
416+ }
408417 } else { /* Pure PCM calculation */
409418 if (hasDynamic_) {
410419 asc = K_d_->computeCharge (iter_pot->second , irrep);
@@ -726,7 +735,8 @@ void Meddle::initStaticSolver() {
726735 delete biop;
727736
728737 // Perform Gauss' theorem check for nuclear charges
729- if (!hasFQ_) GaussCheck ();
738+ if (!hasFQ_)
739+ GaussCheck ();
730740
731741 infoStream_ << " ========== Static solver " << std::endl;
732742 infoStream_ << *K_0_ << std::endl;
@@ -759,8 +769,8 @@ void Meddle::initDynamicSolver() {
759769}
760770
761771void Meddle::initMMFQ () {
762- FQ_ = new mmfq::FQOhno (input_.fragments ());
763- size_ = pcm ::make_tuple (input_.fragments ().sites .cols (),
772+ FQ_ = new mmfq::FQOhno (input_.fragments (), input_. isNonPolarizable () );
773+ size_ = std ::make_tuple (input_.fragments ().sites .cols (),
764774 input_.fragments ().sites .cols ());
765775 hasFQ_ = true ;
766776
0 commit comments