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

Mechanics invariants and B-matrices #1359

Merged
merged 6 commits into from
Aug 26, 2016

Conversation

endJunction
Copy link
Member

@endJunction endJunction commented Aug 17, 2016

This is part of the mechanics PR #1340.

Includes:

  • deformation process specific invariants in the Kelvin mapping.
  • B-matrices (like shape-matrices for mechanics) and Kelvin vector types.

For the tests the error bounds were eyeballed from a gnuplot graphics showing the error vs. input vector norm. Tried to make them as tight as possible. It might happen that they will need to be increased a little bit... we'll see.

Aside from the failing compiler (of the test code) this is ready for review.

Todo:

  • Cite Nagel et al. Kelvin mapping.
  • rename files/classes. Will do at the very end to reduce rereview:
    • MathLib/mechanics_invariants.h > MaterialLib/SolidModels/KelvinVector.h
    • Split off impl.h or even .cpp for specializations of det/inv.
  • fix MSVC12 compilation.
  • Possibly add test of LinearBMatrix using computeStrain function. Will not do.
  • Test P_dev * P_sph == P_sph * P_dev == 0 6x6; P_dev + P_sph == identity 6x6;
  • Move inverse out of Invariants.
  • Maybe rename BMatrixPolicy::_columns to "number of DOF"? (And _rows to _kelvin_vector_size?)
  • Merge/Unify ShapeMatrixPolicy and the BMatrixPolicy
    • Now you use the ::detail::EigenMatrixType, why not the respective type from ShapeMatricesType?
    • Wouldn't it be better to use the typedefs from ShapeMatrixPolicy here instead of always using fixed size matrices?
    • DynamicBMatrixPolicy Can be merged with the above into one type using only the typedefs from ShapeMatrixPolicyType.

@endJunction endJunction force-pushed the MechanicsInvariantsBMatrices branch 2 times, most recently from 19c9c2c to 26c946c Compare August 17, 2016 20:30
@@ -48,7 +48,7 @@ Eigen::Matrix<double, KelvinToTensorSize<1>::value,
kelvinToTensor(KelvinVector<1> const& v)
{
Eigen::Matrix<double, 1, 1> m;
m << v[0];
m.coeffRef(0,0) = v[0];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe m(0,0) = v[0], or something like Eigen::Matrix<double, 1, 1> m = Eigen::Matrix<double, 1, 1>::Constant(v[0])?

Eigen::Matrix<double, 3, 3> kelvinToTensor(KelvinVector<4> const& v)
{
Eigen::Matrix<double, 3, 3> m;
// The z-component is ignored, otherwise the matrix must be 3x3.
Copy link
Collaborator

@chleh chleh Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment correct? ✅

@chleh
Copy link
Collaborator

chleh commented Aug 24, 2016

Only minor additional comments from my side. Basically:

  • Eigen and auto
  • == 0.0 vs. < eps
  • some remaining displacementdim 1 code.

Afterwards 👍

Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize> P_dev =
Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>::Identity();

P_dev.template topLeftCorner<3, 3>() -=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure: noalias() may influence optimization

@norihiro-w
Copy link
Collaborator

looks good, besides minor comments

@ogsbot
Copy link
Member

ogsbot commented Aug 24, 2016

Jenkins: OGS-6/Gui/Gui-Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Gui/job/Gui-Linux-PRs/2630/

@endJunction
Copy link
Member Author

Can I rebase and merge, or is there more review to be expected?

The only test failing (again) is

[ RUN      ] NumLib.ComponentNormMultiComponent2
/home/travis/build/ufz/ogs/Tests/NumLib/TestComponentNorms.cpp:94: Failure
The difference between total_norm and compwise_total_norm is 8.8817841970012523e-15, which exceeds tolerance, where
total_norm evaluates to 14.747408246182694,
compwise_total_norm evaluates to 14.747408246182685, and
tolerance evaluates to 6.6613381477509392e-15.
[  FAILED  ] NumLib.ComponentNormMultiComponent2 (72 ms)

@chleh
Copy link
Collaborator

chleh commented Aug 25, 2016

I'm fine with this PR. ⏩
I will raise the test tolerances since this test failed very often recently.

@endJunction
Copy link
Member Author

Jenkins, test this please!

@endJunction endJunction force-pushed the MechanicsInvariantsBMatrices branch 2 times, most recently from b8d5fb6 to 2988a25 Compare August 26, 2016 07:46
@endJunction
Copy link
Member Author

It could happen that the error margins in the unit tests are too tight. In that case I'll increase the tolerance a little.

@endJunction endJunction merged commit af25f51 into ufz:master Aug 26, 2016
@endJunction endJunction deleted the MechanicsInvariantsBMatrices branch August 26, 2016 14:06
@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.

6 participants