Go to the documentation of this file.
63 <<
" : Smoothing normals in interior ..." <<
endl;
65 const edgeList& edges = mesh_.edges();
73 label meshPointI = fixedPoints[i];
74 isFixedPoint.
set(meshPointI, 1);
100 for (
label iter = 0; iter < nIter; iter++)
115 if ((iter % 10) == 0)
122 Info<<
" Iteration " << iter <<
" residual " << resid <<
endl;
128 if (isFixedPoint.
get(pointI) == 0)
132 normals[pointI] =
average[pointI];
133 normals[pointI] /=
mag(normals[pointI]) + VSMALL;
153 Info<< typeName <<
" : Smoothing normals ..." <<
endl;
169 for (
label iter = 0; iter < nIter; iter++)
184 if ((iter % 10) == 0)
191 Info<<
" Iteration " << iter <<
" residual " << resid <<
endl;
199 normals[pointI] =
average[pointI];
200 normals[pointI] /=
mag(normals[pointI]) + VSMALL;
215 const edgeList& edges = mesh_.edges();
234 Info<< typeName <<
" : Smoothing displacement ..." <<
endl;
236 const scalar
lambda = 0.33;
237 const scalar
mu = -0.34;
241 for (
label iter = 0; iter < nIter; iter++)
257 if (isToBeSmoothed[i])
278 if (isToBeSmoothed[i])
280 displacement[i] = (1-
mu)*displacement[i]+
mu*
average[i];
286 if ((iter % 10) == 0)
293 Info<<
" Iteration " << iter <<
" residual " << resid <<
endl;
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const dimensionedScalar mu
Atomic mass unit.
#define forAll(list, i)
Loop across all elements in list.
void set(const PackedList< 1 > &)
Set specified bits.
virtual ~fieldSmoother()
Destructor.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void calculateEdgeWeights(const polyMesh &mesh, const PackedBoolList &isMasterEdge, const labelList &meshPoints, const edgeList &edges, scalarField &edgeWeights, scalarField &invSumWeight)
Helper: calculate edge weights (1/length)
dimensioned< scalar > mag(const dimensioned< Type > &)
void smoothNormals(const label nIter, const PackedBoolList &isMeshMasterPoint, const PackedBoolList &isMeshMasterEdge, const labelList &fixedPoints, pointVectorField &normals) const
Smooth interior normals.
Mesh consisting of general polyhedral cells.
void smoothLambdaMuDisplacement(const label nIter, const PackedBoolList &isMeshMasterPoint, const PackedBoolList &isMeshMasterEdge, const PackedBoolList &isSmoothable, vectorField &displacement) const
Smooth and then un-smooth a displacement.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
static void weightedSum(const polyMesh &mesh, const PackedBoolList &isMasterEdge, const labelList &meshPoints, const edgeList &edges, const scalarField &edgeWeights, const Field< Type > &data, Field< Type > &sum)
Helper: weighted sum (over all subset of mesh points) by.
void smoothPatchNormals(const label nIter, const PackedBoolList &isPatchMasterPoint, const PackedBoolList &isPatchMasterEdge, const indirectPrimitivePatch &adaptPatch, pointField &normals) const
Smooth patch normals.
unsigned int get(const label) const
Get value at index I.
static T gAverage(const PackedBoolList &isMasterElem, const UList< T > &values)
Helper: calculate average.
fieldSmoother(const fieldSmoother &)
Disallow default bitwise copy construct.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
Generic GeometricField class.
defineTypeNameAndDebug(combustionModel, 0)
dimensionedScalar lambda(laminarTransport.lookup("lambda"))
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
A list of faces which address into the list of points.