Skip to content

Commit

Permalink
add character angle
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Jun 26, 2024
1 parent 056697e commit 3e7676e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions atomrdf/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1973,10 +1973,13 @@ def add_dislocation(self, disl_dict):
angle_deg = disl_dict['DislocationCharacter']
if (np.abs(angle_deg-0) < 1E-3) or (np.abs(angle_deg-180) < 1E-3) or (np.abs(angle_deg-360) < 1E-3):
disl_type = LDO.ScrewDislocation
disl_name = "ScrewDislocation"
elif (np.abs(angle_deg-90) < 1E-3) or (np.abs(angle_deg-270) < 1E-3):
disl_type = LDO.EdgeDislocation
disl_name = "EdgeDislocation"
else:
disl_type = LDO.MixedDislocation
disl_name = "MixedDislocation"

line_defect = self.graph.create_node(f"{self._name}_Dislocation", disl_type)
self.graph.add((self.material, CMSO.hasDefect, line_defect))
Expand All @@ -1993,6 +1996,8 @@ def add_dislocation(self, disl_dict):
self.graph.add((burgers_vector, CMSO.hasComponent_z, Literal(disl_dict['BurgersVector'][2], datatype=XSD.float)))
self.graph.add((line_defect, LDO.hasBurgersVector, burgers_vector))

self.graph.add((line_defect, LDO.hasCharacterAngle, Literal(angle_deg, datatype=XSD.float)))

slip_direction = self.graph.create_node(f"{self._name}_DislocationSlipDirection", LDO.SlipDirection)
self.graph.add((slip_direction, CMSO.hasComponent_x, Literal(disl_dict['SlipDirection'][0], datatype=XSD.float)))
self.graph.add((slip_direction, CMSO.hasComponent_y, Literal(disl_dict['SlipDirection'][1], datatype=XSD.float)))
Expand Down

0 comments on commit 3e7676e

Please sign in to comment.