Modified data_bonds_post() and calling structure

This commit is contained in:
Oliver Henrich
2021-07-15 13:36:40 +01:00
parent 39bd342913
commit 0f0059269d
23 changed files with 18 additions and 64 deletions

View File

@ -32,7 +32,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
10 ellipsoids 10 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
8 bonds 8 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -32,7 +32,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
10 ellipsoids 10 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
8 bonds 8 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -32,7 +32,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
16 ellipsoids 16 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
13 bonds 13 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -32,7 +32,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
16 ellipsoids 16 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
13 bonds 13 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -33,7 +33,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
10 ellipsoids 10 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
8 bonds 8 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -33,7 +33,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
10 ellipsoids 10 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
8 bonds 8 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -33,7 +33,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
16 ellipsoids 16 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
13 bonds 13 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -33,7 +33,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
16 ellipsoids 16 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
13 bonds 13 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -33,7 +33,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
10 ellipsoids 10 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
8 bonds 8 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -33,7 +33,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
10 ellipsoids 10 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
8 bonds 8 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -36,7 +36,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
26 ellipsoids 26 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
24 bonds 24 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -36,7 +36,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
26 ellipsoids 26 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
24 bonds 24 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -36,7 +36,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
26 ellipsoids 26 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
24 bonds 24 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -36,7 +36,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
26 ellipsoids 26 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
24 bonds 24 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -33,7 +33,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
16 ellipsoids 16 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
13 bonds 13 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -33,7 +33,6 @@ Reading data file ...
2 = max bonds/atom 2 = max bonds/atom
16 ellipsoids 16 ellipsoids
reading bonds ... reading bonds ...
Setting oxDNA 3'->5' bond directionality ...
13 bonds 13 bonds
Finding 1-2 1-3 1-4 neighbors ... Finding 1-2 1-3 1-4 neighbors ...
special bond factors lj: 0 0 0 special bond factors lj: 0 0 0

View File

@ -66,7 +66,7 @@ void AtomVecOxdna::grow_pointers()
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
initialize atom quantity initialize atom quantity 5' partner
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void AtomVecOxdna::data_atom_post(int ilocal) void AtomVecOxdna::data_atom_post(int ilocal)
@ -80,45 +80,17 @@ void AtomVecOxdna::data_atom_post(int ilocal)
store 5' partner to inform 3'->5' bond directionality store 5' partner to inform 3'->5' bond directionality
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void AtomVecOxdna::data_bonds_post(int n, char *buf, tagint id_offset) void AtomVecOxdna::data_bonds_post(int m, int num_bond, tagint atom1,
tagint atom2, tagint id_offset)
{ {
int m,tmp,itype,rv;
tagint atom1,atom2;
char *next;
tagint *id5p = atom->id5p; tagint *id5p = atom->id5p;
if (comm->me == 0) utils::logmesg(lmp,"Setting oxDNA 3'->5' bond directionality ...\n"); if (id_offset) {
atom1 += id_offset;
atom2 += id_offset;
}
for (int i = 0; i < n; i++) { if ((m = atom->map(atom1)) >= 0) {
id5p[m] = atom2;
next = strchr(buf,'\n');
*next = '\0';
rv = sscanf(buf,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT,
&tmp,&itype,&atom1,&atom2);
if (id_offset) {
atom1 += id_offset;
atom2 += id_offset;
}
if ((m = atom->map(atom1)) >= 0) {
id5p[m] = atom2;
}
buf = next + 1;
} }
} }
/* ----------------------------------------------------------------------
process bond information as per data file
store 5' partner to inform 3'->5' bond directionality
------------------------------------------------------------------------- */
void AtomVecOxdna::data_bonds_post2(int m, int num_bond, tagint atom1, tagint atom2, tagint id_offset)
{
printf("CALLED FROM ATOM_VEC_OXDNA\n");
}

View File

@ -30,8 +30,7 @@ class AtomVecOxdna : public AtomVec {
~AtomVecOxdna(); ~AtomVecOxdna();
void grow_pointers(); void grow_pointers();
virtual void data_bonds_post(int, char *, tagint); virtual void data_bonds_post(int, int, tagint, tagint, tagint);
virtual void data_bonds_post2(int, int, tagint, tagint, tagint);
void data_atom_post(int); void data_atom_post(int);
private: private:

View File

@ -1288,7 +1288,7 @@ void Atom::data_bonds(int n, char *buf, int *count, tagint id_offset,
bond_type[m][num_bond[m]] = itype; bond_type[m][num_bond[m]] = itype;
bond_atom[m][num_bond[m]] = atom2; bond_atom[m][num_bond[m]] = atom2;
num_bond[m]++; num_bond[m]++;
avec->data_bonds_post2(m, num_bond[m], atom1, atom2, id_offset); avec->data_bonds_post(m, num_bond[m], atom1, atom2, id_offset);
} }
} }
if (newton_bond == 0) { if (newton_bond == 0) {
@ -1298,6 +1298,7 @@ void Atom::data_bonds(int n, char *buf, int *count, tagint id_offset,
bond_type[m][num_bond[m]] = itype; bond_type[m][num_bond[m]] = itype;
bond_atom[m][num_bond[m]] = atom1; bond_atom[m][num_bond[m]] = atom1;
num_bond[m]++; num_bond[m]++;
avec->data_bonds_post(m, num_bond[m], atom1, atom2, id_offset);
} }
} }
} }

View File

@ -129,8 +129,7 @@ class AtomVec : protected Pointers {
virtual void data_atom_bonus(int, char **) {} virtual void data_atom_bonus(int, char **) {}
virtual void data_body(int, int, int, int *, double *) {} virtual void data_body(int, int, int, int *, double *) {}
virtual void data_bonds_post(int, char *, tagint) {} virtual void data_bonds_post(int, int , tagint, tagint, tagint) {}
virtual void data_bonds_post2(int, int , tagint, tagint, tagint) {}
virtual void pack_data(double **); virtual void pack_data(double **);
virtual void write_data(FILE *, int, double **); virtual void write_data(FILE *, int, double **);

View File

@ -442,11 +442,11 @@ void AtomVecHybrid::data_atom_post(int ilocal)
modify what AtomVec::data_bonds() just unpacked modify what AtomVec::data_bonds() just unpacked
or initialize other bond quantities or initialize other bond quantities
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void AtomVecHybrid::data_bonds_post2(int m, int num_bond, tagint atom1, tagint atom2, tagint id_offset) void AtomVecHybrid::data_bonds_post(int m, int num_bond, tagint atom1,
tagint atom2, tagint id_offset)
{ {
for (int k = 0; k < nstyles; k++)
printf("CALLED FROM ATOM_VEC_HYBRID\n"); styles[k]->data_bonds_post(m, num_bond, atom1, atom2, id_offset);
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -56,7 +56,7 @@ class AtomVecHybrid : public AtomVec {
void create_atom_post(int); void create_atom_post(int);
void data_atom_post(int); void data_atom_post(int);
virtual void data_bonds_post2(int, int, tagint, tagint, tagint); virtual void data_bonds_post(int, int, tagint, tagint, tagint);
void pack_data_pre(int); void pack_data_pre(int);
void pack_data_post(int); void pack_data_post(int);

View File

@ -1342,7 +1342,6 @@ void ReadData::bonds(int firstpass)
if (eof) error->all(FLERR,"Unexpected end of data file"); if (eof) error->all(FLERR,"Unexpected end of data file");
strcpy(buffer_post,buffer); strcpy(buffer_post,buffer);
atom->data_bonds(nchunk,buffer,count,id_offset,boffset); atom->data_bonds(nchunk,buffer,count,id_offset,boffset);
if (!firstpass) avec->data_bonds_post(nchunk,buffer_post,id_offset);
nread += nchunk; nread += nchunk;
} }