nutofem / nuto

NuTo - yet another finite element library
https://nuto.readthedocs.io
Boost Software License 1.0
17 stars 5 forks source link

Check if shapes match when adding interpolations/cells #247

Closed Psirus closed 6 years ago

Psirus commented 6 years ago

Previously, when you called AddDofInterpolation with a quad interpolation on a mesh full of triangles, it finished without complaining, adding nodes at weird locations. This checks if the shapes of the two interpolations are the same.

The same applies for adding cells with an ElementCollection and an IntegrationType.

Also fixed a couple of typos and added outstream operators for the shapes.

codecov[bot] commented 6 years ago

Codecov Report

Merging #247 into PDE_reviewed will increase coverage by 0.07%. The diff coverage is 100%.

Impacted file tree graph

@@               Coverage Diff                @@
##           PDE_reviewed     #247      +/-   ##
================================================
+ Coverage         84.33%   84.41%   +0.07%     
================================================
  Files               294      294              
  Lines             10774    10828      +54     
================================================
+ Hits               9086     9140      +54     
  Misses             1688     1688
Flag Coverage Δ
#integrationtests 61.91% <32.43%> (-0.15%) :arrow_down:
#unittests 87.69% <100%> (+0.11%) :arrow_up:
Impacted Files Coverage Δ
nuto/math/shapes/Hexahedron.h 100% <100%> (ø) :arrow_up:
nuto/math/shapes/Triangle.h 100% <100%> (ø) :arrow_up:
test/mechanics/cell/Cell.cpp 100% <100%> (ø) :arrow_up:
nuto/math/shapes/Prism.h 80% <100%> (+5%) :arrow_up:
test/mechanics/mesh/MeshFem.cpp 98.55% <100%> (+0.01%) :arrow_up:
nuto/math/shapes/Tetrahedron.h 100% <100%> (ø) :arrow_up:
test/tools/BoostUnitTest.h 84.21% <100%> (+4.21%) :arrow_up:
test/math/Shapes.cpp 100% <100%> (ø) :arrow_up:
nuto/math/shapes/Shape.h 100% <100%> (ø) :arrow_up:
nuto/math/shapes/Pyramid.h 80% <100%> (+5%) :arrow_up:
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d67a8d4...81cd826. Read the comment docs.

Psirus commented 6 years ago

Hehe, it already found a bug^^

In the StructuralGradientDamage test (specifically, here), we are trying to integrate line elements with a triangle integration type:

IntegrationTypeTriangle integration(4);
auto cellsLeft = cellStorage.AddCells(leftElements, integration);