Skip to content

Mechanics invariants and B-matrices#1359

Merged
endJunction merged 6 commits intoufz:masterfrom
endJunction:MechanicsInvariantsBMatrices
Aug 26, 2016
Merged

Mechanics invariants and B-matrices#1359
endJunction merged 6 commits intoufz:masterfrom
endJunction:MechanicsInvariantsBMatrices

Conversation

@endJunction
Copy link
Copy Markdown
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.

Comment thread Tests/MathLib/mechanics_invariants.cpp Outdated
{
Eigen::Matrix<double, 1, 1> m;
m << v[0];
m.coeffRef(0,0) = v[0];
Copy link
Copy Markdown
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])?

@endJunction
Copy link
Copy Markdown
Member Author

Jenkins, test this please.

The following ctests FAILED for some reason but they don't affect the review for now:
4 - MapGeometryToMeshSurface-MapGeometryToMeshSurface_Bode-time-diff (Failed)
6 - MapGeometryToMeshSurface-MapGeometryToMeshSurface_Naegelstedt-time-diff (Failed)

Comment thread ProcessLib/Deformation/BMatrixPolicy.h Outdated
struct KelvinVectorDimensions;

template <>
struct KelvinVectorDimensions<1>
Copy link
Copy Markdown
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.

Can that be removed now? ✅

@chleh
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

looks good, besides minor comments

@ogsbot
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

Jenkins, test this please!

@endJunction
Copy link
Copy Markdown
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
Copy Markdown
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