Search in sources :

Example 1 with MSGroup

use of ffx.potential.bonded.MSGroup in project ffx by mjschnie.

the class MolecularAssembly method setColor.

/**
 * {@inheritDoc}
 */
@Override
public void setColor(RendererCache.ColorModel newColorModel, Color3f color, Material mat) {
    for (ListIterator<MSNode> li = getAtomNodeList().listIterator(); li.hasNext(); ) {
        MSGroup group = (MSGroup) li.next();
        group.setColor(newColorModel, color, mat);
    }
    for (MSNode m : molecules.getChildList()) {
        m.setColor(newColorModel, color, mat);
    }
    for (MSNode m : water.getChildList()) {
        m.setColor(newColorModel, color, mat);
    }
    for (MSNode m : ions.getChildList()) {
        m.setColor(newColorModel, color, mat);
    }
}
Also used : MSNode(ffx.potential.bonded.MSNode) MSGroup(ffx.potential.bonded.MSGroup)

Example 2 with MSGroup

use of ffx.potential.bonded.MSGroup in project ffx by mjschnie.

the class BiojavaFilter method numberAtoms.

/**
 * <p>
 * numberAtoms</p>
 */
public void numberAtoms() {
    int index = 1;
    for (Atom a : activeMolecularAssembly.getAtomArray()) {
        a.setXyzIndex(index++);
    }
    index--;
    if (logger.isLoggable(Level.INFO)) {
        logger.info(String.format(" Total number of atoms: %d\n", index));
    }
    Polymer[] polymers = activeMolecularAssembly.getChains();
    if (polymers != null) {
        for (Polymer p : polymers) {
            List<Residue> residues = p.getResidues();
            for (Residue r : residues) {
                r.reOrderAtoms();
            }
        }
    }
    List<Molecule> molecules = activeMolecularAssembly.getMolecules();
    for (Molecule n : molecules) {
        n.reOrderAtoms();
    }
    List<MSNode> waters = activeMolecularAssembly.getWaters();
    for (MSNode n : waters) {
        MSGroup m = (MSGroup) n;
        m.reOrderAtoms();
    }
    List<MSNode> ions = activeMolecularAssembly.getIons();
    for (MSNode n : ions) {
        MSGroup m = (MSGroup) n;
        m.reOrderAtoms();
    }
}
Also used : Molecule(ffx.potential.bonded.Molecule) MSNode(ffx.potential.bonded.MSNode) Residue(ffx.potential.bonded.Residue) Polymer(ffx.potential.bonded.Polymer) MSGroup(ffx.potential.bonded.MSGroup) Atom(ffx.potential.bonded.Atom)

Example 3 with MSGroup

use of ffx.potential.bonded.MSGroup in project ffx by mjschnie.

the class MolecularAssembly method finalize.

/**
 * {@inheritDoc}
 */
@Override
public void finalize(boolean finalizeGroups, ForceField forceField) {
    setFinalized(false);
    if (finalizeGroups) {
        bondTime = 0;
        angleTime = 0;
        stretchBendTime = 0;
        ureyBradleyTime = 0;
        outOfPlaneBendTime = 0;
        torsionTime = 0;
        piOrbitalTorsionTime = 0;
        torsionTorsionTime = 0;
        ArrayList<MSNode> Polymers = getAtomNodeList();
        for (ListIterator<MSNode> li = Polymers.listIterator(); li.hasNext(); ) {
            MSGroup group = (MSGroup) li.next();
            if (logger.isLoggable(Level.FINE)) {
                logger.fine(" Finalizing bonded terms for polymer " + group.toString());
            }
            try {
                group.finalize(true, forceField);
            } catch (Exception e) {
                String message = "Fatal exception finalizing " + group.toString();
                logger.log(Level.SEVERE, message, e);
                System.exit(-1);
            }
            if (logger.isLoggable(Level.FINE)) {
                Runtime runtime = Runtime.getRuntime();
                long occupiedMemory = runtime.totalMemory() - runtime.freeMemory();
                long MB = 1024 * 1024;
                logger.fine("\n In-Use Memory   (Mb): " + occupiedMemory / MB + "\n Free Memory     (Mb): " + runtime.freeMemory() / MB + "\n Total Memory    (Mb): " + runtime.totalMemory() / MB);
            }
        }
        for (MSNode m : molecules.getChildList()) {
            Molecule molecule = (Molecule) m;
            molecule.finalize(true, forceField);
        }
        for (MSNode m : water.getChildList()) {
            Molecule molecule = (Molecule) m;
            molecule.finalize(true, forceField);
        }
        for (MSNode m : ions.getChildList()) {
            Molecule molecule = (Molecule) m;
            molecule.finalize(true, forceField);
        }
        if (logger.isLoggable(Level.FINE)) {
            StringBuilder sb = new StringBuilder("\n Time to create bonded energy terms\n\n");
            sb.append(String.format(" Bond Streching     %10.3f\n", bondTime * 1.0e-9));
            sb.append(String.format(" Angle Bending      %10.3f\n", angleTime * 1.0e-9));
            sb.append(String.format(" Stretch-Bend       %10.3f\n", stretchBendTime * 1.0e-9));
            sb.append(String.format(" Urey-Bradley       %10.3f\n", ureyBradleyTime * 1.0e-9));
            sb.append(String.format(" Out-of-Plane Bend  %10.3f\n", outOfPlaneBendTime * 1.0e-9));
            sb.append(String.format(" Torsionanl Angle   %10.3f\n", torsionTime * 1.0e-9));
            sb.append(String.format(" Pi-Orbital Torsion %10.3f\n", piOrbitalTorsionTime * 1.0e-9));
            sb.append(String.format(" Torsion-Torsion    %10.3f\n", torsionTorsionTime * 1.0e-9));
            logger.fine(sb.toString());
        }
    }
    if (!java.awt.GraphicsEnvironment.isHeadless()) {
        createScene(!finalizeGroups);
        center();
    }
    removeLeaves();
    setFinalized(true);
}
Also used : Molecule(ffx.potential.bonded.Molecule) MSNode(ffx.potential.bonded.MSNode) MSGroup(ffx.potential.bonded.MSGroup)

Example 4 with MSGroup

use of ffx.potential.bonded.MSGroup in project ffx by mjschnie.

the class PDBFilter method numberAtoms.

/**
 * <p>
 * numberAtoms</p>
 */
private void numberAtoms() {
    int index = 1;
    for (Atom a : activeMolecularAssembly.getAtomArray()) {
        a.setXyzIndex(index++);
    }
    index--;
    if (logger.isLoggable(Level.INFO)) {
        logger.info(String.format(" Total number of atoms: %d\n", index));
    }
    Polymer[] polymers = activeMolecularAssembly.getChains();
    if (polymers != null) {
        for (Polymer p : polymers) {
            List<Residue> residues = p.getResidues();
            for (Residue r : residues) {
                r.reOrderAtoms();
            }
        }
    }
    List<Molecule> molecules = activeMolecularAssembly.getMolecules();
    for (Molecule n : molecules) {
        n.reOrderAtoms();
    }
    List<MSNode> waters = activeMolecularAssembly.getWaters();
    for (MSNode n : waters) {
        MSGroup m = (MSGroup) n;
        m.reOrderAtoms();
    }
    List<MSNode> ions = activeMolecularAssembly.getIons();
    for (MSNode n : ions) {
        MSGroup m = (MSGroup) n;
        m.reOrderAtoms();
    }
}
Also used : Molecule(ffx.potential.bonded.Molecule) MSNode(ffx.potential.bonded.MSNode) Residue(ffx.potential.bonded.Residue) Polymer(ffx.potential.bonded.Polymer) MSGroup(ffx.potential.bonded.MSGroup) Atom(ffx.potential.bonded.Atom)

Aggregations

MSGroup (ffx.potential.bonded.MSGroup)4 MSNode (ffx.potential.bonded.MSNode)4 Molecule (ffx.potential.bonded.Molecule)3 Atom (ffx.potential.bonded.Atom)2 Polymer (ffx.potential.bonded.Polymer)2 Residue (ffx.potential.bonded.Residue)2