#5591 Avoid saw tooth shape on normalized stresses

This commit is contained in:
Gaute Lindkvist
2020-03-02 08:37:36 +01:00
parent 3674c4451d
commit bd1d1caacc
8 changed files with 140 additions and 59 deletions

View File

@@ -20,6 +20,8 @@
#include "RigFemPartGrid.h"
#include "RigFemPart.h"
#include <array>
#include <cmath>
#include <limits.h>
@@ -481,8 +483,15 @@ void RigFemPartGrid::cellCornerVertices( size_t cellIndex, cvf::Vec3d vertices[8
//--------------------------------------------------------------------------------------------------
cvf::Vec3d RigFemPartGrid::cellCentroid( size_t cellIndex ) const
{
CVF_ASSERT( false );
return cvf::Vec3d::ZERO;
std::array<cvf::Vec3d, 8> cellVertices;
this->cellCornerVertices( cellIndex, cellVertices.data() );
cvf::Vec3d centroid( 0.0, 0.0, 0.0 );
for ( int i = 0; i < 8; ++i )
{
centroid += cellVertices[i];
}
return centroid / 8.0;
}
//--------------------------------------------------------------------------------------------------