Go to the documentation of this file.
41 if (!faceToPointWeightsPtr_)
43 makeFaceToPointWeights();
46 return *faceToPointWeightsPtr_;
53 if (faceToPointWeightsPtr_)
56 <<
"Face-to-edge weights already calculated"
71 const labelList& curFaces = pointFaces[pointi];
97 if (!faceToEdgeWeightsPtr_)
99 makeFaceToEdgeWeights();
102 return *faceToEdgeWeightsPtr_;
106 template<
class Patch>
109 if (faceToEdgeWeightsPtr_)
112 <<
"Face-to-edge weights already calculated"
118 const edgeList& edges = patch_.edges();
121 faceToEdgeWeightsPtr_ =
new scalarList(patch_.nInternalEdges());
132 -(((
N - P)^(S - P))&((
N - P)^
e))/(((
N - P)^
e )&((
N - P)^
e));
136 weights[edgei] =
mag(
N - E)/(
mag(
N - E) +
mag(E - P));
141 template<
class Patch>
151 template<
class Patch>
155 faceToPointWeightsPtr_(NULL),
156 faceToEdgeWeightsPtr_(NULL)
162 template<
class Patch>
171 template<
class Patch>
179 if (
ff.size() != patch_.size())
182 <<
"given field does not correspond to patch. Patch size: "
183 << patch_.size() <<
" field size: " <<
ff.size()
200 forAll(pointFaces, pointi)
202 const labelList& curFaces = pointFaces[pointi];
207 result[pointi] +=
w[facei]*
ff[curFaces[facei]];
215 template<
class Patch>
228 template<
class Patch>
235 if (pf.size() != patch_.nPoints())
238 <<
"given field does not correspond to patch. Patch size: "
239 << patch_.nPoints() <<
" field size: " << pf.size()
258 const labelList& curPoints = localFaces[facei];
262 result[facei] += pf[curPoints[pointi]];
265 result[facei] /= curPoints.
size();
272 template<
class Patch>
285 template<
class Patch>
293 if (pf.size() != patch_.size())
296 <<
"given field does not correspond to patch. Patch size: "
297 << patch_.size() <<
" field size: " << pf.size()
308 const edgeList& edges = patch_.edges();
311 const scalarList& weights = faceToEdgeWeights();
313 for (
label edgei = 0; edgei < patch_.nInternalEdges(); edgei++)
316 weights[edgei]*pf[edgeFaces[edgei][0]]
317 + (1.0 - weights[edgei])*pf[edgeFaces[edgei][1]];
320 for (
label edgei = patch_.nInternalEdges(); edgei < edges.
size(); edgei++)
322 result[edgei] = pf[edgeFaces[edgei][0]];
329 template<
class Patch>
342 template<
class Patch>
List< scalar > scalarList
A List of scalars.
volScalarField w(IOobject("w", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("w", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
Template functions to aid in the implementation of demand driven data.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
tmp< Field< Type > > pointToFaceInterpolate(const Field< Type > &pf) const
Interpolate from points to faces.
dimensioned< scalar > mag(const dimensioned< Type > &)
const scalarList & faceToEdgeWeights() const
Face-to-edge weights.
bool movePoints()
Do what is neccessary if the mesh has moved.
const scalarListList & faceToPointWeights() const
Face-to-point weights.
void deleteDemandDrivenData(DataPtr &dataPtr)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
void makeFaceToPointWeights() const
Make face-to-point weights.
void clearWeights()
Clear weights.
errorManip< error > abort(error &err)
const double e
Elementary charge.
tmp< Field< Type > > faceToPointInterpolate(const Field< Type > &ff) const
Interpolate from faces to points.
~PrimitivePatchInterpolation()
Destructor.
void setSize(const label)
Reset size of List.
const FieldField< fvPatchField, Type > & ff(const FieldField< fvPatchField, Type > &bf)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
PrimitivePatchInterpolation(const PrimitivePatchInterpolation &)
Disallow default bitwise copy construct.
void makeFaceToEdgeWeights() const
Make face-to-edge weights.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Traits class for primitives.
tmp< Field< Type > > faceToEdgeInterpolate(const Field< Type > &ff) const
Interpolate from faces to edges.
void size(const label)
Override size to be inconsistent with allocated storage.
List< scalarList > scalarListList