Commit 430895ee authored by mattijs's avatar mattijs
Browse files

ENH: snappyHexMesh: allow restart through suppression of refinement. Fixes #626.

parent 4e7306f0
......@@ -101,8 +101,11 @@ castellatedMeshControls
// The surface refinement loop might spend lots of iterations refining just
// a few cells. This setting will cause refinement to stop if
// <= minimumRefine cells are selected for refinement. Note: it will
// at least do one iteration (unless the number of cells to refine is 0)
// <= minRefinementCells cells are selected for refinement. Note: it will
// at least do one iteration unless
// a: the number of cells to refine is 0
// b: minRefinementCells = -1. This is a special value indicating
// no refinement.
minRefinementCells 0;
// Allow a certain level of imbalance during refining
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -80,6 +80,13 @@ Foam::label Foam::snappyRefineDriver::featureEdgeRefine
const label minRefine
)
{
if (refineParams.minRefineCells() == -1)
{
// Special setting to be able to restart shm on meshes with inconsistent
// cellLevel/pointLevel
return 0;
}
addProfiling(edge, "snappyHexMesh::refine::edge");
const fvMesh& mesh = meshRefiner_.mesh();
......@@ -190,6 +197,13 @@ Foam::label Foam::snappyRefineDriver::smallFeatureRefine
const label maxIter
)
{
if (refineParams.minRefineCells() == -1)
{
// Special setting to be able to restart shm on meshes with inconsistent
// cellLevel/pointLevel
return 0;
}
addProfiling(feature, "snappyHexMesh::refine::smallFeature");
const fvMesh& mesh = meshRefiner_.mesh();
......@@ -313,6 +327,13 @@ Foam::label Foam::snappyRefineDriver::surfaceOnlyRefine
const label maxIter
)
{
if (refineParams.minRefineCells() == -1)
{
// Special setting to be able to restart shm on meshes with inconsistent
// cellLevel/pointLevel
return 0;
}
addProfiling(surface, "snappyHexMesh::refine::surface");
const fvMesh& mesh = meshRefiner_.mesh();
......@@ -437,6 +458,13 @@ Foam::label Foam::snappyRefineDriver::gapOnlyRefine
const label maxIter
)
{
if (refineParams.minRefineCells() == -1)
{
// Special setting to be able to restart shm on meshes with inconsistent
// cellLevel/pointLevel
return 0;
}
const fvMesh& mesh = meshRefiner_.mesh();
// Determine the maximum refinement level over all surfaces. This
......@@ -669,6 +697,13 @@ Foam::label Foam::snappyRefineDriver::bigGapOnlyRefine
const label maxIter
)
{
if (refineParams.minRefineCells() == -1)
{
// Special setting to be able to restart shm on meshes with inconsistent
// cellLevel/pointLevel
return 0;
}
const fvMesh& mesh = meshRefiner_.mesh();
label iter = 0;
......@@ -811,6 +846,13 @@ Foam::label Foam::snappyRefineDriver::danglingCellRefine
const label maxIter
)
{
if (refineParams.minRefineCells() == -1)
{
// Special setting to be able to restart shm on meshes with inconsistent
// cellLevel/pointLevel
return 0;
}
addProfiling(dangling, "snappyHexMesh::refine::danglingCell");
const fvMesh& mesh = meshRefiner_.mesh();
......@@ -957,6 +999,13 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
const label maxIter
)
{
if (refineParams.minRefineCells() == -1)
{
// Special setting to be able to restart shm on meshes with inconsistent
// cellLevel/pointLevel
return 0;
}
addProfiling(interface, "snappyHexMesh::refine::transition");
const fvMesh& mesh = meshRefiner_.mesh();
......@@ -1348,6 +1397,13 @@ Foam::label Foam::snappyRefineDriver::shellRefine
const label maxIter
)
{
if (refineParams.minRefineCells() == -1)
{
// Special setting to be able to restart shm on meshes with inconsistent
// cellLevel/pointLevel
return 0;
}
addProfiling(shell, "snappyHexMesh::refine::shell");
const fvMesh& mesh = meshRefiner_.mesh();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment