Skip to content

Commit ecb79ad

Browse files
committed
Bugfix
1 parent 2de707b commit ecb79ad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/kanapy/api.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,9 @@ def generate_orientations(self, data, ang=None, omega=None, Nbase=5000,
360360
'"random" or "unimodal"')
361361
for i, igr in enumerate(self.mesh.grain_dict.keys()):
362362
if self.mesh.grain_phase_dict[igr] == ip:
363-
ind = i - ip * self.ngrains[0]
364-
ori_dict[igr] = ori_rve[ind, :]
363+
if iphase is None or iphase == ip:
364+
ind = i - ip * self.ngrains[0]
365+
ori_dict[igr] = ori_rve[ind, :]
365366
self.mesh.grain_ori_dict = ori_dict
366367
return
367368

@@ -767,7 +768,7 @@ def write_abq(self, nodes=None, file=None, path='./', voxel_dict=None, grain_dic
767768
dual_phase=dual_phase,
768769
ialloy=ialloy, grain_phase_dict=grpd,
769770
thermal=thermal, periodic=self.rve.periodic)
770-
# if orientation exists and ialloy is defined also write material file with Euler angles
771+
# if orientations exist and ialloy is defined also write material file with Euler angles
771772
if not (self.mesh.grain_ori_dict is None or ialloy is None):
772773
writeAbaqusMat(ialloy, self.mesh.grain_ori_dict,
773774
file=file[0:-8] + 'mat.inp',

0 commit comments

Comments
 (0)