コード例 #1
0
    def generate_connections(self):
        try:
            self.atom_labels, self.bonds
        except AttributeError:
            raise Exception("Simulation has not been assigned atom types and bonds yet")

        connect = Connector()
        self.bond_types = connect.find_bond_types(self.atom_labels, self.bonds)
        self.bond_labels = connect.bond_labels(
            self.atom_labels, self.bonds, self.bond_types
        )

        self.bond_graph = self.generate_bond_graph(self.bonds)

        self.angles = connect.angles(self.bonds, self.bond_graph)
        self.angle_types = connect.find_angle_types(self.atom_labels, self.angles)
        self.angle_labels = connect.angle_labels(
            self.atom_labels, self.angles, self.angle_types
        )

        self.dihedrals = connect.dihedrals(self.bonds, self.bond_graph)
        self.dihedral_types = connect.find_dihedral_types(
            self.atom_labels, self.dihedrals
        )
        self.dihedral_labels = connect.dihedral_labels(
            self.atom_labels, self.dihedrals, self.dihedral_types
        )

        self.impropers = connect.impropers(self.bonds, self.bond_graph)
        self.improper_types = connect.find_improper_types(
            self.atom_labels, self.impropers
        )
        self.improper_labels = connect.improper_labels(
            self.atom_labels, self.impropers, self.improper_types
        )
コード例 #2
0
    def generate_connections(self):
        connect = Connector()
        bond_types, angle_types, torsion_types, improper_types = self.molecule.connection_types()
        self.bonds = self.molecule.assign_bonds(self.lattice_dimensions)
        self.bond_labels = connect.bond_labels(self.atom_labels, self.bonds, bond_types)

        self.angles = connect.angles(self.bonds)
        self.angle_labels = connect.angle_labels(self.atom_labels, self.angles, angle_types)

        self.torsions = connect.torsions(self.bonds)
        self.torsion_labels = connect.torsion_labels(self.atom_labels, self.torsions, torsion_types)

        self.impropers = connect.impropers(self.bonds)
        self.improper_labels = connect.improper_labels(self.atom_labels, self.impropers, improper_types)
コード例 #3
0
                         [11, 16], [13, 14], [15, 14], [15, 17], [12, 18],
                         [18, 19], [19, 20], [19, 21], [19, 22], [18, 23],
                         [23, 24], [23, 25], [23, 26], [18, 1], [5, 27],
                         [27, 28], [28, 29], [28, 30], [28, 31], [29, 32],
                         [29, 33], [29, 34], [33, 32], [32, 35], [32, 36],
                         [14, 37], [38, 12], [38, 13], [13, 39], [38, 40],
                         [37, 41], [41, 42], [41, 43], [41, 44], [42, 45],
                         [42, 46], [42, 47], [45, 46], [45, 48], [45, 49]]))

from connector import Connector
from write_coords import Writer
from params import Parameterise

connect = Connector()
epoxy.bond_types = connect.find_bond_types(epoxy.atom_labels, epoxy.bonds)
epoxy.bond_labels = connect.bond_labels(epoxy.atom_labels, epoxy.bonds,
                                        epoxy.bond_types)

epoxy.angles = connect.angles(epoxy.bonds)
epoxy.angle_types = connect.find_angle_types(epoxy.atom_labels, epoxy.angles)
epoxy.angle_labels = connect.angle_labels(epoxy.atom_labels, epoxy.angles,
                                          epoxy.angle_types)
epoxy.torsions = connect.torsions(epoxy.bonds)
epoxy.torsion_types = connect.find_torsion_types(epoxy.atom_labels,
                                                 epoxy.torsions)
epoxy.torsion_labels = connect.torsion_labels(epoxy.atom_labels,
                                              epoxy.torsions,
                                              epoxy.torsion_types)
epoxy.impropers = connect.impropers(epoxy.bonds)
epoxy.improper_types = connect.find_improper_types(epoxy.atom_labels,
                                                   epoxy.impropers)
epoxy.improper_labels = connect.improper_labels(epoxy.atom_labels,
コード例 #4
0
diamine.molecule_labels = [1] * len(diamine.coords)

diamine.bonds = np.array(([[1, 2], [2, 3], [3, 4], [3, 5], [3, 6], [2, 7],
                           [2, 8], [7, 9], [7, 10], [7, 11], [9, 12], [12, 13],
                           [12, 14], [12, 15], [13, 16], [16, 17], [16, 18],
                           [16, 19], [13, 20], [13, 21], [1, 22], [1, 23],
                           [20, 24], [20, 25]]))

from connector import Connector
from write_coords import Writer
from params import Parameterise

connect = Connector()
diamine.bond_types = connect.find_bond_types(diamine.atom_labels,
                                             diamine.bonds)
diamine.bond_labels = connect.bond_labels(diamine.atom_labels, diamine.bonds,
                                          diamine.bond_types)

diamine.angles = connect.angles(diamine.bonds)
diamine.angle_types = connect.find_angle_types(diamine.atom_labels,
                                               diamine.angles)
diamine.angle_labels = connect.angle_labels(diamine.atom_labels,
                                            diamine.angles,
                                            diamine.angle_types)
diamine.torsions = connect.torsions(diamine.bonds)
diamine.torsion_types = connect.find_torsion_types(diamine.atom_labels,
                                                   diamine.torsions)
diamine.torsion_labels = connect.torsion_labels(diamine.atom_labels,
                                                diamine.torsions,
                                                diamine.torsion_types)
diamine.impropers = connect.impropers(diamine.bonds)
diamine.improper_types = connect.find_improper_types(diamine.atom_labels,
コード例 #5
0
propanol.vdw_defs = {1: 80, 2: 100, 3: 85, 4: 96, 5: 97}
#propanol.vdw_defs = {80:80, 100:100, 89:89, 96:96, 97:97}

propanol.molecule_labels = [1] * len(propanol.coords)

propanol.bonds = np.array(([[1, 2], [1, 3], [1, 4], [2, 5], [5, 6], [5, 7],
                            [2, 8], [2, 9], [8, 10], [1, 11], [5, 12]]))

from connector import Connector
from write_coords import Writer
from params import Parameterise

connect = Connector()
propanol.bond_types = connect.find_bond_types(propanol.atom_labels,
                                              propanol.bonds)
propanol.bond_labels = connect.bond_labels(propanol.atom_labels,
                                           propanol.bonds, propanol.bond_types)

propanol.angles = connect.angles(propanol.bonds)
propanol.angle_types = connect.find_angle_types(propanol.atom_labels,
                                                propanol.angles)
propanol.angle_labels = connect.angle_labels(propanol.atom_labels,
                                             propanol.angles,
                                             propanol.angle_types)
propanol.torsions = connect.torsions(propanol.bonds)
propanol.torsion_types = connect.find_torsion_types(propanol.atom_labels,
                                                    propanol.torsions)
propanol.torsion_labels = connect.torsion_labels(propanol.atom_labels,
                                                 propanol.torsions,
                                                 propanol.torsion_types)
propanol.impropers = connect.impropers(propanol.bonds)
propanol.improper_types = connect.find_improper_types(propanol.atom_labels,
コード例 #6
0
[13,30],
[29,31],
[27,33],
[28,32]]))





from connector import Connector
from write_coords import Writer
from params import Parameterise

connect = Connector()
bp.bond_types = connect.find_bond_types(bp.atom_labels,bp.bonds)
bp.bond_labels = connect.bond_labels(bp.atom_labels,bp.bonds,bp.bond_types)

bp.angles = connect.angles(bp.bonds)
bp.angle_types = connect.find_angle_types(bp.atom_labels,
                                           bp.angles)
bp.angle_labels = connect.angle_labels(bp.atom_labels,bp.angles,
                                        bp.angle_types)
bp.torsions = connect.torsions(bp.bonds)
bp.torsion_types = connect.find_torsion_types(bp.atom_labels,
                                           bp.torsions)
bp.torsion_labels = connect.torsion_labels(bp.atom_labels,bp.torsions,
                                        bp.torsion_types)
bp.impropers = connect.impropers(bp.bonds)
bp.improper_types = connect.find_improper_types(bp.atom_labels,
                                           bp.impropers)
bp.improper_labels = connect.improper_labels(bp.atom_labels,bp.impropers,