diff --git a/.gitignore b/.gitignore index f567511db3..3cc18eb468 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,10 @@ doc/[Dd]oxygen/man /*.html /doc/*.html +# untracked configuration files +/etc/prefs.csh +/etc/prefs.sh + # source packages - anywhere *.tar.bz2 *.tar.gz diff --git a/README b/README index df56c9c9a4..52fba8b216 100644 --- a/README +++ b/README @@ -112,7 +112,7 @@ which may be obtained from http://gcc.gnu.org/. Install the compiler in - $WM_THIRD_PARTY_DIR/gcc-/platforms/$WM_ARCH$WM_COMPILER_ARCH/ + $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc- and change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and $WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the environment variables as in section 3. @@ -166,6 +166,7 @@ gcc-4.3.3. Execute the following: + cd $WM_THIRD_PARTY_DIR + rm -rf paraview-3.6.1/platforms + + rm -rf platforms/*/paraview-3.6.1 + ./makeParaView The PV3blockMeshReader and the PV3FoamReader ParaView plugins are compiled diff --git a/applications/test/nearWallDist-wave/testWallDistData.C b/applications/test/nearWallDist-wave/testWallDistData.C index cb742f435f..0b94dfa216 100644 --- a/applications/test/nearWallDist-wave/testWallDistData.C +++ b/applications/test/nearWallDist-wave/testWallDistData.C @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) mesh ), mesh, - dimensionedVector("n", dimLength, wallPoint::greatPoint) + dimensionedVector("n", dimLength, point::max) ); // Fill wall patches with unit normal diff --git a/applications/test/syncTools/syncToolsTest.C b/applications/test/syncTools/syncToolsTest.C index 320b4e6f61..fb225ac397 100644 --- a/applications/test/syncTools/syncToolsTest.C +++ b/applications/test/syncTools/syncToolsTest.C @@ -187,8 +187,6 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) ); const pointField& localPoints = allBoundary.localPoints(); - const point greatPoint(GREAT, GREAT, GREAT); - // Point data // ~~~~~~~~~~ @@ -196,7 +194,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) { // Create some data. Use slightly perturbed positions. Map sparseData; - pointField fullData(mesh.nPoints(), greatPoint); + pointField fullData(mesh.nPoints(), point::max); forAll(localPoints, i) { @@ -222,7 +220,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) mesh, fullData, minEqOp(), - greatPoint, + point::max, true // apply separation ); @@ -232,7 +230,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) { const point& fullPt = fullData[meshPointI]; - if (fullPt != greatPoint) + if (fullPt != point::max) { const point& sparsePt = sparseData[meshPointI]; @@ -272,7 +270,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) { // Create some data. Use slightly perturbed positions. EdgeMap sparseData; - pointField fullData(mesh.nEdges(), greatPoint); + pointField fullData(mesh.nEdges(), point::max); const edgeList& edges = allBoundary.edges(); const labelList meshEdges = allBoundary.meshEdges @@ -307,7 +305,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) mesh, fullData, minEqOp(), - greatPoint, + point::max, true ); @@ -317,7 +315,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) { const point& fullPt = fullData[meshEdgeI]; - if (fullPt != greatPoint) + if (fullPt != point::max) { const point& sparsePt = sparseData[mesh.edges()[meshEdgeI]]; @@ -364,8 +362,6 @@ void testPointSync(const polyMesh& mesh, Random& rndGen) { Info<< nl << "Testing point-wise data synchronisation." << endl; - const point greatPoint(GREAT, GREAT, GREAT); - // Test position. { @@ -379,7 +375,7 @@ void testPointSync(const polyMesh& mesh, Random& rndGen) mesh, syncedPoints, minEqOp(), - greatPoint, + point::max, true ); @@ -444,8 +440,6 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen) const edgeList& edges = mesh.edges(); - const point greatPoint(GREAT, GREAT, GREAT); - // Test position. { @@ -463,7 +457,7 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen) mesh, syncedMids, minEqOp(), - greatPoint, + point::max, true ); diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/Make/files b/applications/utilities/mesh/generation/extrudeToRegionMesh/Make/files new file mode 100644 index 0000000000..62431e23d4 --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/Make/files @@ -0,0 +1,7 @@ +patchPointEdgeCirculator.C +createShellMesh.C +extrudeToRegionMesh.C + +EXE = $(FOAM_APPBIN)/extrudeToRegionMesh + + diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/Make/options b/applications/utilities/mesh/generation/extrudeToRegionMesh/Make/options new file mode 100644 index 0000000000..dbf50a9b09 --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/Make/options @@ -0,0 +1,14 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + /* -I$(LIB_SRC)/surfMesh/lnInclude */ \ + /* -I$(LIB_SRC)/lagrangian/basic/lnInclude */ \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + /* -lsurfMesh */ \ + /* -llagrangian */ \ + -lmeshTools \ + -ldynamicMesh + diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/createShellMesh.C b/applications/utilities/mesh/generation/extrudeToRegionMesh/createShellMesh.C new file mode 100644 index 0000000000..df998941ef --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/createShellMesh.C @@ -0,0 +1,588 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "createShellMesh.H" +#include "polyTopoChange.H" +#include "meshTools.H" +#include "mapPolyMesh.H" +#include "polyAddPoint.H" +#include "polyAddFace.H" +#include "polyModifyFace.H" +#include "polyAddCell.H" +#include "patchPointEdgeCirculator.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::createShellMesh, 0); + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::createShellMesh::calcPointRegions +( + const primitiveFacePatch& patch, + const PackedBoolList& nonManifoldEdge, + faceList& pointRegions, + labelList& regionPoints +) +{ + pointRegions.setSize(patch.size()); + forAll(pointRegions, faceI) + { + const face& f = patch.localFaces()[faceI]; + pointRegions[faceI].setSize(f.size(), -1); + } + + label nRegions = 0; + + forAll(pointRegions, faceI) + { + const face& f = patch.localFaces()[faceI]; + + forAll(f, fp) + { + if (pointRegions[faceI][fp] == -1) + { + // Found unassigned point. Distribute current region. + label pointI = f[fp]; + label edgeI = patch.faceEdges()[faceI][fp]; + + patchPointEdgeCirculator circ + ( + patch, + nonManifoldEdge, + edgeI, + findIndex(patch.edgeFaces()[edgeI], faceI), + pointI + ); + + for + ( + patchPointEdgeCirculator iter = circ.begin(); + iter != circ.end(); + ++iter + ) + { + label face2 = iter.faceID(); + + if (face2 != -1) + { + const face& f2 = patch.localFaces()[face2]; + label fp2 = findIndex(f2, pointI); + label& region = pointRegions[face2][fp2]; + if (region != -1) + { + FatalErrorIn + ( + "createShellMesh::calcPointRegions(..)" + ) << "On point " << pointI + << " at:" << patch.localPoints()[pointI] + << " found region:" << region + << abort(FatalError); + } + region = nRegions; + } + } + + nRegions++; + } + } + } + + + // From region back to originating point (many to one, a point might + // have multiple regions though) + regionPoints.setSize(nRegions); + forAll(pointRegions, faceI) + { + const face& f = patch.localFaces()[faceI]; + + forAll(f, fp) + { + regionPoints[pointRegions[faceI][fp]] = f[fp]; + } + } + + + if (debug) + { + const labelListList& pointFaces = patch.pointFaces(); + forAll(pointFaces, pointI) + { + label region = -1; + const labelList& pFaces = pointFaces[pointI]; + forAll(pFaces, i) + { + label faceI = pFaces[i]; + const face& f = patch.localFaces()[faceI]; + label fp = findIndex(f, pointI); + + if (region == -1) + { + region = pointRegions[faceI][fp]; + } + else if (region != pointRegions[faceI][fp]) + { + Pout<< "Non-manifold point:" << pointI + << " at " << patch.localPoints()[pointI] + << " region:" << region + << " otherRegion:" << pointRegions[faceI][fp] + << endl; + + } + } + } + } +} + + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::createShellMesh::createShellMesh +( + const primitiveFacePatch& patch, + const faceList& pointRegions, + const labelList& regionPoints +) +: + patch_(patch), + pointRegions_(pointRegions), + regionPoints_(regionPoints) +{ + if (pointRegions_.size() != patch_.size()) + { + FatalErrorIn("createShellMesh::createShellMesh(..)") + << "nFaces:" << patch_.size() + << " pointRegions:" << pointRegions.size() + << exit(FatalError); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + + +void Foam::createShellMesh::setRefinement +( + const pointField& thickness, + const labelList& topPatchID, + const labelList& bottomPatchID, + const labelListList& extrudeEdgePatches, + polyTopoChange& meshMod +) +{ + if (thickness.size() != regionPoints_.size()) + { + FatalErrorIn("createShellMesh::setRefinement(..)") + << "nRegions:" << regionPoints_.size() + << " thickness:" << thickness.size() + << exit(FatalError); + } + + if + ( + topPatchID.size() != patch_.size() + && bottomPatchID.size() != patch_.size() + ) + { + FatalErrorIn("createShellMesh::setRefinement(..)") + << "nFaces:" << patch_.size() + << " topPatchID:" << topPatchID.size() + << " bottomPatchID:" << bottomPatchID.size() + << exit(FatalError); + } + + if (extrudeEdgePatches.size() != patch_.nEdges()) + { + FatalErrorIn("createShellMesh::setRefinement(..)") + << "nEdges:" << patch_.nEdges() + << " extrudeEdgePatches:" << extrudeEdgePatches.size() + << exit(FatalError); + } + + + + // From cell to patch (trivial) + DynamicList