@@ -155,16 +155,16 @@ void Meddle::CTORBody() {
155
155
TIMER_ON (" Meddle::initCavity" );
156
156
initCavity ();
157
157
TIMER_OFF (" Meddle::initCavity" );
158
+ }
158
159
159
- TIMER_ON (" Meddle::initStaticSolver" );
160
- initStaticSolver ();
161
- TIMER_OFF (" Meddle::initStaticSolver" );
160
+ TIMER_ON (" Meddle::initStaticSolver" );
161
+ initStaticSolver ();
162
+ TIMER_OFF (" Meddle::initStaticSolver" );
162
163
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" );
168
168
}
169
169
}
170
170
@@ -335,10 +335,12 @@ double pcm::Meddle::computePolarizationEnergy(const std::string & mep_name,
335
335
// Dot product of MEP + Electronegativities times Fluctuating charges
336
336
energy = (functions_.at (mep_name) + input_.fragments ().chi )
337
337
.dot (functions_.at (asc_name));
338
+ if (input_.isNonPolarizable ()) { /* HACK Nonpolarizable doesn't need 1/2 */
339
+ energy *= 2.0 ;
340
+ }
338
341
} else { /* Pure PCM calculation */
339
342
// 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));
342
344
}
343
345
return (energy / 2.0 );
344
346
}
@@ -372,8 +374,13 @@ void pcm::Meddle::computeASC(const std::string & mep_name,
372
374
// Get the proper iterators
373
375
SurfaceFunctionMapConstIter iter_pot = functions_.find (mep_name);
374
376
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
+ }
377
384
} else { /* Pure PCM calculation */
378
385
asc = K_0_->computeCharge (iter_pot->second , irrep);
379
386
// Renormalize
@@ -402,9 +409,11 @@ void pcm::Meddle::computeResponseASC(const std::string & mep_name,
402
409
// Get the proper iterators
403
410
SurfaceFunctionMapConstIter iter_pot = functions_.find (mep_name);
404
411
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
+ }
408
417
} else { /* Pure PCM calculation */
409
418
if (hasDynamic_) {
410
419
asc = K_d_->computeCharge (iter_pot->second , irrep);
@@ -726,7 +735,8 @@ void Meddle::initStaticSolver() {
726
735
delete biop;
727
736
728
737
// Perform Gauss' theorem check for nuclear charges
729
- if (!hasFQ_) GaussCheck ();
738
+ if (!hasFQ_)
739
+ GaussCheck ();
730
740
731
741
infoStream_ << " ========== Static solver " << std::endl;
732
742
infoStream_ << *K_0_ << std::endl;
@@ -759,8 +769,8 @@ void Meddle::initDynamicSolver() {
759
769
}
760
770
761
771
void 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 (),
764
774
input_.fragments ().sites .cols ());
765
775
hasFQ_ = true ;
766
776
0 commit comments