Commit f44bab7c authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

rename memory keyword to bbox and change internal variable names accordingly

also some whitespace/formatting cleanup to better match LAMMPS' programming style.
parent 5a65deb0
Loading
Loading
Loading
Loading
+87 −82
Original line number Diff line number Diff line
@@ -58,9 +58,9 @@ void Replicate::command(int narg, char **arg)
  int nz = force->inumeric(FLERR,arg[2]);
  int nrep = nx*ny*nz;

  int use_more_memory = 0;
  int bbox_flag = 0;
  if (narg == 4)
    if(strcmp(arg[3],"memory") == 0) use_more_memory = 1;
    if (strcmp(arg[3],"bbox") == 0) bbox_flag = 1;

  // error and warning checks

@@ -113,7 +113,7 @@ void Replicate::command(int narg, char **arg)
  _imagehi[1] = 0;
  _imagehi[2] = 0;

  if(use_more_memory) {
  if (bbox_flag) {

    for (i=0; i<atom->nlocal; ++i) {
      imageint image = atom->image[i];
@@ -315,7 +315,7 @@ void Replicate::command(int narg, char **arg)
  double *coord;
  int tag_enable = atom->tag_enable;

  if(use_more_memory) {
  if (bbox_flag) {

    // allgather size of buf on each proc

@@ -416,13 +416,19 @@ void Replicate::command(int narg, char **arg)
            double _lhi[3];
            domain->x2lamda(_hi,_lhi);

	    if( _llo[0] > (subhi[0] - EPSILON) || _lhi[0] < (sublo[0] + EPSILON) ) xoverlap = 0;
	    if( _llo[1] > (subhi[1] - EPSILON) || _lhi[1] < (sublo[1] + EPSILON) ) yoverlap = 0;
	    if( _llo[2] > (subhi[2] - EPSILON) || _lhi[2] < (sublo[2] + EPSILON) ) zoverlap = 0;
            if (_llo[0] > (subhi[0] - EPSILON)
                || _lhi[0] < (sublo[0] + EPSILON) ) xoverlap = 0;
            if (_llo[1] > (subhi[1] - EPSILON)
                || _lhi[1] < (sublo[1] + EPSILON) ) yoverlap = 0;
            if (_llo[2] > (subhi[2] - EPSILON)
                || _lhi[2] < (sublo[2] + EPSILON) ) zoverlap = 0;
          } else {
	    if( _lo[0] > (subhi[0] - EPSILON) || _hi[0] < (sublo[0] + EPSILON) ) xoverlap = 0;
	    if( _lo[1] > (subhi[1] - EPSILON) || _hi[1] < (sublo[1] + EPSILON) ) yoverlap = 0;
	    if( _lo[2] > (subhi[2] - EPSILON) || _hi[2] < (sublo[2] + EPSILON) ) zoverlap = 0;
            if (_lo[0] > (subhi[0] - EPSILON)
                || _hi[0] < (sublo[0] + EPSILON) ) xoverlap = 0;
            if (_lo[1] > (subhi[1] - EPSILON)
                || _hi[1] < (sublo[1] + EPSILON) ) yoverlap = 0;
            if (_lo[2] > (subhi[2] - EPSILON)
                || _hi[2] < (sublo[2] + EPSILON) ) zoverlap = 0;
          }

          int overlap = 0;
@@ -602,7 +608,7 @@ void Replicate::command(int narg, char **arg)
    MPI_Reduce(&num_replicas_added, &sum, 1, MPI_INT, MPI_SUM, 0, world);
    double avg = (double) sum / nprocs;
    if (me == 0 && screen)
      fprintf(screen,"Replicate: average # of replicas added to proc= %f out of %i (%f %%)\n",
      fprintf(screen,"Replicate: average # of replicas added to proc: %f out of %i (%f %%)\n",
              avg,nx*ny*nz,avg/(nx*ny*nz)*100.0);

  } else {
@@ -694,8 +700,7 @@ void Replicate::command(int narg, char **arg)
        }
      }
    }

  } // if(use_more_memory)
  } // if (bbox_flag)

  // free communication buffer and old atom class