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

Kelvin vector symmetric tensor conversion #2075

Merged

Conversation

endJunction
Copy link
Member

@endJunction endJunction commented Feb 12, 2018

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.

@endJunction endJunction force-pushed the KelvinVectorSymmetricTensorConversion branch from 6cfaaf6 to 3ce6178 Compare February 13, 2018 09:07
Copy link
Collaborator

@chleh chleh left a 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)
{
Copy link
Collaborator

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");

{
Eigen::Matrix<double, Eigen::MatrixBase<Derived>::RowsAtCompileTime, 1>
result;
if (v.size() == 4)
Copy link
Collaborator

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?

@endJunction endJunction merged commit d4fb96f into ufz:master Feb 14, 2018
@endJunction endJunction deleted the KelvinVectorSymmetricTensorConversion branch February 14, 2018 09:27
@ogsbot
Copy link
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants