1865
void CTimeStep::WriteTimestepNb(FILE *a, CNbSet *nbs)
1867
void CTimeStep::WriteTimestepNb(FILE *a, CNbSet *nbs, int singlemol)
1868
int z, z2, z3, z4, z0, n;
1870
int z, z2, z3, z4, z0, n, ti;
1870
1872
CSingleMolecule *sm;
1873
CConditionGroup *cg;
1874
CConditionSubGroup *cs;
1873
1879
for (z=0;z<g_oaMolecules.GetSize();z++)
1875
1881
if (nbs->m_oaConditionGroups[z] == NULL)
1889
1895
mfprintf(a," %d\n",n);
1890
if (m_pComment != NULL)
1891
mfprintf(a,"%s\n",m_pComment);
1892
else mfprintf(a,"\n");
1897
mfprintf(a,"# Step %d",((int)g_iSteps));
1901
sm = (CSingleMolecule*)g_oaSingleMolecules[singlemol];
1902
m = (CMolecule*)g_oaMolecules[sm->m_iMolType];
1903
if (!g_bSaveVirtAtoms)
1905
if (g_bWriteAtomwise)
1906
mfprintf(a,", RM=%s[%d]",m->m_sName,sm->m_iMolSMIndex+1);
1907
else mfprintf(a,", RM=%s[%d] (%d atoms)",m->m_sName,sm->m_iMolSMIndex+1,m->m_iAtomGes-m->m_laVirtualAtoms.GetSize());
1910
if (g_bWriteAtomwise)
1911
mfprintf(a,", RM=%s[%d]",m->m_sName,sm->m_iMolSMIndex+1);
1912
else mfprintf(a,", RM=%s[%d] (%d atoms)",m->m_sName,sm->m_iMolSMIndex+1,m->m_iAtomGes);
1916
if (g_bEnvWriteDetailedInfo)
1918
for (z=0;z<g_oaMolecules.GetSize();z++)
1920
if (nbs->m_oaConditionGroups[z] == NULL)
1922
m = (CMolecule*)g_oaMolecules[z];
1924
cg = (CConditionGroup*)nbs->m_oaConditionGroups[z];
1929
if (cg->m_oaConditionSubGroups.GetSize() == 1)
1931
cs = (CConditionSubGroup*)cg->m_oaConditionSubGroups[0];
1932
if (cs->m_oaConditions.GetSize() == 1)
1933
nb = (CNbSearch*)cs->m_oaConditions[0];
1938
if (nb->m_iNbCountMin <= -1)
1941
for (z2=nb->m_iNbCountMin;z2<=nb->m_iNbCountMax;z2++)
1943
ti = nb->m_pNbSort[z2].m_iOM;
1944
if (!g_bSaveVirtAtoms)
1946
if (m->m_laSingleMolIndex[ti] != singlemol)
1948
if (g_bWriteAtomwise)
1949
mfprintf(a,", %s[%d] d=%.3fpm",m->m_sName,z2+1,nb->m_pNbSort[z2].m_fMinDist);
1950
else mfprintf(a,", %s[%d] d=%.3fpm (%d atoms)",m->m_sName,ti+1,nb->m_pNbSort[z2].m_fMinDist,m->m_iAtomGes-m->m_laVirtualAtoms.GetSize());
1954
if (m->m_laSingleMolIndex[ti] != singlemol)
1956
if (g_bWriteAtomwise)
1957
mfprintf(a,", %s[%d] d=%.3fpm",m->m_sName,z2+1,nb->m_pNbSort[z2].m_fMinDist);
1958
else mfprintf(a,", %s[%d] d=%.3fpm (%d atoms)",m->m_sName,ti+1,nb->m_pNbSort[z2].m_fMinDist,m->m_iAtomGes);
1965
for (z2=0;z2<m->m_laSingleMolIndex.GetSize();z2++)
1967
if (cg->Contains(z2))
1969
if (!g_bSaveVirtAtoms)
1971
if (m->m_laSingleMolIndex[z2] != singlemol)
1973
if (g_bWriteAtomwise)
1974
mfprintf(a,", %s[%d]",m->m_sName,z2+1);
1975
else mfprintf(a,", %s[%d] (%d atoms)",m->m_sName,z2+1,m->m_iAtomGes-m->m_laVirtualAtoms.GetSize());
1979
if (m->m_laSingleMolIndex[z2] != singlemol)
1981
if (g_bWriteAtomwise)
1982
mfprintf(a,", %s[%d]",m->m_sName,z2+1);
1983
else mfprintf(a,", %s[%d] (%d atoms)",m->m_sName,z2+1,m->m_iAtomGes);
1894
1994
if (g_bWriteAtomwise)
2025
sm = (CSingleMolecule*)g_oaSingleMolecules[singlemol];
2026
m = (CMolecule*)g_oaMolecules[sm->m_iMolType];
2027
for (z3=0;z3<m->m_baAtomIndex.GetSize();z3++)
2029
if ((!g_bSaveVirtAtoms) && (m->m_baAtomIndex[z3] == g_iVirtAtomType))
2031
for (z4=0;z4<((CxIntArray*)sm->m_oaAtomOffset[z3])->GetSize();z4++)
2032
mfprintf(a," %s %8.5f %8.5f %8.5f\n",((CAtom*)g_oaAtoms[m->m_baAtomIndex[z3]])->m_sName,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][0]/100.0f,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][1]/100.0f,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][2]/100.0f);
1923
2036
for (z=0;z<g_oaMolecules.GetSize();z++)
1925
2038
if (nbs->m_oaConditionGroups[z] == NULL)
1927
2040
m = (CMolecule*)g_oaMolecules[z];
1928
for (z2=0;z2<m->m_laSingleMolIndex.GetSize();z2++)
2041
cg = (CConditionGroup*)nbs->m_oaConditionGroups[z];
1930
if (((CConditionGroup*)nbs->m_oaConditionGroups[z])->Contains(z2))
1932
sm = (CSingleMolecule*)g_oaSingleMolecules[m->m_laSingleMolIndex[z2]];
2046
if (cg->m_oaConditionSubGroups.GetSize() == 1)
2048
cs = (CConditionSubGroup*)cg->m_oaConditionSubGroups[0];
2049
if (cs->m_oaConditions.GetSize() == 1)
2050
nb = (CNbSearch*)cs->m_oaConditions[0];
2055
if (nb->m_iNbCountMin <= -1)
2058
for (z2=nb->m_iNbCountMin;z2<=nb->m_iNbCountMax;z2++)
2060
ti = nb->m_pNbSort[z2].m_iOM;
2062
if (m->m_laSingleMolIndex[ti] == singlemol)
2065
sm = (CSingleMolecule*)g_oaSingleMolecules[m->m_laSingleMolIndex[ti]];
1933
2066
for (z3=0;z3<m->m_baAtomIndex.GetSize();z3++)
1935
2068
if ((!g_bSaveVirtAtoms) && (m->m_baAtomIndex[z3] == g_iVirtAtomType))
1938
2071
mfprintf(a," %s %8.5f %8.5f %8.5f\n",((CAtom*)g_oaAtoms[m->m_baAtomIndex[z3]])->m_sName,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][0]/100.0f,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][1]/100.0f,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][2]/100.0f);
2077
for (z2=0;z2<m->m_laSingleMolIndex.GetSize();z2++)
2079
if (((CConditionGroup*)nbs->m_oaConditionGroups[z])->Contains(z2))
2081
if (m->m_laSingleMolIndex[z2] == singlemol)
2083
sm = (CSingleMolecule*)g_oaSingleMolecules[m->m_laSingleMolIndex[z2]];
2084
for (z3=0;z3<m->m_baAtomIndex.GetSize();z3++)
2086
if ((!g_bSaveVirtAtoms) && (m->m_baAtomIndex[z3] == g_iVirtAtomType))
2088
for (z4=0;z4<((CxIntArray*)sm->m_oaAtomOffset[z3])->GetSize();z4++)
2089
mfprintf(a," %s %8.5f %8.5f %8.5f\n",((CAtom*)g_oaAtoms[m->m_baAtomIndex[z3]])->m_sName,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][0]/100.0f,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][1]/100.0f,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][2]/100.0f);