Exemplo n.º 1
0
def test_distances_mapped_atom_idx(ortho_conventional):
    distances = Distances(ortho_conventional, center_coord=[0.0, 0.0, 0.49])
    assert distances.atom_idx_at_center(specie="He") == 4
    distances = Distances(ortho_conventional, center_coord=[0.251, 0.25, 0.25])
    assert distances.atom_idx_at_center(specie="H") is None

    distances = Distances(ortho_conventional, center_coord=[0.0, 0.0, 0.5])
    assert distances.atom_idx_at_center(specie="Li") == None
Exemplo n.º 2
0
 def make_d_to_p(self):
     result = []
     for site in self._defect_structure:
         distances = Distances(self._perfect_structure, site.frac_coords,
                               self.same_distance_criterion)
         result.append(distances.atom_idx_at_center(specie=site.specie))
     return result
Exemplo n.º 3
0
 def _atom_projection(self, structure_from, structure_to, specie=True):
     result = []
     for site in structure_from:
         distances = Distances(structure_to, site.frac_coords,
                               self.dist_tol)
         specie = site.specie if specie else None
         result.append(distances.atom_idx_at_center(specie=specie))
     return result
Exemplo n.º 4
0
 def make_p_to_d(self):
     result = []
     for site in self._perfect_structure:
         distances = Distances(self._defective_structure, site.frac_coords)
         result.append(distances.atom_idx_at_center(specie=site.specie))
     return result