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

Function normaliseWeights

src/sampling/meshToMesh/meshToMesh.C:203–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201
202
203void Foam::meshToMesh::normaliseWeights
204(
205 const word& descriptor,
206 const labelListList& addr,
207 scalarListList& wght
208) const
209{
210 const label nCell = returnReduce(wght.size(), sumOp<label>());
211
212 if (nCell > 0)
213 {
214 forAll(wght, celli)
215 {
216 scalarList& w = wght[celli];
217 scalar s = sum(w);
218
219 forAll(w, i)
220 {
221 // note: normalise by s instead of cell volume since
222 // 1-to-1 methods duplicate contributions in parallel
223 w[i] /= s;
224 }
225 }
226 }
227}
228
229
230void Foam::meshToMesh::calcAddressing

Callers 2

calculateFunction · 0.85
AMIInterpolation.CFile · 0.85

Calls 3

returnReduceFunction · 0.85
forAllFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected