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,
150 const edgeList& edges = adaptPatch.edges();
151 const labelList& meshPoints = adaptPatch.meshPoints();
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;
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void smoothLambdaMuDisplacement(const label nIter, const bitSet &isMeshMasterPoint, const bitSet &isMeshMasterEdge, const bitSet &isSmoothable, vectorField &displacement) const
Smooth and then un-smooth a displacement.
List< edge > edgeList
List of edge.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
Ostream & endl(Ostream &os)
Add newline and flush stream.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
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)
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field...
#define forAll(list, i)
Loop across all elements in list.
void smoothPatchNormals(const label nIter, const bitSet &isPatchMasterPoint, const bitSet &isPatchMasterEdge, const indirectPrimitivePatch &adaptPatch, pointField &normals) const
Smooth patch normals.
vectorField pointField
pointField is a vectorField.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
defineTypeNameAndDebug(combustionModel, 0)
const dimensionedScalar mu
Atomic mass unit.
void smoothNormals(const label nIter, const bitSet &isMeshMasterPoint, const bitSet &isMeshMasterEdge, const labelList &fixedPoints, pointVectorField &normals) const
Smooth interior normals.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Mesh consisting of general polyhedral cells.
Utility functions for mesh motion solvers.
List< label > labelList
A List of labels.
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.
virtual ~fieldSmoother()
Destructor.