boundingBox has mag() and span() methods - use them

This commit is contained in:
Mark Olesen
2008-12-31 17:58:23 +01:00
parent 172b862c47
commit dcc82bf77b
25 changed files with 106 additions and 123 deletions

View File

@ -93,7 +93,7 @@ Foam::labelList Foam::blockMesh::createMergeList()
// the size of the block.
boundBox bb(blockCells[blockPlabel].points(blockFaces, blockPoints));
const scalar mergeSqrDist = SMALL*magSqr(bb.max() - bb.min());
const scalar mergeSqrDist = SMALL*magSqr(bb.span());
// This is an N^2 algorithm

View File

@ -177,9 +177,9 @@ int main(int argc, char *argv[])
const boundBox& bb = mesh.globalData().bb();
const vector span(bb.max() - bb.min());
const vector span = bb.span();
const scalar minDim = min(span[0], min(span[1], span[2]));
const scalar mergeDim = 1E-4*minDim;
const scalar mergeDim = 1E-4 * minDim;
Pout<< "Mesh bounding box:" << bb << nl
<< " with span:" << span << nl

View File

@ -55,7 +55,7 @@ using namespace Foam;
scalar getMergeDistance(const polyMesh& mesh, const scalar mergeTol)
{
const boundBox& meshBb = mesh.bounds();
scalar mergeDist = mergeTol*mag(meshBb.max() - meshBb.min());
scalar mergeDist = mergeTol * meshBb.mag();
scalar writeTol = std::pow
(
scalar(10.0),