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,6 +57,8 @@ cellSizeFunction::cellSizeFunction
|
||||
{
|
||||
word mode = cellSizeFunctionDict.lookup("mode");
|
||||
|
||||
if (surface_.hasVolumeType())
|
||||
{
|
||||
if (mode == "inside")
|
||||
{
|
||||
sideMode_ = INSIDE;
|
||||
@ -76,6 +78,16 @@ cellSizeFunction::cellSizeFunction
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
else if (mode != BOTHSIDES)
|
||||
{
|
||||
WarningIn("cellSizeFunction::cellSizeFunction")
|
||||
<< "surface does not support volumeType, defaulting mode to "
|
||||
<< "bothSides."
|
||||
<< endl;
|
||||
|
||||
sideMode_ = BOTHSIDES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -54,12 +54,47 @@ uniform::uniform
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool uniform::cellSize(const point& pt, scalar& size) const
|
||||
{
|
||||
if (sideMode_ == BOTHSIDES)
|
||||
{
|
||||
size = cellSize_;
|
||||
|
||||
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();
|
||||
|
||||
point sizeTestPt = vector(0.5, 0.3, 0.6);
|
||||
Info<< nl << cellSizeControl().cellSize(sizeTestPt) << endl;
|
||||
|
||||
createFeaturePoints();
|
||||
timeCheck();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user