ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/flucq/FluctuatingChargeConstraints.cpp
(Generate patch)

Comparing trunk/src/flucq/FluctuatingChargeConstraints.cpp (file contents):
Revision 1939 by gezelter, Thu Oct 31 18:18:57 2013 UTC vs.
Revision 2070 by gezelter, Sat Mar 7 16:59:57 2015 UTC

# Line 50 | Line 50 | namespace OpenMD {
50   namespace OpenMD {
51  
52    FluctuatingChargeConstraints::FluctuatingChargeConstraints(SimInfo* info) :
53 <    info_(info), constrainRegions_(false), hasFlucQ_(false), initialized_(false) {
53 >    info_(info), initialized_(false), hasFlucQ_(false),
54 >    constrainRegions_(false) {
55    }
56  
57    void FluctuatingChargeConstraints::initialize(){
# Line 135 | Line 136 | namespace OpenMD {
136   #ifdef IS_MPI
137      // in parallel, we need to add up the contributions from all
138      // processors:
139 <    MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &totalFrc, 1, MPI::REALTYPE,
140 <                              MPI::SUM);
139 >    MPI_Allreduce(MPI_IN_PLACE, &totalFrc, 1, MPI_REALTYPE,
140 >                  MPI_SUM, MPI_COMM_WORLD);
141  
142      if (constrainRegions_) {
143 <      MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &regionForce_[0],
144 <                                regionForce_.size(), MPI::REALTYPE, MPI::SUM);
145 <      MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &regionCharges_[0],
146 <                                regionCharges_.size(), MPI::INT, MPI::SUM);
143 >      MPI_Allreduce(MPI_IN_PLACE, &regionForce_[0],
144 >                    regionForce_.size(), MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD);
145 >      MPI_Allreduce(MPI_IN_PLACE, &regionCharges_[0],
146 >                    regionCharges_.size(), MPI_INT, MPI_SUM, MPI_COMM_WORLD);
147      }
148  
149   #endif
# Line 183 | Line 184 | namespace OpenMD {
184  
185        for (atom = mol->beginFluctuatingCharge(j); atom != NULL;
186             atom = mol->nextFluctuatingCharge(j)) {
187 <        //constrainedFrc = atom->getFlucQFrc() - totalFrc - totalMolFrc;
187 >        constrainedFrc = atom->getFlucQFrc() - totalFrc - totalMolFrc;
188  
189 <        constrainedFrc = atom->getFlucQFrc() - totalMolFrc;
189 >        //constrainedFrc = atom->getFlucQFrc() - totalMolFrc;
190  
191          if (constrainRegions_)
192            constrainedFrc -= regionFrc;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines