MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / minSmooth

Function minSmooth

src/dynamicMesh/motionSmoother/motionSmootherAlgo.C:133–164  ·  view source on GitHub ↗

Smooth on selected points (usually patch points)

Source from the content-addressed store, hash-verified

131
132// Smooth on selected points (usually patch points)
133void Foam::motionSmootherAlgo::minSmooth
134(
135 const scalarField& edgeWeights,
136 const PackedBoolList& isAffectedPoint,
137 const labelList& meshPoints,
138 const pointScalarField& fld,
139 pointScalarField& newFld
140) const
141{
142 tmp<pointScalarField> tavgFld = avg
143 (
144 fld,
145 edgeWeights //scalarField(mesh_.nEdges(), 1.0) // uniform weighting
146 );
147 const pointScalarField& avgFld = tavgFld();
148
149 forAll(meshPoints, i)
150 {
151 label pointi = meshPoints[i];
152 if (isAffectedPoint.get(pointi) == 1)
153 {
154 newFld[pointi] = min
155 (
156 fld[pointi],
157 0.5*fld[pointi] + 0.5*avgFld[pointi]
158 );
159 }
160 }
161
162 // Single and multi-patch constraints
163 pointConstraints::New(pMesh()).constrain(newFld, false);
164}
165
166
167// Smooth on all internal points

Callers 1

scaleMeshFunction · 0.85

Calls 5

minFunction · 0.85
isInternalPointFunction · 0.85
getMethod · 0.80
forAllFunction · 0.50
NewFunction · 0.50

Tested by

no test coverage detected