mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
uniform cellSizeFunction implemented. Check applied in cellSizeFunction base
class to surface for hasVolumeType - defaulting to BOTHSIDES if not a closed surface. Test point for cell sizes in conformalVoronoiMesh.C.
This commit is contained in:
@ -57,23 +57,35 @@ cellSizeFunction::cellSizeFunction
|
|||||||
{
|
{
|
||||||
word mode = cellSizeFunctionDict.lookup("mode");
|
word mode = cellSizeFunctionDict.lookup("mode");
|
||||||
|
|
||||||
if (mode == "inside")
|
if (surface_.hasVolumeType())
|
||||||
{
|
{
|
||||||
sideMode_ = INSIDE;
|
if (mode == "inside")
|
||||||
}
|
{
|
||||||
else if (mode == "outside")
|
sideMode_ = INSIDE;
|
||||||
{
|
}
|
||||||
sideMode_ = OUTSIDE;
|
else if (mode == "outside")
|
||||||
}
|
{
|
||||||
else if (mode == "bothSides")
|
sideMode_ = OUTSIDE;
|
||||||
{
|
}
|
||||||
sideMode_ = BOTHSIDES;
|
else if (mode == "bothSides")
|
||||||
}
|
{
|
||||||
else
|
sideMode_ = BOTHSIDES;
|
||||||
{
|
}
|
||||||
FatalErrorIn("cellSizeFunction::cellSizeFunction")
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn("cellSizeFunction::cellSizeFunction")
|
||||||
<< "Unknown mode, expected: inside, outside or bothSides" << nl
|
<< "Unknown mode, expected: inside, outside or bothSides" << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (mode != BOTHSIDES)
|
||||||
|
{
|
||||||
|
WarningIn("cellSizeFunction::cellSizeFunction")
|
||||||
|
<< "surface does not support volumeType, defaulting mode to "
|
||||||
|
<< "bothSides."
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
sideMode_ = BOTHSIDES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,9 +55,44 @@ uniform::uniform
|
|||||||
|
|
||||||
bool uniform::cellSize(const point& pt, scalar& size) const
|
bool uniform::cellSize(const point& pt, scalar& size) const
|
||||||
{
|
{
|
||||||
size = cellSize_;
|
if (sideMode_ == BOTHSIDES)
|
||||||
|
{
|
||||||
|
size = cellSize_;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
pointField ptF(1, pt);
|
||||||
|
List<searchableSurface::volumeType> vTL(1);
|
||||||
|
|
||||||
|
surface_.getVolumeType(ptF, vTL);
|
||||||
|
|
||||||
|
size = 0;
|
||||||
|
|
||||||
|
bool functionApplied = false;
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
sideMode_ == INSIDE
|
||||||
|
&& vTL[1] == searchableSurface::INSIDE
|
||||||
|
)
|
||||||
|
{
|
||||||
|
size = cellSize_;
|
||||||
|
|
||||||
|
functionApplied = true;
|
||||||
|
}
|
||||||
|
else if
|
||||||
|
(
|
||||||
|
sideMode_ == OUTSIDE
|
||||||
|
&& vTL[1] == searchableSurface::OUTSIDE
|
||||||
|
)
|
||||||
|
{
|
||||||
|
size = cellSize_;
|
||||||
|
|
||||||
|
functionApplied = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return functionApplied;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -100,6 +100,9 @@ Foam::conformalVoronoiMesh::conformalVoronoiMesh
|
|||||||
{
|
{
|
||||||
timeCheck();
|
timeCheck();
|
||||||
|
|
||||||
|
point sizeTestPt = vector(0.5, 0.3, 0.6);
|
||||||
|
Info<< nl << cellSizeControl().cellSize(sizeTestPt) << endl;
|
||||||
|
|
||||||
createFeaturePoints();
|
createFeaturePoints();
|
||||||
timeCheck();
|
timeCheck();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user