60 label jPlus1 =
f.fcIndex(j);
61 scalar l =
mag(u[j] - u[jPlus1]);
68 label
pid = toLocal[
f[j]];
69 label jMin1 =
f.rcIndex(j);
88 const Map<label>& toLocal,
96 DynamicList<scalar>
alpha(100);
97 DynamicList<scalar> theta(100);
98 DynamicList<point> u(100);
104 label facei = cFaces[iter];
105 const face&
f =
mesh.faces()[facei];
114 u(j) = uVec[toLocal[
f[j]]];
123 vector temp = u[j] ^ u[jPlus1];
125 scalar magTemp =
mag(temp);
127 if (magTemp < VSMALL)
137 scalar l =
min(
mag(u[j] - u[jPlus1]), 2.0);
145 scalar vNorm =
mag(v);
164 scalar l =
min(
mag(n0 - n1), 2.0);
174 l =
min(
mag(u[j] - v), 2.0);
180 bool outlierFlag =
false;
183 if (
mag(theta[j]) < tol)
187 label
pid = toLocal[
f[j]];
188 weights[
pid] += vNorm / dist[
pid];
213 calcWeights(toLocal,
f, u, dist, weights);
221 label
pid = toLocal[
f[j]];
233 scalar sumWeight =
sum(weights);
235 if (
mag(sumWeight) < tol)
239 weights /= sumWeight;
247 const polyMesh&
mesh,
249 const label cellIndex,
250 const label faceIndex
253 cellIndex_((cellIndex != -1) ? cellIndex :
mesh.faceOwner()[faceIndex])
273 uVec[
pid] = pt-position;
305 DynamicList<point> u(100);
306 const face&
f =
mesh.faces()[faceIndex];
310 u(j) = uVec[toLocal[
f[j]]];
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
label size() const noexcept
The number of elements in table.
void setSize(label n)
Alias for resize().
A HashTable to objects of type <T> with a label key.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label rcIndex(const label i) const noexcept
The reverse circular index. The previous index in the list which returns to the last at the beginning...
void size(const label n)
Older name for setAddressableSize.
label fcIndex(const label i) const noexcept
The forward circular index. The next index in the list which returns to the first at the end of the l...
A cell is defined as a list of faces with extra functionality.
A face is a list of labels corresponding to mesh vertices.
Container to calculate weights for interpolating directly from vertices of cell using Mean Value Coor...
const label cellIndex_
Cell index.
static scalar tol
Tolerance used in calculating barycentric coordinates.
scalarField weights_
Weights applied to cell vertices.
const scalarField & weights() const noexcept
Interpolation weights (in order of cellPoints).
pointMVCWeight(const polyMesh &mesh, const vector &position, const label celli, const label facei=-1)
Construct from components.
void calcWeights(const Map< label > &toLocal, const face &f, const UList< point > &u, const scalarField &dist, scalarField &weights) const
Calculate weights from single face's vertices only.
Mesh consisting of general polyhedral cells.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
#define defineDebugSwitchWithName(Type, Name, Value)
Define the debug information, lookup as Name.
dimensionedScalar asin(const dimensionedScalar &ds)
dimensionedScalar tan(const dimensionedScalar &ds)
Map< label > invertToMap(const labelUList &values)
Create inverse mapping, which is a lookup table into the given list.
List< label > labelList
A List of labels.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
dimensionedScalar sin(const dimensionedScalar &ds)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
pid_t pid()
Return the PID of this process.
static constexpr const zero Zero
Global zero (0).
#define forAll(list, i)
Loop across all elements in list.