41 PrimitivePatchInterpolation<Patch>::faceToPointWeights()
const
43 if (!faceToPointWeightsPtr_)
45 makeFaceToPointWeights();
48 return *faceToPointWeightsPtr_;
53 void PrimitivePatchInterpolation<Patch>::makeFaceToPointWeights()
const
55 if (faceToPointWeightsPtr_)
58 <<
"Face-to-edge weights already calculated"
63 const List<typename Patch::FaceType>& faces = patch_.localFaces();
73 const labelList& curFaces = pointFaces[pointi];
97 PrimitivePatchInterpolation<Patch>::faceToEdgeWeights()
const
99 if (!faceToEdgeWeightsPtr_)
101 makeFaceToEdgeWeights();
104 return *faceToEdgeWeightsPtr_;
108 template<
class Patch>
109 void PrimitivePatchInterpolation<Patch>::makeFaceToEdgeWeights()
const
111 if (faceToEdgeWeightsPtr_)
114 <<
"Face-to-edge weights already calculated"
119 const List<typename Patch::FaceType>& faces = patch_.localFaces();
120 const edgeList& edges = patch_.edges();
123 faceToEdgeWeightsPtr_ =
new scalarList(patch_.nInternalEdges());
134 -(((
N - P)^(S - P))&((
N - P)^
e))/(((
N - P)^
e )&((
N - P)^
e));
138 weights[edgei] =
mag(
N - E)/(
mag(
N - E) +
mag(E - P));
143 template<
class Patch>
144 void PrimitivePatchInterpolation<Patch>::clearWeights()
153 template<
class Patch>
157 faceToPointWeightsPtr_(nullptr),
158 faceToEdgeWeightsPtr_(nullptr)
164 template<
class Patch>
173 template<
class Patch>
181 if (
ff.size() != patch_.size())
184 <<
"given field does not correspond to patch. Patch size: "
185 << patch_.size() <<
" field size: " <<
ff.size()
193 patch_.nPoints(),
Zero
202 forAll(pointFaces, pointi)
204 const labelList& curFaces = pointFaces[pointi];
209 result[pointi] += w[facei]*
ff[curFaces[facei]];
217 template<
class Patch>
230 template<
class Patch>
237 if (pf.size() != patch_.nPoints())
240 <<
"given field does not correspond to patch. Patch size: "
241 << patch_.nPoints() <<
" field size: " << pf.size()
260 const labelList& curPoints = localFaces[facei];
264 result[facei] += pf[curPoints[pointi]];
267 result[facei] /= curPoints.size();
274 template<
class Patch>
287 template<
class Patch>
295 if (pf.size() != patch_.size())
298 <<
"given field does not correspond to patch. Patch size: "
299 << patch_.size() <<
" field size: " << pf.size()
310 const edgeList& edges = patch_.edges();
313 const scalarList& weights = faceToEdgeWeights();
315 for (
label edgei = 0; edgei < patch_.nInternalEdges(); edgei++)
318 weights[edgei]*pf[edgeFaces[edgei][0]]
319 + (1.0 - weights[edgei])*pf[edgeFaces[edgei][1]];
322 for (
label edgei = patch_.nInternalEdges(); edgei < edges.size(); edgei++)
324 result[edgei] = pf[edgeFaces[edgei][0]];
331 template<
class Patch>
344 template<
class Patch>