48 const dictionary& initialPointsDict,
49 const searchableSurface&
surface,
50 const scalar& defaultCellSize,
64 coeffsDict().
get<scalar>(
"distanceCellSizeCoeff") * defaultCellSize
68 coeffsDict().
get<scalar>(
"distanceCoeff") * defaultCellSize
70 distanceSqr_(
sqr(distance_))
76 Foam::scalar Foam::linearDistance::sizeFunction
83 const scalar interpolatedSize
84 = surfaceCellSizeFunction_().interpolate(pt, index);
87 = (distanceCellSize_ - interpolatedSize)
90 scalar size = gradient*d + interpolatedSize;
108 if (sideMode_ == rmBothsides)
111 shapeSizes.resize(2);
113 shapePts[0] = pt -
n*distance_;
114 shapePts[1] = pt +
n*distance_;
116 shapeSizes[0] = distanceCellSize_;
117 shapeSizes[1] = distanceCellSize_;
119 else if (sideMode_ == smInside)
122 shapeSizes.resize(1);
124 shapePts[0] = pt -
n*distance_;
125 shapeSizes[0] = distanceCellSize_;
127 else if (sideMode_ == smOutside)
130 shapeSizes.resize(1);
132 shapePts[0] = pt +
n*distance_;
133 shapeSizes[0] = distanceCellSize_;
144 List<pointIndexHit> hits;
158 const point& hitPt = hitInfo.point();
159 const label hitIndex = hitInfo.index();
161 const scalar dist = hitPt.dist(pt);
163 if (sideMode_ == rmBothsides)
165 size = sizeFunction(hitPt, dist, hitIndex);
172 if (dist < snapToSurfaceTol_)
174 size = sizeFunction(hitPt, 0, hitIndex);
180 List<volumeType> vTL;
182 surface_.getVolumeType(ptF, vTL);
184 bool functionApplied =
false;
188 sideMode_ == smInside
192 size = sizeFunction(hitPt, dist, hitIndex);
194 functionApplied =
true;
198 sideMode_ == smOutside
202 size = sizeFunction(hitPt, dist, hitIndex);
204 functionApplied =
true;
207 return functionApplied;
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
virtual bool setCellSize(const pointField &pts)
Adapt local cell size. Return true if anything changed.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
Macros for easy insertion into run-time selection tables.
vectorField pointField
pointField is a vectorField.
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.
A location inside the volume.
A location outside the volume.
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
defineTypeNameAndDebug(combustionModel, 0)
virtual bool sizeLocations(const pointIndexHit &hitPt, const vector &n, pointField &shapePts, scalarField &shapeSizes) const
vector point
Point is a vector.
List< label > labelList
A List of labels.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
linearDistance(const dictionary &initialPointsDict, const searchableSurface &surface, const scalar &defaultCellSize, const labelList regionIndices)
Construct from components.