-
Notifications
You must be signed in to change notification settings - Fork 310
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
[FEM] Add method computeVonMisesStress in TetrahedralCorotationalForceField and option to draw them #4945
base: master
Are you sure you want to change the base?
[FEM] Add method computeVonMisesStress in TetrahedralCorotationalForceField and option to draw them #4945
Conversation
…FEMForceField and method to draw it by Node
Data<type::vector<Real> > d_vonMisesPerNode; ///< von Mises Stress per node | ||
|
||
sofa::helper::ColorMap* m_VonMisesColorMap; |
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.
Data<type::vector<Real> > d_vonMisesPerNode; ///< von Mises Stress per node | |
sofa::helper::ColorMap* m_VonMisesColorMap; | |
Data<type::vector<Real> > d_vonMisesPerNode; ///< von Mises Stress per node | |
sofa::helper::ColorMap* m_vonMisesColorMap; |
I guess this is a copy-paste from the other file 🫢but it is nice to have consistency
matVert[k][l] = X0[ix][l - 1]; | ||
} | ||
|
||
const bool canInvert = type::invertMatrix(tetrahedronInf[i].elemShapeFun, matVert); |
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.
const bool canInvert = type::invertMatrix(tetrahedronInf[i].elemShapeFun, matVert); | |
[[maybe_unused]] const bool canInvert = type::invertMatrix(tetrahedronInf[i].elemShapeFun, matVert); |
const TetrahedronInformation& tetraInfo = tetrahedronInf[i]; | ||
|
||
computeRotationLarge(R_0_2, X, tetra[0], tetra[1], tetra[2]); | ||
//tetraInfo.rotation.transpose(R_0_2); |
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.
//tetraInfo.rotation.transpose(R_0_2); |
|
||
if (d_drawing.getValue()) | ||
{ | ||
std::vector< type::Vec3 > points[4]; |
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.
You could reserve the memory beforehand as the size seems computable
To me adding more and more hard coded drawing function by copy-pasting other's drawing function in every components is not desirable. I see two better solutions:
|
Similar to TetrahedronFEMForceField, compute von mises per element and add option to draw it.
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if