57 const bitSet& isMeshMasterPoint,
58 const bitSet& isMeshMasterEdge,
65 <<
" : Smoothing normals in interior ..." <<
endl;
67 const edgeList& edges = mesh_.edges();
70 bitSet isFixedPoint(mesh_.nPoints());
75 label meshPointI = fixedPoints[i];
76 isFixedPoint.
set(meshPointI);
102 for (label iter = 0; iter < nIter; iter++)
117 if ((iter % 10) == 0)
124 Info<<
" Iteration " << iter <<
" residual " << resid <<
endl;
130 if (!isFixedPoint.
test(pointI))
144 const bitSet& isPatchMasterPoint,
145 const bitSet& isPatchMasterEdge,
154 Info<< typeName <<
" : Smoothing normals ..." <<
endl;
170 for (label iter = 0; iter < nIter; iter++)
185 if ((iter % 10) == 0)
192 Info<<
" Iteration " << iter <<
" residual " << resid <<
endl;
209 const bitSet& isMeshMasterPoint,
210 const bitSet& isMeshMasterEdge,
211 const bitSet& isToBeSmoothed,
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.
test(i))
278 if (isToBeSmoothed.
test(i))
280 displacement[i] = (1-
mu)*displacement[i]+
mu*
average[i];
286 if ((iter % 10) == 0)
293 Info<<
" Iteration " << iter <<
" residual " << resid <<
endl;
A list of faces which address into the list of points.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
void size(const label n)
Older name for setAddressableSize.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void set(const bitSet &bitset)
Set specified bits from another bitset.
bool test(const label pos) const
Test value at specified position, never auto-vivify entries.
Utility functions for mesh motion solvers.
void smoothLambdaMuDisplacement(const label nIter, const bitSet &isMeshMasterPoint, const bitSet &isMeshMasterEdge, const bitSet &isSmoothable, vectorField &displacement) const
Smooth and then un-smooth a displacement.
virtual ~fieldSmoother()
Destructor.
void smoothNormals(const label nIter, const bitSet &isMeshMasterPoint, const bitSet &isMeshMasterEdge, const labelList &fixedPoints, pointVectorField &normals) const
Smooth interior normals.
void smoothPatchNormals(const label nIter, const bitSet &isPatchMasterPoint, const bitSet &isPatchMasterEdge, const indirectPrimitivePatch &adaptPatch, pointField &normals) const
Smooth patch normals.
static void calculateEdgeWeights(const polyMesh &mesh, const bitSet &isMasterEdge, const labelList &meshPoints, const edgeList &edges, scalarField &edgeWeights, scalarField &invSumWeight)
Helper: calculate edge weights (1/length)
static T gAverage(const bitSet &isMasterElem, const UList< T > &values)
Helper: calculate average.
static void weightedSum(const polyMesh &mesh, const bitSet &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.
Mesh consisting of general polyhedral cells.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const volScalarField & mu
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
messageStream Info
Information stream (stdout output on master, null elsewhere)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
#define forAll(list, i)
Loop across all elements in list.