/** * Create a benzene molecule with 2 residues and 2 charge groups * * @return */ public MDMolecule makeMDBenzene() { MDMolecule mol = new MDMolecule(); mol.addAtom(new Atom("C")); // 0 mol.addAtom(new Atom("C")); // 1 mol.addAtom(new Atom("C")); // 2 mol.addAtom(new Atom("C")); // 3 mol.addAtom(new Atom("C")); // 4 mol.addAtom(new Atom("C")); // 5 mol.addBond(0, 1, IBond.Order.SINGLE); // 1 mol.addBond(1, 2, IBond.Order.DOUBLE); // 2 mol.addBond(2, 3, IBond.Order.SINGLE); // 3 mol.addBond(3, 4, IBond.Order.DOUBLE); // 4 mol.addBond(4, 5, IBond.Order.SINGLE); // 5 mol.addBond(5, 0, IBond.Order.DOUBLE); // 6 // Create 2 residues AtomContainer ac = new AtomContainer(); ac.addAtom(mol.getAtom(0)); ac.addAtom(mol.getAtom(1)); ac.addAtom(mol.getAtom(2)); Residue res1 = new Residue(ac, 0, mol); res1.setName("myResidue1"); mol.addResidue(res1); AtomContainer ac2 = new AtomContainer(); ac2.addAtom(mol.getAtom(3)); ac2.addAtom(mol.getAtom(4)); ac2.addAtom(mol.getAtom(5)); Residue res2 = new Residue(ac2, 1, mol); res2.setName("myResidue2"); mol.addResidue(res2); // Create 2 chargegroups AtomContainer ac3 = new AtomContainer(); ac3.addAtom(mol.getAtom(0)); ac3.addAtom(mol.getAtom(1)); ChargeGroup chg1 = new ChargeGroup(ac3, 2, mol); chg1.setSwitchingAtom(mol.getAtom(1)); mol.addChargeGroup(chg1); AtomContainer ac4 = new AtomContainer(); ac4.addAtom(mol.getAtom(2)); ac4.addAtom(mol.getAtom(3)); ac4.addAtom(mol.getAtom(4)); ac4.addAtom(mol.getAtom(5)); ChargeGroup chg2 = new ChargeGroup(ac4, 3, mol); chg2.setSwitchingAtom(mol.getAtom(4)); mol.addChargeGroup(chg2); return mol; }