38 void Foam::patchCorrectedInterpolation::interpolateType
40 const GeometricField<Type, fvPatchField, volMesh>& cellDisplacement,
41 GeometricField<Type, pointPatchField, pointMesh>& pointDisplacement
45 GeometricField<Type, pointPatchField, pointMesh>
46 pointUncorrectedDisplacement
50 "pointUncorrectedDisplacement",
54 pointDisplacement.mesh(),
55 pointDisplacement.dimensions(),
61 pointUncorrectedDisplacement ==
67 pointUncorrectedDisplacement.boundaryField().size(),
74 pointDisplacement.primitiveFieldRef() =
75 pointUncorrectedDisplacement.primitiveField();
76 pointDisplacement.correctBoundaryConditions();
81 pointUncorrectedDisplacement ==
82 pointDisplacement - pointUncorrectedDisplacement;
85 interpolateDataFromPatchGroups(pointUncorrectedDisplacement);
88 pointDisplacement += pointUncorrectedDisplacement;
89 pointDisplacement.correctBoundaryConditions();
94 void Foam::patchCorrectedInterpolation::interpolateDataFromPatchGroups
96 GeometricField<Type, pointPatchField, pointMesh>& data
112 data = dimensioned<Type>(data.dimensions(),
Zero);
114 forAll(patchGroups_, patchGroupI)
129 GeometricField<Type, pointPatchField, pointMesh> patchData(data);
132 propagateDataFromPatchGroup
142 1/
max(
sqr(patchDistance.primitiveField()), SMALL)
144 data.primitiveFieldRef() += patchWeight*patchData.primitiveField();
145 weight.primitiveFieldRef() += patchWeight;
153 template <
class Type>
154 void Foam::patchCorrectedInterpolation::propagateDataFromPatchGroup
156 const label patchGroupi,
158 GeometricField<Type, pointPatchField, pointMesh>& data
161 const labelList& patchGroup(patchGroups_[patchGroupi]);
165 forAll(patchGroup, patchGroupi)
167 const label patchi(patchGroup[patchGroupi]);
169 nSeedInfo += data.boundaryField()[patchi].size();
174 List<PointData<Type>> seedInfo(nSeedInfo);
176 forAll(patchGroup, patchGroupi)
178 const label patchi(patchGroup[patchGroupi]);
180 pointPatchField<Type>& patchDataField(data.boundaryFieldRef()[patchi]);
182 patchDataField.updateCoeffs();
184 const pointPatch&
patch(patchDataField.patch());
185 const Field<Type> patchData(patchDataField.patchInternalField());
189 const label pointi(
patch.meshPoints()[patchPointi]);
191 seedLabels[nSeedInfo] = pointi;
193 seedInfo[nSeedInfo] =
198 patchData[patchPointi]
206 List<PointData<Type>> allPointInfo(
mesh().
nPoints());
207 List<PointData<Type>> allEdgeInfo(
mesh().nEdges());
208 PointEdgeWave<PointData<Type>>
219 forAll(allPointInfo, pointi)
221 distance[pointi] =
sqrt(allPointInfo[pointi].distSqr());
222 data[pointi] = allPointInfo[pointi].data();
tmp< GeometricField< Type, pointPatchField, pointMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate volField using inverse distance weighting.
static const volPointInterpolation & New(const fvMesh &mesh, Args &&... args)
Get existing or create a new MeshObject. Registered with typeName.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
const fvMesh & mesh() const
Return const-reference to the mesh.
scalar distance(const vector &p1, const vector &p2)
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
const dimensionSet dimless
Dimensionless.
label nTotalPoints() const noexcept
Return total number of points in decomposed mesh. Not compensated for duplicate points! ...
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
Typename for Field.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const globalMeshData & globalData() const
Return parallel info (demand-driven)
GeometricField< scalar, pointPatchField, pointMesh > pointScalarField
List< word > wordList
List of word.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const std::string patch
OpenFOAM patch number as a std::string.
List< label > labelList
A List of labels.
static constexpr const zero Zero
Global zero (0)