Smooth on selected points (usually patch points)
| 131 | |
| 132 | // Smooth on selected points (usually patch points) |
| 133 | void 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 |