Example #1
0
/*
 * Builds the full neighborlist list from scratch for a particle
 * This is used for the initial build for all the particles, then for rebuilds
 * of moved particles
 *
 * arguments:
 *      particles:      The spatially decomposed particle information
 *      neighbor_list:  The particle's neighborlist
 *      x,y,z:          The indecies for the block which the particle belongs to
 *      array_index:    The index of the particle in the list
 */
void build_list_full(Particle* particles[XDiv][YDiv][ZDiv], Neighbor* neighbor_list, int x, int y, int z, int array_index){
    // Iterates through the buckets in in such a way that for every pair of particles which are
    // potential neighbors, one and only one of them will have to check the distance for that pair. This is done by,
    // if we are looking at particle p, only looking at particles further down in the array in the block containing p,
    // and only looking in a "forward" direction (that is, for each pair of blocks that are "across" from eachother around
    // the block containing p, we consider only of those blocks)

    
    int j, k;
    int index = 0;
    Particle p = particles[x][y][z][array_index];
    
    for (j = -1; j <= 1; ++j){ //y offset
        for (k = -1; k <= 1; ++k) { //z offset
            check_particles(particles, x+1, y+j, z+k, neighbor_list, p, &index);
        }
    }
    
    check_particles(particles, x, y+1, z+1, neighbor_list, p, &index);
    check_particles(particles, x, y+1, z  , neighbor_list, p, &index);
    check_particles(particles, x, y+1, z-1, neighbor_list, p, &index);
    check_particles(particles, x, y  , z+1, neighbor_list, p, &index);
    check_particles_center(particles, x, y, z, array_index, neighbor_list, p, &index);
    
    sort_list(neighbor_list);

}
IMPISD_BEGIN_NAMESPACE

GaussianRestraint::GaussianRestraint(Particle *x, Particle *mu,
                                     Particle *sigma) : px_(x), pmu_(mu), psigma_(sigma), isx_(true),
    ismu_(true), issigma_(true) {
    check_particles();
}
LognormalRestraint::LognormalRestraint(double x, Particle *mu,
                                       double sigma)
    : Restraint(mu->get_model(), "LognormalRestraint%1%"),
      x_(x),
      pmu_(mu),
      sigma_(sigma),
      isx_(false),
      ismu_(true),
      issigma_(false) {
  check_particles();
}
LognormalRestraint::LognormalRestraint(Particle *x, double mu,
                                       Particle *sigma)
    : Restraint(sigma->get_model(), "LognormalRestraint%1%"),
      px_(x),
      mu_(mu),
      psigma_(sigma),
      isx_(true),
      ismu_(false),
      issigma_(true) {
  check_particles();
}
Example #5
0
GaussianRestraint::GaussianRestraint(double x, double mu,
                                     Particle *sigma)
    : Restraint(sigma->get_model(), "GaussianRestraint%1%"),
      x_(x),
      mu_(mu),
      psigma_(sigma),
      isx_(false),
      ismu_(false),
      issigma_(true) {
  check_particles();
}
Example #6
0
GaussianRestraint::GaussianRestraint(Particle *x, Particle *mu,
                                     double sigma)
    : Restraint(x->get_model(), "GaussianRestraint%1%"),
      px_(x),
      pmu_(mu),
      sigma_(sigma),
      isx_(true),
      ismu_(true),
      issigma_(false) {
  check_particles();
}
Example #7
0
IMPISD_BEGIN_NAMESPACE

GaussianRestraint::GaussianRestraint(Particle *x, Particle *mu,
                                     Particle *sigma)
    : Restraint(sigma->get_model(), "GaussianRestraint%1%"),
      px_(x),
      pmu_(mu),
      psigma_(sigma),
      isx_(true),
      ismu_(true),
      issigma_(true) {
  check_particles();
}
GaussianRestraint::GaussianRestraint(double x, Particle *mu,
                                     double sigma) : x_(x), pmu_(mu), sigma_(sigma), isx_(false),
    ismu_(true), issigma_(false) {
    check_particles();
}
GaussianRestraint::GaussianRestraint(Particle *x, double mu,
                                     double sigma) : px_(x), mu_(mu), sigma_(sigma), isx_(true),
    ismu_(false), issigma_(false) {
    check_particles();
}