46 label nSmoothingIterations = 10;
48 for (
label iter = 0; iter < nSmoothingIterations; ++iter)
56 const point& fC = faceCentres[sI];
57 const scalar value = surf[sI];
66 const label faceLabel = faceFaces[fI];
67 const point& faceCentre = faceCentres[faceLabel];
69 const scalar faceValue = surf[faceLabel];
72 newValue += faceValue/(
distance + SMALL);
76 if (value < faceValue)
83 if (nFaces == faceFaces.size())
88 surf[sI] = newValue/totalDist;
98 const dictionary& cellSizeCalcTypeDict,
99 const triSurfaceMesh& surface,
100 const scalar& defaultCellSize
103 cellSizeCalculationType
106 cellSizeCalcTypeDict,
110 coeffsDict_(cellSizeCalcTypeDict.subDict(typeName +
"Coeffs")),
111 surfaceName_(surface.searchableSurface::
name()),
112 readCurvature_(Switch(coeffsDict_.
lookup(
"curvature"))),
113 curvatureFile_(coeffsDict_.
lookup(
"curvatureFile")),
114 readFeatureProximity_(Switch(coeffsDict_.
lookup(
"featureProximity"))),
115 featureProximityFile_(coeffsDict_.
lookup(
"featureProximityFile")),
116 readInternalCloseness_(Switch(coeffsDict_.
lookup(
"internalCloseness"))),
117 internalClosenessFile_(coeffsDict_.
lookup(
"internalClosenessFile")),
118 curvatureCellSizeCoeff_
134 <<
"Calculating cell size on surface: " << surfaceName_ <<
endl;
136 tmp<triSurfacePointScalarField> tPointCellSize
142 surfaceName_ +
".cellSize",
143 surface_.searchableSurface::time().constant(),
145 surface_.searchableSurface::time(),
160 <<
"Reading curvature : " << curvatureFile_ <<
endl;
167 surface_.searchableSurface::time().constant(),
169 surface_.searchableSurface::time(),
186 (1.0/curvatureCellSizeCoeff_)*
mag(curvature[pI]),
194 PrimitivePatchInterpolation
196 PrimitivePatch<labelledTri, ::Foam::List, pointField, point>
197 > patchInterpolate(surface_);
199 const Map<label>& meshPointMap = surface_.meshPointMap();
201 if (readInternalCloseness_)
204 <<
"Reading internal closeness: " << internalClosenessFile_ <<
endl;
210 internalClosenessFile_,
211 surface_.searchableSurface::time().constant(),
213 surface_.searchableSurface::time(),
224 patchInterpolate.faceToPointInterpolate(internalCloseness)
232 internalClosenessPointField[meshPointMap[pI]],
238 if (readFeatureProximity_)
241 <<
"Reading feature proximity : " << featureProximityFile_ <<
endl;
247 featureProximityFile_,
248 surface_.searchableSurface::time().constant(),
250 surface_.searchableSurface::time(),
261 patchInterpolate.faceToPointInterpolate(featureProximity)
269 featureProximityPointField[meshPointMap[pI]],
277 pointCellSize.write();
285 faces[fI] = surface_.triSurface::operator[](fI).triFaceFace();
288 vtkSurfaceWriter().write
290 surface_.searchableSurface::time().constant()/
"triSurface",
291 surfaceName_.lessExt().name(),
301 return tPointCellSize;