-
Notifications
You must be signed in to change notification settings - Fork 239
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
Kelvin vector symmetric tensor conversion #2075
Kelvin vector symmetric tensor conversion #2075
Conversation
Move the test to Tests/MathLib and extract MathLib::tensorToKelvin for completness.
6cfaaf6
to
3ce6178
Compare
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.
Only small comments from my side.
template <typename Derived> | ||
Eigen::Matrix<double, Eigen::MatrixBase<Derived>::RowsAtCompileTime, 1> | ||
symmetricTensorToKelvinVector(Eigen::MatrixBase<Derived> const& v) | ||
{ |
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.
Maybe add static_assert(Eigen::MatrixBase<Derived>::ColsAtCompileTime == 1, "ERR");
MathLib/KelvinVector.h
Outdated
{ | ||
Eigen::Matrix<double, Eigen::MatrixBase<Derived>::RowsAtCompileTime, 1> | ||
result; | ||
if (v.size() == 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.
This if-clause also covers dynamically allocated matrices, but don't you have to specify their size manually before filling them with the <<
operator?
OpenGeoSys development has been moved to GitLab. |
Follow up of #2060 with fixes to the symmetric tensor to/from Kelvin vector conversion, now tested.
This came up during Integration point data to VTK's field data output PR.