#9622: Exclude cells with very small volumes

This commit is contained in:
Magne Sjaastad 2023-01-09 14:46:13 +01:00
parent 1bbe02614b
commit 62a13d3847

View File

@ -36,6 +36,7 @@
#include "cvfStructGrid.h"
#include "cvfBase.h"
#include "cvfBoundingBox.h"
namespace caf
{
@ -360,6 +361,16 @@ void StructGridInterface::characteristicCellSizes( double* iSize, double* jSize,
size_t cellIndex = cellIndexFromIJK( i, j, k );
cellCornerVertices( cellIndex, cornerVerts );
cvf::BoundingBox bb;
for ( const auto& v : cornerVerts )
{
bb.add( v );
}
// Exclude cells with very small volumes
const double tolerance = 0.2;
if ( bb.extent().z() < tolerance ) continue;
iLengthAccumulated +=
( cornerVerts[faceConnPosI[0]] - cornerVerts[faceConnNegI[0]] ).lengthSquared();
iLengthAccumulated +=