diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C index dec725ee1f..c2294f98a4 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C @@ -174,7 +174,7 @@ Foam::searchableSurfaceControl::searchableSurfaceControl searchableSurface_(geometryToConformTo.geometry()[surfaceName_]), geometryToConformTo_(geometryToConformTo), cellSizeFunctions_(1), - regionToCellSizeFunctions_(geometryToConformTo_.patchNames().size(), -1), + regionToCellSizeFunctions_(searchableSurface_.regions().size(), -1), maxPriority_(-1) { Info<< indent << "Master settings:" << endl; @@ -205,11 +205,11 @@ Foam::searchableSurfaceControl::searchableSurfaceControl if (controlFunctionDict.found("regions")) { const dictionary& regionsDict = controlFunctionDict.subDict("regions"); - const wordList& regionNames = geometryToConformTo_.patchNames(); + const wordList& regionNames = searchableSurface_.regions(); label nRegions = regionsDict.size(); - regionCellSizeFunctions.setSize(nRegions + 1); + regionCellSizeFunctions.setSize(nRegions); defaultCellSizeRegions.setCapacity(nRegions); forAll(regionNames, regionI) @@ -263,6 +263,8 @@ Foam::searchableSurfaceControl::searchableSurfaceControl } else if (nRegionCellSizeFunctions > 0) { + regionCellSizeFunctions.setSize(nRegionCellSizeFunctions + 1); + regionCellSizeFunctions.set ( nRegionCellSizeFunctions, @@ -275,7 +277,7 @@ Foam::searchableSurfaceControl::searchableSurfaceControl ) ); - const wordList& regionNames = geometryToConformTo_.patchNames(); + const wordList& regionNames = searchableSurface_.regions(); forAll(regionNames, regionI) { @@ -289,7 +291,7 @@ Foam::searchableSurfaceControl::searchableSurfaceControl } else { - const wordList& regionNames = geometryToConformTo_.patchNames(); + const wordList& regionNames = searchableSurface_.regions(); forAll(regionNames, regionI) { diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C index 8c466e9693..b68ee557e5 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C @@ -369,13 +369,15 @@ Foam::conformationSurfaces::conformationSurfaces featureI ); + const wordList& rNames = allGeometry_[surfaces_[surfI]].regions(); + if (surfaceSubDict.found("regions")) { const dictionary& regionsDict = surfaceSubDict.subDict("regions"); - forAll(regionNames, regionI) + forAll(rNames, regionI) { - const word& regionName = regionNames[regionI]; + const word& regionName = rNames[regionI]; if (regionsDict.found(regionName)) { diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index 4d480b9efc..5f1331e124 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -42,7 +42,11 @@ geometry //maxTreeDepth 10; // optional:depth of octree. Decrease only in case // of memory limitations. - // Per region the patchname. If not provided will be _. + // Per region the patchname. If not provided will be _. + // Note: this name cannot be used to identity this region in any + // other part of this dictionary; it is only a name + // for the combination of surface+region (which is only used + // when creating patches) regions { secondSolid diff --git a/src/OpenFOAM/containers/Lists/List/List.H b/src/OpenFOAM/containers/Lists/List/List.H index d69c92aadd..0523b55b75 100644 --- a/src/OpenFOAM/containers/Lists/List/List.H +++ b/src/OpenFOAM/containers/Lists/List/List.H @@ -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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -162,10 +162,10 @@ public: // Edit - //- Reset size of List. + //- Alias for setSize(const label) inline void resize(const label); - //- Reset size of List and value for new elements. + //- Alias for setSize(const label, const T&) inline void resize(const label, const T&); //- Reset size of List. diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrList.H b/src/OpenFOAM/containers/Lists/PtrList/PtrList.H index 94f7f89dbc..357b078dbf 100644 --- a/src/OpenFOAM/containers/Lists/PtrList/PtrList.H +++ b/src/OpenFOAM/containers/Lists/PtrList/PtrList.H @@ -173,16 +173,12 @@ public: // Edit - //- Reset size of PtrList. This can only be used to set the size - // of an empty PtrList, extend a PtrList, remove entries from - // the end of a PtrList. If the entries are non-empty they are + //- Reset size of PtrList. If extending the PtrList, new entries are + // set to NULL. If truncating the PtrList, removed entries are // deleted. void setSize(const label); - //- Reset size of PtrList. This can only be used to set the size - // of an empty PtrList, extend a PtrList, remove entries from - // the end of a PtrList. If the entries are non-empty they are - // deleted. + //- Alias for setSize(const label) inline void resize(const label); //- Clear the PtrList, i.e. set size to zero deleting all the @@ -190,7 +186,7 @@ public: void clear(); //- Append an element at the end of the list - inline void append(const T*); + inline void append(T*); inline void append(const autoPtr&); inline void append(const tmp&); diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H b/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H index 74fafa6da5..c901b5fed4 100644 --- a/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H +++ b/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H @@ -80,7 +80,7 @@ inline void Foam::PtrList::resize(const label newSize) template -inline void Foam::PtrList::append(const T* ptr) +inline void Foam::PtrList::append(T* ptr) { label sz = size(); this->setSize(sz+1); diff --git a/src/OpenFOAM/primitives/SymmTensor2D/SymmTensor2DI.H b/src/OpenFOAM/primitives/SymmTensor2D/SymmTensor2DI.H index e021707370..458976b756 100644 --- a/src/OpenFOAM/primitives/SymmTensor2D/SymmTensor2DI.H +++ b/src/OpenFOAM/primitives/SymmTensor2D/SymmTensor2DI.H @@ -443,7 +443,7 @@ class innerProduct, SymmTensor2D > { public: - typedef SymmTensor2D type; + typedef Tensor2D type; }; template diff --git a/src/meshTools/searchableSurface/searchableSurfaces.C b/src/meshTools/searchableSurface/searchableSurfaces.C index 08569aba78..54857140fc 100644 --- a/src/meshTools/searchableSurface/searchableSurfaces.C +++ b/src/meshTools/searchableSurface/searchableSurfaces.C @@ -301,7 +301,7 @@ Foam::label Foam::searchableSurfaces::findSurfaceRegionID { label surfaceIndex = findSurfaceID(surfaceName); - return findIndex(regionNames()[surfaceIndex], regionName); + return findIndex(this->operator[](surfaceIndex).regions(), regionName); } diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H index cdae056126..a2a5731162 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H @@ -139,7 +139,7 @@ public: virtual tmp rho() const; //- Density for patch [kg/m^3] - virtual tmp rho(const label patchi) const = 0; + virtual tmp rho(const label patchi) const; //- Return non-const access to the local density field [kg/m^3] virtual volScalarField& rho(); diff --git a/tutorials/mesh/foamyHexMesh/flange/system/foamyHexMeshDict b/tutorials/mesh/foamyHexMesh/flange/system/foamyHexMeshDict index cf6a3cafdf..00b03b6a69 100644 --- a/tutorials/mesh/foamyHexMesh/flange/system/foamyHexMeshDict +++ b/tutorials/mesh/foamyHexMesh/flange/system/foamyHexMeshDict @@ -22,34 +22,7 @@ FoamFile geometry { - flange.stl - { - name flange; - type triSurfaceMesh; - - regions - { - patch1 - { - name wall; - } - - patch2 - { - name plate; - } - - patch3 - { - name rings; - } - - patch4 - { - name outlet; - } - } - } + #include "meshDict.geometry" } @@ -80,7 +53,7 @@ surfaceConformation regions { - wall + patch1 { patchInfo { @@ -88,7 +61,7 @@ surfaceConformation } } - plate + patch2 { patchInfo { @@ -96,7 +69,7 @@ surfaceConformation } } - rings + patch3 { patchInfo { @@ -104,7 +77,7 @@ surfaceConformation } } - outlet + patch4 { patchInfo { @@ -150,7 +123,7 @@ motionControl regions { - rings + patch3 { type searchableSurfaceControl; priority 2; @@ -158,7 +131,7 @@ motionControl surfaceCellSizeFunction uniformValue; uniformValueCoeffs { - surfaceCellSizeCoeff 0.5; + surfaceCellSizeCoeff 0.25; } cellSizeFunction surfaceOffsetLinearDistance; surfaceOffsetLinearDistanceCoeffs diff --git a/tutorials/mesh/foamyHexMesh/flange/system/meshDict.geometry b/tutorials/mesh/foamyHexMesh/flange/system/meshDict.geometry new file mode 100644 index 0000000000..d71298fc60 --- /dev/null +++ b/tutorials/mesh/foamyHexMesh/flange/system/meshDict.geometry @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object meshDict.geometry; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +flange.obj +{ + name flange; + type triSurfaceMesh; + + regions + { + patch1 + { + name wall; + } + + patch2 + { + name plate; + } + + patch3 + { + name rings; + } + + patch4 + { + name outlet; + } + } +} + + +// ************************************************************************* // diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/system/foamyHexMeshDict b/tutorials/mesh/foamyHexMesh/mixerVessel/system/foamyHexMeshDict index a000ba4ad3..9ec0594223 100644 --- a/tutorials/mesh/foamyHexMesh/mixerVessel/system/foamyHexMeshDict +++ b/tutorials/mesh/foamyHexMesh/mixerVessel/system/foamyHexMeshDict @@ -59,9 +59,9 @@ surfaceConformation extendedFeatureEdgeMesh "vessel.extendedFeatureEdgeMesh"; regions { - vessel_wall {} - vessel_outletPipe {} - vessel_outlet {} + patch1 {} + patch2 {} + patch3 {} } } @@ -142,7 +142,7 @@ motionControl regions { - vessel_wall + patch1 { surfaceCellSizeFunction uniformValue; uniformValueCoeffs @@ -154,7 +154,7 @@ motionControl uniformCoeffs{} } - vessel_outletPipe + patch2 { priority 2; surfaceCellSizeFunction uniformValue; @@ -170,7 +170,7 @@ motionControl } } - vessel_outlet + patch3 { priority 2; surfaceCellSizeFunction uniformValue;