diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index be23570078..8159ee73aa 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -146,5 +146,3 @@ ( additionalControlsDict.lookup("solvePrimaryRegion") ); - - IObasicSourceList sources(mesh); diff --git a/applications/utilities/mesh/advanced/modifyMesh/cellSplitter.C b/applications/utilities/mesh/advanced/modifyMesh/cellSplitter.C index d746d63b8f..46954c120c 100644 --- a/applications/utilities/mesh/advanced/modifyMesh/cellSplitter.C +++ b/applications/utilities/mesh/advanced/modifyMesh/cellSplitter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,7 +36,10 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(Foam::cellSplitter, 0); +namespace Foam +{ +defineTypeNameAndDebug(cellSplitter, 0); +} // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C index 27cc47f823..18109761a5 100644 --- a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C +++ b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C @@ -466,8 +466,8 @@ int main(int argc, char *argv[]) labelListList pointPoints; autoPtr meshDistributor = buildMap(mesh, pointPoints); - triadField alignments = buildAlignmentField(mesh); - pointField points = buildPointField(mesh); + triadField alignments(buildAlignmentField(mesh)); + pointField points(buildPointField(mesh)); mesh.printInfo(Info); diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H index 124f4b39dc..fcc5d8c2ba 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H @@ -168,7 +168,8 @@ public: ); //- Inserts points into the triangulation if the point is within - // the circumsphere of another cell + // the circumsphere of another cell. Returns HashSet of failed + // point insertions template labelPairHashSet rangeInsertReferredWithInfo ( diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/Make/options b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/Make/options index 4a072aa593..03ee51a4f6 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/Make/options +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/Make/options @@ -24,7 +24,7 @@ EXE_INC = \ -IPrintTable \ -I../vectorTools -EXE_LIBS = \ +LIB_LIBS = \ -lmeshTools \ -ledgeMesh \ -lfileFormats \ diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C index a6b47f4ab0..7238f270bb 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C @@ -585,7 +585,7 @@ Foam::label Foam::cellShapeControl::refineMesh const autoPtr& decomposition ) { - const pointField cellCentres = shapeControlMesh_.cellCentres(); + const pointField cellCentres(shapeControlMesh_.cellCentres()); Info<< " Created cell centres" << endl; @@ -682,7 +682,7 @@ Foam::label Foam::cellShapeControl::refineMesh ) ); verts.last().targetCellSize() = lastCellSize; - verts.last().alignment() = tensor::I; + verts.last().alignment() = triad::unset; } } @@ -704,8 +704,8 @@ void Foam::cellShapeControl::smoothMesh() pointPoints ); - triadField alignments = buildAlignmentField(shapeControlMesh_); - pointField points = buildPointField(shapeControlMesh_); + triadField alignments(buildAlignmentField(shapeControlMesh_)); + pointField points(buildPointField(shapeControlMesh_)); // Setup the sizes and alignments on each point triadField fixedAlignments(shapeControlMesh_.vertexCount(), triad::unset); @@ -721,12 +721,7 @@ void Foam::cellShapeControl::smoothMesh() { const tensor& alignment = vit->alignment(); - fixedAlignments[vit->index()] = triad - ( - alignment.x(), - alignment.y(), - alignment.z() - ); + fixedAlignments[vit->index()] = alignment; } } @@ -881,12 +876,7 @@ void Foam::cellShapeControl::smoothMesh() { if (vit->real()) { - vit->alignment() = tensor - ( - alignments[vit->index()].x(), - alignments[vit->index()].y(), - alignments[vit->index()].z() - ); + vit->alignment() = alignments[vit->index()]; } } @@ -911,9 +901,7 @@ void Foam::cellShapeControl::smoothMesh() { if (vit->referred()) { - const triad& t = alignments[referredPoints[referredI++]]; - - vit->alignment() = tensor(t.x(), t.y(), t.z()); + vit->alignment() = alignments[referredPoints[referredI++]]; } } } diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C index bdcbf5a885..ae57bbb087 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C @@ -684,7 +684,7 @@ void Foam::cellShapeControlMesh::insertBoundingPoints(const boundBox& bb) boundBox bbInflate = bb; bbInflate.inflate(10); - pointField pts = bbInflate.points(); + pointField pts(bbInflate.points()); forAll(pts, pI) { diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C index e8f09cf5f1..4a73b4a7c5 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C @@ -263,8 +263,6 @@ Foam::triSurfaceScalarField Foam::automatic::load() surfaceCellSize.write(); - debug = 1; - if (debug) { faceList faces(surface_.size()); diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C index 92ee53c1f2..5eb2c01f5f 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C @@ -30,6 +30,7 @@ License #include "indexedCellChecks.H" #include "CGAL/Exact_predicates_exact_constructions_kernel.h" +#include "CGAL/Gmpq.h" // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // @@ -211,9 +212,8 @@ void Foam::conformalVoronoiMesh::checkDuals() typedef CGAL::Exact_predicates_exact_constructions_kernel EK2; typedef CGAL::Regular_triangulation_euclidean_traits_3 EK; - typedef CGAL::Cartesian_converter To_exact; - typedef CGAL::Cartesian_converter - Back_from_exact; + typedef CGAL::Cartesian_converter To_exact; + typedef CGAL::Cartesian_converter Back_from_exact; // PackedBoolList bPoints(number_of_finite_cells()); @@ -391,13 +391,13 @@ void Foam::conformalVoronoiMesh::checkDuals() CGAL::Gmpq z(CGAL::to_double(masterPoint.z())); std::cout<< "master = " << x << " " << y << " " << z - << endl; + << std::endl; CGAL::Gmpq xs(CGAL::to_double(closestPoint.x())); CGAL::Gmpq ys(CGAL::to_double(closestPoint.y())); CGAL::Gmpq zs(CGAL::to_double(closestPoint.z())); std::cout<< "slave = " << xs << " " << ys << " " << zs - << endl; + << std::endl; } } else diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H index 02d37c1b05..ea9e4db6d4 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H @@ -142,7 +142,7 @@ inline int CGAL::indexedVertex::index() const template -inline typename CGAL::indexedVertex::vertexType& +inline Foam::indexedVertexEnum::vertexType& CGAL::indexedVertex::type() { return type_; @@ -150,7 +150,7 @@ CGAL::indexedVertex::type() template -inline typename CGAL::indexedVertex::vertexType +inline Foam::indexedVertexEnum::vertexType CGAL::indexedVertex::type() const { return type_; diff --git a/applications/utilities/mesh/generation/cvMesh/cvMesh.C b/applications/utilities/mesh/generation/cvMesh/cvMesh.C index cf21964271..e9487b909b 100644 --- a/applications/utilities/mesh/generation/cvMesh/cvMesh.C +++ b/applications/utilities/mesh/generation/cvMesh/cvMesh.C @@ -64,14 +64,22 @@ int main(int argc, char *argv[]) ) ); - conformalVoronoiMesh::debug = true; - - conformalVoronoiMesh mesh(runTime, cvMeshDict); - if (checkGeometry) { - const searchableSurfaces& allGeometry = mesh.allGeometry(); + const searchableSurfaces allGeometry + ( + IOobject + ( + "cvSearchableSurfaces", + runTime.constant(), + "triSurface", + runTime, + IOobject::MUST_READ, + IOobject::NO_WRITE + ), + cvMeshDict.subDict("geometry") + ); // Write some stats allGeometry.writeStats(List(0), Info); @@ -91,6 +99,11 @@ int main(int argc, char *argv[]) } + conformalVoronoiMesh::debug = true; + + conformalVoronoiMesh mesh(runTime, cvMeshDict); + + while (runTime.loop()) { Info<< nl << "Time = " << runTime.timeName() << endl; diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C index d964ac12cc..ef521a257d 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C @@ -803,7 +803,7 @@ Foam::label Foam::checkGeometry(const polyMesh& mesh, const bool allGeometry) if (allGeometry) { cellSet cells(mesh, "underdeterminedCells", mesh.nCells()/100); - if (mesh.checkCellDeterminant(true, &cells, mesh.geometricD())) + if (mesh.checkCellDeterminant(true, &cells)) { noFailedChecks++; diff --git a/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C b/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C index df572a3619..26d472c44d 100644 --- a/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C +++ b/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C @@ -33,7 +33,10 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(Foam::mergePolyMesh, 1); +namespace Foam +{ +defineTypeNameAndDebug(mergePolyMesh, 1); +} // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C b/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C index e0dabffedb..a86343da25 100644 --- a/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C +++ b/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C @@ -34,7 +34,10 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(Foam::meshDualiser, 0); +namespace Foam +{ +defineTypeNameAndDebug(meshDualiser, 0); +} // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/applications/utilities/mesh/manipulation/setSet/Allwmake b/applications/utilities/mesh/manipulation/setSet/Allwmake index 3be0afc595..0d586b6f94 100755 --- a/applications/utilities/mesh/manipulation/setSet/Allwmake +++ b/applications/utilities/mesh/manipulation/setSet/Allwmake @@ -14,7 +14,7 @@ if [ -f /usr/include/readline/readline.h -a "${1%NO_READLINE}" = "$1" ] then echo "Found -- enabling readline support." export COMP_FLAGS="-DHAS_READLINE" - export LINK_FLAGS="-lreadline -lncurses" + export LINK_FLAGS="-lreadline" fi wmake diff --git a/applications/utilities/mesh/manipulation/subsetMesh/Make/files b/applications/utilities/mesh/manipulation/subsetMesh/Make/files index d8856b5f26..79552b3264 100644 --- a/applications/utilities/mesh/manipulation/subsetMesh/Make/files +++ b/applications/utilities/mesh/manipulation/subsetMesh/Make/files @@ -1,6 +1,3 @@ -cellSelection/cellSelection.C -cellSelection/badQualityCellSelection.C -cellSelection/outsideCellSelection.C subsetMesh.C EXE = $(FOAM_APPBIN)/subsetMesh diff --git a/applications/utilities/mesh/manipulation/subsetMesh/cellSelection/outsideCellSelection.C b/applications/utilities/mesh/manipulation/subsetMesh/cellSelection/outsideCellSelection.C deleted file mode 100644 index 7cb4eec518..0000000000 --- a/applications/utilities/mesh/manipulation/subsetMesh/cellSelection/outsideCellSelection.C +++ /dev/null @@ -1,417 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "outsideCellSelection.H" -#include "addToRunTimeSelectionTable.H" -#include "faceSet.H" -#include "polyMesh.H" -#include "motionSmoother.H" -#include "regionSplit.H" -#include "syncTools.H" -#include "zeroGradientFvPatchFields.H" - - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace cellSelections -{ - defineTypeNameAndDebug(outsideCellSelection, 0); - addToRunTimeSelectionTable(cellSelection, outsideCellSelection, dictionary); -} -} - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -Foam::tmp -Foam::cellSelections::outsideCellSelection::generateField -( - const word& name, - const boolList& lst -) const -{ - const fvMesh& mesh = dynamic_cast(mesh_); - - tmp tfld - ( - new volScalarField - ( - IOobject - ( - name, - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - mesh, - dimensionedScalar(name, dimless, 0), - zeroGradientFvPatchScalarField::typeName - ) - ); - scalarField& fld = tfld().internalField(); - - forAll(fld, celli) - { - fld[celli] = 1.0*lst[celli]; - } - tfld().correctBoundaryConditions(); - - return tfld; -} - - -void Foam::cellSelections::outsideCellSelection::markRegionFaces -( - const boolList& selectedCell, - boolList& regionFace -) const -{ - // Internal faces - const labelList& faceOwner = mesh_.faceOwner(); - const labelList& faceNeighbour = mesh_.faceNeighbour(); - forAll(faceNeighbour, faceI) - { - if - ( - selectedCell[faceOwner[faceI]] - != selectedCell[faceNeighbour[faceI]] - ) - { - regionFace[faceI] = true; - } - } - - // Swap neighbour selectedCell state - boolList nbrSelected; - syncTools::swapBoundaryCellList(mesh_, selectedCell, nbrSelected); - - // Boundary faces - const polyBoundaryMesh& pbm = mesh_.boundaryMesh(); - forAll(pbm, patchI) - { - const polyPatch& pp = pbm[patchI]; - const labelUList& faceCells = pp.faceCells(); - forAll(faceCells, i) - { - label faceI = pp.start()+i; - label bFaceI = faceI-mesh_.nInternalFaces(); - if - ( - selectedCell[faceCells[i]] - != selectedCell[nbrSelected[bFaceI]] - ) - { - regionFace[faceI] = true; - } - } - } -} - - -Foam::boolList Foam::cellSelections::outsideCellSelection::findRegions -( - const bool verbose, - const regionSplit& cellRegion -) const -{ - boolList keepRegion(cellRegion.nRegions(), false); - - forAll(locationsInMesh_, i) - { - // Find the region containing the insidePoint - - label cellI = mesh_.findCell(locationsInMesh_[i]); - - label keepRegionI = -1; - label keepProcI = -1; - if (cellI != -1) - { - keepRegionI = cellRegion[cellI]; - keepProcI = Pstream::myProcNo(); - } - reduce(keepRegionI, maxOp