~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to src/MC/fix_bond_break.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
263
263
  }
264
264
 
265
265
  commflag = 1;
266
 
  comm->forward_comm_fix(this);
 
266
  comm->forward_comm_fix(this,2);
267
267
 
268
268
  // break bonds
269
269
  // if both atoms list each other as winning bond partner
342
342
  // 1-2 neighs already reflect broken bonds
343
343
 
344
344
  commflag = 2;
345
 
  comm->forward_comm_variable_fix(this);
 
345
  comm->forward_comm_fix(this);
346
346
 
347
347
  // create list of broken bonds that influence my owned atoms
348
348
  //   even if between owned-ghost or ghost-ghost atoms
389
389
  tagint *slist;
390
390
 
391
391
  int **nspecial = atom->nspecial;
392
 
  int **special = atom->special;
 
392
  tagint **special = atom->special;
393
393
  int nlocal = atom->nlocal;
394
394
 
395
395
  int flag = 0;
702
702
 
703
703
/* ---------------------------------------------------------------------- */
704
704
 
705
 
int FixBondBreak::pack_comm(int n, int *list, double *buf,
706
 
                            int pbc_flag, int *pbc)
 
705
int FixBondBreak::pack_forward_comm(int n, int *list, double *buf,
 
706
                                    int pbc_flag, int *pbc)
707
707
{
708
708
  int i,j,k,m,ns;
709
709
 
714
714
      buf[m++] = ubuf(partner[j]).d;
715
715
      buf[m++] = probability[j];
716
716
    }
717
 
    return 2;
 
717
    return m;
718
718
  }
719
719
 
720
720
  int **nspecial = atom->nspecial;
721
 
  int **special = atom->special;
 
721
  tagint **special = atom->special;
722
722
 
723
723
  m = 0;
724
724
  for (i = 0; i < n; i++) {
734
734
 
735
735
/* ---------------------------------------------------------------------- */
736
736
 
737
 
void FixBondBreak::unpack_comm(int n, int first, double *buf)
 
737
void FixBondBreak::unpack_forward_comm(int n, int first, double *buf)
738
738
{
739
739
  int i,j,m,ns,last;
740
740
 
749
749
  } else {
750
750
 
751
751
    int **nspecial = atom->nspecial;
752
 
    int **special = atom->special;
 
752
    tagint **special = atom->special;
753
753
 
754
754
    m = 0;
755
755
    last = first + n;
775
775
    buf[m++] = ubuf(partner[i]).d;
776
776
    buf[m++] = distsq[i];
777
777
  }
778
 
  return 2;
 
778
  return m;
779
779
}
780
780
 
781
781
/* ---------------------------------------------------------------------- */
800
800
void FixBondBreak::print_bb()
801
801
{
802
802
  for (int i = 0; i < atom->nlocal; i++) {
803
 
    printf("TAG %i: %d nbonds: ",atom->tag[i],atom->num_bond[i]);
 
803
    printf("TAG " TAGINT_FORMAT ": %d nbonds: ",atom->tag[i],atom->num_bond[i]);
804
804
    for (int j = 0; j < atom->num_bond[i]; j++) {
805
805
      printf(" %d",atom->bond_atom[i][j]);
806
806
    }
807
807
    printf("\n");
808
 
    printf("TAG %i: %d nangles: ",atom->tag[i],atom->num_angle[i]);
 
808
    printf("TAG " TAGINT_FORMAT ": %d nangles: ",atom->tag[i],atom->num_angle[i]);
809
809
    for (int j = 0; j < atom->num_angle[i]; j++) {
810
810
      printf(" %d %d %d,",atom->angle_atom1[i][j],
811
811
             atom->angle_atom2[i][j],atom->angle_atom3[i][j]);
812
812
    }
813
813
    printf("\n");
814
 
    printf("TAG %i: %d ndihedrals: ",atom->tag[i],atom->num_dihedral[i]);
 
814
    printf("TAG " TAGINT_FORMAT ": %d ndihedrals: ",atom->tag[i],atom->num_dihedral[i]);
815
815
    for (int j = 0; j < atom->num_dihedral[i]; j++) {
816
816
      printf(" %d %d %d %d,",atom->dihedral_atom1[i][j],
817
817
             atom->dihedral_atom2[i][j],atom->dihedral_atom3[i][j],
818
818
             atom->dihedral_atom4[i][j]);
819
819
    }
820
820
    printf("\n");
821
 
    printf("TAG %i: %d %d %d nspecial: ",atom->tag[i],
 
821
    printf("TAG " TAGINT_FORMAT ": %d %d %d nspecial: ",atom->tag[i],
822
822
           atom->nspecial[i][0],atom->nspecial[i][1],atom->nspecial[i][2]);
823
823
    for (int j = 0; j < atom->nspecial[i][2]; j++) {
824
824
      printf(" %d",atom->special[i][j]);
841
841
 
842
842
double FixBondBreak::compute_vector(int n)
843
843
{
844
 
  if (n == 1) return (double) breakcount;
 
844
  if (n == 0) return (double) breakcount;
845
845
  return (double) breakcounttotal;
846
846
}
847
847