here more option is given to the user to select from damask python package itself.
from pyiron_continuum import Project
from damask import Rotation
pr = Project("damask_proj")
pr.remove_jobs_silently(recursive=True)
job = pr.create.job.DAMASK("damask_job")
homogenization = pr.create.DAMASK.homogenization(method='SX',
parameters={'N_constituents': 1,
"mechanical": {"type": "pass"}})
homogenization = pr.continuum.damask.Homogenization(method='SX',
parameters={'N_constituents': 1,
"mechanical": {"type": "pass"}})
elasticity = pr.continuum.damask.Elasticity(type= 'Hooke', C_11= 106.75e9,
C_12= 60.41e9, C_44=28.34e9)
plasticity = pr.continuum.damask.Plasticity(N_sl=[12], a_sl=2.25,
atol_xi=1.0, dot_gamma_0_sl=0.001,
h_0_sl_sl=75e6, h_sl_sl=[1, 1, 1.4, 1.4, 1.4, 1.4],
n_sl=20, output=['xi_sl'], type='phenopowerlaw',
xi_0_sl=[31e6], xi_inf_sl=[63e6])
phase = pr.continuum.damask.Phase(composition='Aluminum', lattice= 'cF',
output_list=['F', 'P', 'F_e', 'F_p', 'L_p', 'O'],
elasticity=elasticity, plasticity=plasticity)
rotation = pr.continuum.damask.Rotation(Rotation.from_random, 10)
material = pr.continuum.damask.Material([rotation],['Aluminum'], phase, homogenization)
job.material = material
grid = pr.continuum.damask.Grid.via_voronoi_tessellation(box_size=1., grid_dim=4, num_grains=10)
job.grid = grid
load_step =[{'mech_bc_dict':{'dot_F':[1e-3,0,0, 0,'x',0, 0,0,'x'],
'P':['x','x','x', 'x',0,'x', 'x','x',0]},
'discretization':{'t': 10.,'N': 40},
'additional': {'f_out': 4}
},{'mech_bc_dict':{'dot_F':[1e-3,0,0, 0,'x',0, 0,0,'x'],
'P':['x','x','x', 'x',0,'x', 'x','x',0]},
'discretization':{'t': 60.,'N': 60},
'additional': {'f_out': 4}
}]
solver = job.list_solvers()[0]
job.loading = pr.continuum.damask.Loading(solver=solver, load_steps=load_step)
job.run()
The job damask_job was saved and received the ID: 1
██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00
pr.job_table()
id | status | chemicalformula | job | subjob | projectpath | project | timestart | timestop | totalcputime | computer | hamilton | hamversion | parentid | masterid | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | finished | None | damask_job | /damask_job | /home/muhammad/ | workspace/tmp/damask_tests/damask_proj/ | 2021-10-15 00:51:40.019162 | 2021-10-15 00:51:44.016029 | 3.0 | pyiron@cmleo14#1 | DAMASK | 0.4 | None | None |
job.plot_stress_strain(component='zz')
(<Figure size 432x288 with 1 Axes>, <AxesSubplot:xlabel='$\\varepsilon_z$$_z$', ylabel='$\\sigma_z$$_z$(Pa)'>)
job.plot_stress_strain(von_mises=True)
(<Figure size 432x288 with 1 Axes>, <AxesSubplot:xlabel='$\\varepsilon_{vM}$', ylabel='$\\sigma_{vM}$ (Pa)'>)
job.output.damask.view(increments=80)
increment_80 (50.0s) phase Aluminum mechanical F / 1: deformation gradient F_e / 1: elastic deformation gradient F_p / 1: plastic deformation gradient L_p / 1/s: plastic velocity gradient O / q_0 (q_1 q_2 q_3): crystal orientation as quaternion P / Pa: first Piola-Kirchhoff stress avg_sigma / Pa: average stress (formula: np.average(#sigma#, axis=0)) avg_sigma_vM / Pa: average stress VM (formula: np.average(#sigma_vM#)) avg_strain / : average strain (formula: np.average(#epsilon_V^0.0(F)#, axis=0)) avg_strain_vM / : average strain vM (formula: np.average(#epsilon_V^0.0(F)_vM#)) epsilon_V^0.0(F) / 1: strain tensor of F (deformation gradient) epsilon_V^0.0(F)_vM / 1: Mises equivalent strain of epsilon_V^0.0(F) (strain tensor of F (deformation gradient)) sigma / Pa: Cauchy stress calculated from P (first Piola-Kirchhoff stress) and F (deformation gradient) sigma_vM / Pa: Mises equivalent stress of sigma (Cauchy stress calculated from P (first Piola-Kirchhoff stress) and F (deformation gradient)) homogenization SX mechanical
job.output.stress
array([[[ 8.00420474e-06, 1.39588888e-07, -7.33218121e-07], [ 1.39588888e-07, 6.93473093e-06, 5.99086292e-07], [-7.33218121e-07, 5.99086292e-07, 8.35255459e-06]], [[ 7.13057905e+07, -2.37476623e+05, 1.85522156e+05], [-2.37476623e+05, 1.58040649e+02, -9.93611512e+05], [ 1.85522156e+05, -9.93611512e+05, 4.01062264e+01]], [[ 1.42924670e+08, -4.75280935e+05, 3.71406474e+05], [-4.75280935e+05, 1.85063506e+01, -1.98615140e+06], [ 3.71406474e+05, -1.98615140e+06, 1.10952616e+01]], [[ 2.14857766e+08, -7.13418512e+05, 5.57658920e+05], [-7.13418512e+05, -4.67552322e+01, -2.97762485e+06], [ 5.57658920e+05, -2.97762485e+06, -6.91403296e+01]], [[ 2.87106077e+08, -9.51888954e+05, 7.44278258e+05], [-9.51888954e+05, -1.30802842e+02, -3.96803515e+06], [ 7.44278258e+05, -3.96803515e+06, -1.73965486e+02]], [[ 3.59670617e+08, -1.19069339e+06, 9.31265044e+05], [-1.19069339e+06, -2.39267297e+02, -4.95738630e+06], [ 9.31265044e+05, -4.95738630e+06, -3.08628024e+02]], [[ 4.32552406e+08, -1.42983296e+06, 1.11861982e+06], [-1.42983296e+06, -3.72307249e+02, -5.94568226e+06], [ 1.11861982e+06, -5.94568226e+06, -4.73065112e+02]], [[ 5.05752472e+08, -1.66930880e+06, 1.30634313e+06], [-1.66930880e+06, -5.29920812e+02, -6.93292695e+06], [ 1.30634313e+06, -6.93292695e+06, -6.67052831e+02]], [[ 5.79271844e+08, -1.90912206e+06, 1.49443551e+06], [-1.90912206e+06, -7.12101119e+02, -7.91912426e+06], [ 1.49443551e+06, -7.91912426e+06, -8.90363265e+02]], [[ 6.53111557e+08, -2.14927386e+06, 1.68289752e+06], [-2.14927386e+06, -9.18840977e+02, -8.90427806e+06], [ 1.68289752e+06, -8.90427806e+06, -1.14276911e+03]], [[ 7.27272650e+08, -2.38976534e+06, 1.87172969e+06], [-2.38976534e+06, -1.15013308e+03, -9.88839222e+06], [ 1.87172969e+06, -9.88839222e+06, -1.42404389e+03]], [[ 1.02715277e+09, -3.35514457e+06, 2.63077374e+06], [-3.35514457e+06, -1.01655926e+03, -1.38145159e+07], [ 2.63077374e+06, -1.38145159e+07, -1.46122309e+03]], [[ 1.33225823e+09, -4.32605556e+06, 3.39578187e+06], [-4.32605556e+06, -2.46407641e+03, -1.77243200e+07], [ 3.39578187e+06, -1.77243200e+07, -3.20057570e+03]], [[ 1.64265854e+09, -5.30256567e+06, 4.16679312e+06], [-5.30256567e+06, -4.30862479e+03, -2.16180291e+07], [ 4.16679312e+06, -2.16180291e+07, -5.37572596e+03]], [[ 1.95842339e+09, -6.28474801e+06, 4.94384409e+06], [-6.28474801e+06, -6.54858381e+03, -2.54958746e+07], [ 4.94384409e+06, -2.54958746e+07, -7.97098269e+03]], [[ 2.27962364e+09, -7.27267582e+06, 5.72697197e+06], [-7.27267582e+06, -9.18341286e+03, -2.93580830e+07], [ 5.72697197e+06, -2.93580830e+07, -1.09726166e+04]], [[ 2.60633137e+09, -8.26642254e+06, 6.51621452e+06], [-8.26642254e+06, -1.22123751e+04, -3.32048759e+07], [ 6.51621452e+06, -3.32048759e+07, -1.43668988e+04]], [[ 2.93861986e+09, -9.26606181e+06, 7.31161010e+06], [-9.26606181e+06, -1.56347029e+04, -3.70364702e+07], [ 7.31161010e+06, -3.70364702e+07, -1.81402551e+04]], [[ 3.27656361e+09, -1.02716675e+07, 8.11319767e+06], [-1.02716675e+07, -1.94496097e+04, -4.08530780e+07], [ 8.11319767e+06, -4.08530780e+07, -2.22792693e+04]], [[ 3.62023842e+09, -1.12833139e+07, 8.92101680e+06], [-1.12833139e+07, -2.36562909e+04, -4.46549074e+07], [ 8.92101680e+06, -4.46549074e+07, -2.67706759e+04]], [[ 3.96972138e+09, -1.23010753e+07, 9.73510769e+06], [-1.23010753e+07, -2.82539245e+04, -4.84421619e+07], [ 9.73510769e+06, -4.84421619e+07, -3.16013528e+04]], [[ 4.32509090e+09, -1.33250267e+07, 1.05555112e+07], [-1.33250267e+07, -3.32416720e+04, -5.22150410e+07], [ 1.05555112e+07, -5.22150410e+07, -3.67583142e+04]], [[ 4.68642675e+09, -1.43552433e+07, 1.13822688e+07], [-1.43552433e+07, -3.86186782e+04, -5.59737399e+07], [ 1.13822688e+07, -5.59737399e+07, -4.22287031e+04]], [[ 5.05381009e+09, -1.53918007e+07, 1.22154226e+07], [-1.53918007e+07, -4.43840722e+04, -5.97184501e+07], [ 1.22154226e+07, -5.97184501e+07, -4.79997853e+04]], [[ 5.42732346e+09, -1.64347750e+07, 1.30550156e+07], [-1.64347750e+07, -5.05369684e+04, -6.34493592e+07], [ 1.30550156e+07, -6.34493592e+07, -5.40589422e+04]], [[ 5.80705090e+09, -1.74842427e+07, 1.39010912e+07], [-1.74842427e+07, -5.70764663e+04, -6.71666510e+07], [ 1.39010912e+07, -6.71666510e+07, -6.03936652e+04]]])