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

WireRestShape: getBeamSection() must return a const ref in any case #151

Merged
merged 2 commits into from
Jul 15, 2024
Merged
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
2 changes: 2 additions & 0 deletions src/BeamAdapter/component/engine/WireRestShape.inl
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ const BeamSection& WireRestShape<DataTypes>::getBeamSection(const Real& x_curv)
}

msg_error() << " problem in getBeamSection : x_curv " << x_curv << " is not between keyPoints" << keyPts;
static const BeamSection emptySection{};
return emptySection;
}


Expand Down
16 changes: 8 additions & 8 deletions src/BeamAdapter/utils/BeamSection.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
namespace sofa::beamadapter
{
struct BeamSection {
double _r; ///< Radius of the beam section
double _rInner; ///< Inner radius of the section if beam is hollow
double _Iy; ///< Iy is the cross-section moment of inertia (assuming mass ratio = 1) about the y axis, see https ://en.wikipedia.org/wiki/Second_moment_of_area
double _Iz; ///< Iz is the cross-section moment of inertia (assuming mass ratio = 1) about the z axis, see https ://en.wikipedia.org/wiki/Second_moment_of_area
double _J; ///< Polar moment of inertia (J = Iy + Iz)
double _A; ///< A is the cross-sectional area
double _Asy; ///< _Asy is the y-direction effective shear area = 10/9 (for solid circular section) or 0 for a non-Timoshenko beam
double _Asz; ///< _Asz is the z-direction effective shear area
double _r{}; ///< Radius of the beam section
double _rInner{}; ///< Inner radius of the section if beam is hollow
double _Iy{}; ///< Iy is the cross-section moment of inertia (assuming mass ratio = 1) about the y axis, see https ://en.wikipedia.org/wiki/Second_moment_of_area
double _Iz{}; ///< Iz is the cross-section moment of inertia (assuming mass ratio = 1) about the z axis, see https ://en.wikipedia.org/wiki/Second_moment_of_area
double _J{}; ///< Polar moment of inertia (J = Iy + Iz)
double _A{}; ///< A is the cross-sectional area
double _Asy{}; ///< _Asy is the y-direction effective shear area = 10/9 (for solid circular section) or 0 for a non-Timoshenko beam
double _Asz{}; ///< _Asz is the z-direction effective shear area
};

} // namespace sofa::beamAdapter
Loading