47 const dictionary& initialPointsDict,
48 const searchableSurface& surface,
49 const scalar& defaultCellSize,
63 coeffsDict().
lookup<scalar>(
"distanceCellSizeCoeff")
68 coeffsDict().
lookup<scalar>(
"distanceCoeff")*defaultCellSize
70 distanceSqr_(
sqr(distance_))
76 scalar linearDistance::sizeFunction
83 const scalar interpolatedSize
87 = (distanceCellSize_ - interpolatedSize)
90 scalar size = gradient*d + interpolatedSize;
111 shapeSizes.resize(2);
113 shapePts[0] = pt - n*distance_;
114 shapeSizes[0] = distanceCellSize_;
116 shapePts[1] = pt + n*distance_;
117 shapeSizes[1] = distanceCellSize_;
122 shapeSizes.resize(1);
124 shapePts[0] = pt - n*distance_;
125 shapeSizes[0] = distanceCellSize_;
130 shapeSizes.resize(1);
132 shapePts[0] = pt + n*distance_;
133 shapeSizes[0] = distanceCellSize_;
144 List<pointIndexHit> hits;
158 const point& hitPt = hitInfo.hitPoint();
159 const label hitIndex = hitInfo.index();
161 const scalar dist =
mag(pt - hitPt);
165 size = sizeFunction(hitPt, dist, hitIndex);
174 size = sizeFunction(hitPt, 0, hitIndex);
180 List<volumeType> vTL;
184 bool functionApplied =
false;
192 size = sizeFunction(hitPt, dist, hitIndex);
194 functionApplied =
true;
202 size = sizeFunction(hitPt, dist, hitIndex);
204 functionApplied =
true;
207 return functionApplied;
virtual bool setCellSize(const pointField &pts)
Adapt local cell size. Return true if anything changed.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
autoPtr< surfaceCellSizeFunction > surfaceCellSizeFunction_
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
Vector< scalar > vector
A scalar version of the templated Vector.
Macros for easy insertion into run-time selection tables.
const labelList regionIndices_
Index of the region of the surface that this cell size function.
vectorField pointField
pointField is a vectorField.
stressControl lookup("compactNormalStress") >> compactNormalStress
virtual void findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const =0
virtual bool cellSize(const point &pt, scalar &size) const
Modify scalar argument to the cell size specified by function.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< label > labelList
A List of labels.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
virtual bool sizeLocations(const pointIndexHit &hitPt, const vector &n, pointField &shapePts, scalarField &shapeSizes) const
vector point
Point is a vector.
virtual void getVolumeType(const pointField &, List< volumeType > &) const =0
Determine type (inside/outside) for point. unknown if.
static scalar snapToSurfaceTol_
Point closeness tolerance to a surface where the function "snaps" to.
dimensioned< scalar > mag(const dimensioned< Type > &)
const searchableSurface & surface_
Reference to the searchableSurface that cellSizeFunction.
sideMode sideMode_
Mode of size specification, i.e. inside, outside or bothSides.
linearDistance(const dictionary &initialPointsDict, const searchableSurface &surface, const scalar &defaultCellSize, const labelList regionIndices)
Construct from components.