@@ -370,18 +370,24 @@ def generate_orientations(self, data, ang=None, omega=None, Nbase=5000,
370
370
-------- Plotting methods --------
371
371
"""
372
372
373
- def plot_ellipsoids (self , cmap = 'prism' , dual_phase = False ):
373
+ def plot_ellipsoids (self , cmap = 'prism' , dual_phase = None , phases = False ):
374
374
""" Generates plot of particles"""
375
+ if dual_phase is not None :
376
+ print ('Use of "dual_phase" is depracted. Use parameter "phases" instead.' )
377
+ phases = dual_phase
375
378
if self .particles is None :
376
379
raise ValueError ('No particle to plot. Run pack first.' )
377
380
hmin = min (self .rve .size )
378
381
asp_arr = [int (self .rve .size [0 ] / hmin ),
379
382
int (self .rve .size [1 ] / hmin ),
380
383
int (self .rve .size [2 ] / hmin )]
381
- plot_ellipsoids_3D (self .particles , cmap = cmap , dual_phase = dual_phase , asp_arr = asp_arr )
384
+ plot_ellipsoids_3D (self .particles , cmap = cmap , phases = phases , asp_arr = asp_arr )
382
385
383
- def plot_particles (self , cmap = 'prism' , dual_phase = False , plot_hull = True ):
386
+ def plot_particles (self , cmap = 'prism' , dual_phase = None , phases = False , plot_hull = True ):
384
387
""" Generates plot of particles"""
388
+ if dual_phase is not None :
389
+ print ('Use of "dual_phase" is depracted. Use parameter "phases" instead.' )
390
+ phases = dual_phase
385
391
if self .particles is None :
386
392
raise ValueError ('No particle to plot. Run pack first.' )
387
393
if self .particles [0 ].inner is None :
@@ -391,9 +397,9 @@ def plot_particles(self, cmap='prism', dual_phase=False, plot_hull=True):
391
397
int (self .rve .size [1 ] / hmin ),
392
398
int (self .rve .size [2 ] / hmin )]
393
399
plot_particles_3D (self .particles , cmap = cmap ,
394
- dual_phase = dual_phase , plot_hull = plot_hull , asp_arr = asp_arr )
400
+ phases = phases , plot_hull = plot_hull , asp_arr = asp_arr )
395
401
396
- def plot_voxels (self , sliced = False , dual_phase = False , cmap = 'prism' , ori = None ,
402
+ def plot_voxels (self , sliced = False , dual_phase = None , phases = False , cmap = 'prism' , ori = None ,
397
403
color_key = 0 , silent = False ):
398
404
"""
399
405
Generates plot of voxel structure
@@ -412,9 +418,12 @@ def plot_voxels(self, sliced=False, dual_phase=False, cmap='prism', ori=None,
412
418
-------
413
419
414
420
"""
421
+ if dual_phase is not None :
422
+ print ('Use of "dual_phase" is depracted. Use parameter "phases" instead.' )
423
+ phases = dual_phase
415
424
if self .mesh .grains is None :
416
425
raise ValueError ('No voxels or elements to plot. Run voxelize first.' )
417
- elif dual_phase :
426
+ elif phases :
418
427
data = self .mesh .phases
419
428
else :
420
429
data = self .mesh .grains
@@ -435,14 +444,19 @@ def plot_voxels(self, sliced=False, dual_phase=False, cmap='prism', ori=None,
435
444
int (self .rve .size [1 ] / hmin ),
436
445
int (self .rve .size [2 ] / hmin )]
437
446
fig = plot_voxels_3D (data , Ngr = np .sum (self .ngrains ), sliced = sliced ,
438
- dual_phase = dual_phase , cmap = cmap , clist = clist ,
447
+ phases = phases , cmap = cmap , clist = clist ,
439
448
silent = silent , asp_arr = asp_arr )
440
449
if silent :
441
450
return fig
442
451
443
452
def plot_grains (self , geometry = None , cmap = 'prism' , alpha = 0.4 ,
444
- ec = [ 0.5 , 0.5 , 0.5 , 0.1 ], dual_phase = False ):
453
+ ec = None , dual_phase = None , phases = False ):
445
454
""" Plot polygonalized microstructure"""
455
+ if ec is None :
456
+ ec = [0.5 , 0.5 , 0.5 , 0.1 ]
457
+ if dual_phase is not None :
458
+ print ('Use of "dual_phase" is depracted. Use parameter "phases" instead.' )
459
+ phases = dual_phase
446
460
if geometry is None :
447
461
geometry = self .geometry
448
462
if geometry is None :
@@ -452,23 +466,26 @@ def plot_grains(self, geometry=None, cmap='prism', alpha=0.4,
452
466
int (self .rve .size [1 ] / hmin ),
453
467
int (self .rve .size [2 ] / hmin )]
454
468
plot_polygons_3D (geometry , cmap = cmap , alpha = alpha , ec = ec ,
455
- dual_phase = dual_phase , asp_arr = asp_arr )
469
+ phases = phases , asp_arr = asp_arr )
456
470
457
471
def plot_stats (self , data = None ,
458
472
gs_data = None , gs_param = None ,
459
473
ar_data = None , ar_param = None ,
460
- dual_phase = False ,
474
+ dual_phase = None , phases = False ,
461
475
save_files = False ,
462
476
show_all = False , verbose = False ,
463
477
silent = False , enhanced_plot = False ):
464
478
""" Plots the particle- and grain diameter attributes for statistical
465
479
comparison."""
480
+ if dual_phase is not None :
481
+ print ('Use of "dual_phase" is depracted. Use parameter "phases" instead.' )
482
+ phases = dual_phase
466
483
if silent :
467
484
verbose = False
468
485
show_all = False
469
486
enhanced_plot = True
470
487
ax_max = np .prod (self .rve .size ) ** (1 / 3 )
471
- if dual_phase :
488
+ if phases :
472
489
nphases = self .nphases
473
490
if self .precipit and 0 in self .mesh .grain_dict .keys ():
474
491
# in case of precipit, remove irregular grain 0 from analysis
@@ -494,7 +511,7 @@ def plot_stats(self, data=None,
494
511
for ip in range (nphases ):
495
512
stats_list = []
496
513
labels = []
497
- if dual_phase :
514
+ if phases :
498
515
iphase = ip
499
516
print (f'Plotting statistical information for phase { ip } ' )
500
517
@@ -537,7 +554,7 @@ def plot_stats(self, data=None,
537
554
stats_list .append (grain_stats )
538
555
labels .append ('Grains' )
539
556
540
- if dual_phase :
557
+ if phases :
541
558
print (f'\n Statistical microstructure parameters of phase { iphase } in RVE' )
542
559
print ('-------------------------------------------------------' )
543
560
else :
0 commit comments