예제 #1
0
파일: initialize.c 프로젝트: andmi/espresso
void on_cell_structure_change()
{
    EVENT_TRACE(fprintf(stderr, "%d: on_cell_structure_change\n", this_node));

    /* Now give methods a chance to react to the change in cell
       structure.  Most ES methods need to reinitialize, as they depend
       on skin, node grid and so on. Only for a change in box length we
       have separate, faster methods, as this might happend frequently
       in a NpT simulation. */
#ifdef ELECTROSTATICS
    switch (coulomb.method) {
    case COULOMB_DH:
        break;
#ifdef P3M
    case COULOMB_ELC_P3M:
        ELC_init();
    // fall through
    case COULOMB_P3M:
        p3m_init();
        break;
#endif
    case COULOMB_MMM1D:
        MMM1D_init();
        break;
    case COULOMB_MMM2D:
        MMM2D_init();
        break;
    case COULOMB_MAGGS:
        maggs_init();
        /* Maggs electrostatics needs ghost velocities */
        on_ghost_flags_change();
        break;
    default:
        break;
    }
#endif  /* ifdef ELECTROSTATICS */

#ifdef DIPOLES
    switch (coulomb.Dmethod) {
#ifdef DP3M
    case DIPOLAR_MDLC_P3M:
    // fall through
    case DIPOLAR_P3M:
        dp3m_init();
        break;
#endif
    default:
        break;
    }
#endif  /* ifdef DIPOLES */

#ifdef LB
    if(lattice_switch & LATTICE_LB) {
        lb_init();
    }
#endif
}
예제 #2
0
파일: initialize.c 프로젝트: andmi/espresso
void on_coulomb_change()
{
    EVENT_TRACE(fprintf(stderr, "%d: on_coulomb_change\n", this_node));
    invalidate_obs();

    recalc_coulomb_prefactor();

#ifdef ELECTROSTATICS
    switch (coulomb.method) {
    case COULOMB_DH:
        break;
#ifdef P3M
    case COULOMB_ELC_P3M:
        ELC_init();
    // fall through
    case COULOMB_P3M:
        p3m_init();
        break;
#endif
    case COULOMB_MMM1D:
        MMM1D_init();
        break;
    case COULOMB_MMM2D:
        MMM2D_init();
        break;
    case COULOMB_MAGGS:
        maggs_init();
        /* Maggs electrostatics needs ghost velocities */
        on_ghost_flags_change();
        break;
    default:
        break;
    }
#endif  /* ifdef ELECTROSTATICS */

#ifdef DIPOLES
    switch (coulomb.Dmethod) {
#ifdef DP3M
    case DIPOLAR_MDLC_P3M:
    // fall through
    case DIPOLAR_P3M:
        dp3m_init();
        break;
#endif
    default:
        break;
    }
#endif  /* ifdef DIPOLES */

    /* all Coulomb methods have a short range part, aka near field
       correction. Even in case of switching off, we should call this,
       since the required cutoff might have reduced. */
    on_short_range_ia_change();

    recalc_forces = 1;
}
예제 #3
0
void on_coulomb_change()
{
  EVENT_TRACE(fprintf(stderr, "%d: on_coulomb_change\n", this_node));
  invalidate_obs();

  recalc_coulomb_prefactor();

#ifdef ELECTROSTATICS
  switch (coulomb.method) {
  case COULOMB_DH:
    break;    
#ifdef P3M
#ifdef CUDA
  case COULOMB_P3M_GPU:
    if ( box_l[0] != box_l[1] || box_l[0] != box_l[2] ) {
      fprintf (stderr, "P3M on the GPU requires a cubic box!\n");
      exit(1);
    }
    p3m_gpu_init(p3m.params.cao, p3m.params.mesh[0], p3m.params.alpha, box_l[0]);
    MPI_Bcast(gpu_get_global_particle_vars_pointer_host(), sizeof(CUDA_global_part_vars), MPI_BYTE, 0, comm_cart);
    p3m_init();
    break;
#endif
  case COULOMB_ELC_P3M:
    ELC_init();
    // fall through
  case COULOMB_P3M:
    p3m_init();
    break;
#endif
  case COULOMB_MMM1D:
    MMM1D_init();
    break;
  case COULOMB_MMM2D:
    MMM2D_init();
    break;
  case COULOMB_MAGGS: 
    maggs_init();
    /* Maggs electrostatics needs ghost velocities */
    on_ghost_flags_change();
    break;
  default: break;
  }
#endif  /* ifdef ELECTROSTATICS */

#ifdef DIPOLES
  switch (coulomb.Dmethod) {
#ifdef DP3M
  case DIPOLAR_MDLC_P3M:
    // fall through
  case DIPOLAR_P3M:
    dp3m_init();
    break;
#endif
  default: break;
  }
#endif  /* ifdef DIPOLES */

  /* all Coulomb methods have a short range part, aka near field
     correction. Even in case of switching off, we should call this,
     since the required cutoff might have reduced. */
  on_short_range_ia_change();

  recalc_forces = 1;
}