| 55 | 
  | 
#include "UseTheForce/fCutoffPolicy.h" | 
| 56 | 
  | 
#include "UseTheForce/DarkSide/fElectrostaticSummationMethod.h" | 
| 57 | 
  | 
#include "UseTheForce/DarkSide/fElectrostaticScreeningMethod.h" | 
| 58 | 
+ | 
#include "UseTheForce/DarkSide/fSwitchingFunctionType.h" | 
| 59 | 
  | 
#include "UseTheForce/doForces_interface.h" | 
| 60 | 
  | 
#include "UseTheForce/DarkSide/electrostatic_interface.h" | 
| 61 | 
  | 
#include "UseTheForce/notifyCutoffs_interface.h" | 
| 62 | 
+ | 
#include "UseTheForce/DarkSide/switcheroo_interface.h" | 
| 63 | 
  | 
#include "utils/MemoryUtils.hpp" | 
| 64 | 
  | 
#include "utils/simError.h" | 
| 65 | 
  | 
#include "selection/SelectionManager.hpp" | 
| 474 | 
  | 
    int isError = 0; | 
| 475 | 
  | 
     | 
| 476 | 
  | 
    setupElectrostaticSummationMethod( isError ); | 
| 477 | 
+ | 
    setupSwitchingFunction(); | 
| 478 | 
  | 
 | 
| 479 | 
  | 
    if(isError){ | 
| 480 | 
  | 
      sprintf( painCave.errMsg, | 
| 519 | 
  | 
    int useLennardJones = 0; | 
| 520 | 
  | 
    int useElectrostatic = 0; | 
| 521 | 
  | 
    int useEAM = 0; | 
| 522 | 
+ | 
    int useSC = 0; | 
| 523 | 
  | 
    int useCharge = 0; | 
| 524 | 
  | 
    int useDirectional = 0; | 
| 525 | 
  | 
    int useDipole = 0; | 
| 533 | 
  | 
    //usePBC and useRF are from simParams | 
| 534 | 
  | 
    int usePBC = simParams_->getUsePeriodicBoundaryConditions(); | 
| 535 | 
  | 
    int useRF; | 
| 536 | 
< | 
    int useDW; | 
| 536 | 
> | 
    int useSF; | 
| 537 | 
  | 
    std::string myMethod; | 
| 538 | 
  | 
 | 
| 539 | 
  | 
    // set the useRF logical | 
| 540 | 
  | 
    useRF = 0; | 
| 541 | 
< | 
    useDW = 0; | 
| 541 | 
> | 
    useSF = 0; | 
| 542 | 
  | 
 | 
| 543 | 
  | 
 | 
| 544 | 
  | 
    if (simParams_->haveElectrostaticSummationMethod()) { | 
| 547 | 
  | 
      if (myMethod == "REACTION_FIELD") { | 
| 548 | 
  | 
        useRF=1; | 
| 549 | 
  | 
      } else { | 
| 550 | 
< | 
        if (myMethod == "SHIFTED_POTENTIAL") { | 
| 551 | 
< | 
          useDW = 1; | 
| 550 | 
> | 
        if (myMethod == "SHIFTED_FORCE") { | 
| 551 | 
> | 
          useSF = 1; | 
| 552 | 
  | 
        } | 
| 553 | 
  | 
      } | 
| 554 | 
  | 
    } | 
| 558 | 
  | 
      useLennardJones |= (*i)->isLennardJones(); | 
| 559 | 
  | 
      useElectrostatic |= (*i)->isElectrostatic(); | 
| 560 | 
  | 
      useEAM |= (*i)->isEAM(); | 
| 561 | 
+ | 
      useSC |= (*i)->isSC(); | 
| 562 | 
  | 
      useCharge |= (*i)->isCharge(); | 
| 563 | 
  | 
      useDirectional |= (*i)->isDirectional(); | 
| 564 | 
  | 
      useDipole |= (*i)->isDipole(); | 
| 609 | 
  | 
    temp = useEAM; | 
| 610 | 
  | 
    MPI_Allreduce(&temp, &useEAM, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);     | 
| 611 | 
  | 
 | 
| 612 | 
+ | 
    temp = useSC; | 
| 613 | 
+ | 
    MPI_Allreduce(&temp, &useSC, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); | 
| 614 | 
+ | 
     | 
| 615 | 
  | 
    temp = useShape; | 
| 616 | 
  | 
    MPI_Allreduce(&temp, &useShape, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    | 
| 617 | 
  | 
 | 
| 621 | 
  | 
    temp = useRF; | 
| 622 | 
  | 
    MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);     | 
| 623 | 
  | 
 | 
| 624 | 
< | 
    temp = useDW; | 
| 625 | 
< | 
    MPI_Allreduce(&temp, &useDW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);     | 
| 624 | 
> | 
    temp = useSF; | 
| 625 | 
> | 
    MPI_Allreduce(&temp, &useSF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);     | 
| 626 | 
  | 
 | 
| 627 | 
  | 
#endif | 
| 628 | 
  | 
 | 
| 636 | 
  | 
    fInfo_.SIM_uses_StickyPower = useStickyPower; | 
| 637 | 
  | 
    fInfo_.SIM_uses_GayBerne = useGayBerne; | 
| 638 | 
  | 
    fInfo_.SIM_uses_EAM = useEAM; | 
| 639 | 
+ | 
    fInfo_.SIM_uses_SC = useSC; | 
| 640 | 
  | 
    fInfo_.SIM_uses_Shapes = useShape; | 
| 641 | 
  | 
    fInfo_.SIM_uses_FLARB = useFLARB; | 
| 642 | 
  | 
    fInfo_.SIM_uses_RF = useRF; | 
| 643 | 
< | 
    fInfo_.SIM_uses_DampedWolf = useDW; | 
| 643 | 
> | 
    fInfo_.SIM_uses_SF = useSF; | 
| 644 | 
  | 
 | 
| 645 | 
  | 
    if( myMethod == "REACTION_FIELD") { | 
| 646 | 
  | 
       | 
| 987 | 
  | 
    initFortranFF( &esm, &errorOut ); | 
| 988 | 
  | 
  } | 
| 989 | 
  | 
 | 
| 990 | 
+ | 
  void SimInfo::setupSwitchingFunction() {     | 
| 991 | 
+ | 
    int ft = CUBIC; | 
| 992 | 
+ | 
 | 
| 993 | 
+ | 
    if (simParams_->haveSwitchingFunctionType()) { | 
| 994 | 
+ | 
      std::string funcType = simParams_->getSwitchingFunctionType(); | 
| 995 | 
+ | 
      toUpper(funcType); | 
| 996 | 
+ | 
      if (funcType == "CUBIC") { | 
| 997 | 
+ | 
        ft = CUBIC; | 
| 998 | 
+ | 
      } else { | 
| 999 | 
+ | 
        if (funcType == "FIFTH_ORDER_POLYNOMIAL") { | 
| 1000 | 
+ | 
          ft = FIFTH_ORDER_POLY; | 
| 1001 | 
+ | 
        } else { | 
| 1002 | 
+ | 
          // throw error         | 
| 1003 | 
+ | 
          sprintf( painCave.errMsg, | 
| 1004 | 
+ | 
                   "SimInfo error: Unknown switchingFunctionType. (Input file specified %s .)\n\tswitchingFunctionType must be one of: \"cubic\" or \"fifth_order_polynomial\".", funcType.c_str() ); | 
| 1005 | 
+ | 
          painCave.isFatal = 1; | 
| 1006 | 
+ | 
          simError(); | 
| 1007 | 
+ | 
        }            | 
| 1008 | 
+ | 
      } | 
| 1009 | 
+ | 
    } | 
| 1010 | 
+ | 
 | 
| 1011 | 
+ | 
    // send switching function notification to switcheroo | 
| 1012 | 
+ | 
    setFunctionType(&ft); | 
| 1013 | 
+ | 
 | 
| 1014 | 
+ | 
  } | 
| 1015 | 
+ | 
 | 
| 1016 | 
  | 
  void SimInfo::addProperty(GenericData* genData) { | 
| 1017 | 
  | 
    properties_.addProperty(genData);   | 
| 1018 | 
  | 
  } |