Merge pull request #3121 from bska/prune-unused-object

Push 'corners' Object into Assert
This commit is contained in:
Bård Skaflestad
2021-03-19 12:23:05 +01:00
committed by GitHub
2 changed files with 3 additions and 4 deletions

View File

@@ -892,7 +892,7 @@ private:
static constexpr int zCoord = Element::dimension - 1;
Scalar zz = 0.0;
const Geometry geometry = element.geometry();
const Geometry& geometry = element.geometry();
const int corners = geometry.corners();
for (int i=0; i < corners; ++i)
zz += geometry.corner(i)[zCoord];

View File

@@ -414,14 +414,13 @@ protected:
Scalar zz1 = 0.0;
Scalar zz2 = 0.0;
const Geometry geometry = element.geometry();
const int corners = geometry.corners();
const Geometry& geometry = element.geometry();
// This code only works with CP-grid where the
// number of corners are 8 and
// also assumes that the first
// 4 corners are the top surface and
// the 4 next are the bottomn.
assert(corners == 8);
assert(geometry.corners() == 8);
for (int i=0; i < 4; ++i){
zz1 += geometry.corner(i)[zCoord];
zz2 += geometry.corner(i+4)[zCoord];