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
merged 5 commits into from Feb 14, 2018

Conversation

Projects
None yet
3 participants
@endJunction
Copy link
Member

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 added some commits Jan 31, 2018

[T] KelvinVector; Move Test. Move tensorToKelvin.
Move the test to Tests/MathLib and extract MathLib::tensorToKelvin for completness.

@endJunction endJunction force-pushed the endJunction:KelvinVectorSymmetricTensorConversion branch from 6cfaaf6 to 3ce6178 Feb 13, 2018

@chleh

chleh approved these changes Feb 13, 2018

Copy link
Collaborator

chleh left a comment

Only small comments from my side.

template <typename Derived>
Eigen::Matrix<double, Eigen::MatrixBase<Derived>::RowsAtCompileTime, 1>
symmetricTensorToKelvinVector(Eigen::MatrixBase<Derived> const& v)
{

This comment has been minimized.

@chleh

chleh Feb 13, 2018

Collaborator

Maybe add static_assert(Eigen::MatrixBase<Derived>::ColsAtCompileTime == 1, "ERR");

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

This comment has been minimized.

@chleh

chleh Feb 13, 2018

Collaborator

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

1 of 2 checks passed

continuous-integration/jenkins/pr-merge This commit cannot be built
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@endJunction endJunction deleted the endJunction:KelvinVectorSymmetricTensorConversion branch Feb 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.