diff --git a/applications/utilities/mesh/generation/cvMesh/cvMesh.C b/applications/utilities/mesh/generation/cvMesh/cvMesh.C index 484110fd76..351e52c7ac 100644 --- a/applications/utilities/mesh/generation/cvMesh/cvMesh.C +++ b/applications/utilities/mesh/generation/cvMesh/cvMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,18 +56,18 @@ int main(int argc, char *argv[]) conformalVoronoiMesh mesh(runTime, cvMeshDict); - // while (runTime.loop()) - // { - // Info<< nl << "Time = " << runTime.timeName() << endl; + while (runTime.loop()) + { + Info<< nl << "Time = " << runTime.timeName() << endl; - // mesh.move(); + mesh.move(); - // Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - // << " ClockTime = " << runTime.elapsedClockTime() << " s" - // << nl << endl; - // } + Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } - // mesh.writeMesh(runTime.constant()); + mesh.writeMesh(runTime.constant()); Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C index fbb106efef..2829cf62f6 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C @@ -1193,21 +1193,6 @@ Foam::conformalVoronoiMesh::conformalVoronoiMesh ) ) { - fvMesh mesh - ( - IOobject - ( - fvMesh::defaultRegion, - runTime_.constant(), - runTime_, - IOobject::MUST_READ - ) - ); - - findRemainingProtrusionSet(mesh); - - return; - createFeaturePoints(); if (cvMeshControls().objOutput()) diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C index bf91b5bf6f..fefc5546d6 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C @@ -399,76 +399,76 @@ void Foam::conformalVoronoiMesh::writeCellSizes cellSize[i] = cellSizeControl().cellSize(C[i]); } - // Info<< nl << "Create targetCellVolume volScalarField" << endl; + Info<< nl << "Create targetCellVolume volScalarField" << endl; - // volScalarField targetCellVolume - // ( - // IOobject - // ( - // "targetCellVolume", - // mesh.polyMesh::instance(), - // mesh, - // IOobject::NO_READ, - // IOobject::AUTO_WRITE - // ), - // mesh, - // dimensionedScalar("cellVolume", dimLength, 0), - // zeroGradientPointPatchField::typeName - // ); + volScalarField targetCellVolume + ( + IOobject + ( + "targetCellVolume", + mesh.polyMesh::instance(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("cellVolume", dimLength, 0), + zeroGradientPointPatchField::typeName + ); - // targetCellVolume.internalField() = pow3(cellSize); + targetCellVolume.internalField() = pow3(cellSize); - // Info<< nl << "Create actualCellVolume volScalarField" << endl; + Info<< nl << "Create actualCellVolume volScalarField" << endl; - // volScalarField actualCellVolume - // ( - // IOobject - // ( - // "actualCellVolume", - // mesh.polyMesh::instance(), - // mesh, - // IOobject::NO_READ, - // IOobject::AUTO_WRITE - // ), - // mesh, - // dimensionedScalar("cellVolume", dimVolume, 0), - // zeroGradientPointPatchField::typeName - // ); + volScalarField actualCellVolume + ( + IOobject + ( + "actualCellVolume", + mesh.polyMesh::instance(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("cellVolume", dimVolume, 0), + zeroGradientPointPatchField::typeName + ); - // actualCellVolume.internalField() = mesh.cellVolumes(); + actualCellVolume.internalField() = mesh.cellVolumes(); - // Info<< nl << "Create equivalentCellSize volScalarField" << endl; + Info<< nl << "Create equivalentCellSize volScalarField" << endl; - // volScalarField equivalentCellSize - // ( - // IOobject - // ( - // "equivalentCellSize", - // mesh.polyMesh::instance(), - // mesh, - // IOobject::NO_READ, - // IOobject::AUTO_WRITE - // ), - // mesh, - // dimensionedScalar("cellSize", dimLength, 0), - // zeroGradientPointPatchField::typeName - // ); + volScalarField equivalentCellSize + ( + IOobject + ( + "equivalentCellSize", + mesh.polyMesh::instance(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("cellSize", dimLength, 0), + zeroGradientPointPatchField::typeName + ); - // equivalentCellSize.internalField() = pow - // ( - // actualCellVolume.internalField(), - // 1.0/3.0 - // ); + equivalentCellSize.internalField() = pow + ( + actualCellVolume.internalField(), + 1.0/3.0 + ); targetCellSize.correctBoundaryConditions(); - // targetCellVolume.correctBoundaryConditions(); - // actualCellVolume.correctBoundaryConditions(); - // equivalentCellSize.correctBoundaryConditions(); + targetCellVolume.correctBoundaryConditions(); + actualCellVolume.correctBoundaryConditions(); + equivalentCellSize.correctBoundaryConditions(); targetCellSize.write(); - // targetCellVolume.write(); - // actualCellVolume.write(); - // equivalentCellSize.write(); + targetCellVolume.write(); + actualCellVolume.write(); + equivalentCellSize.write(); } // { @@ -525,97 +525,30 @@ void Foam::conformalVoronoiMesh::findRemainingProtrusionSet labelHashSet protrudingBoundaryPoints; - label objPtI = 2; - - meshTools::writeOBJ(Info, vector::zero); - - // forAll(patches, patchI) - // { - // Info<< "# " << patches[patchI].name() << endl; - - // const labelList& patchLocalPtIs = patches[patchI].boundaryPoints(); - - // forAll(patchLocalPtIs, ppI) - // { - // label meshPtI = - // patches[patchI].meshPoints()[patchLocalPtIs[ppI]]; - - // const Foam::point& pt = mesh.points()[meshPtI]; - - // if - // ( - // geometryToConformTo_.wellOutside - // ( - // pt, - // sqr(1.2*targetCellSize(pt)) - // ) - // ) - // { - // Info<< "# maxSurfaceProtrusion " << maxSurfaceProtrusion(pt) - // << endl; - - // meshTools::writeOBJ(Info, pt); - // Info<< "l 1 " << objPtI++ << endl; - - // protrudingBoundaryPoints.insert(meshPtI); - // } - // } - // } - - label patchI = patches.size() - 1; - - Info<< "# " << patches[patchI].name() << endl; - - const labelList& patchLocalPtIs = patches[patchI].boundaryPoints(); - - forAll(patchLocalPtIs, ppI) + forAll(patches, patchI) { - label meshPtI = patches[patchI].meshPoints()[patchLocalPtIs[ppI]]; + const labelList& patchLocalPtIs = patches[patchI].boundaryPoints(); - const Foam::point& pt = mesh.points()[meshPtI]; - - Info<< nl << "# ppI " << ppI << " " << pt << endl; - - bool wO = geometryToConformTo_.wellOutside - ( - pt, - sqr(1.2*targetCellSize(pt)) - ); - - Info<< "# wO " << wO << endl; - - if (wO) + forAll(patchLocalPtIs, ppI) { - meshTools::writeOBJ(Info, pt); - Info<< "l 1 " << objPtI++ << endl; + label meshPtI = patches[patchI].meshPoints()[patchLocalPtIs[ppI]]; - protrudingBoundaryPoints.insert(meshPtI); + const Foam::point& pt = mesh.points()[meshPtI]; + + if + ( + geometryToConformTo_.wellOutside + ( + pt, + sqr(2.0*maxSurfaceProtrusion(pt)) + ) + ) + { + protrudingBoundaryPoints.insert(meshPtI); + } } } - // forAll(mesh.points(), pI) - // { - // const Foam::point& pt = mesh.points()[pI]; - - // if - // ( - // geometryToConformTo_.wellOutside - // ( - // pt, - // sqr(1.2*targetCellSize(pt)) - // ) - // ) - // { - // Info<< "# maxSurfaceProtrusion " << maxSurfaceProtrusion(pt) - // << endl; - - // meshTools::writeOBJ(Info, pt); - // Info<< "l 1 " << objPtI++ << endl; - - // protrudingBoundaryPoints.insert(pI); - // } - // } - cellSet protrudingCells ( mesh, @@ -628,9 +561,9 @@ void Foam::conformalVoronoiMesh::findRemainingProtrusionSet const label pointI = iter.key(); const labelList& pCells = mesh.pointCells()[pointI]; - forAll(pCells, pCI) + forAll(pCells, pCellI) { - protrudingCells.insert(pCells[pCI]); + protrudingCells.insert(pCells[pCellI]); } } diff --git a/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C b/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C index a1bb274c9e..527a15023c 100644 --- a/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C +++ b/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C @@ -336,7 +336,6 @@ Foam::Field Foam::conformationSurfaces::wellInOutSide bool testForInside ) const { - Info<< "Enter wellInOutSide " << endl; List > surfaceVolumeTests ( surfaces_.size(), @@ -403,20 +402,11 @@ Foam::Field Foam::conformationSurfaces::wellInOutSide { inOutSidePoint[i] = !testForInside; - Info<< " break " << endl; - break; } } } - Info<< "# " << referenceVolumeTypes_[0] << " " - << surfaceVolumeTests[0][0] << " " - << hitInfo[0].hit() << " " - << inOutSidePoint[0] << endl; - - Info<< "Return wellInOutSide " << inOutSidePoint << endl; - return inOutSidePoint; } @@ -447,15 +437,7 @@ Foam::Field Foam::conformationSurfaces::wellOutside const scalarField& testDistSqr ) const { - Info<< "field pt wellOutside" << endl; - - Field wO = wellInOutSide(samplePts, testDistSqr, false); - - Info<< "field pt wellOutside field " << wO << endl; - - return wO; - - // return wellInOutSide(samplePts, testDistSqr, false); + return wellInOutSide(samplePts, testDistSqr, false); } @@ -465,19 +447,7 @@ bool Foam::conformationSurfaces::wellOutside scalar testDistSqr ) const { - Info<< "single pt wellOutside" << endl; - - Field wO = wellOutside - ( - pointField(1, samplePt), - scalarField(1, testDistSqr) - ); - - Info<< "single pt wellOutside field " << wO << endl; - - return wO[0]; - - // return wellOutside(pointField(1, samplePt), scalarField(1, testDistSqr))[0]; + return wellOutside(pointField(1, samplePt), scalarField(1, testDistSqr))[0]; }