ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/brains/SimInfo.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/brains/SimInfo.cpp (file contents):
Revision 2285 by gezelter, Wed Sep 7 20:46:46 2005 UTC vs.
Revision 2303 by chrisfen, Fri Sep 16 19:00:12 2005 UTC

# Line 53 | Line 53
53   #include "math/Vector3.hpp"
54   #include "primitives/Molecule.hpp"
55   #include "UseTheForce/fCutoffPolicy.h"
56 + #include "UseTheForce/Darkside/fElectrostaticSummationMethod.h"
57   #include "UseTheForce/doForces_interface.h"
58   #include "UseTheForce/notifyCutoffs_interface.h"
59   #include "utils/MemoryUtils.hpp"
# Line 463 | Line 464 | namespace oopse {
464      //setup fortran force field
465      /** @deprecate */    
466      int isError = 0;
467 <    initFortranFF( &fInfo_.SIM_uses_RF, &fInfo_.SIM_uses_UW,
468 <                   &fInfo_.SIM_uses_DW, &isError );
467 >    
468 >    setupElectrostaticSummationMethod( isError );
469 >
470      if(isError){
471        sprintf( painCave.errMsg,
472                 "ForceField error: There was an error initializing the forceField in fortran.\n" );
# Line 520 | Line 522 | namespace oopse {
522      int useElectrostatics = 0;
523      //usePBC and useRF are from simParams
524      int usePBC = simParams_->getPBC();
523    int useRF = simParams_->getUseRF();
524    int useUW = simParams_->getUseUndampedWolf();
525    int useDW = simParams_->getUseDampedWolf();
525  
526      //loop over all of the atom types
527      for (i = atomTypes.begin(); i != atomTypes.end(); ++i) {
# Line 585 | Line 584 | namespace oopse {
584      temp = useFLARB;
585      MPI_Allreduce(&temp, &useFLARB, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
586  
588    temp = useRF;
589    MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
590
591    temp = useUW;
592    MPI_Allreduce(&temp, &useUW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);  
593
594    temp = useDW;
595    MPI_Allreduce(&temp, &useDW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);  
596    
587   #endif
588  
589      fInfo_.SIM_uses_PBC = usePBC;    
# Line 608 | Line 598 | namespace oopse {
598      fInfo_.SIM_uses_EAM = useEAM;
599      fInfo_.SIM_uses_Shapes = useShape;
600      fInfo_.SIM_uses_FLARB = useFLARB;
611    fInfo_.SIM_uses_RF = useRF;
612    fInfo_.SIM_uses_UW = useUW;
613    fInfo_.SIM_uses_DW = useDW;
601  
602      if( fInfo_.SIM_uses_Dipoles && fInfo_.SIM_uses_RF) {
603  
# Line 870 | Line 857 | namespace oopse {
857        }
858      }
859      notifyFortranCutoffs(&rcut_, &rsw_, &rnblist, &cp);
860 +  }
861 +
862 +  void SimInfo::setupElectrostaticSummationMethod( int isError ) {    
863 +    
864 +    int errorOut;
865 +    int esm =  NONE;
866 +    double alphaVal;
867 +
868 +    errorOut = isError;
869 +
870 +    if (simParams_->haveElectrostaticSummationMethod()) {
871 +      std::string myMethod = simParams_->getElectrostaticSummationMethod();
872 +      if (myMethod == "NONE") {
873 +        esm = NONE;
874 +      } else {
875 +        if (myMethod == "UNDAMPED_WOLF") {
876 +          esm = UNDAMPED_WOLF;
877 +        } else {
878 +          if (myMethod == "DAMPED_WOLF") {            
879 +            esm = DAMPED_WOLF;
880 +            if (!simParams_->haveDampingAlpha()) {
881 +              //throw error
882 +              sprintf( painCave.errMsg,
883 +                       "SimInfo warning: dampingAlpha was not specified in the input file. A default value of %f (1/ang) will be used for the Damped Wolf Method.", simParams_->getDampingAlpha());
884 +              painCave.isFatal = 0;
885 +              simError();
886 +            }
887 +            alphaVal = simParams_->getDampingAlpha();
888 +          } else {
889 +            if (myMethod == "REACTION_FIELD") {
890 +              esm = REACTION_FIELD;
891 +            } else {
892 +              // throw error        
893 +              sprintf( painCave.errMsg,
894 +                       "SimInfo error: Unknown electrostaticSummationMethod. (Input file specified %s .)\n\telectrostaticSummationMethod must be one of: \"none\", \"undamped_wolf\", \"damped_wolf\", or \"reaction_field\".", myMethod.c_str() );
895 +              painCave.isFatal = 1;
896 +              simError();
897 +            }    
898 +          }          
899 +        }
900 +      }
901 +    }
902 +    initFortranFF( &fInfo_.SIM_uses_RF, &esm, &alphaVal, &errorOut );
903    }
904  
905    void SimInfo::addProperty(GenericData* genData) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines