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

change the small deformation to finite deformation. #540

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ void BarStressRelaxationSecondHalf::initialization(size_t index_i, Real dt)
Vecd pseudo_b_n_temp = pseudo_b_n_[index_i];

pseudo_n_[index_i] = transformation_matrix_[index_i].transpose() *
getVectorAfterThinStructureRotation(local_pseudo_n_0, rotation_[index_i]);
getVectorAfterThinStructureRotation(local_pseudo_n_0, rotation_[index_i] + rotation_b_[index_i]);

pseudo_b_n_[index_i] = transformation_matrix_[index_i].transpose() *
getVectorAfterThinStructureRotation(local_pseudo_b_n_0, rotation_b_[index_i]);
getVectorAfterThinStructureRotation(local_pseudo_b_n_0, rotation_[index_i] + rotation_b_[index_i]);

if (dt < 1e-10)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Copy link
Collaborator

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?

Vec3d(local_dpseudo_b_n_d2t), Vec3d(rotation_b_[index_i]), Vec3d(angular_b_vel_[index_i]), dt);
Copy link
Collaborator

Choose a reason for hiding this comment

The 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(
Copy link
Collaborator

Choose a reason for hiding this comment

The 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

*/
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 +
Expand All @@ -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);
Copy link
Collaborator

Choose a reason for hiding this comment

The 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);
Copy link
Collaborator

Choose a reason for hiding this comment

The 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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Vec3d getVectorChangeRateAfterThinStructureRotation(const Vec3d &initial_vector,

/** get the rotation from pseudo-normal for finite deformation. */
Vec3d getRotationFromPseudoNormalForFiniteDeformation(const Vec3d &dpseudo_n_d2t, const Vec3d &rotation, const Vec3d &angular_vel, Real dt);
/** get the rotation from pseudo-binormal for finite deformation. */
Vec3d getRotationFromPseudoNormalForFiniteDeformation_b(const Vec3d &dpseudo_b_n_d2t, const Vec3d &rotation_b, const Vec3d &angular_b_vel, Real dt);

/** get the rotation from pseudo-normal for small deformation. */
Vec3d getRotationFromPseudoNormalForSmallDeformation(const Vec3d &dpseudo_b_n_d2t, const Vec3d &dpseudo_n_d2t, const Vec3d &rotation, const Vec3d &angular_vel, Real dt);
Expand Down
Loading