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:
graham
2009-07-07 17:34:36 +01:00
parent 67acfcb7e2
commit 254f98f56b
3 changed files with 67 additions and 17 deletions

View File

@ -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 * * * * * * * * * * * * * * * //

View File

@ -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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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();