49 label nSmoothingIterations = 10;
51 for (label iter = 0; iter < nSmoothingIterations; ++iter)
59 const point& fC = faceCentres[sI];
60 const scalar value = surf[sI];
69 const label faceLabel = faceFaces[fI];
70 const point& faceCentre = faceCentres[faceLabel];
72 const scalar faceValue = surf[faceLabel];
75 newValue += faceValue/(
distance + SMALL);
79 if (value < faceValue)
86 if (nFaces == faceFaces.size())
91 surf[sI] = newValue/totalDist;
101 const dictionary& cellSizeCalcTypeDict,
102 const triSurfaceMesh& surface,
103 const scalar defaultCellSize
106 cellSizeCalculationType
109 cellSizeCalcTypeDict,
113 coeffsDict_(cellSizeCalcTypeDict.optionalSubDict(typeName +
"Coeffs")),
114 surfaceName_(surface.searchableSurface::
name()),
116 readCurvature_(coeffsDict_.
get<
bool>(
"curvature")),
117 readFeatureProximity_(coeffsDict_.
get<
bool>(
"featureProximity")),
118 readInternalCloseness_(coeffsDict_.
get<
bool>(
"internalCloseness")),
120 curvatureFile_(coeffsDict_.
get<word>(
"curvatureFile")),
121 featureProximityFile_(coeffsDict_.
get<word>(
"featureProximityFile")),
122 internalClosenessFile_(coeffsDict_.
get<word>(
"internalClosenessFile")),
124 curvatureCellSizeCoeff_
126 coeffsDict_.
get<scalar>(
"curvatureCellSizeCoeff")
130 coeffsDict_.
get<scalar>(
"maximumCellSizeCoeff") * defaultCellSize
140 <<
"Calculating cell size on surface: " << surfaceName_ <<
endl;
142 tmp<triSurfacePointScalarField> tPointCellSize
148 surfaceName_ +
".cellSize",
149 surface_.searchableSurface::time().constant(),
151 surface_.searchableSurface::time(),
166 <<
"Reading curvature : " << curvatureFile_ <<
endl;
173 surface_.searchableSurface::time().constant(),
175 surface_.searchableSurface::time(),
192 (1.0/curvatureCellSizeCoeff_)*
mag(curvature[pI]),
200 PrimitivePatchInterpolation
202 PrimitivePatch<::Foam::List<labelledTri>,
pointField>
203 > patchInterpolate(surface_);
205 const Map<label>& meshPointMap = surface_.meshPointMap();
207 if (readInternalCloseness_)
210 <<
"Reading internal closeness: " << internalClosenessFile_ <<
endl;
216 internalClosenessFile_,
217 surface_.searchableSurface::time().constant(),
219 surface_.searchableSurface::time(),
230 patchInterpolate.faceToPointInterpolate(internalCloseness)
238 internalClosenessPointField[meshPointMap[pI]],
244 if (readFeatureProximity_)
247 <<
"Reading feature proximity : " << featureProximityFile_ <<
endl;
253 featureProximityFile_,
254 surface_.searchableSurface::time().constant(),
256 surface_.searchableSurface::time(),
275 featureProximityPointField[meshPointMap[pI]],
283 pointCellSize.write();
291 faces[fI] = surface_.triSurface::operator[](fI);
294 vtk::surfaceWriter vtkWriter
299 surface_.searchableSurface::time().constant()
301 / surfaceName_.nameLessExt() +
"_cellSize"
306 vtkWriter.writeGeometry();
308 vtkWriter.beginPointData(1);
310 vtkWriter.write(
"cellSize", pointCellSize);
313 return tPointCellSize;