| 51 |
|
|
| 52 |
|
FluctuatingChargeConstraints::FluctuatingChargeConstraints(SimInfo* info) : |
| 53 |
|
info_(info), constrainRegions_(false), hasFlucQ_(false), initialized_(false) { |
| 54 |
– |
|
| 54 |
|
} |
| 55 |
|
|
| 56 |
|
void FluctuatingChargeConstraints::initialize(){ |
| 62 |
|
initialized_ = true; |
| 63 |
|
} |
| 64 |
|
|
| 65 |
+ |
|
| 66 |
|
void FluctuatingChargeConstraints::setConstrainRegions(bool cr) { |
| 67 |
|
constrainRegions_ = cr; |
| 68 |
+ |
|
| 69 |
+ |
if (!initialized_) initialize(); |
| 70 |
+ |
|
| 71 |
|
regionKeys_.clear(); |
| 72 |
|
regionForce_.clear(); |
| 73 |
|
regionCharges_.clear(); |
| 99 |
|
void FluctuatingChargeConstraints::applyConstraints() { |
| 100 |
|
if (!initialized_) initialize(); |
| 101 |
|
if (!hasFlucQ_) return; |
| 102 |
+ |
|
| 103 |
|
SimInfo::MoleculeIterator i; |
| 104 |
|
Molecule::FluctuatingChargeIterator j; |
| 105 |
|
Molecule* mol; |