Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repating issue #560

Open
Xiangyu-Hu opened this issue Apr 9, 2024 · 1 comment
Open

Repating issue #560

Xiangyu-Hu opened this issue Apr 9, 2024 · 1 comment
Assignees

Comments

@Xiangyu-Hu
Copy link
Owner

Matd current_transformation_matrix = getTransformationMatrix(pseudo_n_[index_i]);
Matd resultant_stress = Matd::Zero();
Matd resultant_moment = Matd::Zero();
Vecd resultant_shear_stress = Vecd::Zero();
for (int i = 0; i != number_of_gaussian_points_; ++i)
{
Matd F_gaussian_point = F_[index_i] + gaussian_point_[i] * F_bending_[index_i] * thickness_[index_i] * 0.5;
Matd dF_gaussian_point_dt = dF_dt_[index_i] + gaussian_point_[i] * dF_bending_dt_[index_i] * thickness_[index_i] * 0.5;
Matd inverse_F_gaussian_point = F_gaussian_point.inverse();
Matd current_local_almansi_strain = current_transformation_matrix * transformation_matrix_[index_i].transpose() * 0.5 *
(Matd::Identity() - inverse_F_gaussian_point.transpose() * inverse_F_gaussian_point) *
transformation_matrix_[index_i] * current_transformation_matrix.transpose();
/** correct Almansi strain tensor according to plane stress problem. */
current_local_almansi_strain = getCorrectedAlmansiStrain(current_local_almansi_strain, nu_);
/** correct out-plane numerical damping. */
Matd cauchy_stress = elastic_solid_.StressCauchy(current_local_almansi_strain, index_i) + current_transformation_matrix * transformation_matrix_[index_i].transpose() * F_gaussian_point *
elastic_solid_.NumericalDampingRightCauchy(F_gaussian_point, dF_gaussian_point_dt, numerical_damping_scaling_[index_i], index_i) * F_gaussian_point.transpose() * transformation_matrix_[index_i] * current_transformation_matrix.transpose() / F_gaussian_point.determinant();
/** Impose modeling assumptions. */
cauchy_stress.col(Dimensions - 1) *= shear_correction_factor_;
cauchy_stress.row(Dimensions - 1) *= shear_correction_factor_;
cauchy_stress(Dimensions - 1, Dimensions - 1) = 0.0;
if (i == 0)
{
mid_surface_cauchy_stress_[index_i] = cauchy_stress;
}
/** Integrate Cauchy stress along thickness. */
resultant_stress +=
0.5 * thickness_[index_i] * gaussian_weight_[i] * cauchy_stress;
resultant_moment +=
0.5 * thickness_[index_i] * gaussian_weight_[i] * (cauchy_stress * gaussian_point_[i] * thickness_[index_i] * 0.5);
resultant_shear_stress -=
0.5 * thickness_[index_i] * gaussian_weight_[i] * cauchy_stress.col(Dimensions - 1);
resultant_stress.col(Dimensions - 1) = Vecd::Zero();
resultant_moment.col(Dimensions - 1) = Vecd::Zero();
}
/** stress and moment in global coordinates for pair interaction */
global_stress_[index_i] = J * current_transformation_matrix.transpose() * resultant_stress * current_transformation_matrix * transformation_matrix_[index_i].transpose() * inverse_F.transpose() * transformation_matrix_[index_i];
global_moment_[index_i] = J * current_transformation_matrix.transpose() * resultant_moment * current_transformation_matrix * transformation_matrix_[index_i].transpose() * inverse_F.transpose() * transformation_matrix_[index_i];
global_shear_stress_[index_i] = J * current_transformation_matrix.transpose() * resultant_shear_stress;

It seems that "current_transformation_matrix * transformation_matrix_[index_i].transpose()" repeated many times and wast time.

@Xiangyu-Hu
Copy link
Owner Author

@DongWuTUM Please have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants