Skip to content

Commit 3a9d32a

Browse files
committed
add pe output
a
1 parent 9216c4d commit 3a9d32a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Grain.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Grain::Grain(): deform_grad(Matrix3d::Identity()), deform_grad_elas(deform_grad)
44
strain_tensor(Matrix3d::Zero()), orientation(Matrix3d::Identity()), elastic_modulus(Matrix6d::Identity()), elastic_modulus_ref(Matrix6d::Identity()) {};
55

66
Grain::Grain(Matrix6d elastic_mod, Matrix3d lat_vecs, vector<PMode*> s, MatrixXd latent_matrix, Matrix3d orient_Mat){
7-
deform_grad = Matrix3d::Identity(), deform_grad_elas = deform_grad, deform_grad_plas = stress_tensor = Matrix3d::Zero(), \
7+
deform_grad = Matrix3d::Identity(), deform_grad_elas = deform_grad, deform_grad_plas = deform_grad ,stress_tensor = Matrix3d::Zero(), \
88
strain_tensor = Matrix3d::Zero(), orient_ref = orientation = orient_Mat, elastic_modulus_ref = elastic_mod, elastic_modulus = rotate_6d_stiff_modu(elastic_mod,orientation.transpose());
99
lattice_vec = lat_vecs;
1010
lat_hard_mat = latent_matrix;
@@ -186,9 +186,11 @@ Matrix<double, 6, 3> Grain::get_Sigma_ik(Vector6d &stress_6d){
186186
}
187187

188188
void Grain::print_stress_strain(ofstream &os){
189+
Matrix3d plastic_strain = 0.5 * (deform_grad_plas.transpose() * deform_grad_plas - Matrix3d::Identity());
190+
double pe = calc_equivalent_value(plastic_strain);
189191
os << norm_time << ',' << strain_tensor(0,0) << ',' << strain_tensor(1,1) << ',' << strain_tensor(2,2) << ',' << strain_tensor(0,1) << ','
190192
<< strain_tensor(0,2) << ',' << strain_tensor(1,2) << ',' << stress_tensor(0,0) << ',' << stress_tensor(1,1) << ','
191-
<< stress_tensor(2,2) << ',' << stress_tensor(0,1) << ',' << stress_tensor(0,2) << ',' << stress_tensor(1,2) << endl;
193+
<< stress_tensor(2,2) << ',' << stress_tensor(0,1) << ',' << stress_tensor(0,2) << ',' << stress_tensor(1,2) << ',' << pe << endl;
192194
}
193195

194196
void Grain::print_stress_strain_screen(){

write_output.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ void outfile_initialization(Grain &grain){
2929
cout << "Output Files Initialing (Grain) ...." << endl;
3030
int slip_num = grain.mode_sys.size();
3131

32-
stress_step_file << "time,e11,e22,e33,e12,e13,e23,s11,s22,s33,s12,s13,s23" << endl;
32+
stress_step_file << "time,e11,e22,e33,e12,e13,e23,s11,s22,s33,s12,s13,s23,pe" << endl;
3333
grain.print_stress_strain(stress_step_file);
34-
stress_file << "time,e11,e22,e33,e12,e13,e23,s11,s22,s33,s12,s13,s23" << endl;
34+
stress_file << "time,e11,e22,e33,e12,e13,e23,s11,s22,s33,s12,s13,s23,pe" << endl;
3535
grain.print_stress_strain(stress_file);
3636
cout << "This grain has " << slip_num << " slip systems" << endl;
3737
title_output(crss_file,"e11,e22,e33,acc_strain,","crss", slip_num);

0 commit comments

Comments
 (0)