diff --git a/applications/solvers/immersedBoundary/pimpleDyMIbFoam/Make/options b/applications/solvers/immersedBoundary/pimpleDyMIbFoam/Make/options index 2a4994647..2d648a16b 100644 --- a/applications/solvers/immersedBoundary/pimpleDyMIbFoam/Make/options +++ b/applications/solvers/immersedBoundary/pimpleDyMIbFoam/Make/options @@ -19,6 +19,6 @@ EXE_LIBS = \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ - -limmersedBoundaryTurbulence \ + -lincompressibleImmersedBoundaryTurbulence \ -llduSolvers \ -L$(MESQUITE_LIB_DIR) -lmesquite diff --git a/applications/utilities/immersedBoundary/writeIbMasks/writeIbMasks.C b/applications/utilities/immersedBoundary/writeIbMasks/writeIbMasks.C index d3bb15a1e..1ae1cb938 100644 --- a/applications/utilities/immersedBoundary/writeIbMasks/writeIbMasks.C +++ b/applications/utilities/immersedBoundary/writeIbMasks/writeIbMasks.C @@ -33,6 +33,7 @@ Description #include "fvc.H" #include "fvMatrices.H" #include "immersedBoundaryFvPatch.H" +#include "cellSet.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -59,6 +60,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) label minLiveCell = -1; const scalarField& gammaIn = gamma.internalField(); + // Collect dead cells + labelHashSet deadCellsHash; + forAll (mesh.boundary(), patchI) { if (isA(mesh.boundary()[patchI])) @@ -79,6 +83,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) minLiveCell = ibCells[dcI]; } } + + // Collect dead cells + deadCellsHash.insert(ibPatch.ibPolyPatch().deadCells()); } } @@ -124,6 +131,17 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) sGamma.write(); gamma.write(); + + // Create dead cells set + { + cellSet + ( + mesh, + "deadCells", + deadCellsHash + ).write(); + } + // Check consistency of face area vectors Info<< nl << "Calculating divSf" << endl; @@ -240,8 +258,6 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) << "Sum normal areas: " << sum(openFaceAreas) << nl << "Sum iB areas: " << sum(ibVectors) << nl << endl; - - } Info<< endl; diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C index f255331f7..d2170d0a9 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C @@ -25,7 +25,8 @@ Description Extrude mesh from existing patch (by default outwards facing normals; optional flips faces) or from patch read from file. - Note: Merges close points so be careful. + Note: Merges close points so be careful. This can be controlled with the + optional mergeTolerance parameter (1e-4) by default. Type of extrusion prescribed by run-time selectable model. @@ -179,7 +180,11 @@ int main(int argc, char *argv[]) const boundBox& bb = mesh.globalData().bb(); const vector span = bb.span(); - const scalar mergeDim = 1e-4 * bb.minDim(); + + // Read merge tolerance + const scalar mergeTolerance = + dict.lookupOrDefault("mergeTolerance", 1e-4); + const scalar mergeDim = mergeTolerance*bb.minDim(); Info<< "Mesh bounding box : " << bb << nl << " with span : " << span << nl @@ -200,7 +205,7 @@ int main(int argc, char *argv[]) // Collapse edges // ~~~~~~~~~~~~~~ - + if (mergeTolerance > SMALL) { Info<< "Collapsing edges < " << mergeDim << " ..." << nl << endl; diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties b/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties index 6a2269dc5..5f82569fc 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties @@ -70,5 +70,7 @@ sigmaRadialCoeffs pStrat 1; } +mergeTolerance 1e-4; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/Allwmake b/src/Allwmake index 6ff5d803d..755fa7dbd 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -80,7 +80,8 @@ wmake libso solidModels wmake libso dbns wmake libso immersedBoundary/immersedBoundary -wmake libso immersedBoundary/immersedBoundaryTurbulence +wmake libso immersedBoundary/immersedBoundaryTurbulence/incompressible +wmake libso immersedBoundary/immersedBoundaryTurbulence/compressible wmake libso immersedBoundary/immersedBoundaryDynamicMesh wmake libso overset/oversetMesh diff --git a/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/decomposeMesh.C b/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/decomposeMesh.C index 57fe4ec5b..db73122ac 100644 --- a/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/decomposeMesh.C +++ b/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/decomposeMesh.C @@ -459,7 +459,7 @@ void Foam::domainDecomposition::decomposeMesh(const bool filterEmptyPatches) // cell with multiple faces, we need to collect neighbour cell // indices on the other side and possibly swap the order of // adding faces. The same "swapping" of insertion order needs to - // happend on the slave side, but now we sort on the remote + // happen on the slave side, but now we sort on the remote // (master) data and not on the local (slave) data as we do for // master processor. VV, 16/Feb/2019. @@ -588,7 +588,7 @@ void Foam::domainDecomposition::decomposeMesh(const bool filterEmptyPatches) // above, owner and neighbour proc are the same. In // order to avoid using cellToProc list for slave // processor (where ownCellI is actually found on the - // other side), use curNbrPtc with patchFace indes + // other side), use curNbrPtc with patchFace index const label& ownerProc = curNbrPtc[patchFaceI]; // Add the patch face into the list in the correct diff --git a/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/fvFieldDecomposerDecomposeFields.C b/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/fvFieldDecomposerDecomposeFields.C index 80d92197e..5611b07bd 100644 --- a/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/fvFieldDecomposerDecomposeFields.C +++ b/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/fvFieldDecomposerDecomposeFields.C @@ -158,9 +158,17 @@ fvFieldDecomposer::decomposeField const label patchStart = field.mesh().boundaryMesh()[patchI].start(); - forAll (p, i) + // Bugfix + // Special patches soch as overset and immersed boundary have + // their faces and values in a separate list; the list of + // values does not correspond to faces. Skip such patches. + // HJ, 4/Jul/2019 + if (p.size() == field.mesh().boundaryMesh()[patchI].size()) { - allFaceField[patchStart + i] = p[i]; + forAll (p, i) + { + allFaceField[patchStart + i] = p[i]; + } } } diff --git a/src/decompositionMethods/decomposeReconstruct/reconstructTools/finiteVolume/processorMeshesRebuild.C b/src/decompositionMethods/decomposeReconstruct/reconstructTools/finiteVolume/processorMeshesRebuild.C index df1afae56..19fd200fa 100644 --- a/src/decompositionMethods/decomposeReconstruct/reconstructTools/finiteVolume/processorMeshesRebuild.C +++ b/src/decompositionMethods/decomposeReconstruct/reconstructTools/finiteVolume/processorMeshesRebuild.C @@ -1728,8 +1728,337 @@ Foam::processorMeshesReconstructor::reconstructMesh(const Time& db) // due to the presence of old/new patches globalMesh.addFvPatches(reconPatches, false); - // TODO: point, face and cell zones + // Recombine cell, face and point zones. + // Note 1: all zones have to be present on same processors in the same + // order. This is the result of the decomposition. See + // domainDecomposition::processorMesh member function + // Note 2: the code below could be written in a generic way by using a + // template helper member function, but it's not straightforward since we + // don't have a list of ZoneMeshes for all processors + // Get index for the first valid mesh + const label fvmID = firstValidMesh(); + + // First pass: count maximum number of cells, faces and points in zones + labelList nCellsPerZone(meshes_[fvmID].cellZones().size(), 0); + labelList nFacesPerZone(meshes_[fvmID].faceZones().size(), 0); + labelList nPointsPerZone(meshes_[fvmID].pointZones().size(), 0); + + forAll (meshes_, procI) + { + if (meshes_.set(procI)) + { + // Grab the current mesh + const polyMesh& curMesh = meshes_[procI]; + + // PART 1: Cell zones. Scope for clarity and safety + { + const cellZoneMesh& cz = curMesh.cellZones(); + + forAll (cz, zoneI) + { + // Count number of cells in the zone + nCellsPerZone[zoneI] += cz[zoneI].size(); + } + } + + // PART 2: Face zones. Scope for clarity and safety + { + const faceZoneMesh& fz = curMesh.faceZones(); + + forAll (fz, zoneI) + { + // Count number of faces in the zone + nFacesPerZone[zoneI] += fz[zoneI].size(); + } + } + + // PART 3: Point zones. Scope for clarity and safety + { + const pointZoneMesh& pz = curMesh.pointZones(); + + forAll (pz, zoneI) + { + // Count number of points in the zone + nPointsPerZone[zoneI] += pz[zoneI].size(); + } + } + } // End if processor mesh set + } // End for all processor meshes + + // Second pass: redistribute cells, faces and points in zones + + // Create lists that contain labels of all cells/faces/points in a given + // zone coming from different processor meshes. Index is the zoneID, which + // is the same for all processor bits, while the other list collects all the + // cells/faces/points in a given zone. + labelListList reconCellZones(nCellsPerZone.size()); + labelListList reconFaceZones(nFacesPerZone.size()); + List reconFaceZoneFlips(nFacesPerZone.size()); + labelListList reconPointZones(nPointsPerZone.size()); + + // Size the lists appropriatelly for each zone + forAll (reconCellZones, zoneI) + { + reconCellZones[zoneI].setSize(nCellsPerZone[zoneI], -1); + } + forAll (reconFaceZones, zoneI) + { + reconFaceZones[zoneI].setSize(nFacesPerZone[zoneI], -1); + reconFaceZoneFlips[zoneI].setSize(nFacesPerZone[zoneI], false); + } + forAll (reconPointZones, zoneI) + { + reconPointZones[zoneI].setSize(nPointsPerZone[zoneI], -1); + } + + // Reset counting lists for indexing during list item assignement and for + // collecting the final number of faces/points in face/pointZones (since + // these can be actually fewer if e.g. a processor face becomes an internal + // face). + nCellsPerZone = 0; + nFacesPerZone = 0; + nPointsPerZone = 0; + + // Loop through all the meshes and collect cells/faces/points in the zones + forAll (meshes_, procI) + { + if (meshes_.set(procI)) + { + // Grab the current mesh + const polyMesh& curMesh = meshes_[procI]; + + // PART 1: Cell zones. Scope for clarity and safety + { + const cellZoneMesh& cz = curMesh.cellZones(); + + // Get old-to-new cell addressing for this mesh + const labelList& curCellProcAddr = cellProcAddressing_[procI]; + + forAll (cz, zoneI) + { + // Get "new" zone cell index + label& nCells = nCellsPerZone[zoneI]; + + // Reference to the new recon zone + labelList& zoneReconCells = reconCellZones[zoneI]; + + // Get all the cells in this zone + const labelList& zoneCells = cz[zoneI]; + + // Loop through the cells + forAll (zoneCells, i) + { + // Get cell index in the processor mesh + const label& oldCellI = zoneCells[i]; + + // Get cell index in the new mesh + const label& newCellI = curCellProcAddr[oldCellI]; + + // Redundancy check: check if the the newCellI is + // -1. This should not happen because cells have perfect + // 1-to-1 mapping + if (newCellI != -1) + { + // Insert the cell in the new recon zone and + // increment the counter + zoneReconCells[nCells++] = newCellI; + } + else + { + FatalErrorIn + ( + "autoPtr" + "\n processorMeshesReconstructor::" + "reconstructMesh(const Time& db)" + ) << "Found unmapped cell while reconstructing" + << " cell zones." + << nl + << "Cell from processor: " << procI << nl + << "Cell zone name: " << cz[zoneI].name() << nl + << "Index in the cell zone: " << i << nl + << "Old cell index: " << oldCellI << nl + << "New cell index: " << newCellI + << abort(FatalError); + } + + } // End for all cells in the zone + } // End for all cell zones + } // End scope for cell zone handling + + // PART 2: Face zones. Scope for clarity and safety + { + const faceZoneMesh& fz = curMesh.faceZones(); + + // Get old-to-new face addressing for this mesh + const labelList& curFaceProcAddr = faceProcAddressing_[procI]; + + forAll (fz, zoneI) + { + // Get "new" zone face index + label& nFaces = nFacesPerZone[zoneI]; + + // Reference to the new recon zone and flips in the zone + labelList& zoneReconFaces = reconFaceZones[zoneI]; + boolList& zoneReconFaceFlips = reconFaceZoneFlips[zoneI]; + + // Get all the faces in this zone and also their flips + const labelList& zoneFaces = fz[zoneI]; + const boolList& zoneFlipMap = fz[zoneI].flipMap(); + + // Loop through the faces + forAll (zoneFaces, i) + { + // Get the face index in the processor mesh + const label& oldFaceI = zoneFaces[i]; + + // Get the face index in the new, reconstructed mesh + const label& newFaceI = curFaceProcAddr[oldFaceI]; + + // Check if the face is mapped. + // Note: + // 1. Need to decrement by 1 because of the face turning + // 2. No need to handle negative new indices coming from + // slave processor because we'd end up with + // duplicate entries (two faces on two processors + // merged into a single one) + if (newFaceI > 0) + { + // This is a face that's been correctly + // mapped, insert the face in the new zone + zoneReconFaces[nFaces] = newFaceI - 1; + + // Also store the flip map of the face. We don't + // need to check whether the flip map has been + // preserved because we only get the combined faces + // that are inserted from master side. + zoneReconFaceFlips[nFaces] = zoneFlipMap[i]; + + // Increment the number of faces for this zone + ++nFaces; + } + } // End for all faces in the zone + } // End for all face zones + } // End scope for face zone handling + + // PART 3: Point zones. Scope for clarity and safety + { + const pointZoneMesh& fz = curMesh.pointZones(); + + // Get old-to-new point addressing for this mesh + const labelList& curPointProcAddr = pointProcAddressing_[procI]; + + forAll (fz, zoneI) + { + // Get "new" zone point index + label& nPoints = nPointsPerZone[zoneI]; + + // Reference to the new recon zone + labelList& zoneReconPoints = reconPointZones[zoneI]; + + // Get all the points in this zone + const labelList& zonePoints = fz[zoneI]; + + // Loop through the points + forAll (zonePoints, i) + { + // Get point index in the processor mesh + const label& oldPointI = zonePoints[i]; + + // Get point index in the new mesh + const label& newPointI = curPointProcAddr[oldPointI]; + + // Check if the point is mapped + if (newPointI != -1) + { + // Insert the point in the new recon zone and + // increment the counter + zoneReconPoints[nPoints++] = newPointI; + } + + } // End for all points in the zone + } // End for all point zones + } // End scope for point zone handling + } // End if the processor mesh is set + } // End for all processor meshes + + // We need to resize the face and point zones to number of inserted + // faces/points because not all faces and points need to be + // inserted. There's nothing to do for cell zones because these are always + // mapped uniquely one-to-one + forAll (reconFaceZones, zoneI) + { + reconFaceZones[zoneI].setSize(nFacesPerZone[zoneI]); + reconFaceZoneFlips[zoneI].setSize(nFacesPerZone[zoneI]); + } + forAll (reconPointZones, zoneI) + { + reconPointZones[zoneI].setSize(nPointsPerZone[zoneI]); + } + + // Now we have all the zones as ordinary lists without possible duplicate + // faces and points due to merging of processor boundaries. Create zone + // meshes + + // PART 1: Cell zones + List reconCz(reconCellZones.size()); + + // Loop through all the cell zones and create them + forAll (reconCz, zoneI) + { + // Notes: + // 1. Grab the name from the respective zone in the first valid mesh + // 2. Transfer the list of cell IDs, invalidating reconCellZones[zoneI] + reconCz[zoneI] = new cellZone + ( + meshes_[fvmID].cellZones()[zoneI].name(), + reconCellZones[zoneI].xfer(), + zoneI, + globalMesh.cellZones() + ); + } + + // PART 2: Face zones + List reconFz(reconFaceZones.size()); + + // Loop through all the face zones and create them + forAll (reconFz, zoneI) + { + // Notes: + // 1. Grab the name from the respective zone in the first valid mesh + // 2. Transfer the list of face IDs, invalidating reconFaceZones[zoneI] + reconFz[zoneI] = new faceZone + ( + meshes_[fvmID].faceZones()[zoneI].name(), + reconFaceZones[zoneI].xfer(), + reconFaceZoneFlips[zoneI].xfer(), + zoneI, + globalMesh.faceZones() + ); + } + + // PART 3: Point zones + List reconPz(reconPointZones.size()); + + // Loop through all the point zones and create them + forAll (reconPz, zoneI) + { + // Notes: + // 1. Grab the name from the respective zone in the first valid mesh + // 2. Transfer the list of point IDs, invalidating reconPointZones[zoneI] + reconPz[zoneI] = new pointZone + ( + meshes_[fvmID].pointZones()[zoneI].name(), + reconPointZones[zoneI].xfer(), + zoneI, + globalMesh.pointZones() + ); + } + + // Add the zones into the mesh + globalMesh.addZones(reconPz, reconFz, reconCz); + + // All done, return the global mesh pointer return globalMeshPtr; } diff --git a/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/hexRef8.C b/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/hexRef8.C index cb55ea15e..d26289f85 100644 --- a/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/hexRef8.C +++ b/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/hexRef8.C @@ -1698,7 +1698,7 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh) IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), - labelList(mesh_.nCells(), 0) + labelField(mesh_.nCells(), 0) ), pointLevel_ ( @@ -1711,7 +1711,7 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh) IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), - labelList(mesh_.nPoints(), 0) + labelField(mesh_.nPoints(), 0) ), level0Edge_(getLevel0EdgeLength()), history_ @@ -1779,8 +1779,8 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh) Foam::hexRef8::hexRef8 ( const polyMesh& mesh, - const labelList& cellLevel, - const labelList& pointLevel, + const labelField& cellLevel, + const labelField& pointLevel, const refinementHistory& history ) : @@ -1833,8 +1833,8 @@ Foam::hexRef8::hexRef8 { FatalErrorIn ( - "hexRef8::hexRef8(const polyMesh&, const labelList&" - ", const labelList&, const refinementHistory&)" + "hexRef8::hexRef8(const polyMesh&, const labelField&" + ", const labelField&, const refinementHistory&)" ) << "History enabled but number of visible cells in it " << history_.visibleCells().size() << " is not equal to the number of cells in the mesh " @@ -1849,8 +1849,8 @@ Foam::hexRef8::hexRef8 { FatalErrorIn ( - "hexRef8::hexRef8(const polyMesh&, const labelList&" - ", const labelList&, const refinementHistory&)" + "hexRef8::hexRef8(const polyMesh&, const labelField&" + ", const labelField&, const refinementHistory&)" ) << "Incorrect cellLevel or pointLevel size." << endl << "Number of cells in mesh:" << mesh_.nCells() << " does not equal size of cellLevel:" << cellLevel_.size() << endl @@ -1876,8 +1876,8 @@ Foam::hexRef8::hexRef8 Foam::hexRef8::hexRef8 ( const polyMesh& mesh, - const labelList& cellLevel, - const labelList& pointLevel + const labelField& cellLevel, + const labelField& pointLevel ) : mesh_(mesh), diff --git a/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/hexRef8.H b/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/hexRef8.H index df4bc8535..e61c31caa 100644 --- a/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/hexRef8.H +++ b/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/hexRef8.H @@ -43,6 +43,7 @@ SourceFiles #include "removeFaces.H" #include "refinementHistory.H" #include "PackedList.H" +#include "labelIOField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -68,10 +69,10 @@ class hexRef8 const polyMesh& mesh_; //- Per cell the refinement level - labelIOList cellLevel_; + labelIOField cellLevel_; //- Per point the refinement level - labelIOList pointLevel_; + labelIOField pointLevel_; //- Typical edge length between unrefined points const scalar level0Edge_; @@ -326,8 +327,8 @@ public: hexRef8 ( const polyMesh& mesh, - const labelList& cellLevel, - const labelList& pointLevel, + const labelField& cellLevel, + const labelField& pointLevel, const refinementHistory& history ); @@ -335,8 +336,8 @@ public: hexRef8 ( const polyMesh& mesh, - const labelList& cellLevel, - const labelList& pointLevel + const labelField& cellLevel, + const labelField& pointLevel ); @@ -344,12 +345,12 @@ public: // Access - const labelIOList& cellLevel() const + const labelIOField& cellLevel() const { return cellLevel_; } - const labelIOList& pointLevel() const + const labelIOField& pointLevel() const { return pointLevel_; } diff --git a/src/dynamicMesh/dynamicMesh/directTopoChange/meshCut/modifiers/multiDirRefinement/multiDirRefinement.C b/src/dynamicMesh/dynamicMesh/directTopoChange/meshCut/modifiers/multiDirRefinement/multiDirRefinement.C index 0cf15e047..c48fe9ce5 100644 --- a/src/dynamicMesh/dynamicMesh/directTopoChange/meshCut/modifiers/multiDirRefinement/multiDirRefinement.C +++ b/src/dynamicMesh/dynamicMesh/directTopoChange/meshCut/modifiers/multiDirRefinement/multiDirRefinement.C @@ -264,8 +264,8 @@ void Foam::multiDirRefinement::refineHex8 hexRef8 hexRefiner ( mesh, - labelList(mesh.nCells(), 0), // cellLevel - labelList(mesh.nPoints(), 0), // pointLevel + labelField(mesh.nCells(), 0), // cellLevel + labelField(mesh.nPoints(), 0), // pointLevel refinementHistory ( IOobject diff --git a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/polyhedralRefinement/polyhedralRefinement.C b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/polyhedralRefinement/polyhedralRefinement.C index 0d5f2db57..64862038f 100644 --- a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/polyhedralRefinement/polyhedralRefinement.C +++ b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/polyhedralRefinement/polyhedralRefinement.C @@ -2055,15 +2055,6 @@ void Foam::polyhedralRefinement::setCellsToRefine } } - // Remove all cells that would exceed the maximum refinement level - forAll (refineCell, cellI) - { - if (refineCell[cellI] && (cellLevel_[cellI] + 1 > maxRefinementLevel_)) - { - refineCell[cellI] = false; - } - } - // Make sure that the refinement is face consistent (2:1 consistency) and // point consistent (4:1 consistency) if necessary diff --git a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/prismatic2DRefinement/prismatic2DRefinement.C b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/prismatic2DRefinement/prismatic2DRefinement.C index 7fa88a836..e6e3677d5 100644 --- a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/prismatic2DRefinement/prismatic2DRefinement.C +++ b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/prismatic2DRefinement/prismatic2DRefinement.C @@ -2614,15 +2614,6 @@ void Foam::prismatic2DRefinement::setCellsToRefine } } - // Remove all cells that exceed the maximum refinement level - forAll (refineCell, cellI) - { - if (refineCell[cellI] && (cellLevel_[cellI] + 1 > maxRefinementLevel_)) - { - refineCell[cellI] = false; - } - } - // Make sure that the refinement is face consistent (2:1 consistency) and // point consistent (4:1 consistency) if necessary diff --git a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/refinement/refinement.C b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/refinement/refinement.C index 63e1dd1fe..43f709ef5 100644 --- a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/refinement/refinement.C +++ b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/refinement/refinement.C @@ -1333,20 +1333,6 @@ bool Foam::refinement::changeTopology() const void Foam::refinement::setRefinement(polyTopoChange& ref) const { - // Make sure that the point levels are updated across coupled patches before - // setting refinement and unrefinement. Note: not sure why the sync is not - // performed correctly if I do it in updateMesh. This is a temporary - // solution, need to investigate in detail, but I assume something is not - // updated yet in that case. VV, 31/Jan/2018. - syncTools::syncPointList - ( - mesh_, - pointLevel_, - maxEqOp