41 surfaceOffsetLinearDistance,
49 const dictionary& initialPointsDict,
50 const searchableSurface& surface,
51 const scalar& defaultCellSize,
65 coeffsDict().
lookup<scalar>(
"distanceCellSizeCoeff")
70 coeffsDict().
lookup<scalar>(
"surfaceOffsetCoeff")*defaultCellSize
88 <<
"totalDistanceCoeff and linearDistanceCoeff found, " 89 <<
"specify one or other, not both." 110 <<
"totalDistanceCoeff or linearDistanceCoeff not found." 114 totalDistanceSqr_ =
sqr(totalDistance_);
120 scalar surfaceOffsetLinearDistance::sizeFunction
127 const scalar interpolatedSize
130 if (d <= surfaceOffset_)
132 return interpolatedSize;
136 (distanceCellSize_ - interpolatedSize)
137 /(totalDistance_ - surfaceOffset_);
139 scalar intercept = interpolatedSize - gradient*surfaceOffset_;
141 return gradient*d + intercept;
157 const scalar offsetCellSize =
163 shapeSizes.resize(4);
165 shapePts[0] = pt - n*surfaceOffset_;
166 shapeSizes[0] = offsetCellSize;
167 shapePts[1] = pt - n*totalDistance_;
168 shapeSizes[1] = distanceCellSize_;
170 shapePts[2] = pt + n*surfaceOffset_;
171 shapeSizes[2] = offsetCellSize;
172 shapePts[3] = pt + n*totalDistance_;
173 shapeSizes[3] = distanceCellSize_;
178 shapeSizes.resize(2);
180 shapePts[0] = pt - n*surfaceOffset_;
181 shapeSizes[0] = offsetCellSize;
182 shapePts[1] = pt - n*totalDistance_;
183 shapeSizes[1] = distanceCellSize_;
188 shapeSizes.resize(2);
190 shapePts[0] = pt + n*surfaceOffset_;
191 shapeSizes[0] = offsetCellSize;
192 shapePts[1] = pt + n*totalDistance_;
193 shapeSizes[1] = distanceCellSize_;
208 List<pointIndexHit> hits;
222 const point& hitPt = hitInfo.hitPoint();
223 const label hitIndex = hitInfo.index();
225 const scalar dist =
mag(pt - hitPt);
229 size = sizeFunction(hitPt, dist, hitIndex);
238 size = sizeFunction(hitPt, 0, hitIndex);
244 List<volumeType> vTL;
248 bool functionApplied =
false;
256 size = sizeFunction(hitPt, dist, hitIndex);
258 functionApplied =
true;
266 size = sizeFunction(hitPt, dist, hitIndex);
268 functionApplied =
true;
271 return functionApplied;
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual bool sizeLocations(const pointIndexHit &hitPt, const vector &n, pointField &shapePts, scalarField &shapeSizes) const
errorManipArg< error, int > exit(error &err, const int errNo=1)
autoPtr< surfaceCellSizeFunction > surfaceCellSizeFunction_
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
surfaceOffsetLinearDistance(const dictionary &initialPointsDict, const searchableSurface &surface, const scalar &defaultCellSize, const labelList regionIndices)
Construct from components.
vectorField pointField
pointField is a vectorField.
stressControl lookup("compactNormalStress") >> compactNormalStress
virtual void findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const =0
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const dictionary & coeffsDict() const
Const access to the details dictionary.
List< label > labelList
A List of labels.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
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.
virtual bool cellSize(const point &pt, scalar &size) const
Modify scalar argument to the cell size specified by function.
sideMode sideMode_
Mode of size specification, i.e. inside, outside or bothSides.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.