*ip = -1;
}
}
+#if PIATOM
if (mol->piconnects != NULL) {
for (i = mol->piconnects[idx]; i < mol->piconnects[idx + 1]; i++) {
n = mol->piconnects[i];
}
}
}
+#endif
for (ip = results; *ip >= 0; ip++)
;
return ip - results;
#define SWAP_INT(_i, _j) do { Int _k; _k = _i; _i = _j; _j = _k; } while (0)
+#if PIATOM
/* Check whether i1-i2 is included in the pi-bond list */
static int
s_check_pi_bond(MDArena *arena, Int i1, Int i2)
}
return 0;
}
+#endif
/* Find vdw parameters and build the in-use list */
static int
Atom *ap1, *ap2;
i1 = mol->bonds[i * 2];
i2 = mol->bonds[i * 2 + 1];
+#if PIATOM
if (s_check_pi_bond(arena, i1, i2)) {
/* Skip this bond */
arena->bond_par_i[i] = -1;
continue;
}
+#endif
ap1 = ATOM_AT_INDEX(mol->atoms, i1);
ap2 = ATOM_AT_INDEX(mol->atoms, i2);
type1 = ap1->type;
i1 = mol->angles[i * 3];
i2 = mol->angles[i * 3 + 1];
i3 = mol->angles[i * 3 + 2];
+#if PIATOM
if (s_check_pi_bond(arena, i1, i2) || s_check_pi_bond(arena, i2, i3)) {
/* Skip this angle */
arena->angle_par_i[i] = -1;
continue;
}
+#endif
type1 = ATOM_AT_INDEX(mol->atoms, i1)->type;
type2 = ATOM_AT_INDEX(mol->atoms, i2)->type;
type3 = ATOM_AT_INDEX(mol->atoms, i3)->type;
i2 = mol->dihedrals[i * 4 + 1];
i3 = mol->dihedrals[i * 4 + 2];
i4 = mol->dihedrals[i * 4 + 3];
+#if PIATOM
if (s_check_pi_bond(arena, i1, i2) || s_check_pi_bond(arena, i2, i3) || s_check_pi_bond(arena, i3, i4)) {
/* Skip this dihedral */
arena->dihedral_par_i[i] = -1;
continue;
}
+#endif
type1 = ATOM_AT_INDEX(mol->atoms, i1)->type;
type2 = ATOM_AT_INDEX(mol->atoms, i2)->type;
type3 = ATOM_AT_INDEX(mol->atoms, i3)->type;
return nmissing;
}
+#if PIATOM
/* Find pi-bond parameters */
static int
s_find_pibond_parameters(MDArena *arena)
arena->nmissing += nmissing;
return nmissing;
}
+#endif
/* Find one fragment, starting from start_index */
static void
"Number of bonds = %d\n"
"Number of angles = %d\n"
"Number of dihedrals = %d\n"
- "Number of impropers = %d\n"
- "Number of pi anchors = %d\n"
- "Number of pi anchor constructs = %d\n",
- mol->nbonds, mol->nangles, mol->ndihedrals, mol->nimpropers, mol->npiatoms, mol->npibonds);
+ "Number of impropers = %d\n",
+ mol->nbonds, mol->nangles, mol->ndihedrals, mol->nimpropers);
t1 = t2 = t3 = 0;
for (i = 0; i < mol->natoms; i++) {
if (arena->par != NULL)
ParameterRelease(arena->par);
arena->par = ParameterNew();
+
+#if PIATOM
if (arena->pi_pars != NULL)
free(arena->pi_pars);
if (arena->mol->npibonds > 0)
arena->pi_pars = (UnionPar *)malloc(sizeof(UnionPar) * arena->mol->npibonds);
else arena->pi_pars = NULL;
-
+#endif
+
arena->nmissing = arena->nsuspicious = 0;
s_find_vdw_parameters(arena);
s_find_bond_parameters(arena);
s_find_angle_parameters(arena);
s_find_dihedral_parameters(arena);
s_find_improper_parameters(arena);
+#if PIATOM
s_find_pibond_parameters(arena);
+#endif
if (arena->nmissing > 0) {
/* for (i = 0; i < nmissing; i++) {
memmove(mol->impropers, xmol->impropers, sizeof(Int) * 4 * xmol->nimpropers);
NewArray(&mol->syms, &mol->nsyms, sizeof(Transform), xmol->nsyms);
memmove(mol->syms, xmol->syms, sizeof(Transform) * xmol->nsyms);
+#if PIATOM
NewArray(&mol->piatoms, &mol->npiatoms, sizeof(PiAtom), xmol->npiatoms);
for (i = 0; i < xmol->npiatoms; i++) {
PiAtomDuplicate(mol->piatoms + i, xmol->piatoms + i);
}
NewArray(&mol->pibonds, &mol->npibonds, sizeof(Int) * 4, xmol->npibonds);
memmove(mol->pibonds, xmol->pibonds, sizeof(Int) * 4 * xmol->npibonds);
+#endif
if (xmol->cell != NULL) {
mol->cell = (XtalCell *)malloc(sizeof(XtalCell));
memmove(mol->cell, xmol->cell, sizeof(XtalCell));
AtomConnectResize(ac, ac->count - 1);
}
+#if PIATOM
void
PiAtomDuplicate(PiAtom *pa, const PiAtom *cpa)
{
pa->coeffs = NULL;
}
}
+#endif
#pragma mark ====== Accessor types ======
NewArray(&(mp2->syms), &(mp2->nsyms), sizeof(Transform), mp->nsyms);
memmove(mp2->syms, mp->syms, sizeof(Transform) * mp2->nsyms);
}
+#if PIATOM
if (mp->npiatoms > 0) {
NewArray(&(mp2->piatoms), &(mp2->npiatoms), sizeof(PiAtom), mp->npiatoms);
for (i = 0; i < mp->npiatoms; i++)
NewArray(&(mp2->piconnects), &(mp2->npiconnects), sizeof(Int), mp->npiconnects);
memmove(mp2->piconnects, mp->piconnects, sizeof(Int) * mp->npiconnects);
}
+#endif
/* mp2->useFlexibleCell = mp->useFlexibleCell; */
if (mp->nframe_cells > 0) {
mp->syms = NULL;
mp->nsyms = 0;
}
+#if PIATOM
if (mp->piatoms != NULL) {
for (i = 0; i < mp->npiatoms; i++) {
PiAtomClean(mp->piatoms + i);
mp->piconnects = NULL;
mp->npiconnects = 0;
}
+#endif
if (mp->selection != NULL) {
IntGroupRelease(mp->selection);
mp->selection = NULL;
}
}
continue;
+#if PIATOM
} else if (strcmp(buf, "!:pi_atoms") == 0) {
PiAtom *pp;
while (ReadLine(buf, sizeof buf, fp, &lineNumber) > 0) {
pi_atom_constructs_bad_format:
snprintf(errbuf, errbufsize, "line %d: bad format in pi_atom_constructs", lineNumber);
goto exit;
+#endif /* PIATOM */
} else if (strcmp(buf, "!:anisotropic_thermal_parameters") == 0) {
i = 0;
while (ReadLine(buf, sizeof buf, fp, &lineNumber) > 0) {
fprintf(fp, "\n");
}
+#if PIATOM
if (mp->npiatoms > 0) {
PiAtom *pp;
fprintf(fp, "!:pi_atoms\n");
}
fprintf(fp, "\n");
}
-
+#endif /* PIATOM */
+
if (n_aniso > 0) {
fprintf(fp, "!:anisotropic_thermal_parameters\n");
fprintf(fp, "! b11 b22 b33 b12 b13 b23 [sigma; sb11 sb22 sb33 sb12 sb13 sb23]\n");
n = len / sizeof(Transform);
NewArray(&mp->syms, &mp->nsyms, sizeof(Transform), n);
memmove(mp->syms, ptr, len);
+#if PIATOM
} else if (strcmp(data, "PIATOM") == 0) {
const char *ptr2 = ptr + len;
mp->piatoms = NULL;
n = len / (sizeof(Int) * 4);
NewArray(&mp->pibonds, &mp->npibonds, sizeof(Int) * 4, n);
memmove(mp->pibonds, ptr, len);
+#endif /* PIATOM */
} else if (strcmp(data, "TIME") == 0) {
if (timep != NULL)
*timep = *((Int *)ptr);
len_all += len;
}
+#if PIATOM
/* Pi-atoms */
if (mp->npiatoms > 0) {
/* Estimate the necessary storage first */
memmove(p, mp->pibonds, sizeof(Int) * 4 * mp->npibonds);
len_all += len;
}
-
+#endif /* PIATOM */
+
/* Parameters */
if (mp->par != NULL) {
int type;
return -2;
/* Create atoms, with avoiding duplicates */
+#if PIATOM
MoleculeInvalidatePiConnectionTable(mp);
+#endif
n0 = n1 = mp->natoms;
table = (int *)malloc(sizeof(int) * n0);
if (table == NULL)
if (mp->impropers[i] >= pos)
mp->impropers[i]++;
}
+#if PIATOM
MoleculeInvalidatePiConnectionTable(mp);
+#endif
}
mp->nframes = -1; /* Should be recalculated later */
MoleculeIncrementModifyCount(mp);
act = NULL;
__MoleculeLock(dst);
+#if PIATOM
MoleculeInvalidatePiConnectionTable(dst);
+#endif
nsrc = src->natoms;
ndst = dst->natoms;
if (resSeqOffset < 0)
}
}
+#if PIATOM
/* Renumber the existing pi-atoms */
if (dst->npiatoms > 0) {
for (i = 0; i < dst->npiatoms; i++) {
}
}
}
-
+#endif /* PIATOM */
+
MoleculeCleanUpResidueTable(dst);
free(new2old);
return 1; /* Bad parameter */
__MoleculeLock(src);
+#if PIATOM
MoleculeInvalidatePiConnectionTable(src);
+#endif
if (nactions != NULL)
*nactions = 0;
}
}
}
-
+
+#if PIATOM
/* Copy the pi-atoms */
if (src->npiatoms > 0) {
PiAtom *pp1, *pp2;
free(patoms_old2new);
}
+#endif /* PIATOM */
/* Clean up */
IntGroupRelease(remain_g);
}
int
-MoleculeAddBonds(Molecule *mp, Int nbonds, const Int *bonds)
+MoleculeAddBonds(Molecule *mp, Int nbonds, const Int *bonds, IntGroup *where, Int autoGenerate)
{
int i, j, n1, n2, n;
Atom *ap;
if (mp->noModifyTopology)
return -4; /* Prohibited operation */
- /* Check the bonds */
- bonds_tmp = (Int *)malloc(sizeof(Int) * nbonds * 2);
- if (bonds_tmp == NULL)
+ /* Note: Duplicates and validity are not checked (the caller must do that) */
+
+ __MoleculeLock(mp);
+
+ n1 = mp->nbonds;
+ if (AssignArray(&(mp->bonds), &(mp->nbonds), sizeof(Int) * 2, n1 + nbonds - 1, NULL) == NULL
+ || sInsertElementsToArrayAtPositions(mp->bonds, n1, bonds, nbonds, sizeof(Int) * 2, where) != 0) {
+ __MoleculeUnlock(mp);
return -4; /* Out of memory */
- n = 0;
- for (i = 0; i < nbonds; i++) {
- n1 = bonds[i * 2];
- n2 = bonds[i * 2 + 1];
- if (n1 < 0 || n1 >= mp->natoms || n2 < 0 || n2 >= mp->natoms)
- return -1; /* Bad bond specification */
- if (n1 == n2)
- return -5;
- ap = ATOM_AT_INDEX(mp->atoms, n1);
- /* Check duplicates */
- cp = AtomConnectData(&ap->connect);
- for (j = 0; j < ap->connect.count; j++) {
- if (cp[j] == n2)
- break;
- }
- if (j == ap->connect.count) {
- bonds_tmp[n * 2] = n1;
- bonds_tmp[n * 2 + 1] = n2;
- n++;
- }
- }
- if (n == 0) {
- /* No bonds to add */
- free(bonds_tmp);
- return 0;
}
- __MoleculeLock(mp);
-
/* Add connects[] */
for (i = 0; i < n; i++) {
n1 = bonds_tmp[i * 2];
AtomConnectInsertEntry(&ap->connect, ap->connect.count, n1);
}
- /* Expand the array and insert */
- n1 = mp->nbonds;
-/* if (AssignArray(&(mp->bonds), &(mp->nbonds), sizeof(Int) * 2, mp->nbonds + nb - 1, NULL) == NULL
- || sInsertElementsToArrayAtPositions(mp->bonds, n1, bonds, nb, sizeof(Int) * 2, where) != 0) */
- if (AssignArray(&(mp->bonds), &(mp->nbonds), sizeof(Int) * 2, mp->nbonds + n - 1, NULL) == NULL)
- goto panic;
- memmove(mp->bonds + n1 * 2, bonds_tmp, sizeof(Int) * 2 * n);
-
/* Add angles, dihedrals, impropers */
- {
- Int nangles, ndihedrals, nimpropers;
- Int *angles, *dihedrals, *impropers;
- Int k, n3, n4;
+ if (autoGenerate) {
+ Int nangles, ndihedrals;
+ Int *angles, *dihedrals;
+ Int k, n3, n4, c1, c2;
Int *ip, *cp1, *cp2;
Int temp[4];
- Atom *ap1, *ap2;
+ Atom *ap1, *ap2, *ap3;
- angles = dihedrals = impropers = NULL;
- nangles = ndihedrals = nimpropers = 0;
+ angles = dihedrals = NULL;
+ nangles = ndihedrals = 0;
for (i = 0; i < n; i++) {
+ AtomConnect *ac1, *ac2;
n1 = bonds_tmp[i * 2];
n2 = bonds_tmp[i * 2 + 1];
ap1 = ATOM_AT_INDEX(mp->atoms, n1);
ap2 = ATOM_AT_INDEX(mp->atoms, n2);
- cp1 = AtomConnectData(&ap1->connect);
- cp2 = AtomConnectData(&ap2->connect);
- /* Angles X-n1-n2 */
- for (j = 0; j < ap1->connect.count; j++) {
- n3 = cp1[j];
- if (n3 == n2)
- continue;
- temp[0] = n3;
- temp[1] = n1;
- temp[2] = n2;
- for (k = 0; k < nangles; k++) {
- ip = angles + k * 3;
- if (ip[1] == n1 && ((ip[0] == n3 && ip[2] == n2) || (ip[0] == n2 && ip[2] == n3)))
- break;
- }
- if (k == nangles) {
- if (AssignArray(&angles, &nangles, sizeof(Int) * 3, nangles, temp) == NULL)
- goto panic;
- }
- /* Dihedrals X-n1-n2-X */
- for (k = 0; k < ap2->connect.count; k++) {
- n4 = cp2[k];
- if (n4 == n1 || n4 == n3)
- continue;
- temp[3] = n4;
- if (AssignArray(&dihedrals, &ndihedrals, sizeof(Int) * 4, ndihedrals, temp) == NULL)
- goto panic;
+ if (ap1->anchor == NULL || ap2->anchor == NULL) {
+ /* N1-N2-{XY} or N2-N1-{XY} angles (X: connected atom, Y: constitute atom of pi-anchor) */
+ for (j = 0; j < 4; j++) {
+ switch (j) {
+ case 0: temp[0] = n1; temp[1] = n2; ac1 = &ap2->connect; break; /* N1-N2-X */
+ case 1: if (ap2->anchor == NULL) continue; else ac1 = &ap2->anchor->connect; break; /* N1-N2-Y */
+ case 2: temp[0] = n2; temp[1] = n1; ac1 = &ap1->connect; break; /* N2-N1-X */
+ case 3: if (ap1->anchor == NULL) continue; else ac1 = &ap1->anchor->connect; break; /* N2-N1-Y */
+ }
+ cp1 = AtomConnectData(ac1);
+ for (k = 0; k < ac1->count; k++) {
+ temp[2] = cp1[k];
+ if (temp[2] == temp[0])
+ continue;
+ if (AssignArray(&angles, &nangles, sizeof(Int) * 3, nangles, temp) == NULL)
+ goto panic;
+ /* Dihedrals N1-N2-X-X or N2-N1-X-X */
+ if (j == 1 || j == 3)
+ continue;
+ ap3 = ATOM_AT_INDEX(mp->atoms, temp[2]);
+ cp2 = AtomConnectData(&ap3->connect);
+ for (kk = 0; kk < ap3->connect.count; kk++) {
+ temp[3] = cp2[kk];
+ if (temp[3] == temp[0] || temp[3] == temp[1])
+ continue;
+ if (AssignArray(&dihedrals, &ndihedrals, sizeof(Int) * 4, ndihedrals, temp) == NULL)
+ goto panic;
+ }
+ }
}
- /* Impropers X-n2-n1-X */
- /* temp[1] = n2;
- temp[2] = n1;
- for (k = 0; k < ap1->connect.count; k++) {
- n4 = ap1->connects[k];
- if (n4 == n2 || n4 <= n3)
- continue;
- temp[3] = n4;
- if (AssignArray(&impropers, &nimpropers, sizeof(Int) * 4, nimpropers, temp) == NULL)
- goto panic;
- } */
}
- /* Angles X-n2-n1 */
- for (j = 0; j < ap2->connect.count; j++) {
- n3 = cp2[j];
- if (n3 == n1)
+ /* X-N1-N2-X angles */
+ if (ap1->anchor == NULL)
+ ac1 = &ap1->connect;
+ else ac1 = &ap1->anchor->connect;
+ if (ap2->anchor == NULL)
+ ac2 = &ap2->connect;
+ else ac2 = &ap2->anchor->connect;
+ temp[1] = n1;
+ temp[2] = n2;
+ cp1 = AtomConnectData(ac1);
+ cp2 = AtomConnectData(ac2);
+ for (j = 0; j < ac1->count; j++) {
+ temp[0] = cp1[j];
+ if (temp[0] == temp[2])
continue;
- temp[0] = n1;
- temp[1] = n2;
- temp[2] = n3;
- for (k = 0; k < nangles; k++) {
- ip = angles + k * 3;
- if (ip[1] == n2 && ((ip[0] == n3 && ip[2] == n1) || (ip[0] == n1 && ip[2] == n3)))
- break;
- }
- if (k == nangles) {
- if (AssignArray(&angles, &nangles, sizeof(Int) * 3, nangles, temp) == NULL)
+ if (ATOM_AT_INDEX(mp->atoms, temp[0])->anchor != NULL)
+ continue;
+ for (k = 0; k < ac2->count; k++) {
+ temp[3] = cp2[k];
+ if (temp[3] == temp[0] || temp[3] == temp[1])
+ continue;
+ if (ATOM_AT_INDEX(mp->atoms, temp[3])->anchor != NULL)
+ continue;
+ if (AssignArray(&dihedrals, &ndihedrals, sizeof(Int) * 4, ndihedrals, temp) == NULL)
goto panic;
}
}
}
- temp[0] = kInvalidIndex;
- if (AssignArray(&angles, &nangles, sizeof(Int) * 3, nangles, temp) == NULL)
- goto panic;
- if (AssignArray(&dihedrals, &ndihedrals, sizeof(Int) * 4, ndihedrals, temp) == NULL)
- goto panic;
- if (AssignArray(&impropers, &nimpropers, sizeof(Int) * 4, nimpropers, temp) == NULL)
- goto panic;
- MoleculeAddAngles(mp, angles, NULL);
- MoleculeAddDihedrals(mp, dihedrals, NULL);
- MoleculeAddImpropers(mp, impropers, NULL);
- if (angles != NULL)
+ temp[0] = kInvalidIndex; /* For termination */
+ if (angles != NULL) {
+ if (AssignArray(&angles, &nangles, sizeof(Int) * 3, nangles, temp) == NULL)
+ goto panic;
+ MoleculeAddAngles(mp, angles, NULL);
free(angles);
- if (dihedrals != NULL)
+ }
+ if (dihedrals != NULL) {
+ if (AssignArray(&dihedrals, &ndihedrals, sizeof(Int) * 4, ndihedrals, temp) == NULL)
+ goto panic;
+ MoleculeAddDihedrals(mp, dihedrals, NULL);
free(dihedrals);
- if (impropers != NULL)
- free(impropers);
+ }
}
MoleculeIncrementModifyCount(mp);
__MoleculeUnlock(mp);
Panic("Low memory while adding bonds");
return -1; /* Not reached */
+#endif
}
int
-MoleculeDeleteBonds(Molecule *mp, Int nbonds, const Int *bonds)
+MoleculeDeleteBonds(Molecule *mp, IntGroup *where, Int **outAutoRemoval, IntGroup **outWhere)
{
Int i, j, n1, n2, *cp;
Atom *ap;
angles = NULL;
for (i = 0, ap = mol->atoms; i < mol->natoms; i++, ap = ATOM_NEXT(ap)) {
Int *cp = AtomConnectData(&ap->connect);
+ if (ap->anchor != NULL)
+ continue;
for (j = 0; j < ap->connect.count; j++) {
Int j0 = cp[j];
+ if (ATOM_AT_INDEX(mol->atoms, j0)->anchor != NULL)
+ continue;
for (k = j + 1; k < ap->connect.count; k++) {
Int k0 = cp[k];
+ if (ATOM_AT_INDEX(mol->atoms, k0)->anchor != NULL)
+ continue;
if (MoleculeLookupAngle(mol, j0, i, k0) < 0) {
ip = (Int *)AssignArray(&angles, &nangles, sizeof(Int) * 3, nangles, NULL);
ip[0] = j0;
dihedrals = NULL;
for (n2 = 0, ap2 = mol->atoms; n2 < mol->natoms; n2++, ap2 = ATOM_NEXT(ap2)) {
Int i1, i3, i4, *ip;
+ if (ap2->anchor != NULL)
+ continue;
cp2 = AtomConnectData(&ap2->connect);
for (i3 = 0; i3 < ap2->connect.count; i3++) {
n3 = cp2[i3];
if (n2 > n3)
continue;
ap3 = ATOM_AT_INDEX(mol->atoms, n3);
+ if (ap3->anchor != NULL)
+ continue;
cp3 = AtomConnectData(&ap3->connect);
for (i1 = 0; i1 < ap2->connect.count; i1++) {
n1 = cp2[i1];
if (n1 == n3)
continue;
+ if (ATOM_AT_INDEX(mol->atoms, n1)->anchor != NULL)
+ continue;
for (i4 = 0; i4 < ap3->connect.count; i4++) {
n4 = cp3[i4];
if (n2 == n4 || n1 == n4)
continue;
+ if (ATOM_AT_INDEX(mol->atoms, n4)->anchor != NULL)
+ continue;
if (MoleculeLookupDihedral(mol, n1, n2, n3, n4) < 0) {
ip = (Int *)AssignArray(&dihedrals, &ndihedrals, sizeof(Int) * 4, ndihedrals, NULL);
ip[0] = n1;
free(old2new);
free(apArray);
+#if PIATOM
MoleculeInvalidatePiConnectionTable(mp);
-
+#endif
}
/* Renumber atoms */
}
}
+#if PIATOM
if (mp->npiatoms) {
/* Renumber the pi-atoms */
for (i = 0; i < mp->npiatoms; i++) {
mp->pibonds[i] = old2new[j];
}
}
-
+#endif /* PIATOM */
+
/* Renumber the atoms */
for (i = 0; i < mp->natoms; i++)
memmove(ATOM_AT_INDEX(mp->atoms, old2new[i]), ATOM_AT_INDEX(saveAtoms, i), gSizeOfAtomRecord);
retval = 0;
+#if PIATOM
MoleculeInvalidatePiConnectionTable(mp);
-
+#endif
MoleculeIncrementModifyCount(mp);
mp->needsMDRebuild = 1;
continue;
sMoleculeFragmentSub(mp, idx2, result, exatoms);
}
+#if PIATOM
if (mp->piconnects != NULL) {
for (i = mp->piconnects[idx]; i < mp->piconnects[idx + 1]; i++) {
idx2 = mp->piconnects[i];
sMoleculeFragmentSub(mp, idx2, result, exatoms);
}
}
+#endif
}
/* The molecular fragment (= interconnected atoms) containing the atom n1 and
if (mp == NULL || mp->natoms == 0 || n1 < 0 || n1 >= mp->natoms)
return NULL;
result = IntGroupNew();
+#if PIATOM
MoleculeValidatePiConnectionTable(mp);
+#endif
sMoleculeFragmentSub(mp, n1, result, exatoms);
return result;
}
for (i = 0; i < argc; i++)
IntGroupAdd(exatoms, argv[i], 1);
result = IntGroupNew();
+#if PIATOM
MoleculeValidatePiConnectionTable(mp);
+#endif
sMoleculeFragmentSub(mp, n1, result, exatoms);
IntGroupRelease(exatoms);
return result;
return NULL;
IntGroupIteratorInit(inatoms, &iter);
result = IntGroupNew();
+#if PIATOM
MoleculeValidatePiConnectionTable(mp);
+#endif
while ((i = IntGroupIteratorNext(&iter)) >= 0) {
sMoleculeFragmentSub(mp, i, result, exatoms);
}
Atom *ap;
if (mp == NULL || mp->natoms == 0 || group == NULL)
return 0; /* Invalid arguments */
+#if PIATOM
MoleculeValidatePiConnectionTable(mp);
+#endif
bond_count = 0;
for (i = 0; (i1 = IntGroupGetStartPoint(group, i)) >= 0; i++) {
i2 = IntGroupGetEndPoint(group, i);
return 0; /* Too many bonds */
}
}
+#if PIATOM
if (mp->piconnects != NULL) {
for (k = mp->piconnects[j]; k < mp->piconnects[j + 1]; k++) {
k2 = mp->piconnects[k];
}
}
}
+#endif
}
}
if (bond_count == 1) {
#pragma mark ====== Pi Atoms ======
+#if PIATOM
int
MoleculeCalculatePiAtomPosition(Molecule *mol, int idx)
{
}
mol->npiconnects = 0;
}
+#endif /* PIATOM */
#pragma mark ====== MO calculation ======