-
Notifications
You must be signed in to change notification settings - Fork 244
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
change the small deformation to finite deformation. #540
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,14 +231,14 @@ class BarStressRelaxationFirstHalf : public BaseBarRelaxation | |
|
||
force_[index_i] = force * inv_rho0_ / (thickness_[index_i] * width_[index_i]); | ||
dpseudo_n_d2t_[index_i] = pseudo_normal_acceleration * inv_rho0_ * 12.0 / pow(thickness_[index_i], 4); | ||
dpseudo_b_n_d2t_[index_i] = -pseudo_b_normal_acceleration * inv_rho0_ * 12.0 / pow(thickness_[index_i], 4); | ||
dpseudo_b_n_d2t_[index_i] = pseudo_b_normal_acceleration * inv_rho0_ * 12.0 / pow(thickness_[index_i], 4); | ||
|
||
Vecd local_dpseudo_n_d2t = transformation_matrix_[index_i] * dpseudo_n_d2t_[index_i]; | ||
Vecd local_dpseudo_b_n_d2t = transformation_matrix_[index_i] * dpseudo_b_n_d2t_[index_i]; | ||
dangular_b_vel_dt_[index_i] = getRotationFromPseudoNormalForSmallDeformation_b( | ||
Vec3d(local_dpseudo_b_n_d2t), Vec3d(local_dpseudo_n_d2t), Vec3d(rotation_b_[index_i]), Vec3d(angular_b_vel_[index_i]), dt); | ||
dangular_vel_dt_[index_i] = getRotationFromPseudoNormalForSmallDeformation( | ||
Vec3d(local_dpseudo_b_n_d2t), Vec3d(local_dpseudo_n_d2t), Vec3d(rotation_[index_i]), Vec3d(angular_vel_[index_i]), dt); | ||
dangular_b_vel_dt_[index_i] = getRotationFromPseudoNormalForFiniteDeformation_b( | ||
Vec3d(local_dpseudo_b_n_d2t), Vec3d(rotation_b_[index_i]), Vec3d(angular_b_vel_[index_i]), dt); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here, Vec3d is not needed, since the slender structure simulation is always 3D. |
||
dangular_vel_dt_[index_i] = getRotationFromPseudoNormalForFiniteDeformation( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please notice the writing, thanks:) Two more spaces here. |
||
Vec3d(local_dpseudo_n_d2t), Vec3d(rotation_[index_i]), Vec3d(angular_vel_[index_i]), dt); | ||
}; | ||
|
||
void update(size_t index_i, Real dt = 0.0); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,11 +52,11 @@ Vec3d getRotationFromPseudoNormalForFiniteDeformation(const Vec3d &dpseudo_n_d2t | |
Real sin_rotation_1 = sin(rotation[1]); | ||
Real cos_rotation_1 = cos(rotation[1]); | ||
|
||
Real rotation_0_a = -(dpseudo_n_d2t[2] * cos_rotation_1 + dpseudo_n_d2t[0] * sin_rotation_1 + | ||
/* Real rotation_0_a = -(dpseudo_n_d2t[2] * cos_rotation_1 + dpseudo_n_d2t[0] * sin_rotation_1 + | ||
angular_vel[1] * angular_vel[1] * cos_rotation_0 + angular_vel[0] * angular_vel[0] * cos_rotation_0); | ||
Real rotation_0_b = sin_rotation_0 * angular_vel[0] * angular_vel[0] - dpseudo_n_d2t[1]; | ||
Real angle_vel_dt_0 = sin_rotation_0 * rotation_0_a + cos_rotation_0 * rotation_0_b; | ||
|
||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These comments can be deleted now. |
||
Real rotation_1_a = dpseudo_n_d2t[0] * cos_rotation_1 - dpseudo_n_d2t[2] * sin_rotation_1 + | ||
2.0 * angular_vel[1] * angular_vel[0] * sin_rotation_0; | ||
Real rotation_1_b1 = dpseudo_n_d2t[0] * cos_rotation_0 + | ||
|
@@ -70,10 +70,43 @@ Vec3d getRotationFromPseudoNormalForFiniteDeformation(const Vec3d &dpseudo_n_d2t | |
Real angle_vel_dt_1 = rotation_1_a * rotation_1_a * (rotation_1_b1 * cos_rotation_1 + rotation_1_b2 * sin_rotation_1) / | ||
(rotation_1_b1 * rotation_1_b1 + rotation_1_b2 * rotation_1_b2 + Eps); | ||
|
||
return Vec3d(angle_vel_dt_0, angle_vel_dt_1, 0.0); | ||
return Vec3d(0, angle_vel_dt_1, 0.0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For writing consistency, 0.0 should be here. |
||
} | ||
//=================================================================================================// | ||
|
||
|
||
Vec3d getRotationFromPseudoNormalForFiniteDeformation_b(const Vec3d &dpseudo_b_n_d2t, const Vec3d &rotation_b, const Vec3d &angular_b_vel, Real dt) | ||
{ | ||
Real sin_rotation_b_0 = sin(rotation_b[0]); | ||
Real cos_rotation_b_0 = cos(rotation_b[0]); | ||
Real sin_rotation_b_2 = sin(rotation_b[2]); | ||
Real cos_rotation_b_2 = cos(rotation_b[2]); | ||
/* | ||
Real rotation_b_0_a = (dpseudo_b_n_d2t[0] * sin_rotation_b_2 - dpseudo_b_n_d2t[1] * cos_rotation_b_2 - cos_rotation_b_0 * angular_b_vel[2] * angular_b_vel[2] - cos_rotation_b_0 * angular_b_vel[0] * angular_b_vel[0]); | ||
|
||
Real rotation_b_0_b = dpseudo_b_n_d2t[2] + sin_rotation_b_0 * angular_b_vel[0] * angular_b_vel[0]; | ||
|
||
Real angle_b_vel_dt_0 = sin_rotation_b_0 * rotation_b_0_a + cos_rotation_b_0 * rotation_b_0_b; | ||
*/ | ||
Real rotation_b_c = (-dpseudo_b_n_d2t[0] * cos_rotation_b_2 - dpseudo_b_n_d2t[1] * sin_rotation_b_2 + 2 * angular_b_vel[2] * angular_b_vel[0] * sin_rotation_b_0); | ||
|
||
Real rotation_b_c1 = -dpseudo_b_n_d2t[0] * cos_rotation_b_0 + | ||
angular_b_vel[2] * angular_b_vel[2] * cos_rotation_b_0 * cos_rotation_b_0 * sin_rotation_b_2 + | ||
angular_b_vel[0] * angular_b_vel[0] * sin_rotation_b_2 + | ||
dpseudo_b_n_d2t[2] * sin_rotation_b_0 * sin_rotation_b_2 + | ||
2.0 * angular_b_vel[0] * angular_b_vel[2] * cos_rotation_b_2 * cos_rotation_b_0 * sin_rotation_b_0; | ||
|
||
Real rotation_b_c2 = -dpseudo_b_n_d2t[1] * cos_rotation_b_0 - | ||
angular_b_vel[2] * angular_b_vel[2] * cos_rotation_b_2 * cos_rotation_b_0 * cos_rotation_b_0 - | ||
angular_b_vel[0] * angular_b_vel[0] * cos_rotation_b_2 - | ||
dpseudo_b_n_d2t[2] * sin_rotation_b_0 * cos_rotation_b_2 + | ||
2.0 * angular_b_vel[0] * angular_b_vel[2] * sin_rotation_b_2 * sin_rotation_b_0 * cos_rotation_b_0; | ||
|
||
Real angle_b_vel_dt_2 = rotation_b_c * rotation_b_c * (rotation_b_c1 * cos_rotation_b_2 + rotation_b_c2 * sin_rotation_b_2) / (rotation_b_c1 * rotation_b_c1 + rotation_b_c2 * rotation_b_c2 + Eps); | ||
return Vec3d(0, 0.0, angle_b_vel_dt_2); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
|
||
} | ||
//=================================================================================================// | ||
Vec3d getRotationFromPseudoNormalForSmallDeformation( | ||
const Vec3d &dpseudo_b_n_d2t, const Vec3d &dpseudo_n_d2t, const Vec3d &rotation, const Vec3d &angular_vel, Real dt) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this pull request focuses on Finite Deformation/Rotation, could you add a test case with a large rotation?