def wrap_cc(cell1, pts): """ Function finds the indices of atoms making tetrahedrons Parameters ------------- cell1 : The simulation cell ( a 3*4 numpy array where the first 3 columns are the cell vectors and the last column is the box origin) pts : Position of atoms in initial cell, the atoms within an rCut of the initial cell. Returns ------------ pts1 : Position of atoms in initial cell, the atoms within an rCut of the initial cell, and the Voronoi coordinates as the new set of atoms. """ data = ovd.DataCollection() data.objects.append(cell1) particles = ovd.Particles() particles.create_property('Position', data=pts) data.objects.append(particles) # Create a new Pipeline with a StaticSource as data source: pipeline = Pipeline(source=StaticSource(data=data)) pipeline.modifiers.append(ovm.WrapPeriodicImagesModifier()) data1 = pipeline.compute() pts1 = np.array(data1.particle_properties['Position'][...]) return pts1
def ovito_dxa(atoms, replicate_z=3): from ovito.io.ase import ase_to_ovito from ovito.modifiers import ReplicateModifier, DislocationAnalysisModifier from ovito.pipeline import StaticSource, Pipeline data = ase_to_ovito(atoms) pipeline = Pipeline(source=StaticSource(data=data)) pipeline.modifiers.append(ReplicateModifier(num_z=replicate_z)) dxa = DislocationAnalysisModifier( input_crystal_structure=DislocationAnalysisModifier.Lattice.BCC) pipeline.modifiers.append(dxa) data = pipeline.compute() return (np.array(data.dislocations.segments[0].true_burgers_vector), data.dislocations.segments[0].length / replicate_z, data.dislocations.segments[0])
# pass #else: # atoms = atoms*(2, 2, 2) data = ase_to_ovito(atoms) node = Pipeline(source=StaticSource(data=data)) node.modifiers.append(modifier) #node.modifiers.append(CommonNeighborAnalysisModifier(mode=CommonNeighborAnalysisModifier.Mode.FixedCutoff)) # node.modifiers.append(CommonNeighborAnalysisModifier(mode=CommonNeighborAnalysisModifier.Mode.AdaptiveCutoff)) #node.modifiers.append(AcklandJonesModifier()) # node.modifiers.append(BondAngleAnalysisModifier()) # node.modifiers.append(PolyhedralTemplateMatchingModifier(rmsd_cutoff=0.0)) # Let OVITO's data pipeline do the heavy work. node.compute() # A two-dimensional array containing the three CNA indices # computed for each bond in the system. atom_classes = list(node.output.particle_properties['Structure Type'].array) #AcklandJonesModifier.Type.OTHER(0) #AcklandJonesModifier.Type.FCC(1) #AcklandJonesModifier.Type.HCP(2) #AcklandJonesModifier.Type.BCC(3) #AcklandJonesModifier.Type.ICO(4) # CommonNeighborAnalysisModifier.Type.OTHER(0) # CommonNeighborAnalysisModifier.Type.FCC(1) # CommonNeighborAnalysisModifier.Type.HCP(2)