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,
103 const scalar defaultCellSize
106 cellSizeCalculationType
109 cellSizeCalcTypeDict,
113 coeffsDict_(cellSizeCalcTypeDict.optionalSubDict(typeName +
"Coeffs")),
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_.stem() +
"_cellSize" 306 vtkWriter.writeGeometry();
308 vtkWriter.beginPointData(1);
310 vtkWriter.write(
"cellSize", pointCellSize);
313 return tPointCellSize;
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
Ostream & indent(Ostream &os)
Indent stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
automatic(const dictionary &cellSizeCalcTypeDict, const triSurfaceMesh &surface, const scalar defaultCellSize)
Construct from components.
Ostream & endl(Ostream &os)
Add newline and flush stream.
scalar distance(const vector &p1, const vector &p2)
Ignore writing from objectRegistry::writeObject()
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
List< face > faceList
List of faces.
const labelListList & faceFaces() const
Return face-face addressing.
vectorField pointField
pointField is a vectorField.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const Field< point_type > & faceCentres() const
Return face centres for patch.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
const triSurfaceMesh & surface_
Reference to the triSurfaceMesh.
virtual tmp< triSurfacePointScalarField > load()
Load the cell size field.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
vector point
Point is a vector.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::DimensionedField< scalar, triSurfacePointGeoMesh > triSurfacePointScalarField
List< label > labelList
A List of labels.
A class for managing temporary objects.
Foam::DimensionedField< scalar, triSurfaceGeoMesh > triSurfaceScalarField
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)