def test_run_molecule(): ff = vermouth.forcefield.ForceField(name='test_ff') meta_mol = MetaMolecule(name="test", force_field=ff) meta_mol.add_monomer(0, "PEO", []) meta_mol.add_monomer(1, "PEO", [(1, 0)]) meta_mol.add_monomer(2, "PEO", [(1, 2)]) meta_mol.volumes = {} meta_mol.volumes["PEO"] = 0.5 RandomWalk().run_molecule(meta_mol) for node in meta_mol.nodes: assert "position" in meta_mol.nodes[node]
def test_update_positions(): ff = vermouth.forcefield.ForceField(name='test_ff') meta_mol = MetaMolecule(name="test", force_field=ff) meta_mol.add_monomer(0, "PEO", []) meta_mol.add_monomer(1, "PEO", [(1, 0)]) meta_mol.add_monomer(2, "PEO", [(1, 2)]) meta_mol.nodes[0]["position"] = np.array([0, 0, 0]) meta_mol.nodes[1]["position"] = np.array([0, 0, 0.5]) meta_mol.volumes = {} meta_mol.volumes["PEO"] = 0.5 vectors = polyply.src.linalg_functions.norm_sphere(50) update_positions(vectors, meta_mol, 2, 1) assert "position" in meta_mol.nodes[2]